/* ==========================================================================
   Cookie notice — site-wide first-visit bar
   --------------------------------------------------------------------------
   Injected into every HTML page by functions/_middleware.js, so it appears on
   the home page, every /flip/ flipbook page, and any page added later without
   touching that page's markup.

   Uses only the design tokens already defined in styles.css. No Madras
   plaid/tartan anywhere, per project rule.
   Kept below z-index 1200 so it can never sit on top of the flipbook's
   share panel or lightbox (css/flipbook.css uses 1200-1400).
   ========================================================================== */

.cookie-notice {
  position: fixed;
  z-index: 900;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 720px;

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;

  margin: 0;
  padding: 18px 22px;

  background: var(--color-surface-container-lowest, #ffffff);
  color: var(--color-on-surface, #1b1c1c);
  border: 1px solid var(--color-outline-variant, #d4c1cd);
  border-radius: var(--radius-lg, 0.75rem);
  box-shadow: 0 10px 30px rgba(27, 28, 28, 0.18);
}

.cookie-notice[hidden] { display: none; }

.cookie-notice-text {
  flex: 1 1 320px;
  margin: 0;
  font-family: var(--font-body, Georgia, serif);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--color-on-surface-variant, #50434c);
}

.cookie-notice-text a {
  color: var(--color-primary, #692364);
  font-weight: 600;
}

.cookie-notice-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Slightly tighter than the page's .btn-lg so the bar stays compact,
   while keeping the 48px minimum touch target used across the site. */
.cookie-notice .btn {
  padding: 10px 22px;
  font-size: 0.95rem;
}

/* ---------- Small screens: stack, and go edge-to-edge ---------- */

@media (max-width: 640px) {
  .cookie-notice {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-width: none;
    transform: none;
    padding: 16px;
    gap: 12px;
  }

  .cookie-notice-actions {
    width: 100%;
  }

  .cookie-notice-actions .btn {
    flex: 1 1 auto;
  }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .cookie-notice {
    animation: cookie-notice-rise 0.28s ease-out both;
  }
}

@keyframes cookie-notice-rise {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 640px) {
  @keyframes cookie-notice-rise {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
}

/* ---------- Forced-colours / high-contrast ---------- */

@media (forced-colors: active) {
  .cookie-notice { border: 2px solid CanvasText; }
}

/* ---------- The "change your choice" block on /cookies ---------- */

.cookie-choice-status {
  font-family: var(--font-label, system-ui, sans-serif);
  font-weight: 600;
  color: var(--color-on-surface-variant, #50434c);
}

/* ==========================================================================
   Plain text pages (/cookies) — narrow, readable column
   ========================================================================== */

.legal-main { padding: 56px var(--margin-mobile) 80px; }

.legal-inner { max-width: 760px; margin: 0 auto; }

.legal-inner h2 { font-size: 1.5rem; margin-top: 2em; }
.legal-inner h2:first-of-type { margin-top: 1em; }

.legal-updated {
  font-family: var(--font-label, system-ui, sans-serif);
  font-size: 0.85rem;
  color: var(--color-on-surface-variant, #50434c);
}

.legal-table-wrap { overflow-x: auto; margin: 0 0 1.5em; }

.legal-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.legal-table th,
.legal-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-outline-variant, #d4c1cd);
}

.legal-table th {
  font-family: var(--font-label, system-ui, sans-serif);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-on-surface-variant, #50434c);
  background: var(--color-surface-container-low, #f5f3f3);
}

.legal-table code {
  font-size: 0.88em;
  background: var(--color-surface-container, #efeded);
  padding: 2px 6px;
  border-radius: var(--radius-sm, 0.25rem);
}

.legal-callout {
  background: var(--color-surface-container-low, #f5f3f3);
  border-left: 4px solid var(--color-primary, #692364);
  border-radius: var(--radius-sm, 0.25rem);
  padding: 20px 22px;
  margin: 0 0 1.5em;
}

.legal-callout p:last-child { margin-bottom: 0; }

@media (min-width: 700px) {
  .legal-main { padding: 72px var(--margin-desktop) 96px; }
}
