/* gs-article — the v2 reading template, shared by the resources-*.html guides,
   the blog-*.html posts and the two indexes (blog.html, resources.html).
   Load it after /css/gs-v2.css and before the page's own <style>, so page
   rules win ties. Spec: docs/design/article-template.md. When this file
   changes, bump ?v= on every page that links it. */

/* ── Reading progress: a green fill along the nav's bottom rule ── */
.ar-progress { position: fixed; z-index: 1001; left: 0; right: 0; top: calc(var(--nav-h) - 3px); height: 3px; pointer-events: none; }
.ar-progress:not([hidden]) { display: block; }
.ar-progress[hidden] { display: none; }
.ar-progress i { display: block; height: 100%; background: var(--gs-green); transform-origin: 0 50%; transform: scaleX(var(--ar-p, 0)); }

/* ── Hero: title, standfirst, date and reading time; a real photo beside it when one fits ── */
.ar-hero { margin-top: var(--nav-h); padding-block: clamp(2.25rem, 6vh, 4.5rem) clamp(2.5rem, 6vh, 4.25rem); border-bottom: 1px solid var(--gs-line); }
.ar-hero-in { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 2.5rem clamp(2.5rem, 5vw, 5rem); align-items: center; }
.ar-hero--plain .ar-hero-in { grid-template-columns: minmax(0, 1fr); }
.ar-hero h1 { font-size: clamp(2.3rem, 3.9vw, 3.55rem); line-height: 1.05; letter-spacing: -0.02em; max-width: 19ch; }
.ar-hero--plain h1 { max-width: 22ch; }
.ar-dek { margin-top: 1.1rem; font-size: clamp(1.05rem, 1.25vw, 1.175rem); line-height: 1.6; color: rgba(245, 242, 235, 0.88); max-width: 58ch; }
.ar-meta { margin-top: 1.25rem; display: flex; flex-wrap: wrap; row-gap: 0.25rem; font-size: 0.875rem; line-height: 1.5; color: var(--gs-fg-muted); }
.ar-meta > *:not(:last-child)::after { content: '\00B7'; padding: 0 0.6rem; }
.ar-meta b { font-weight: 500; color: var(--gs-fg); }
.ar-note-line { margin-top: 0.9rem; font-size: 0.8125rem; line-height: 1.5; color: var(--gs-fg-muted); }
.ar-hero .gs-tb { margin-top: 1.75rem; }
.ar-hero .gs-tb--figures dd { font-size: clamp(1.35rem, 1.9vw, 1.7rem); }
.ar-actions { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.ar-hero-fig { margin: 0; }
.ar-hero-fig .gs-ph { aspect-ratio: var(--gs-iw) / var(--gs-ih); max-height: min(68vh, 620px); }
.ar-hero-fig figcaption, .ar-fig figcaption { margin-top: 0.75rem; font-size: 0.8125rem; line-height: 1.5; color: var(--gs-fg-muted); max-width: 62ch; }
.ar-hero-fig figcaption b, .ar-fig figcaption b { font-weight: 500; color: var(--gs-fg); }
.ar-hero-fig figcaption a, .ar-fig figcaption a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.ar-hero-fig figcaption a:hover, .ar-fig figcaption a:hover { color: var(--gs-link); }

/* ── The article body: contents beside a ~70-character reading column ── */
.ar-body { padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(4rem, 8vw, 6.5rem); }
.ar-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.ar-prose { --ar-measure: 35.5em; max-width: var(--ar-measure); font-size: 1.125rem; line-height: 1.72; color: var(--gs-fg); }
:where(.ar-prose) > * + * { margin-top: 1.15em; }
.ar-prose > :first-child { margin-top: 0; }
.ar-prose [id] { scroll-margin-top: calc(var(--nav-h) + 4.25rem); }
.ar-prose :is(h2, h3, h4) { color: var(--gs-fg); }
.ar-prose h2 { font-size: clamp(1.75rem, 2.45vw, 2.2rem); line-height: 1.12; margin: 2.3em 0 0; }
.ar-prose h3 { font-size: 1.35rem; line-height: 1.3; margin-top: 1.9em; }
.ar-prose h4 { font-family: var(--gs-font-body); font-size: 1.0625rem; font-weight: 600; line-height: 1.4; margin-top: 1.6em; }
.ar-prose :is(h2, h3, h4) + * { margin-top: 0.6em; }
.ar-prose h2 + h3 { margin-top: 1.1em; }
.ar-prose strong, .ar-prose b { font-weight: 600; }
.ar-prose em { font-style: italic; }
.ar-prose a:not([class]) { color: var(--gs-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); transition: text-decoration-color 0.2s; }
.ar-prose a:not([class]):hover { text-decoration-color: currentColor; }
.ar-prose :is(ul, ol):not([class]) { padding-left: 1.4em; }
.ar-prose ul:not([class]) > li { position: relative; }
.ar-prose ul:not([class]) > li::before { content: ''; position: absolute; left: -1.1em; top: 0.84em; width: 0.5em; height: 1.5px; background: var(--gs-link); }
.ar-prose ol:not([class]) { list-style: decimal; }
.ar-prose ol:not([class]) > li::marker { color: var(--gs-link); font-variant-numeric: tabular-nums; }
.ar-prose li { text-wrap: pretty; }
.ar-prose li + li { margin-top: 0.45em; }
.ar-prose li > p { margin: 0; }
.ar-prose li > p + p { margin-top: 0.5em; }
.ar-prose hr { width: 3rem; height: 1px; margin: 2.5em 0; border: 0; background: var(--gs-rule); }

/* Contents. Phones and tablets: a sticky bar under the nav that names the
   section being read and opens the list. Desktop: a rail beside the text. */
.ar-toc { position: sticky; top: var(--nav-h); z-index: 20; margin: 0 calc(-1 * var(--gs-gutter)) 2.25rem; background: var(--gs-day); border-block: 1px solid var(--gs-rule); }
.ar-toc summary { display: flex; align-items: center; gap: 0.9rem; min-height: 48px; padding: 0 var(--gs-gutter); list-style: none; cursor: pointer; }
.ar-toc summary::-webkit-details-marker { display: none; }
.ar-toc-t { flex: none; font: 500 var(--gs-label)/1 var(--gs-font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gs-fg-muted); }
.ar-toc-now { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9375rem; color: var(--gs-fg); }
.ar-toc-i { flex: none; width: 9px; height: 9px; margin: -4px 2px 0 auto; border-right: 1.5px solid var(--gs-link); border-bottom: 1.5px solid var(--gs-link); transform: rotate(45deg); transition: transform 0.3s var(--gs-ease), margin 0.3s var(--gs-ease); }
.ar-toc details[open] .ar-toc-i { transform: rotate(225deg); margin-top: 4px; }
.ar-toc-l { counter-reset: none; }
.ar-toc details[open] .ar-toc-l { position: absolute; left: 0; right: 0; top: 100%; max-height: min(62vh, 30rem); overflow: auto; overscroll-behavior: contain; padding: 0.4rem var(--gs-gutter) 1rem; background: var(--gs-day); border-bottom: 1px solid var(--gs-rule); }
.ar-toc-l a { position: relative; display: block; padding: 0.55rem 0 0.55rem 1.1rem; font-size: 0.9375rem; line-height: 1.4; color: var(--gs-fg-muted); transition: color 0.2s; }
.ar-toc-l a::before { content: ''; position: absolute; left: 0; top: 1.15em; width: 0.65rem; height: 1.5px; background: var(--gs-link); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.45s var(--gs-ease); }
.ar-toc-l a:hover { color: var(--gs-fg); }
.ar-toc-l a[aria-current] { color: var(--gs-fg); font-weight: 500; }
.ar-toc-l a[aria-current]::before { transform: scaleX(1); }
.ar-toc-l a:focus-visible { outline-offset: 0; }
@media (min-width: 1100px) {
  .ar-grid { grid-template-columns: 13.5rem minmax(0, 40rem); column-gap: clamp(3.5rem, 6vw, 6.5rem); justify-content: start; }
  .ar-toc { top: calc(var(--nav-h) + 2.25rem); max-height: calc(100vh - var(--nav-h) - 4.5rem); overflow: auto; margin: 0; padding-top: 0.15rem; background: none; border: 0; scrollbar-width: thin; }
  .ar-toc summary { min-height: 0; padding: 0 0 0.9rem; cursor: default; }
  .ar-toc-now, .ar-toc-i { display: none; }
  .ar-toc details[open] .ar-toc-l, .ar-toc-l { position: static; max-height: none; overflow: visible; padding: 0.35rem 0 0; background: none; border: 0; border-top: 1px solid var(--gs-rule); }
  .ar-toc-l a { padding-block: 0.42rem; font-size: 0.875rem; }
  .ar-prose [id] { scroll-margin-top: calc(var(--nav-h) + 1.75rem); }
}
/* Without JS, browsers that support ::details-content still show the rail open */
@supports selector(::details-content) {
  @media (min-width: 1100px) { .ar-toc details:not([open])::details-content { content-visibility: visible; display: block; } }
}

/* ── In-text components ── */
/* "In short": the page's own short answers as a title block */
.ar-short { margin-bottom: 2.5em; }
.ar-short-h { font: 500 var(--gs-label)/1.3 var(--gs-font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gs-fg-muted); margin: 0 0 0.85rem; }
.ar-prose .ar-short-h { font-size: var(--gs-label); margin: 0 0 0.85rem; }
.ar-tb { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.ar-tb dt { letter-spacing: 0.08em; line-height: 1.45; }
.ar-tb dd { font-size: 1.125rem; line-height: 1.45; }

/* Callout: "What this means for your project", in the page's own words */
.ar-note { margin-block: 2em; padding: 1.3rem 1.5rem 1.4rem; background: rgba(255, 255, 255, 0.42); border: 1px solid var(--gs-rule); }
.ar-note-h { font-family: var(--gs-font-display); font-style: italic; font-weight: 400; font-size: 1.2rem; line-height: 1.3; color: var(--gs-link); }
.ar-note > * + * { margin-top: 0.5em; }
.ar-note p { font-size: 1.0625rem; line-height: 1.65; }
.gs-night .ar-note { background: rgba(245, 242, 235, 0.04); }

/* Pull quote: a sentence repeated from the text, so it is hidden from screen readers */
.ar-pull { margin-block: 2.4em; padding: 1.35em 0 1.25em; border-block: 1px solid var(--gs-rule); }
.ar-pull p { font-family: var(--gs-font-display); font-weight: 300; font-style: italic; font-size: clamp(1.5rem, 2.3vw, 1.9rem); line-height: 1.28; letter-spacing: -0.01em; color: var(--gs-fg); text-wrap: balance; text-indent: -0.42em; }

/* Figure: a real photo with a "Shown:" caption, optionally measured */
.ar-fig { margin-block: 2.1em; }
.ar-fig .gs-ph { aspect-ratio: var(--ar-ratio, 4 / 3); }

/* Steps: a real sequence, numbered down a hairline */
.ar-steps { counter-reset: ar-step; margin-block: 1.6em; }
.ar-steps > li { counter-increment: ar-step; position: relative; padding: 0 0 1.4em 3.4rem; }
.ar-steps > li::before { content: counter(ar-step); position: absolute; left: 0; top: -0.05em; width: 2.1rem; font-family: var(--gs-font-display); font-weight: 300; font-size: 2rem; line-height: 1; text-align: center; color: var(--gs-link); font-variant-numeric: tabular-nums; }
.ar-steps > li::after { content: ''; position: absolute; left: 1.05rem; top: 2.45rem; bottom: 0.55rem; width: 1px; background: var(--gs-rule); }
.ar-steps > li:last-child { padding-bottom: 0; }
.ar-steps > li:last-child::after { content: none; }
.ar-steps h3 { margin: 0; font-size: 1.22rem; line-height: 1.3; }
.ar-steps p { margin-top: 0.3em; }

/* Pair: what something can and cannot do, side by side */
.ar-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-block: 1.8em; }
.ar-pair > div { padding: 1.25rem 1.3rem 1.4rem; border: 1px solid var(--gs-rule); background: rgba(255, 255, 255, 0.35); }
.ar-pair h3 { margin: 0 0 0.8rem; font-size: 1.2rem; line-height: 1.3; }
.ar-marks li { position: relative; padding-left: 1.65rem; font-size: 1rem; line-height: 1.55; }
.ar-marks li + li { margin-top: 0.65rem; }
.ar-marks li::before { content: ''; position: absolute; left: 0.1rem; }
.ar-marks--yes li::before { top: 0.36em; width: 0.72rem; height: 0.4rem; border-left: 1.75px solid var(--gs-link); border-bottom: 1.75px solid var(--gs-link); transform: rotate(-45deg); }
.ar-marks--no li::before { top: 0.74em; width: 0.72rem; height: 1.75px; background: var(--gs-fg-muted); }

/* Checks: items a reader assembles (a submittal, a package) */
.ar-checks { margin-block: 1.6em; border-top: 1px solid var(--gs-rule); }
.ar-checks > li { position: relative; padding: 1rem 0 1.05rem 2.35rem; border-bottom: 1px solid var(--gs-rule); }
.ar-checks > li::before { content: ''; position: absolute; left: 0; top: 1.28rem; width: 1.2rem; height: 1.2rem; border: 1px solid var(--gs-link); }
.ar-checks > li::after { content: ''; position: absolute; left: 0.37rem; top: 1.5rem; width: 0.5rem; height: 0.28rem; border-left: 1.5px solid var(--gs-link); border-bottom: 1.5px solid var(--gs-link); transform: rotate(-45deg); }
.ar-checks h3 { margin: 0; font-size: 1.15rem; line-height: 1.35; }
.ar-checks p { margin-top: 0.25em; font-size: 1rem; line-height: 1.6; color: var(--gs-fg-muted); }

/* Tables (gs-compare) and the FAQ inside the reading column */
.ar-table { margin-block: 1.8em; }
.ar-prose .gs-compare { font-size: 0.9375rem; }
.ar-prose .gs-compare :is(th, td) { padding-right: 1.1rem; }
.ar-prose .gs-faq { max-width: none; margin-top: 1.5em; }
.ar-prose .gs-faq summary { font-size: 1.0625rem; }
.ar-prose .gs-faq details p { font-size: 1rem; max-width: none; }
.gs-day .gs-faq summary:hover { color: var(--gs-green-day); }
.gs-day .gs-faq summary::after { border-color: var(--gs-green-day); }
.gs-day .gs-faq a { text-decoration-color: rgba(30, 92, 53, 0.45); }

/* End of the article: the inline quote line, the byline and sharing */
.ar-endcta { margin-top: 2.75em; padding: 1.15rem 1.35rem; border: 1px solid var(--gs-rule); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; font-size: 1.0625rem; line-height: 1.5; }
.ar-endcta a { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--gs-link); }
.ar-endcta a:hover .gs-ar, .ar-endcta a:focus-visible .gs-ar { translate: 3px 0; }
.ar-foot { margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--gs-rule); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.ar-by { display: flex; align-items: center; gap: 0.85rem; }
.ar-by-m { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--gs-ink-day); color: var(--gs-day); font: 500 0.78rem/1 var(--gs-font-mono); letter-spacing: 0.06em; }
.ar-by b { display: block; font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }
.ar-by span:not(.ar-by-m) { display: block; font-size: 0.875rem; line-height: 1.4; color: var(--gs-fg-muted); }
.ar-share { display: flex; align-items: center; gap: 0.5rem; }
.ar-share-l { margin-right: 0.35rem; font: 500 var(--gs-label)/1 var(--gs-font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gs-fg-muted); }
.ar-share :is(a, button) { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid color-mix(in srgb, var(--gs-fg) 28%, transparent); border-radius: 50%; color: var(--gs-fg); transition: border-color 0.2s, background-color 0.2s, color 0.2s, scale 0.25s var(--gs-ease); }
.ar-share :is(a, button):not([hidden]) { display: inline-grid; }
.ar-share :is(a, button)[hidden] { display: none; }
.ar-share :is(a, button):hover { border-color: var(--gs-fg); background: var(--gs-fg); color: var(--gs-day); }
.ar-share :is(a, button):active { scale: 0.94; }
.ar-share svg { width: 17px; height: 17px; }
.ar-share .ar-ok { display: none; }
.ar-share .is-done .ar-ok { display: block; }
.ar-share .is-done .ar-cp { display: none; }

