/* ============================================================
   Fresh Web Guides. Loaded after /case-studies/cs.css, which
   supplies the shared subpage chrome (tokens, nav, footer,
   buttons, reveal). Only guide-specific layout lives here.
   Generated pages: edit guides/.src/build.py, not the HTML.
   ============================================================ */
:root {
  --warn-bg: #FFF7E6;
  --warn-border: #F0DDB2;
  --warn-text: #5C4410;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

/* ═══ HUB ═══ */
.g-head { padding: 150px 0 8px; text-align: center; }
.g-head .section-desc { margin: 0 auto; }

.g-hub { max-width: 1040px; margin: 56px auto 0; display: grid; gap: 56px; }
.g-cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.g-cat h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.6px; color: var(--text-primary); }
.g-cat h2 a:hover { color: var(--navy-mid); }
.g-cat-blurb { font-size: 16px; color: var(--text-muted); line-height: 1.65; max-width: 620px; }

.g-list { list-style: none; margin-top: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--white); }
.g-list li + li { border-top: 1px solid var(--border); }
.g-row { display: flex; align-items: center; gap: 18px; padding: 20px 24px; transition: background-color 0.2s; }
.g-row-provider { flex: none; width: 168px; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--navy-mid); }
.g-row-title { flex: 1; font-size: 16.5px; font-weight: 700; color: var(--text-primary); line-height: 1.35; }
.g-row-meta { flex: none; font-size: 13px; color: var(--text-muted); }
.g-row .arrow-icon { flex: none; color: var(--navy); transition: transform 0.2s cubic-bezier(0.23,1,0.32,1); }
@media (hover: hover) and (pointer: fine) {
  .g-row:hover { background: var(--bg-secondary); }
  .g-row:hover .arrow-icon { transform: translateX(3px); }
}

.g-help { max-width: 1040px; margin: 64px auto 0; padding: 32px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.g-help h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; margin-bottom: 4px; }
.g-help p { font-size: 15.5px; color: var(--text-secondary); line-height: 1.6; }
.g-help .btn-green { flex: none; }

/* Hub sections: intro column beside the cards */
.g-hub.is-index .g-cat { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px 48px; align-items: start; padding-top: 40px; border-top: 1px solid var(--border); }
.g-hub.is-index .g-cat:first-child { border-top: none; padding-top: 0; }
.g-hub.is-index .g-cat .g-grid { margin-top: 0; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.g-cat-intro { position: sticky; top: 100px; }
.g-cat-intro .g-cat-blurb { font-size: 15.5px; margin-top: 8px; }
.g-cat-count { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--navy); }
.g-cat-count:hover { color: var(--navy-mid); }
.g-hub { gap: 40px; }

/* Guide cards */
.g-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; margin-top: 22px; }
.g-grid > li { display: flex; min-width: 0; }
.g-card { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 172px; padding: 22px 22px 20px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: border-color 0.2s, box-shadow 0.25s, transform 0.25s cubic-bezier(0.23,1,0.32,1); }
.g-card-provider { align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--navy-mid); background: var(--bg-tertiary); padding: 5px 12px; border-radius: var(--radius-pill); }
.g-card-title { font-size: 18px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.3; color: var(--text-primary); text-wrap: balance; }
.g-card-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-muted); }
.g-card-foot .arrow-icon { color: var(--navy); transition: transform 0.2s cubic-bezier(0.23,1,0.32,1); }
.g-card:active { transform: scale(0.99); }
.g-card:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .g-card:hover { border-color: var(--green-dark); box-shadow: 0 18px 40px -24px rgba(22,51,0,0.30); transform: translateY(-2px); }
  .g-card:hover .arrow-icon { transform: translateX(3px); }
}

/* ═══ GUIDE PAGE ═══ */
.g-crumbs { padding: 116px 0 0; }
.g-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-muted); }
.g-crumbs li + li::before { content: '/'; margin-right: 8px; color: var(--border); }
.g-crumbs a { transition: color 0.2s; }
.g-crumbs a:hover { color: var(--navy); }
.g-crumbs [aria-current] { color: var(--text-secondary); }

.g-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 64px; max-width: 1040px; margin: 28px auto 0; align-items: start; }
.g-article { max-width: 720px; min-width: 0; }

.g-title { font-size: clamp(30px, 4.2vw, 44px); font-weight: 900; line-height: 1.1; letter-spacing: -1.4px; color: var(--text-primary); margin: 14px 0 16px; text-wrap: balance; }
.g-lead { font-size: 18px; color: var(--text-secondary); line-height: 1.7; }
.g-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.g-meta span { font-size: 13px; font-weight: 600; color: var(--text-secondary); background: var(--bg-secondary); border: 1px solid var(--border); padding: 6px 14px; border-radius: var(--radius-pill); }

.g-panel { margin-top: 36px; padding: 24px 26px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.g-panel h2 { font-size: 13px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--navy-mid); margin-bottom: 12px; }
.g-panel ul { list-style: none; display: grid; gap: 10px; }
.g-panel li { position: relative; padding-left: 26px; font-size: 15.5px; color: var(--text-secondary); line-height: 1.6; }
.g-panel li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--green); box-shadow: inset 0 0 0 4px var(--green-light); }

