/* Guides hub, guide extras (reclamation certificate, AI for contaminated sites) and the glossary.
   Builds on site.css, blog.css and guide.css (read-only). Light surfaces use the paper tokens only. */

/* ------------------------------------------------------------------ guides hub */
.gh-hero h1 { font-size: clamp(2.1rem, 4.5vw, 4.1rem); max-width: 16em; }
.gh-hero .lede { max-width: 34em; }
.gh-crumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; font-size: 0.9rem; color: var(--fog); }
.gh-crumbs a { color: var(--mist); transition: color 0.2s; }
.gh-crumbs a:hover { color: var(--cream); }
.gh-crumbs [aria-current] { color: var(--cream); }
.gh-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 30px 0 0; padding: 0; }
.gh-hero-meta li { padding: 6px 12px; border-radius: 999px; font-size: 0.86rem; color: var(--mist); box-shadow: inset 0 0 0 1px var(--night-line-strong); }

.gh-list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; margin-bottom: clamp(28px, 3.5vw, 44px); }
.gh-list-head h2 { color: var(--paper-ink); }
.gh-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.gh-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; font-size: 0.92rem; font-weight: 500;
  color: var(--paper-body); box-shadow: inset 0 0 0 1px var(--paper-line); transition: color 0.2s, background-color 0.2s, box-shadow 0.2s; }
.gh-chip:hover { box-shadow: inset 0 0 0 1px var(--paper-muted); }
.gh-chip[aria-pressed='true'] { background: var(--paper-ink); color: var(--paper); box-shadow: none; }
.gh-chip-n { font-size: 0.78rem; color: var(--paper-muted); font-variant-numeric: tabular-nums; }
.gh-chip[aria-pressed='true'] .gh-chip-n { color: inherit; opacity: 0.7; }

.gh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 2.2vw, 28px); list-style: none; margin: 0; padding: 0; }
@media (max-width: 760px) { .gh-grid { grid-template-columns: 1fr; } }
.gh-grid > li[hidden] { display: none; }
.gh-card { position: relative; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 22px; align-items: start; height: 100%; padding: 22px; border-radius: var(--radius-lg);
  background: var(--paper); box-shadow: 0 0 0 1px var(--paper-line), 0 1px 2px rgba(15, 23, 42, 0.04); transition: transform 0.5s var(--ease-out), box-shadow 0.4s ease; }