/* ── Related guides and products ── */
.ar-rel-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem clamp(2rem, 5vw, 5rem); align-items: end; margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }
.ar-rel-head h2 { margin: 0; }
.ar-rel-head p { color: var(--gs-fg-muted); max-width: 52ch; }
.ar-reads { border-top: 1px solid var(--gs-rule); }
.ar-reads a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 2rem; align-items: center; padding: 1.3rem 0.1rem 1.35rem; border-bottom: 1px solid var(--gs-rule); color: var(--gs-fg); }
.ar-reads b { font-family: var(--gs-font-display); font-weight: 300; font-size: clamp(1.3rem, 2.1vw, 1.7rem); line-height: 1.2; letter-spacing: -0.01em; transition: color 0.2s; }
.ar-reads span { grid-column: 1; font-size: 0.875rem; line-height: 1.45; color: var(--gs-fg-muted); }
.ar-reads .gs-ar { grid-column: 2; grid-row: 1 / span 2; width: 18px; height: 18px; color: var(--gs-tag); }
.ar-reads a:hover b { color: var(--gs-gold); }
.gs-day .ar-reads a:hover b { color: var(--gs-green-day); }
.ar-reads a:hover .gs-ar, .ar-reads a:focus-visible .gs-ar { translate: 4px 0; }
.ar-rel .gs-cards { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.ar-rel-sub { margin: clamp(2.75rem, 5vw, 3.75rem) 0 1.1rem; font: 500 var(--gs-label)/1.3 var(--gs-font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gs-tag); }
.ar-rel-sub + .gs-cards { margin-top: 0; }
/* Routes: two to four next destinations with a line on each */
.ar-routes { display: grid; grid-template-columns: repeat(var(--ar-cols, 3), minmax(0, 1fr)); gap: clamp(0.75rem, 1.6vw, 1.25rem); }
.ar-routes a { display: flex; flex-direction: column; height: 100%; padding: 1.4rem 1.4rem 1.3rem; border: 1px solid var(--gs-rule); color: var(--gs-fg); transition: border-color 0.25s, translate 0.5s var(--gs-ease), background-color 0.25s; }
.ar-routes h3 { font-size: clamp(1.25rem, 1.7vw, 1.45rem); line-height: 1.25; }
.ar-route-media { display: block; aspect-ratio: 3 / 2; margin: -1.4rem -1.4rem 1.15rem; }
.ar-route-media > img { transition: transform 0.9s var(--gs-ease); }
.ar-routes a:hover .ar-route-media > img, .ar-routes a:focus-visible .ar-route-media > img { transform: scale(1.03); }
.ar-routes .ar-route-k { margin-top: 0.35rem; font-size: 0.8125rem; color: var(--gs-tag); }
.ar-routes p:not(.ar-route-k) { margin-top: 0.75rem; font-size: 0.9375rem; line-height: 1.6; color: var(--gs-fg-muted); }
.ar-route-go { margin-top: auto; padding-top: 1.25rem; display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9375rem; font-weight: 600; color: var(--gs-link); }
.ar-routes a:hover, .ar-routes a:focus-visible { border-color: color-mix(in srgb, var(--gs-fg) 55%, transparent); translate: 0 -3px; background: rgba(245, 242, 235, 0.03); }
.ar-routes a:hover .gs-ar, .ar-routes a:focus-visible .gs-ar { translate: 3px 0; }

/* ── Close: the quote request ── */
.ar-close { border-top: 1px solid var(--gs-line); }
.ar-close-in { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.5rem 3rem; }
.ar-close h2 { margin-bottom: 0.7rem; max-width: 20ch; }
.ar-close .gs-lede { max-width: 58ch; }
.ar-contact { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.35rem 1.5rem; font-size: 0.9375rem; }
.ar-close .ar-actions { margin-top: 0; }
/* California installation (data-califaux-referral), kept once where a page had it */
.ar-ca { margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: clamp(1.5rem, 3vw, 2rem); border-top: 1px solid var(--gs-line); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 1.25rem clamp(2rem, 5vw, 4rem); align-items: start; }
.ar-ca h3 { margin-bottom: 0.6rem; }
.ar-ca p { font-size: 0.9375rem; line-height: 1.65; color: var(--gs-muted); max-width: 60ch; }
.ar-ca p + p { margin-top: 0.6rem; font-size: 0.8125rem; }
.ar-ca ul { border-top: 1px solid var(--gs-line); }
.ar-ca li a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--gs-line); font-size: 0.9375rem; line-height: 1.4; transition: color 0.2s; }
.ar-ca li a .gs-ar { color: var(--gs-gold); }
.ar-ca li a:hover { color: var(--gs-gold); }
.ar-ca li a:hover .gs-ar, .ar-ca li a:focus-visible .gs-ar { translate: 3px 0; }

