/* ============================================================
   Wunderlust — detail sheet and footer
   Split out of cards.css to keep each file under 200 lines.
   ============================================================ */

/* --- Detail sheet ----------------------------------------- */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(20,28,22,.46);
  backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .24s var(--ease);
}
.sheet-scrim[hidden] { display: none; }
.sheet-scrim[data-open="true"] { opacity: 1; }

.sheet {
  position: fixed; z-index: 41;
  inset: auto 0 0 0;
  max-height: 88vh; overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-3);
  padding: var(--gap-5) clamp(20px, 5vw, 36px) var(--gap-6);
  translate: 0 100%;
  transition: translate .3s var(--ease), visibility 0s linear .3s;
}
.sheet[data-open="true"] {
  translate: 0 0; visibility: visible;
  transition: translate .3s var(--ease);
}
/* Translating it away moves it visually but leaves its hit area in
   place, so a closed panel was quietly swallowing clicks meant for
   whatever sat above it. Only accept input while it is actually open;
   visibility waits out the slide so the close still animates. */
.sheet:not([data-open="true"]) { pointer-events: none; visibility: hidden; }

@media (min-width: 760px) {
  .sheet {
    inset: 50% auto auto 50%;
    width: min(620px, 92vw);
    max-height: 84vh;
    border-radius: var(--r-xl);
    translate: -50% -42%;
    opacity: 0;
    transition: translate .28s var(--ease), opacity .28s var(--ease),
                visibility 0s linear .28s;
  }
  .sheet[data-open="true"] {
    translate: -50% -50%; opacity: 1;
    transition: translate .28s var(--ease), opacity .28s var(--ease);
  }
}

.sheet-close { position: absolute; top: 14px; right: 16px; }
.sheet h2 { font: 600 var(--fs-h2)/1.2 var(--font-display); letter-spacing: -.02em; padding-right: 44px; }
.sheet-where { margin-top: 5px; font-size: var(--fs-sm); color: var(--text-3); }
.sheet-blurb { margin: var(--gap-4) 0 0; color: var(--text-2); }
.sheet-tags { display: flex; flex-wrap: wrap; gap: var(--gap-2); margin-top: var(--gap-4); }
.spec { display: grid; gap: var(--gap-2); margin-top: var(--gap-5); }
.spec-row { display: flex; gap: var(--gap-3); font-size: var(--fs-sm); padding-block: 7px; border-top: 1px solid var(--line); }
.spec-k { flex: 0 0 116px; color: var(--text-3); }
.spec-v { color: var(--text); }
.sheet-cta { display: flex; flex-wrap: wrap; gap: var(--gap-2); margin-top: var(--gap-5); }
.disclosure { margin-top: var(--gap-3); font-size: var(--fs-xs); color: var(--text-3); }

/* --- Filter sheet ------------------------------------------ */
/* Same panel mechanics as the detail sheet, just grouped chips
   instead of one record. Headings do the work the old four-row bar
   was trying to do with position alone. */
.fgroup { margin-top: var(--gap-5); }
.fgroup-h {
  font-size: var(--fs-xs); color: var(--text-3);
  letter-spacing: .05em; text-transform: uppercase;
  margin-bottom: var(--gap-2);
}
.fsheet-acts {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--gap-4); margin-top: var(--gap-6);
  padding-top: var(--gap-4); border-top: 1px solid var(--line);
  /* Stays reachable while the chip groups scroll past it. */
  position: sticky; bottom: calc(var(--gap-6) * -1);
  background: var(--surface);
}

/* --- Footer ------------------------------------------------ */
/* The prose block that used to sit here moved into the About panel,
   leaving just the fixed sitebar: a 3-column grid (brand / centre
   pill / wordmark) so the pill stays optically centred regardless of
   how wide the side content is — space-between would drift. */
.sitebar {
  /* Purely informational — brand, disclosure copy, one credit link —
     so it has no business outranking an interactive popover. On a
     short viewport the progress popover (and, in principle, Settings
     or About) can extend low enough to physically overlap this fixed
     bar; without a lower z-index the footer's stacking context still
     wins and swallows clicks meant for the panel above it. */
  position: fixed; bottom: 0; left: 0; width: 100%; z-index: 10;
  height: calc(40px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  display: flex; align-items: center;
}
.sb-wrap {
  max-width: var(--maxw); width: 100%; margin-inline: auto;
  padding-inline: max(clamp(16px, 4vw, 32px), env(safe-area-inset-left));
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: var(--gap-4);
  font-size: var(--fs-xs);
}
.sb-left  { justify-self: start; display: flex; align-items: center; gap: var(--gap-2); white-space: nowrap; }
.sb-right { justify-self: end; display: flex; align-items: center; gap: var(--gap-4); white-space: nowrap; }
.sb-brand { font: 700 var(--fs-sm)/1 var(--font-display); letter-spacing: -.02em; color: var(--text); }
.sb-copy  { color: var(--text-3); }
.sb-meta  { color: var(--text-3); }
.sb-mav   { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .02em; text-decoration: none; color: var(--accent); }
.sb-mav b { color: var(--text); font-weight: 800; letter-spacing: -.01em; }
.sb-mav:hover { opacity: .72; }

/* The fixed bar would otherwise cover the last row of cards. */
body { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }

/* Shed the middle column before it crushes, not the brand. */
@media (max-width: 700px) { .sb-copy { display: none; } }
@media (max-width: 520px) {
  .sb-wrap { grid-template-columns: 1fr auto; }
  .sb-wrap .p-accent { display: none; }
  .sb-meta { display: none; }
}

.ms {
  font-family: "Material Symbols Rounded";
  font-weight: normal; font-style: normal;
  line-height: 1; letter-spacing: normal;
  display: inline-block; white-space: nowrap;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
