/* The client guide to legal exhibits (#5203): the look Pete approved in
   the mock, on the portal's own tokens, with a light theme for the PDF. */

.container-wide:has(> .guide) { max-width: 1080px; }
.guide {
  --g-parcel-fill: #2b3324; --g-parcel-line: #9fb38a; --g-route: #ecc36a;
  --g-road: #b79cf0; --g-site: #6fcf97; --g-req: #6fcf97;
  font-size: 15px; line-height: 1.55;
}
.guide code { font-family: var(--font-mono, ui-monospace, Consolas, monospace); font-size: .88em; }
.guide h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.12; margin: 0 0 10px; }
.guide h3 { font-family: var(--font-display); font-weight: 500; font-size: 22px; margin: 0; }
.guide h4 { font-size: 15px; margin: 0 0 4px; }
.g-lede { font-size: 17px; color: var(--text-2); max-width: 62ch; margin: 0; }
.g-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--accent); margin: 0 0 6px; }

/* --- top and step rail --- */
.g-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.g-top h1 { margin: 2px 0 10px; }
.g-top .btn { flex: none; }
.g-top .btn svg { width: 16px; height: 16px; }
.g-rail { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 22px 0 8px; padding: 0; list-style: none; counter-reset: g-step; }
.g-rail li { counter-increment: g-step; }
.g-rail a { display: block; height: 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); color: var(--text-2); font-size: 13px; text-decoration: none; }
.g-rail a::before { content: counter(g-step); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; margin-right: 8px; background: var(--bg-2); color: var(--text-2); font: 600 12px var(--font-ui); }
.g-rail a span { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.g-rail a:hover, .g-rail li.g-on a { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.g-rail li.g-on a::before { background: var(--accent); color: var(--on-accent); }

/* --- steps and blocks --- */
.g-step { padding: 34px 0 6px; scroll-margin-top: 12px; }
.g-step + .g-step { border-top: 1px solid var(--border); margin-top: 30px; }
.g-step-small h2 { font-size: 24px; }
.g-block { margin: 30px 0 0; padding-top: 22px; border-top: 1px dashed var(--border); scroll-margin-top: 12px; }
.g-block-head { display: flex; gap: 14px; align-items: baseline; margin-bottom: 6px; }
.g-n { font-family: var(--font-display); color: var(--accent); font-size: 22px; }
.g-block > p { max-width: 68ch; }
.g-optional { font-size: 16px; }
.g-sub { margin: 26px 0 8px; }
.g-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 14px 0; }
.g-grid.g-stack { grid-template-columns: 1fr; }
.g-card { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.g-card p { margin: 0; color: var(--text-2); }
.g-pic-sm { width: 100%; height: 70px; display: block; margin: 8px 0 10px; }
.g-tag { display: inline-block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.g-tag.g-req { color: var(--g-req); }
.g-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.g-chip { font-family: var(--font-mono, monospace); font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text-2); }
.g-chip.g-main { color: var(--text); border-color: var(--border-2); }
.g-opt-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); margin: 12px 0 0; padding: 0; list-style: none; }
.g-opt-list li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.g-opt-list svg { width: 34px; height: 24px; flex: none; }
.g-opt-list b { font-weight: 600; }
.g-opt-list .g-chip { margin-left: auto; }
.g-formats .g-card { text-align: center; }
.g-formats .g-card svg { width: 46px; height: 46px; margin: 4px auto 8px; display: block; }
.g-callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border-2);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface)); margin: 14px 0; max-width: 72ch; }
.g-callout svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--accent); }
.g-callout p { margin: 0; }
.g-points { padding-left: 20px; max-width: 70ch; }
.g-points li { margin: 6px 0; }
.g-downloads { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* --- expandable explainers --- */
.g-more { margin: 10px 0 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.g-more > summary { list-style: none; cursor: pointer; padding: 11px 14px; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.g-more > summary::-webkit-details-marker { display: none; }
.g-more > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); transition: transform .15s; margin: 0 2px; flex: none; }
.g-more[open] > summary::before { transform: rotate(45deg); }
.g-hint { margin-left: auto; font-weight: 400; color: var(--text-3); font-size: 12.5px; }
.g-body { padding: 2px 16px 14px 38px; color: var(--text-2); font-size: 14px; min-width: 0; }
.g-body p { margin: 8px 0; }
.g-body .g-fig { margin: 10px 0 4px; padding: 0; border: 0; background: none; }

.g-table { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--well, var(--bg)); margin: 12px 0; }
.g-table table { border-collapse: collapse; width: 100%; font-size: 13px; }
.g-table th, .g-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.g-table th { font-weight: 600; color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; background: var(--bg-2); }
.g-table td code { white-space: nowrap; }
.g-sheet td { font-family: var(--font-mono, monospace); font-size: 12.5px; white-space: nowrap; color: var(--text); }
.g-sheet .g-key { color: var(--accent-2); }
.g-sheet .g-blank { color: var(--text-3); }
.g-example { font-family: var(--font-mono, monospace); font-size: 12px; color: var(--text); }
pre.g-file { margin: 10px 0; padding: 10px 12px; background: var(--well, var(--bg)); border: 1px solid var(--border); border-radius: var(--radius); font: 12.5px/1.5 var(--font-mono, monospace); overflow-x: auto; color: var(--text); }
pre.g-file .g-hd { color: var(--text-3); }

