/* ========== 18+ AGE-GATE MODAL ==========
 *
 * Lifted out of bn_style.css so a page can style the gate WITHOUT pulling in
 * the app shell. bn_style.css lays out the shell with flex on <html>/<body>,
 * which breaks the standalone marketing pages the moment it is linked — and
 * those are exactly the pages a signed-out visitor lands on first, so they
 * are exactly the pages that need the gate.
 *
 * Same split as bn_faq.css, which /explore-public shares with the home page.
 *
 * Linked by: layouts/main.astro, layouts/guest.astro, layouts/public.astro,
 * pages/ai-girlfriend/[name].astro. Any page mounting AgeVerificationModal
 * needs it — without it the modal renders as a static block halfway down the
 * document instead of an overlay, which looks like the gate silently failing.
 *
 * The neutral-* fallbacks are load-bearing: the marketing pages get their
 * variables from bn_home-reset.css, which defines fewer of them than the app
 * shell does. An unresolved var() drops the whole declaration.
 */

.age-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  /*
   * The page behind is unreadable until the gate is accepted.
   *
   * Done with backdrop-filter on the overlay rather than `filter: blur()` on
   * <body>: blurring the body would blur this modal along with everything
   * else, and a filtered element becomes the containing block for its fixed
   * descendants, which would break the overlay's own `inset: 0`.
   *
   * The darkening above stays — blur alone still leaves large shapes and
   * skin tones legible, and the point is that nothing is made out at all.
   */
  -webkit-backdrop-filter: blur(18px) saturate(0.6);
  backdrop-filter: blur(18px) saturate(0.6);
  z-index: 1001;
  align-items: center;
  justify-content: center;
}

/*
 * Where backdrop-filter is unsupported, the blur silently does nothing — so
 * the fallback is opacity, applied only in that case so it does not darken
 * the blurred version further.
 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .age-overlay { background: rgba(0, 0, 0, 0.94); }
}
.age-overlay.show { display: flex; }

.age-modal {
  background: #000;
  border: 1px solid #571626;
  border-radius: 16px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.age-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 16px;
  text-align: center;
  background: linear-gradient(to bottom, #2b0912, #571626);
}
.age-header-icon { width: 32px; height: 32px; }
.age-header h3 { font-size: 18px; font-weight: 500; line-height: 24px; color: #FFA4B9; margin: 0; }
.age-header p { font-size: 12px; color: #FFA4B9; line-height: 16px; margin: 0; }

.age-body {
  padding: 24px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.age-content { display: flex; flex-direction: column; gap: 24px; width: 100%; }
.age-text { font-size: 12px; line-height: 16px; color: var(--neutral-400, #9E9E9E); white-space: pre-line; }

/* 18+ gate acknowledgements. Two separate required ticks: age, and
   understanding that companions are AI. Deliberately NOT one combined
   confirm — consent has to be specific and unambiguous per item. */
.age-ack {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  cursor: pointer;
  font-size: 12px;
  line-height: 16px;
  color: var(--neutral-300, #D4D4D4);
  text-align: left;
}

.age-ack input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: #CC95FF;
  cursor: pointer;
}

.age-ack span { flex: 1 1 auto; }

.btn-age-confirm:disabled { pointer-events: none; }

.age-links { display: flex; gap: 8px; width: 100%; }
.age-link-btn {
  flex: 1;
  background: var(--neutral-700, #2E2E2E);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  color: #fff;
  font-family: 'Heebo', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
}
.age-link-btn:hover { background: var(--neutral-600, #4B4B4B); }

.btn-age-confirm {
  background: #fff;
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 10px 24px;
  font-family: 'Heebo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
  box-shadow: 0 2px 20px rgba(255, 255, 255, 0.56);
  transition: background 0.2s;
}
.btn-age-confirm:hover { background: #eee; }


/* ── The notice box inside the gate ──────────────────────────────────────
 * Moved here with the rest of the gate. It lived 1,300 lines away in
 * bn_style.css, and leaving it behind is not cosmetic: without the cap below
 * the notice renders at full height, which made the dialog 1,372px tall in a
 * 768px window with the acknowledgements above the top edge and Enter Site
 * below the bottom one. The gate cannot be passed at all in that state.
 */
/* ── "Read this before you start" in the 18+ gate ────────────────────────── */
/*
 * Long by design, so it scrolls inside its own box rather than pushing the
 * acknowledgements and Enter Site off the bottom of the dialog. Someone who
 * has to hunt for the button ticks the boxes without reading anything.
 *
 * tabIndex on the element makes it keyboard-scrollable, which a plain
 * overflow container is not.
 */
.age-notice {
  max-height: 168px;
  overflow-y: auto;
  margin: 0 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--neutral-700, #333);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  /* The fade tells the eye there is more below without needing a scrollbar to
     be visible, which it is not on macOS until you scroll. */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent 100%);
}
.age-notice:focus-visible { outline: 1px solid var(--neutral-600, #4B4B4B); }

.age-notice-title {
  margin: 14px 0 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.age-notice-p {
  margin: 0 0 10px;
  color: var(--neutral-400, #9E9E9E);
  font-size: 12px;
  line-height: 18px;
}
.age-notice-p:last-child { margin-bottom: 0; }

/* The opening statement of fact. */
.age-notice-p.is-lead { color: var(--neutral-300, #d4d4d4); }

/*
 * The two sentences that are the actual warning. Marked so they cannot be
 * skimmed as more of the paragraph above them, which is where the marketing
 * lives.
 */
.age-notice-p.is-emphasis {
  padding: 10px 12px;
  border-left: 2px solid var(--rose-58-solid, #E8508A);
  border-radius: 0 8px 8px 0;
  background: rgba(232, 80, 138, 0.08);
  color: #fff;
  font-weight: 600;
}

/* A short screen has less to give away; the box shrinks before the dialog
   starts scrolling as a whole. */
@media (max-height: 760px) {
  .age-notice { max-height: 120px; }
}


/* ── The dialog never outgrows the window ────────────────────────────────
 * The notice box above caps the long text, but the rest of the dialog —
 * two acknowledgements, three link buttons, Enter Site — still came to
 * 824px, which overflows a 768px window by 28px at the top and 28px at the
 * bottom because the overlay centres it. The header icon gets clipped and
 * nothing tells the user there is more.
 *
 * So the dialog is capped and the body scrolls inside it, with the header
 * pinned. dvh after vh: on a phone, vh is the tallest the window ever gets,
 * so a vh-capped dialog is still cut off while the browser's own chrome is
 * showing. Browsers without dvh keep the vh line.
 */
.age-modal {
  max-height: 92vh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
}

/* min-height:0 because a flex item will not shrink below its content
   without it, which is the usual reason an overflow-y:auto inside a flex
   column scrolls nothing at all. */
.age-body {
  overflow-y: auto;
  min-height: 0;
}
