/* Guides (scripts/build-guides.mjs): static article pages on top of the app's own
   stylesheet, which supplies the fonts, colour tokens, header, footer and buttons. */
.gd-page { --gd-measure: 720px; }
.gd-main { flex: 1 0 auto; width: 100%; padding: clamp(1.5rem, 4vw, 3rem) var(--shell-gutter) clamp(3rem, 7vw, 5.5rem); }
.gd-article, .gd-index { max-width: var(--gd-measure); margin-inline: auto; }
.gd-index { max-width: 980px; }

/* The header has no menu button here (no JavaScript), so keep the call to action on small screens. */
@media (max-width: 560px) {
  .gd-page .site-header__cta.gd-header-cta { display: inline-flex; }
  .gd-page .site-header__signin { display: none; }
}
.gd-page .ea-logo { text-decoration: none; color: inherit; }

.gd-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1.4rem; padding: 0; font-size: .86rem; color: var(--muted); }
.gd-crumbs li { display: inline-flex; align-items: center; gap: .35rem; min-width: 0; }
.gd-crumbs li + li::before { content: "›"; color: var(--border-2); }
.gd-crumbs li[aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; color: var(--ink-2); }
@media (max-width: 560px) { .gd-crumbs li[aria-current] { display: none; } }
.gd-crumbs a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-2); }
.gd-crumbs a:hover { color: var(--green-700); text-decoration-color: currentColor; }

.gd-article h1, .gd-index h1 { margin-top: .9rem; font-size: clamp(2rem, 5.2vw, 3.1rem); line-height: 1.06; text-wrap: balance; }
.gd-meta { margin-top: 1rem; font-size: .88rem; color: var(--muted); }
.gd-summary { margin-top: 1.1rem; font-size: clamp(1.08rem, 1.6vw, 1.22rem); line-height: 1.6; color: var(--ink-2); }

.gd-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 1.8rem 0 0; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.gd-facts > div { background: var(--surface); padding: 1rem 1.2rem; min-width: 0; }
.gd-facts dt { font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.gd-facts dd { margin: .35rem 0 0; font-size: 1rem; line-height: 1.45; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 560px) { .gd-facts { grid-template-columns: 1fr; } }

.gd-toc { margin-top: 1.6rem; padding: 1.1rem 1.3rem; background: var(--bg-2); border-radius: var(--r); }
.gd-toc h2 { font-family: var(--sans); font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.gd-toc ol { margin: .6rem 0 0; padding-inline-start: 1.2rem; display: grid; gap: .3rem; font-size: .95rem; }
.gd-toc a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-2); }
.gd-toc a:hover { color: var(--green-700); text-decoration-color: currentColor; }