.gh-card:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px var(--paper-line), 0 26px 54px -34px rgba(15, 23, 42, 0.38); }
.gh-card-art { aspect-ratio: 3 / 4; border-radius: 12px; background: var(--night-1); display: grid; place-items: center; overflow: hidden; }
.gh-card-art img { width: 84%; height: 88%; object-fit: contain; }
.gh-card-body { display: flex; flex-direction: column; min-height: 100%; }
.gh-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.gh-tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; color: var(--blue); background: rgba(0, 149, 237, 0.08); }
.gh-card h3 { margin-top: 12px; font-size: clamp(1.35rem, 1.9vw, 1.6rem); line-height: 1.15; color: var(--paper-ink); }
.gh-card p { margin-top: 10px; font-size: 0.98rem; line-height: 1.55; color: var(--paper-body); }
.gh-card .link-arrow { margin-top: auto; padding-top: 16px; }
.gh-card.is-new::after { content: 'New'; position: absolute; top: 18px; right: 18px; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; color: #fff; background: var(--blue); }
@media (max-width: 460px) { .gh-card { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; padding: 18px; } }
.gh-empty { margin-top: 20px; color: var(--paper-muted); }
/* filter motion: transform/opacity only */
.gh-grid > li.leaving { opacity: 0; transform: translateY(8px) scale(0.98); transition: opacity 0.2s ease, transform 0.2s ease; }
.gh-grid > li.entering { opacity: 0; transform: translateY(12px); }
.gh-grid > li { transition: opacity 0.35s ease, transform 0.5s var(--ease-out); }

.gh-more { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: clamp(18px, 2.2vw, 28px); }
@media (max-width: 900px) { .gh-more { grid-template-columns: 1fr; } }
.gh-more-card { display: flex; flex-direction: column; gap: 10px; padding: clamp(22px, 2.6vw, 30px); border-radius: var(--radius-lg); background: var(--paper);
  box-shadow: 0 0 0 1px var(--paper-line); transition: transform 0.5s var(--ease-out), box-shadow 0.4s ease; }
.gh-more-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--paper-line), 0 22px 46px -32px rgba(15, 23, 42, 0.35); }
.gh-more-card .h3 { font-family: var(--title); font-weight: 400; color: var(--paper-ink); }
.gh-more-card p { color: var(--paper-body); }
.gh-more-card .link-arrow { margin-top: auto; padding-top: 8px; }
.gh-more-card.is-dark { background: linear-gradient(180deg, #13223A, #0C1626); box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.2); }
.gh-more-card.is-dark .h3 { color: var(--cream); }
.gh-more-card.is-dark p { color: var(--mist); }
.gh-more-card.is-dark .link-arrow { color: var(--sky); }
.gh-more-terms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.gh-more-terms span { padding: 3px 9px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; color: var(--sky); background: rgba(142, 219, 255, 0.1); }

/* ------------------------------------------------------------------ long-form guide extras */
/* numbered process steps */
.prose ol.gh-steps { list-style: none; padding-left: 0; counter-reset: ghstep; }
.prose ol.gh-steps > li { position: relative; padding: 0 0 0 52px; counter-increment: ghstep; }
.prose ol.gh-steps > li + li { margin-top: 1em; }
.prose ol.gh-steps > li::before { content: counter(ghstep); position: absolute; left: 0; top: 0.1em; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font: 600 0.92rem/1 var(--sans); color: var(--blue); background: #F1F7FD; box-shadow: inset 0 0 0 1px #D6E6F5; }
.prose ol.gh-steps > li:not(:last-child)::after { content: ''; position: absolute; left: 16.5px; top: 2.4em; bottom: -0.9em; width: 1px; background: #D6E6F5; }
.prose ol.gh-steps b { color: var(--paper-ink); }

/* two-up liability cards */
.gh-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 1.6em 0; }
@media (max-width: 640px) { .gh-split { grid-template-columns: 1fr; } }
.gh-split-card { padding: 22px 22px 20px; border-radius: var(--radius); background: #fff; box-shadow: 0 0 0 1px var(--paper-line), 0 18px 40px -32px rgba(15, 23, 42, 0.35); }
.prose .gh-split-card p.gh-split-num { font: 400 clamp(2rem, 3.2vw, 2.5rem)/1 var(--title); color: var(--paper-ink); font-variant-numeric: lining-nums; }
.prose .gh-split-card p.gh-split-label { margin-top: 8px; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue); }
.prose .gh-split-card p:not(.gh-split-num):not(.gh-split-label) { margin-top: 12px; font-size: 0.98rem; line-height: 1.6; }

/* research papers list */
.prose ul.gh-papers { list-style: none; padding-left: 0; }
.prose ul.gh-papers > li { padding: 14px 18px; border-radius: 12px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--paper-line); font-size: 1.02rem; }
.prose ul.gh-papers > li + li { margin-top: 10px; }
.prose ul.gh-papers b { color: var(--paper-ink); }

/* top-k figure */
.gh-topk { margin: 1.8em 0; padding: 20px 20px 16px; border-radius: var(--radius-lg); background: #fff; box-shadow: 0 0 0 1px var(--paper-line), 0 24px 50px -36px rgba(15, 23, 42, 0.35); }
.prose ol.gh-topk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.prose ol.gh-topk-list > li { display: flex; align-items: baseline; gap: 12px; margin: 0; padding: 9px 12px; border-radius: 10px; font-size: 0.95rem; line-height: 1.4; color: var(--paper-ink); background: rgba(0, 149, 237, 0.05); }
.gh-rank { flex: none; min-width: 2.6em; font-weight: 600; font-size: 0.82rem; color: var(--blue); font-variant-numeric: tabular-nums; }
.prose ol.gh-topk-list > li.gh-topk-more { color: var(--paper-muted); background: rgba(0, 149, 237, 0.03); }
.prose ol.gh-topk-list > li.gh-topk-cut { position: relative; justify-content: center; padding: 10px 0; background: none; }
.gh-topk-cut::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px dashed #94A3B8; }
.gh-topk-cut span { position: relative; padding: 0 12px; background: #fff; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--paper-muted); }
.prose ol.gh-topk-list > li.gh-topk-miss { color: var(--paper-muted); background: repeating-linear-gradient(135deg, #F8FAFC 0 8px, #F1F5F9 8px 16px); box-shadow: inset 0 0 0 1px var(--paper-line); }
.gh-topk-miss .gh-rank { color: var(--paper-muted); }
.prose .gh-topk figcaption { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--paper-line); font-size: 0.92rem; line-height: 1.5; color: var(--paper-body); }

/* citation levels */
.gh-cite-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 1.6em 0; }
@media (max-width: 640px) { .gh-cite-levels { grid-template-columns: 1fr; } }
.gh-cite { padding: 18px; border-radius: var(--radius); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--paper-line); }
.prose .gh-cite p { font-size: 0.95rem; line-height: 1.5; }
.prose .gh-cite p.gh-cite-k { margin-bottom: 8px; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--paper-muted); }
.gh-cite-on { background: #F1F7FD; box-shadow: inset 0 0 0 1px #BFDDF6; }
.prose .gh-cite-on p.gh-cite-k { color: var(--blue); }
.prose .g-table.gh-check tbody th { width: 30%; }

/* related guides under the article */
.gh-related { margin-top: clamp(64px, 8vw, 104px); padding-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--paper-line); }
.gh-related h2 { margin-bottom: clamp(20px, 2.6vw, 30px); color: var(--paper-ink); }
.gh-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 860px) { .gh-related-grid { grid-template-columns: 1fr; } }
.gh-related-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px; border-radius: var(--radius-lg); background: var(--paper);
  box-shadow: 0 0 0 1px var(--paper-line); transition: transform 0.5s var(--ease-out), box-shadow 0.4s ease; }