.g-steps { list-style: none; counter-reset: step; margin-top: 48px; }
.g-step { counter-increment: step; position: relative; padding: 0 0 44px 64px; scroll-margin-top: 100px; }
.g-step::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: var(--green); font-size: 16px; font-weight: 800; display: grid; place-items: center; }
.g-step::after { content: ''; position: absolute; left: 19.5px; top: 46px; bottom: 6px; width: 1px; background: var(--border); }
.g-step:last-child { padding-bottom: 0; }
.g-step:last-child::after { display: none; }
.g-step h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.5px; color: var(--text-primary); line-height: 1.3; margin-bottom: 10px; }

.g-prose p, .g-prose li { font-size: 16.5px; color: var(--text-secondary); line-height: 1.75; }
.g-prose p + p, .g-prose p + ul, .g-prose ul + p, .g-prose p + ol, .g-prose ol + p { margin-top: 12px; }
.g-prose ul, .g-prose ol { padding-left: 22px; }
.g-prose li + li { margin-top: 6px; }
.g-prose strong { color: var(--text-primary); font-weight: 700; }
.g-prose a { color: var(--navy); font-weight: 600; text-decoration: underline; text-decoration-color: var(--green-dark); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.g-prose a:hover { text-decoration-color: var(--navy); }
.g-prose code, .g-ui { font-family: var(--mono); font-size: 0.88em; background: var(--bg-tertiary); color: var(--text-primary); padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.g-ui { font-family: inherit; font-weight: 700; font-size: 0.94em; background: var(--white); border: 1px solid var(--border); }

/* Record table (DNS) */
.g-records { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--white); }
.g-records table { width: 100%; border-collapse: collapse; }
.g-records th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); background: var(--bg-secondary); padding: 10px 16px; border-bottom: 1px solid var(--border); }
.g-records td { padding: 14px 16px; font-size: 15px; color: var(--text-primary); vertical-align: top; border-top: 1px solid var(--border); }
.g-records tr:first-child td { border-top: none; }
.g-records td:nth-child(2), .g-records td:nth-child(3) { font-family: var(--mono); font-size: 14px; word-break: break-all; }
.g-records .g-from { font-family: 'Inter', -apple-system, sans-serif; font-size: 14px; color: var(--text-muted); font-style: normal; word-break: normal; }

.g-note, .g-warn { margin-top: 18px; padding: 16px 18px; border-radius: var(--radius-md); font-size: 15px; line-height: 1.65; display: flex; gap: 12px; }
.g-note { background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); }
.g-warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); }
.g-note svg, .g-warn svg { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.g-note strong, .g-warn strong { font-weight: 700; color: inherit; }
.g-warn strong { color: #3F2E08; }

.g-done { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--border); scroll-margin-top: 100px; }
.g-done h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.6px; margin-bottom: 12px; }

.g-stuck { margin-top: 48px; padding: 28px; background: var(--navy); color: var(--white); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.g-stuck h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; margin-bottom: 4px; }
.g-stuck p { font-size: 15px; color: rgba(255,255,255,0.65); line-height: 1.6; }
.g-stuck .btn-green { flex: none; }

/* On-this-page rail */
.g-toc { position: sticky; top: 104px; padding-top: 6px; }
.g-toc h2 { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
.g-toc ol { list-style: none; display: grid; gap: 2px; border-left: 1px solid var(--border); }
.g-toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 1px solid transparent; font-size: 14px; color: var(--text-muted); line-height: 1.4; transition: color 0.2s, border-color 0.2s; }
.g-toc a:hover { color: var(--text-primary); }
.g-toc a.is-active { color: var(--navy); font-weight: 600; border-left-color: var(--navy); }

/* Related */
.g-related { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--border); }
.g-related h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
.g-related .g-grid { margin-top: 18px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.g-related .g-card { min-height: 150px; }

@media (prefers-reduced-motion: reduce) {
  .g-row, .g-row .arrow-icon, .g-toc a, .g-card, .g-card-foot .arrow-icon { transition: none; }
  .g-card:hover, .g-card:active { transform: none; }
}

@media (max-width: 1024px) {
  .g-hub.is-index .g-cat { grid-template-columns: minmax(0, 1fr); }
  .g-cat-intro { position: static; }
  .g-layout { grid-template-columns: minmax(0, 1fr); max-width: 720px; }
  .g-toc { display: none; }
}
@media (max-width: 768px) {
  .g-head { padding: 120px 0 4px; }
  .g-crumbs { padding: 96px 0 0; }
  .g-hub { margin-top: 40px; gap: 44px; }
  .g-row { flex-wrap: wrap; gap: 4px 12px; padding: 16px 18px; }
  .g-row-provider { width: 100%; }
  .g-row-meta { display: none; }
  .g-card { min-height: 0; padding: 18px; }
  .g-help, .g-stuck { flex-direction: column; align-items: flex-start; padding: 24px; }
  .g-step { padding-left: 52px; }
  .g-step::before { width: 34px; height: 34px; font-size: 15px; }
  .g-step::after { left: 16.5px; top: 40px; }
  .g-records thead { display: none; }
  .g-records tr { display: block; padding: 12px 16px; border-top: 1px solid var(--border); }
  .g-records tr:first-child { border-top: none; }
  .g-records td { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 3px 0; border: none; }
  .g-records td::before { content: attr(data-label); font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); padding-top: 2px; }
  .g-related { margin-top: 44px; padding-top: 32px; }
}
@media (max-width: 480px) {
  .g-lead { font-size: 16.5px; }
  .g-prose p, .g-prose li { font-size: 15.5px; }
  .g-prose code { white-space: normal; overflow-wrap: anywhere; }
}
