/* site-chrome.css - sitewide header, Explore panel and footer site map (2026-10-29).
   Tokens only (css/tokens.css). Phone-first (iOS Safari + Android Chrome); the inline
   nav + dropdown start at 900px. Every entry = icon + plain-word label. */
:root { --sc-h: 56px; }
html.sc-lock, html.sc-lock body { overflow: hidden; }

.sc-i { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- header ---------- */
.sc-header {
  position: sticky; top: 0; z-index: 60;
  height: var(--sc-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--c-bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--c-line);
  font-family: var(--f-sans);
}
.sc-brand {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto;
  min-height: 44px; color: var(--c-text); text-decoration: none;
}
.sc-mark { flex: 0 0 auto; display: block; border-radius: 7px; }
.sc-wordmark { font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-brand:hover .sc-wordmark { color: var(--c-accent-2); }

.sc-primary { display: none; }
.sc-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.sc-mappill, .sc-explore-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border-radius: var(--r-pill);
  font: 700 15px/1 var(--f-sans); text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.sc-mappill { background: var(--c-accent); color: var(--c-accent-ink); border: 1px solid transparent; }
.sc-mappill:active { background: var(--c-accent-2); }
.sc-explore-btn { background: var(--c-surface-2); color: var(--c-text); border: 1px solid var(--c-line-2); min-width: 104px; }
.sc-explore-btn:active { background: var(--c-surface-3); }
/* open state is obvious: accent fill, X icon, label flips to "Close" */
.sc-explore-btn[aria-expanded="true"] { background: var(--c-accent); color: var(--c-accent-ink); border-color: transparent; }
.sc-i-x, .sc-lbl-close { display: none; }
.sc-explore-btn[aria-expanded="true"] .sc-i-x { display: block; }
.sc-explore-btn[aria-expanded="true"] .sc-lbl-close { display: inline; }
.sc-explore-btn[aria-expanded="true"] .sc-i-menu, .sc-explore-btn[aria-expanded="true"] .sc-lbl-open { display: none; }

/* ---------- panel: phone = full-height sheet ---------- */
.sc-backdrop { position: fixed; top: var(--sc-h); left: 0; right: 0; bottom: 0; z-index: 54; background: rgba(0, 0, 0, .55); }
.sc-panel {
  position: fixed; z-index: 58; top: var(--sc-h); left: 0; right: 0;
  height: calc(100vh - var(--sc-h)); height: calc(100dvh - var(--sc-h));
  display: flex; flex-direction: column;
  background: var(--c-surface); color: var(--c-text); font-family: var(--f-sans);
  animation: sc-sheet .18s ease-out;
}
.sc-panel[hidden], .sc-backdrop[hidden] { display: none; }
@keyframes sc-sheet { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sc-panel-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 4px 20px; border-bottom: 1px solid var(--c-line); }
.sc-panel-title { font-size: 15px; font-weight: 700; color: var(--c-text-2); }
.sc-close {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; border-radius: var(--r-pill); color: var(--c-text); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sc-close:active { background: var(--c-surface-3); }
.sc-close svg { width: 20px; height: 20px; }

.sc-panel-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 16px max(16px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.sc-quick { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-quick a {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px;
  background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--r-2);
  color: var(--c-text); font-size: 15px; font-weight: 700; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.sc-quick a .sc-i { color: var(--c-accent); }
.sc-quick a:active { background: var(--c-surface-3); }

.sc-groups { display: grid; gap: 26px; }
.sc-group h2 {
  display: flex; align-items: center; gap: 12px; margin: 0 0 10px; padding: 0 2px;
  font-size: 15px; font-weight: 800; color: var(--c-accent);
}
.sc-group h2::after { content: ""; flex: 1; height: 1px; background: var(--c-line-2); }
.sc-group ul, .sc-footer ul { list-style: none; margin: 0; padding: 0; }
.sc-group ul { display: grid; gap: 8px; }
.sc-group a {
  display: flex; align-items: center; gap: 14px;
  min-height: 56px; padding: 6px 12px 6px 8px;
  background: var(--c-surface-2); border: 1px solid transparent; border-radius: var(--r-2);
  color: var(--c-text); text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.sc-group a:active { background: var(--c-surface-3); }
.sc-ic { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: var(--c-surface-3); color: var(--c-accent); }
.sc-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sc-l { font-size: 16px; font-weight: 700; line-height: 1.2; }
.sc-h { font-size: 14px; line-height: 1.3; color: var(--c-text-2); }

/* current page: accent border + filled icon tile + a "you are here" dot */
.sc-group a[aria-current="page"] { border-color: var(--c-accent); background: var(--c-accent-soft); }
.sc-group a[aria-current="page"] .sc-ic { background: var(--c-accent); color: var(--c-accent-ink); }
.sc-group a[aria-current="page"]::after { content: ""; margin-left: auto; width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--c-accent); }
.sc-quick a[aria-current="page"] { border-color: var(--c-accent); background: var(--c-accent-soft); }

/* ---------- footer site map ---------- */
.sc-footer {
  border-top: 1px solid var(--c-line); background: var(--c-surface);
  padding: 28px max(16px, env(safe-area-inset-right)) 20px max(16px, env(safe-area-inset-left)); font-family: var(--f-sans);
}
.sc-footer-groups { max-width: 72rem; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; }
.sc-footer h2 { margin: 0 0 8px; font-size: 14px; font-weight: 800; color: var(--c-text); }
.sc-footer ul { display: grid; gap: 8px; }
.sc-footer li a {
  display: flex; align-items: center; min-height: 44px;
  font-size: 15px; color: var(--c-text-2); text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.sc-footer li a:hover { color: var(--c-text); text-decoration: underline; text-underline-offset: 3px; }
.sc-footer li a[aria-current="page"] { color: var(--c-accent); font-weight: 700; }
.sc-footer-name { max-width: 72rem; margin: 20px auto 0; padding-top: 16px; border-top: 1px solid var(--c-line); font-size: 14px; color: var(--c-text-2); }
.sc-footer-name a { display: inline-flex; align-items: center; min-height: 44px; color: var(--c-text-2); text-decoration: none; }
.sc-footer-name a:hover { color: var(--c-text); }

@media (min-width: 560px) {
  .sc-footer-groups { grid-template-columns: repeat(3, 1fr); }
  .sc-quick { grid-template-columns: repeat(3, 1fr); }
}
/* small phones (SE, 320-375): keep the header on one row */
@media (max-width: 380px) {
  .sc-header { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .sc-mark { width: 26px; height: 26px; }
  .sc-brand { gap: 8px; }
  .sc-wordmark { font-size: 15px; }
  .sc-mappill, .sc-explore-btn { padding: 0 12px; }
  .sc-explore-btn { min-width: 0; }
  .sc-quick a { padding: 0 10px; gap: 8px; font-size: 14px; white-space: nowrap; }
}

/* ---------- 900+: inline nav + dropdown panel ---------- */
@media (min-width: 900px) {
  .sc-header { padding: 0 24px; gap: 24px; }
  .sc-primary { display: flex; align-items: center; gap: 4px; }
  .sc-primary a {
    position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
    border-radius: var(--r-1); color: var(--c-text-2); font-size: 15px; font-weight: 600; text-decoration: none;
  }
  .sc-primary a .sc-i { width: 18px; height: 18px; }
  .sc-primary a:hover { color: var(--c-text); background: var(--c-surface-2); }
  .sc-primary a[aria-current="page"] { color: var(--c-text); background: var(--c-accent-soft); }
  .sc-primary a[aria-current="page"] .sc-i { color: var(--c-accent); }
  .sc-primary a[aria-current="page"]::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
    border-radius: 2px; background: var(--c-accent);
  }
  .sc-mappill { display: none; }
  .sc-backdrop { display: none !important; }
  .sc-panel-bar, .sc-quick { display: none; }
  .sc-panel {
    left: 0; right: 0; margin: 8px auto 0; height: auto; bottom: auto;
    width: min(1100px, calc(100vw - 48px)); max-height: calc(100vh - var(--sc-h) - 24px); max-height: calc(100dvh - var(--sc-h) - 24px);
    border: 1px solid var(--c-line-2); border-radius: var(--r-3); box-shadow: var(--shadow-1), 0 24px 60px rgba(0, 0, 0, .5);
    animation: sc-drop .16s ease-out;
  }
  @keyframes sc-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
  .sc-panel-body { padding: 24px 28px 28px; }
  .sc-groups { grid-template-columns: repeat(4, 1fr); gap: 28px; }
  .sc-group a { min-height: 52px; background: transparent; padding: 6px 8px 6px 6px; gap: 12px; }
  .sc-group a:hover { background: var(--c-surface-2); }
  .sc-ic { width: 34px; height: 34px; border-radius: 10px; }
  .sc-l { font-size: 15px; }
  .sc-h { font-size: 13px; }
  .sc-group ul { gap: 2px; }
  .sc-footer { padding: 40px 24px 24px; }
  .sc-footer-groups { grid-template-columns: repeat(7, auto); justify-content: space-between; gap: 16px 24px; }
  .sc-footer ul { gap: 0; }
  .sc-footer li a { min-height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .sc-panel { animation: none; }
}