/* --- annotated figures: markers in the picture, arrows to the notes --- */
.g-fig { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: start;
  margin: 22px 0; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.g-fig.g-wide { grid-template-columns: 1fr; gap: 18px; }
.g-fig.g-wide .g-notes { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.g-fig.g-plain { grid-template-columns: 1fr; gap: 10px; }
.g-pic { min-width: 0; }
.g-cap { grid-column: 1 / -1; margin: -4px 0 0; font-size: 13px; color: var(--text-3); }
.g-connectors { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 2; }
.g-connectors path { fill: none; stroke: var(--border-2); stroke-width: 1.5; stroke-dasharray: 4 4; transition: stroke .15s; }
.g-connectors path.g-hot { stroke: var(--accent); stroke-dasharray: none; stroke-width: 2; }

.g-shot { position: relative; width: 100%; justify-self: center; }
.g-shot img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.g-target { position: absolute; border: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent); border-radius: 8px; pointer-events: none; transition: border-color .15s, box-shadow .15s; }
.g-target.g-hot { border-style: solid; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }

.g-marker { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font: 700 12px var(--font-ui); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.g-marker.g-on-shot { position: absolute; transform: translate(-50%, -50%); z-index: 3; }
.g-marker:focus-visible, .g-marker.g-hot { outline: none; background: var(--accent-hi); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 35%, transparent); }

.g-notes { min-width: 0; list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: start; }
.g-notes li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid transparent; transition: background .15s, border-color .15s; }
.g-notes.g-aligned { display: block; }
.g-notes li.g-hot { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.g-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-2); color: var(--accent); font: 700 12px var(--font-ui); border: 1px solid var(--border-2); }
.g-notes p { margin: 0; color: var(--text-2); font-size: 14px; }
.g-notes strong { color: var(--text); }

.g-tree { align-self: start; background: var(--well, var(--bg)); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; font-family: var(--font-mono, monospace); font-size: 13.5px; }
.g-tree ul { list-style: none; margin: 0; padding-left: 18px; border-left: 1px dashed var(--border); }
.g-tree > ul { padding-left: 0; border: 0; }
.g-tree li { position: relative; padding: 5px 0 5px 4px; }
.g-tree li.g-gap { margin-top: 8px; }
.g-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.g-ic { width: 18px; height: 18px; flex: none; }
.g-kind { color: var(--text-3); font-size: 12px; }
.g-opt { color: var(--text-3); }
.g-zone { font-family: var(--font-ui); font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--text-2); }

@media (max-width: 820px) {
  .g-fig { grid-template-columns: 1fr; gap: 18px; padding: 14px; }
  .g-connectors { display: none; }
  .g-rail { grid-template-columns: repeat(4, minmax(120px, 1fr)); overflow-x: auto; }
  .g-body { padding-left: 16px; }
  .g-tree { font-size: 12.5px; }
  .g-top { flex-direction: column; }
}

/* --- print: light, every explainer open, no arrows --- */
@media print {
  .guide { --accent: #8a6516; --accent-2: #8a6516; --accent-hi: #b98b2c; --on-accent: #fff;
    --g-parcel-fill: #e7ecd9; --g-parcel-line: #4c6548; --g-route: #8b671b; --g-road: #55349f; --g-site: #2f7a4b; --g-req: #2f7a4b;
    --bg-2: #f3efe6; --well: #faf8f3; --border: #d9d0bd; --border-2: #b7a77f; --text-2: #4a4030; --text-3: #6f6450;
    font-size: 10.5pt; }
  .g-print-hide, .g-connectors { display: none !important; }
  /* the screen's level-with-marker spacing means nothing without arrows */
  .g-notes.g-aligned { display: grid; }
  .g-notes.g-aligned li { margin-top: 0 !important; }
  /* a jump to another part of the page cannot be followed on paper */
  .g-notes a { display: none; }
  .g-rail a { border-color: var(--border); }
  .g-step { break-before: page; padding-top: 0; border-top: 0 !important; margin-top: 0 !important; }
  .g-step:first-of-type, .g-step-small { break-before: auto; }
  .g-fig { break-inside: avoid; gap: 18px; padding: 14px; }
  .g-fig:not(.g-wide):not(.g-plain) { grid-template-columns: 1.3fr 1fr; }
  .g-more::details-content { content-visibility: visible !important; display: block !important; }
  .g-more > summary { break-after: avoid; }
  .g-more > summary::before, .g-hint { display: none; }
  .g-table { overflow: visible; }
  .g-table td, .g-table th, .g-table td code { white-space: normal; font-size: 8.5pt; padding: 4px 5px; }
  /* too wide for the page; the column table below carries its values */
  .g-sheet { display: none; }
  pre.g-file { white-space: pre-wrap; word-break: break-all; }
  .g-shot img { border-color: #8a7d62; }
  /* a picture taller than a page would leave a blank page before it and
     split across the next; capping its width by its own aspect keeps the
     markers, placed in shares of the picture, on their targets */
  .g-shot { max-width: min(100%, var(--g-width), calc(8.4in * var(--g-aspect))) !important; }
  .guide a { color: inherit; text-decoration: none; }
}