/* ── Index pages (blog.html, resources.html): a filterable grid of reading ── */
.ar-ix-hero { margin-top: var(--nav-h); padding-block: clamp(2.5rem, 7vh, 4.75rem) clamp(2.25rem, 5vh, 3.5rem); border-bottom: 1px solid var(--gs-line); }
.ar-ix-hero h1 { font-size: clamp(3rem, 6.5vw, 5.25rem); line-height: 1; letter-spacing: -0.025em; }
.ar-ix-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem clamp(2rem, 5vw, 5rem); align-items: end; }
.ar-ix-in .ar-dek { margin-top: 0; }
/* The chips show from the first paint whenever JS runs (html.js is set by the
   inline head script), so the grid never shifts when the filter wakes up.
   Without JS they can't work, so they stay hidden. */
.ar-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }
html:not(.js) .ar-filter[hidden] { display: none; }
.ar-filter .gs-chips { margin: 0; }
.ar-filter .gs-chip { padding: 0.3rem 0.95rem; gap: 0.45rem; }
.ar-filter .gs-chip span { font-variant-numeric: tabular-nums; color: var(--gs-fg-muted); transition: color 0.2s; }
.ar-filter .gs-chip[aria-pressed="true"] span { color: inherit; opacity: 0.7; }
.ar-count { font-size: 0.875rem; color: var(--gs-fg-muted); }
.ar-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(2.25rem, 3.5vw, 3rem) clamp(1rem, 2vw, 1.75rem); }
.ar-card[hidden] { display: none; }
.ar-card > a { display: block; height: 100%; color: var(--gs-fg); transition: translate 0.5s var(--gs-ease); }
.ar-card .gs-ph, .ar-none { aspect-ratio: 3 / 2; }
.ar-card .gs-ph > img { transition: transform 0.9s var(--gs-ease); }
.ar-card-meta { margin-top: 0.95rem; font-size: 0.8125rem; line-height: 1.45; color: var(--gs-fg-muted); }
.ar-card-meta b { font-weight: 600; color: var(--gs-link); }
.ar-card :is(h2, h3) { margin: 0.35rem 0 0; font-size: clamp(1.25rem, 1.55vw, 1.42rem); line-height: 1.24; font-weight: 400; letter-spacing: -0.01em; transition: color 0.2s; }
.ar-card p:not(.ar-card-meta) { margin-top: 0.55rem; font-size: 0.9375rem; line-height: 1.6; color: var(--gs-fg-muted); }
.ar-card > a:hover, .ar-card > a:focus-visible { translate: 0 -4px; }
.ar-card > a:hover .gs-ph > img, .ar-card > a:focus-visible .gs-ph > img { transform: scale(1.03); }
.ar-card > a:hover :is(h2, h3) { color: var(--gs-link); }
.gs-motion .ar-card.is-enter { animation: ar-in 0.55s var(--gs-ease) both; animation-delay: calc(var(--ar-i, 0) * 45ms); }
@keyframes ar-in { from { opacity: 0; transform: translateY(12px); } }
/* No clean photo for a piece of writing: a drafting-hatch tile with its topic */
.ar-none { display: grid; place-items: center; background: #1C1918 repeating-linear-gradient(135deg, rgba(245, 242, 235, 0.07) 0 1px, transparent 1px 11px); }
.ar-none span { padding: 0.42em 0.6em; background: rgba(12, 12, 12, 0.86); font: 500 var(--gs-label)/1 var(--gs-font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: #F5F2EB; }
.ar-ix-arch { margin-top: clamp(3.5rem, 7vw, 5.5rem); }
.ar-ix-arch h2 { margin-bottom: 1.25rem; }
.ar-arch { columns: 2; column-gap: clamp(2rem, 5vw, 4rem); border-top: 1px solid var(--gs-rule); }
.ar-arch li { break-inside: avoid; border-bottom: 1px solid var(--gs-rule); }
.ar-arch a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0.1rem; font-size: 1rem; line-height: 1.45; color: var(--gs-fg); transition: color 0.2s; }
.ar-arch a .gs-ar { color: var(--gs-tag); }
.ar-arch a:hover { color: var(--gs-link); }
.ar-arch a:hover .gs-ar, .ar-arch a:focus-visible .gs-ar { translate: 3px 0; }

/* ── Phone quick-action bars step aside while the page's own buttons are on screen ── */
.m-cta-bar, .ar-mbar { transition: transform 0.35s var(--gs-ease), opacity 0.3s linear; }
.m-cta-bar.is-hidden, .ar-mbar.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }
/* A page excluded from the shell's bar (NO_CTA_BAR) may keep its own two-link bar */
.ar-mbar, .ar-mbar-spacer { display: none; }

@media (max-width: 1024px) {
  .ar-hero-in { grid-template-columns: minmax(0, 1fr); }
  .ar-hero-fig { max-width: 46rem; }
  .ar-hero-fig .gs-ph { max-height: none; }
  .ar-rel-head, .ar-ix-in, .ar-ca { grid-template-columns: minmax(0, 1fr); }
  .ar-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ar-routes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .ar-hero h1 { font-size: clamp(2.05rem, 8.6vw, 2.6rem); }
  .ar-hero-fig { margin-inline: calc(-1 * var(--gs-gutter)); }
  .ar-hero-fig .gs-ph { aspect-ratio: 4 / 3; }
  .ar-hero-fig figcaption { padding-inline: var(--gs-gutter); }
  .ar-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
  .ar-prose { font-size: 1.0625rem; line-height: 1.7; }
  .ar-pair { grid-template-columns: minmax(0, 1fr); }
  .ar-tb > div { display: block; }
  .ar-tb dt { margin-bottom: 0.45rem; }
  .ar-pull p { font-size: 1.45rem; }
  .ar-note { padding: 1.1rem 1.15rem 1.2rem; }
  .ar-cards { grid-template-columns: minmax(0, 1fr); }
  .ar-arch { columns: 1; }
  .ar-mbar-spacer { display: block; height: calc(48px + env(safe-area-inset-bottom)); }
  .ar-mbar { display: flex; position: fixed; z-index: 997; left: 0; right: 0; bottom: 0; border-top: 1px solid var(--gs-line); }
  .ar-mbar a { flex: 1; padding: 0.95rem 0 calc(0.95rem + env(safe-area-inset-bottom)); text-align: center; font: 600 0.7rem/1.2 var(--gs-font-mono); letter-spacing: 0.1em; text-transform: uppercase; background: #141414; color: var(--gs-ink); }
  .ar-mbar a:last-child { background: var(--gs-green); color: var(--gs-night); }
}
@media (prefers-reduced-motion: reduce) {
  .ar-route-media > img, .m-cta-bar, .ar-mbar, .ar-toc-i, .ar-toc-l a::before, .ar-share :is(a, button), .ar-reads b, .ar-routes a, .ar-card > a, .ar-card .gs-ph > img, .ar-arch a { transition: none; }
  .ar-card > a:hover, .ar-card > a:focus-visible, .ar-routes a:hover, .ar-routes a:focus-visible { translate: none; }
  .ar-card > a:hover .gs-ph > img, .ar-card > a:focus-visible .gs-ph > img, .ar-routes a:hover .ar-route-media > img { transform: none; }
  .ar-reads a:hover .gs-ar, .ar-reads a:focus-visible .gs-ar, .ar-routes a:hover .gs-ar, .ar-arch a:hover .gs-ar, .ar-endcta a:hover .gs-ar, .ar-ca li a:hover .gs-ar { translate: none; }
  .ar-ca li a { transition: none; }
  .ar-share :is(a, button):active { scale: none; }
}
/* Posts with no section headings get no contents rail */
.ar-toc:not(:has(li)) { display: none; }