.gh-related-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--paper-line), 0 22px 46px -32px rgba(15, 23, 42, 0.35); }
.gh-related-card b { font: 400 1.35rem/1.18 var(--title); color: var(--paper-ink); }
.gh-related-card .link-arrow { margin-top: auto; padding-top: 6px; font-size: 0.94rem; }

/* ------------------------------------------------------------------ glossary */
.gl-surface { padding: clamp(48px, 6vw, 80px) 0 clamp(72px, 9vw, 120px); }
.gl-tools { position: sticky; top: calc(var(--nav-offset, var(--nav-h)) + 12px); z-index: 20; display: grid; gap: 14px; margin-bottom: clamp(32px, 4vw, 48px); padding: 16px; border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 0 0 1px var(--paper-line), 0 18px 40px -32px rgba(15, 23, 42, 0.35);
  transition: top 0.45s var(--ease-out); }
.gl-search { position: relative; }
.gl-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--paper-muted); pointer-events: none; }
.gl-search input { width: 100%; height: 46px; padding: 0 16px 0 42px; border: 0; border-radius: 12px; font: 400 1rem/1 var(--sans); color: var(--paper-ink); background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--paper-line); transition: box-shadow 0.2s; }
.gl-search input::placeholder { color: var(--paper-muted); }
.gl-search input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blue); }
.gl-jump { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.gl-jump a, .gl-jump span { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 8px; font-size: 0.9rem; font-weight: 600; font-variant-numeric: lining-nums; }
.gl-jump a { color: var(--paper-ink); transition: background-color 0.2s, color 0.2s; }
.gl-jump a:hover { background: var(--paper-2); color: var(--blue); }
.gl-jump span, .gl-jump a.is-empty { color: #CBD5E1; pointer-events: none; }
.gl-count { font-size: 0.86rem; color: var(--paper-muted); }
.gl-layout { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 880px; margin: 0 auto; }
.gl-group { scroll-margin-top: calc(var(--nav-h) + 160px); }
.gl-group + .gl-group { margin-top: clamp(36px, 4.5vw, 56px); }
.gl-group[hidden] { display: none; }
.gl-letter { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; font: 400 2.2rem/1 var(--title); color: var(--blue); }
.gl-letter::after { content: ''; flex: 1; height: 1px; background: var(--paper-line); }
.gl-list { margin: 0; }
.gl-term { padding: 20px 0 22px; border-bottom: 1px solid var(--paper-line); scroll-margin-top: calc(var(--nav-h) + 160px); }
.gl-term[hidden] { display: none; }
.gl-term:target { background: linear-gradient(90deg, rgba(0, 149, 237, 0.06), transparent 70%); }
.gl-term dt { font: 400 1.65rem/1.2 var(--title); color: var(--paper-ink); }
.gl-term dt a.gl-anchor { color: inherit; }
.gl-term dt a.gl-anchor:hover { color: var(--blue); }
.gl-exp { display: inline-block; margin-left: 10px; font: 500 0.9rem/1.4 var(--sans); color: var(--paper-muted); vertical-align: 0.15em; }
.gl-term dd { margin: 8px 0 0; font-size: 1.04rem; line-height: 1.65; color: var(--paper-body); max-width: 46em; }
.gl-term dd a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.gl-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 0.88rem; }
.gl-term .gl-meta a { color: var(--blue); text-decoration: none; }
.gl-term .gl-meta a:hover { text-decoration: underline; }
.gl-term .gl-meta a.gl-src { color: var(--paper-muted); }
.gl-empty { padding: 40px 0; text-align: center; color: var(--paper-muted); }
.gl-empty[hidden] { display: none; }
mark.gl-hit { padding: 0 1px; border-radius: 3px; color: inherit; background: rgba(0, 202, 203, 0.22); }
.gl-note { max-width: 880px; margin: clamp(48px, 6vw, 72px) auto 0; }
@media (max-width: 640px) {
  .gl-tools { position: static; }
  .gl-jump a, .gl-jump span { min-width: 28px; height: 30px; font-size: 0.86rem; }
  .gl-exp { display: block; margin: 4px 0 0; }
}
