/* ══════════════════════════════════════════════════════════════════════════
   consent-gate.css — the first-visit Terms and Privacy acceptance gate.

   Markup: templates/_consent_gate.html. Behaviour: static/js/consent-gate.js.

   The element carries `hidden` until the script decides to show it, so the
   [hidden] rule below is what keeps a no-JavaScript reader from ever meeting
   it. Everything else here only describes the open state.
   ══════════════════════════════════════════════════════════════════════════ */

.consent-gate[hidden] { display: none; }

.consent-gate {
  position: fixed;
  inset: 0;
  z-index: var(--z-consent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  /* Denser than the ordinary modal scrim (0.35): this one is answering a
     question, not decorating a page, so the text behind it reads as out of
     reach rather than merely dimmed. */
  background: rgba(33, 26, 20, 0.52);
  opacity: 0;
  transition: opacity var(--dur-base) ease;
}
.consent-gate.is-open { opacity: 1; }

/* While the gate is up the page behind it must not scroll away under it. */
html.consent-locked,
html.consent-locked body { overflow: hidden; }

.consent-gate__card {
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bento-white);
  border: 1px solid var(--bento-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card-hover);
  padding: var(--sp-6);
  text-align: left;
  transform: translateY(12px) scale(0.97);
  transition: transform var(--dur-base) var(--ease-spring);
}
.consent-gate.is-open .consent-gate__card { transform: none; }

.consent-gate__eyebrow {
  margin: 0 0 var(--sp-2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bento-ink-soft);
  opacity: 0.72;
}

.consent-gate__title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.2rem + 0.8vw, 1.7rem);
  font-weight: 600;
  line-height: 1.22;
  color: var(--bento-ink);
}

.consent-gate__body {
  margin: 0 0 var(--sp-5);
  font-size: 1.02rem;
  line-height: 1.62;
  color: var(--bento-ink-soft);
}

/* ── The two documents ─────────────────────────────────────────────────── */

.consent-gate__docs {
  list-style: none;
  margin: 0 0 var(--sp-5);
  padding: 0;
  display: grid;
  gap: 10px;
}
.consent-gate__docs a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  /* 14px + 1.02rem line-box clears the 44px minimum touch target without a
     fixed height, so the row still grows if the label wraps on a phone. */
  padding: 14px var(--sp-4);
  background: var(--bento-sand);
  border: 1px solid var(--bento-line);
  border-radius: var(--r-md);
  color: var(--bento-ink);
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.consent-gate__docs a:hover,
.consent-gate__docs a:focus-visible {
  background: var(--bento-tan-100);
  border-color: var(--bento-tan-300);
}
.consent-gate__fmt {
  flex: none;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--bento-white);
  border: 1px solid var(--bento-line);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--bento-ink-soft);
}

/* ── Agreeing ──────────────────────────────────────────────────────────── */

.consent-gate__accept {
  width: 100%;
  justify-content: center;
  font-size: 1.02rem;
}

.consent-gate__note {
  margin: 14px 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: center;
  color: var(--bento-ink-soft);
  opacity: 0.78;
}

/* ── Phones ────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .consent-gate { padding: 12px; align-items: flex-end; }
  .consent-gate__card {
    padding: var(--sp-5);
    max-height: 90vh;
    /* Rising from the bottom edge is the gesture a phone reader expects of
       something that demands an answer; on a wide screen it stays centred. */
    transform: translateY(24px);
  }
}