.gd-body section { margin-top: clamp(2.2rem, 5vw, 3rem); scroll-margin-top: 84px; }
.gd-body h2, .gd-faq h2, .gd-sources h2, .gd-related h2, .gd-index section h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); line-height: 1.15; text-wrap: balance; scroll-margin-top: 84px; }
.gd-body p, .gd-body li { font-size: 1.05rem; line-height: 1.72; color: var(--ink); }
.gd-body p { margin: .95rem 0 0; }
.gd-body ul, .gd-body ol { margin: .9rem 0 0; padding-inline-start: 1.35rem; display: grid; gap: .45rem; }
.gd-body li::marker { color: var(--green); }
.gd-body a, .gd-faq a, .gd-summary a { color: var(--green-700); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.gd-body strong { font-weight: 600; color: var(--ink); }
.gd-note { padding: .9rem 1.1rem; background: var(--green-tint); border-inline-start: 3px solid var(--green); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 1rem !important; }

.gd-table { margin-top: 1.1rem; max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); }
.gd-table:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.gd-table table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.45; }
.gd-table caption { caption-side: top; text-align: start; padding: .85rem 1rem 0; font-size: .86rem; color: var(--muted); }
.gd-table th, .gd-table td { padding: .7rem 1rem; text-align: start; vertical-align: top; border-top: 1px solid var(--border); }
.gd-table thead th { border-top: 0; background: var(--bg-2); font-size: .74rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.gd-table tbody th { font-weight: 600; color: var(--ink); min-width: 9rem; }
.gd-table td { color: var(--ink-2); min-width: 8rem; }
@media (max-width: 560px) {
  .gd-table { overflow: visible; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .gd-table table, .gd-table tbody, .gd-table tr, .gd-table th, .gd-table td { display: block; width: 100%; }
  .gd-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .gd-table caption { display: block; padding: 0 0 .2rem; }
  .gd-table tbody tr { margin-top: .7rem; padding: .85rem 1rem .95rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); }
  .gd-table tbody th { min-width: 0; padding: 0 0 .3rem; border: 0; font-size: 1rem; }
  .gd-table td { min-width: 0; padding: .4rem 0 0; border: 0; display: grid; grid-template-columns: minmax(6rem, 36%) minmax(0, 1fr); gap: .8rem; overflow-wrap: anywhere; }
  .gd-table td::before { content: attr(data-label); padding-top: .12rem; font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
}

.gd-cta { margin-top: clamp(2.4rem, 6vw, 3.4rem); padding: clamp(1.4rem, 4vw, 2rem); border-radius: var(--r-lg); background: var(--green); color: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem 1.6rem; box-shadow: var(--shadow); }
.gd-cta > div { flex: 1 1 320px; min-width: 0; }
.gd-cta h2 { color: #fff; font-size: clamp(1.35rem, 3vw, 1.7rem); }
.gd-cta p { margin-top: .5rem; color: rgba(255,255,255,.86); line-height: 1.55; }
.gd-page a.gd-cta__button { --bg-c: #fff; --fg-c: var(--green-700); --bd-c: #fff; flex: none; }
.gd-page a.gd-cta__button:hover { --bg-c: var(--green-tint); background: var(--green-tint); }
@media (max-width: 560px) { .gd-page a.gd-cta__button { width: 100%; justify-content: center; } }

.gd-faq { margin-top: clamp(2.4rem, 6vw, 3.2rem); }
.gd-faq details { margin-top: .8rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.gd-faq summary { cursor: pointer; padding: 1rem 1.2rem; font-weight: 600; color: var(--ink); list-style: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.gd-faq summary::-webkit-details-marker { display: none; }
.gd-faq summary::after { content: "+"; flex: none; width: 1.5rem; height: 1.5rem; margin-top: -.05rem; border-radius: 999px; display: grid; place-items: center; background: var(--green-tint); color: var(--green-700); font-weight: 600; line-height: 1; }
.gd-faq details[open] summary::after { content: "–"; }
.gd-faq summary:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: var(--r); }
.gd-faq details[open] summary { border-bottom: 1px solid var(--border); }
.gd-faq details p { margin: 0; padding: .9rem 1.2rem 1.1rem; line-height: 1.65; color: var(--ink-2); }

.gd-sources { margin-top: clamp(2.4rem, 6vw, 3.2rem); padding-top: 1.6rem; border-top: 1px solid var(--border); }
.gd-sources > p { margin-top: .6rem; color: var(--ink-2); line-height: 1.6; font-size: .95rem; }
.gd-sources ol { margin: 1rem 0 0; padding-inline-start: 1.3rem; display: grid; gap: .7rem; }
.gd-sources li { line-height: 1.45; }
.gd-sources li a { color: var(--green-700); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.gd-sources li span { display: block; margin-top: .15rem; font-size: .84rem; color: var(--muted); }
.gd-independence { margin-top: 1.6rem; font-size: .88rem; color: var(--muted); line-height: 1.55; }

.gd-related { margin-top: clamp(2.4rem, 6vw, 3.2rem); }
.gd-related ul, .gd-cards { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1rem; }
.gd-related a, .gd-cards a { height: 100%; display: flex; flex-direction: column; gap: .45rem; padding: 1.15rem 1.25rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.gd-related a:hover, .gd-cards a:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
.gd-related strong, .gd-cards strong { font-family: var(--serif); font-weight: 500; font-size: 1.14rem; line-height: 1.25; }
.gd-related a > span:not(.gd-related__kicker), .gd-cards a > span:not(.gd-related__kicker) { font-size: .92rem; line-height: 1.5; color: var(--ink-2); }
.gd-related__kicker { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.gd-cards .gd-cards__date { margin-top: auto; padding-top: .3rem; font-size: .8rem !important; color: var(--muted) !important; }
.gd-index section { margin-top: clamp(2.2rem, 5vw, 3rem); }

@media (prefers-reduced-motion: reduce) { .gd-related a, .gd-cards a { transition: none; } .gd-related a:hover, .gd-cards a:hover { transform: none; } }
@media print { .site-header, .site-footer, .gd-cta, .gd-related, .gd-toc { display: none; } .gd-main { padding: 0; } }
