/* The signers (2026-11-17, the owner's pick HI1): /signers and /signer/{slug}, views signers.php and signer.php.
   Every class starts .sg-. Colours are the site's variables (style.css :root) or plain colours that
   tools/build_dark_css.php turns dark; rerun it after changing a colour here.
   The signature frame (.sg-frame) keeps its paper colour in the dark look too: the pictures are scans of dark ink on
   light paper. Its colours are set through --sg-paper and --sg-paper-line on the frame itself, which the dark-look
   builder leaves alone. */

.sg-kicker { font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.sg-muted { color: var(--muted); }
.sg-head { padding: .8rem 0 .4rem; max-width: 780px; }
.sg-head h1 { color: var(--navy); font-size: clamp(2rem, 4.4vw, 2.8rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: .35rem; }
.sg-head > p { color: var(--muted); font-size: 1.04rem; line-height: 1.6; margin-top: .6rem; }
.sg-figs { display: flex; flex-wrap: wrap; gap: .4rem 2rem; list-style: none; margin: 1rem 0 0; color: var(--muted); font-size: .95rem; }
.sg-figs b { color: var(--navy); font-size: 1.3rem; font-weight: 800; }
.sg-tools a:focus-visible, .sg-tools button:focus-visible, .sg-terr summary:focus-visible, .sg-wall a:focus-visible,
.sg-hero a:focus-visible, .sg-cols a:focus-visible, .sg-pics summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* the frame that evens the signatures out: the same shape whatever the picture's size */
.sg-frame { --sg-paper: #f7f4ec; --sg-paper-line: #e6e0cf; --sg-px: 10px; --sg-py: 7px; position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 1; background: var(--sg-paper); border: 1px solid var(--sg-paper-line); border-radius: 10px; overflow: hidden; }
.sg-frame img { position: absolute; left: var(--sg-px); top: var(--sg-py); width: calc(100% - 2 * var(--sg-px)); height: calc(100% - 2 * var(--sg-py)); max-width: none; object-fit: contain; }
.sg-nopic { --sg-nopic-ink: #6b6450; font-size: .8rem; color: var(--sg-nopic-ink); text-align: center; }

/* /signers: the tools */
.sg-tools { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 1.1rem 1.3rem; margin: 1.2rem 0 1rem; display: grid; gap: .9rem; }
.sg-find[hidden], .sg-acts[hidden], .sg-jump[hidden] { display: none; }
.sg-find label { display: block; font-weight: 700; color: var(--navy); margin-bottom: .3rem; }
.sg-find input { width: 100%; max-width: 32rem; font: inherit; font-size: 1rem; padding: .55rem .9rem; border: 1.5px solid #c9d4e6; border-radius: 10px; min-height: 46px; background: var(--card); color: var(--ink); }
.sg-find input:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
.sg-count { font-size: .9rem; color: var(--muted); margin-top: .35rem; min-height: 1.3rem; }
.sg-jump { display: flex; flex-wrap: wrap; gap: .4rem; }
.sg-jump a { display: inline-flex; align-items: center; gap: .35rem; min-height: 38px; padding: .3rem .75rem; border-radius: 99px; border: 1px solid #d5ddea; background: var(--card); color: var(--ink); font-size: .9rem; font-weight: 600; text-decoration: none; }
.sg-jump a small { font-size: .78rem; color: var(--muted); font-weight: 700; }
.sg-jump a:hover { border-color: var(--accent); color: var(--accent-strong); }
.sg-acts { display: flex; flex-wrap: wrap; gap: .5rem; }
.sg-acts button { font: inherit; border: 1.5px solid var(--accent); background: var(--card); color: var(--accent); border-radius: 10px; padding: .4rem .9rem; font-weight: 700; min-height: 44px; cursor: pointer; }

/* /signers: a territory and its wall */
.sg-terr { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); margin-bottom: .7rem; scroll-margin-top: 1rem; }
.sg-terr[hidden] { display: none; }
.sg-terr summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto 1.2rem; gap: .4rem 1rem; align-items: center; padding: .8rem 1.3rem; min-height: 56px; cursor: pointer; border-radius: 16px; }
.sg-terr summary::-webkit-details-marker { display: none; }
.sg-terr summary:hover { background: var(--thead); }
.sg-terr summary b { color: var(--navy); font-size: 1.1rem; }
.sg-terr summary > span:not(.sg-chev) { color: var(--muted); font-size: .9rem; text-align: right; }
.sg-chev { color: var(--muted); font-size: 1.4rem; line-height: 1; transition: transform .15s; }
.sg-terr[open] > summary .sg-chev { transform: rotate(90deg); }
.sg-wall { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; padding: .4rem 1.3rem 1.4rem; }
.sg-tile[hidden] { display: none; }
.sg-tile a { display: flex; flex-direction: column; gap: .55rem; height: 100%; padding: .6rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); text-decoration: none; transition: box-shadow .15s, border-color .15s; }
.sg-tile a:hover { border-color: #b7c8e8; box-shadow: var(--shadow-hover); }
.sg-tt { display: flex; flex-direction: column; padding: 0 .2rem .1rem; line-height: 1.3; }
.sg-tt b { color: var(--navy); font-size: .95rem; }
.sg-office { font-size: .82rem; color: var(--muted); }
.sg-ty { display: flex; justify-content: space-between; gap: .5rem; font-size: .82rem; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.sg-ty span:last-child { color: var(--muted); }
.sg-none { padding: 1.4rem; text-align: center; color: var(--muted); background: var(--card); border-radius: 12px; margin-bottom: 1rem; }
.sg-about { max-width: 780px; margin: 1.6rem 0 1rem; color: var(--muted); }
.sg-about h2 { color: var(--navy); font-size: 1.05rem; margin-bottom: .35rem; }
.sg-about p + p { margin-top: .5rem; }

/* /signer/{slug} */
.sg-hero { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.6rem; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 1.6rem 1.8rem; margin: 1rem 0 .8rem; align-items: center; }
.sg-hero-nopic { grid-template-columns: 1fr; }
.sg-hero h1 { color: var(--navy); font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; margin: .3rem 0 .2rem; line-height: 1.15; }
.sg-offices { list-style: none; font-size: 1.05rem; color: var(--ink); }
.sg-offices span { color: var(--muted); }
.sg-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-top: 1.1rem; max-width: 34rem; }
.sg-stat { background: var(--accent-soft); border-radius: 12px; padding: .65rem .8rem; }
.sg-stat dt { font-size: .82rem; color: var(--muted); }
.sg-stat dd { color: var(--navy); font-weight: 700; font-size: 1.05rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.sg-lead { grid-column: 1 / -1; background: var(--card); border: 1px solid #cfdcfb; }
.sg-lead dd { font-size: 1.3rem; }
.sg-sigbox { margin: 0; }
.sg-frame-big { --sg-px: 18px; --sg-py: 14px; box-shadow: 0 8px 22px rgba(30,47,77,.10); }
.sg-sigbox figcaption { margin-top: .6rem; font-size: .86rem; color: var(--muted); text-align: center; }
.sg-caution { font-size: .92rem; color: var(--amber-ink); background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 10px; padding: .55rem .9rem; margin: 0 0 1.4rem; }

.sg-cols { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.4rem; align-items: start; margin-bottom: 1rem; }
.sg-main { min-width: 0; }
.sg-rail { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }
.sg-sec { background: var(--card); border-radius: 16px; padding: 1.3rem 1.5rem 1.5rem; box-shadow: var(--shadow); }
.sg-sec > h2 { color: var(--navy); font-size: 1.15rem; font-weight: 800; margin-bottom: .3rem; }
.sg-rail .sg-sec { padding: 1.1rem 1.2rem 1.2rem; }
.sg-rail .sg-sec > h2 { font-size: 1rem; }
.sg-lede { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }
.sg-th { color: var(--navy); font-size: 1.05rem; margin: 1.4rem 0 .2rem; padding-bottom: .3rem; border-bottom: 2px solid #c9d4e6; }
.sg-pick { margin-top: 1.1rem; }
.sg-ph { display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; margin-bottom: .3rem; }
.sg-ph a { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; text-decoration: none; }
.sg-ph a:hover { text-decoration: underline; }
.sg-ph b { color: var(--navy); }
.sg-ph span { color: var(--muted); font-size: .9rem; }
.sg-vt { width: 100%; border-collapse: collapse; font-size: .93rem; }
.sg-vt th { text-align: left; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--thead); padding: .45rem .65rem; }
.sg-vt td { padding: .45rem .65rem; border-top: 1px solid var(--line); vertical-align: top; }
.sg-vl { white-space: nowrap; }
.sg-vl a { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; text-decoration: none; }
.sg-vl a:hover { text-decoration: underline; }
.sg-vd { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sg-vs { color: var(--muted); }
.sg-kind { display: inline-block; font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--row); border-radius: 99px; padding: .05rem .5rem; margin-left: .2rem; white-space: nowrap; }
.sg-unc { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--amber-ink); background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 6px; padding: 0 .35rem; }
.sg-listed { margin-top: 1.6rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.sg-listed h3 { color: var(--navy); font-size: 1rem; }
.sg-listed ul { list-style: none; margin-top: .5rem; display: grid; gap: .2rem; }
.sg-listed a { font-weight: 700; display: inline-flex; align-items: center; min-height: 32px; }

.sg-with { list-style: none; display: grid; gap: .5rem; }
.sg-with a { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: .7rem; align-items: center; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .6rem; min-height: 56px; }
.sg-with a:hover { border-color: #cfdcfb; background: var(--accent-soft); }
.sg-frame-s { --sg-px: 5px; --sg-py: 3px; border-radius: 6px; }
.sg-with b { display: block; font-size: .95rem; color: var(--accent-strong); line-height: 1.3; }
.sg-with a > span:last-child > span { font-size: .84rem; color: var(--muted); }
.sg-pics summary { cursor: pointer; font-weight: 700; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
.sg-pics[open] summary { margin-bottom: .5rem; }
.sg-pics ul { list-style: none; display: grid; gap: .8rem; }
.sg-pics li span { display: block; font-size: .82rem; color: var(--muted); margin-top: .25rem; }
.sg-back a { font-weight: 700; display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 1000px) { .sg-cols { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .sg-hero { grid-template-columns: 1fr; padding: 1.2rem 1.1rem; } .sg-sigbox { order: -1; } }
@media (max-width: 640px) {
  .sg-tools { padding: 1rem; }
  .sg-jump a { min-height: 44px; }
  .sg-terr summary { grid-template-columns: minmax(0, 1fr) 1.2rem; padding: .7rem 1rem; }
  .sg-terr summary > span:not(.sg-chev) { grid-column: 1; grid-row: 2; text-align: left; }
  .sg-terr summary .sg-chev { grid-column: 2; grid-row: 1 / span 2; }
  .sg-wall { grid-template-columns: 1fr 1fr; gap: .6rem; padding: .3rem .8rem 1rem; }
  .sg-tile a { padding: .45rem; gap: .4rem; }
  .sg-frame { aspect-ratio: 2.4 / 1; --sg-px: 6px; --sg-py: 5px; }
  .sg-office { display: none; }
  .sg-ty { flex-direction: column; gap: 0; }
  .sg-tt b { font-size: .88rem; }
  .sg-sec { padding: 1.1rem 1rem 1.2rem; }
  .sg-stats { grid-template-columns: 1fr 1fr; }
  .sg-vt thead { display: none; }
  .sg-vt, .sg-vt tbody, .sg-vt tr, .sg-vt td { display: block; }
  .sg-vt tr { border-top: 1px solid var(--line); padding: .4rem 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .8rem; align-items: center; }
  .sg-vt td { border: 0; padding: .05rem .1rem; }
  .sg-vl { grid-column: 1; }
  .sg-vd { grid-column: 2; text-align: right; }
  .sg-vs { grid-column: 1 / -1; }
  .sg-vl a { display: inline-flex; align-items: center; min-height: 44px; }
  .sg-listed a, .sg-ph a { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (prefers-reduced-motion: reduce) { .sg-chev, .sg-tile a { transition: none; } }
