/* =========================================================
   TWO LITTLE MONKEYS — LEGAL PAGES
   Disclaimer / Terms of Use / Privacy Policy. Loaded only when
   is_page_template('page-templates/legal-page.php') — see
   tlm_legal_enqueue_assets() in inc/legal-pages.php.

   Same identity as the rest of the site (packaging gradients, volcano
   ridge), but the reading surface stays calm: a white sheet on cream,
   navy text, a sticky contents list. Colour lives in the hero only.
   ========================================================= */

.tlm-legal-hero {
  --legal-bg: var(--vb-lagoon-sky, linear-gradient(170deg, #1B2440 0%, #1C628D 48%, #2FA8D8 100%));
  position: relative;
  isolation: isolate;
  padding: clamp(3.5rem, 7vw, 6rem) var(--tlm-section-px) clamp(6rem, 11vw, 9rem);
  background: var(--legal-bg);
  color: #fff;
  overflow: hidden;
}

.tlm-legal-hero--terms-of-use,
.tlm-legal-hero--terms { --legal-bg: var(--vb-dusk, linear-gradient(160deg, #5E2751 0%, #9B2E62 45%, #E1505C 100%)); }
.tlm-legal-hero--disclaimer { --legal-bg: var(--vb-sunset, linear-gradient(165deg, #4A2B6B 0%, #B0325F 38%, #F0625E 68%, #F8A445 100%)); }

/* a low sun behind the title */
.tlm-legal-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -8%;
  top: -30%;
  width: min(60vw, 640px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 201, 77, 0.55) 0%, rgba(255, 201, 77, 0.18) 45%, transparent 70%);
  pointer-events: none;
}

/* volcano ridge into the cream reading area */
.tlm-legal-hero::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: -1px;
  height: clamp(60px, 9vw, 120px);
  background: var(--vb-cream, var(--tlm-cream));
  -webkit-mask: var(--vb-mask-ridge) no-repeat bottom / 100% 100%;
  mask: var(--vb-mask-ridge) no-repeat bottom / 100% 100%;
  pointer-events: none;
}

.tlm-legal-hero__inner {
  position: relative;
  z-index: 2;
  max-width: var(--tlm-content-max);
  margin-inline: auto;
}

.tlm-legal-hero__mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
  margin-bottom: 1rem;
  padding: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
}

.tlm-legal-hero__eyebrow {
  margin: 0 0 0.75rem;
  color: var(--vb-sun, #FFC94D);
  font-family: var(--tlm-font-body);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.tlm-legal-hero__title {
  margin: 0 0 1.1rem;
  max-width: 18ch;
  color: #fff;
  font-family: var(--tlm-font-display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 700;
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.tlm-legal-hero__updated {
  display: inline-block;
  margin: 0 0 1.25rem;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-family: var(--tlm-font-body);
  font-size: 1rem;
  font-weight: 600;
}

.tlm-legal-hero__summary {
  margin: 0;
  max-width: 56ch;
  color: rgba(255, 255, 255, 0.94);
  font-family: var(--tlm-font-body);
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  line-height: 1.6;
}

/* ---------------- Content + table of contents ---------------- */

.tlm-legal-content {
  padding: 0 var(--tlm-section-px) clamp(4rem, 8vw, 6.5rem);
  background: var(--vb-cream, var(--tlm-cream));
}

.tlm-legal-content__inner {
  max-width: var(--tlm-content-max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.tlm-legal-toc {
  order: -1;
  padding: 1.4rem 1.5rem 1.5rem;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 48px -32px rgba(27, 36, 64, 0.35);
}

.tlm-legal-toc__title {
  margin: 0 0 0.75rem;
  color: var(--vb-night, var(--tlm-navy));
  font-family: var(--tlm-font-display);
  font-variation-settings: "SOFT" 100;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.tlm-legal-toc__list {
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.1rem;
}

.tlm-legal-toc__list a {
  display: block;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  color: var(--tlm-navy);
  font-family: var(--tlm-font-body);
  font-size: 1rem;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tlm-legal-toc__list a:hover,
.tlm-legal-toc__list a:focus-visible {
  background: var(--vb-cream, var(--tlm-cream));
  color: var(--vb-berry, #B0325F);
  transform: translateX(3px);
}

.tlm-legal-toc__print {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: var(--vb-night, var(--tlm-navy));
  color: #fff;
  font-family: var(--tlm-font-body);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.tlm-legal-toc__print:hover,
.tlm-legal-toc__print:focus-visible {
  background: var(--vb-berry, #B0325F);
  transform: translateY(-2px);
}

/* ---------------- Body copy: a white sheet ---------------- */

.tlm-legal-content__body {
  max-width: none;
  margin-inline: 0;
  padding: clamp(1.75rem, 4vw, 3.5rem);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 30px 60px -36px rgba(27, 36, 64, 0.35);
  color: var(--tlm-navy);
  font-family: var(--tlm-font-body);
  font-size: 1.1rem;
  line-height: 1.75;
}

.tlm-legal-content__body > * { max-width: 68ch; }

.tlm-legal-content__body > * + * {
  margin-top: 1.3em;
}

.tlm-legal-content__body h2 {
  margin-top: 2.4em;
  color: var(--vb-night, var(--tlm-navy));
  font-family: var(--tlm-font-display);
  font-variation-settings: "SOFT" 100;
  font-weight: 700;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  line-height: 1.2;
  scroll-margin-top: 6rem;
}

.tlm-legal-content__body > h2:first-child,
.tlm-legal-content__body > p:first-child + h2 { margin-top: 2em; }

.tlm-legal-content__body h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 5px;
  margin-top: 0.6em;
  background: var(--vb-sunset, var(--tlm-gold));
  border-radius: 999px;
}

.tlm-legal-content__body h3 {
  margin-top: 1.8em;
  color: var(--tlm-navy);
  font-family: var(--tlm-font-body);
  font-weight: 800;
  font-size: 1.15rem;
}

.tlm-legal-content__body p,
.tlm-legal-content__body li {
  font-size: inherit;
}

.tlm-legal-content__body ul,
.tlm-legal-content__body ol {
  padding-left: 1.4em;
}

.tlm-legal-content__body li + li {
  margin-top: 0.5em;
}

.tlm-legal-content__body li::marker { color: var(--vb-coral, var(--tlm-gold)); }

.tlm-legal-content__body a {
  color: var(--vb-berry, var(--tlm-gold-ink));
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.tlm-legal-content__body a:hover,
.tlm-legal-content__body a:focus-visible {
  color: var(--vb-night, var(--tlm-navy));
}

.tlm-legal-content__body strong {
  color: var(--tlm-navy);
}

.tlm-legal-content__body hr {
  margin: 2.2em 0;
  border: none;
  border-top: 1px solid rgba(6, 50, 71, 0.16);
}

/* Owner-confirmation placeholders — visually flagged so they're impossible
   to miss while still local/draft, never meant to reach production. */
.tlm-legal-content__body mark {
  padding: 0.05em 0.4em;
  border-radius: 6px;
  background: rgba(255, 201, 77, 0.4);
  color: var(--tlm-navy);
  font-style: italic;
}

/* ---------------- Focus states (sitewide convention) ---------------- */

.tlm-legal-content__body a:focus-visible,
.tlm-legal-toc a:focus-visible,
.tlm-legal-toc__print:focus-visible {
  outline: 3px solid var(--vb-coral, var(--tlm-gold));
  outline-offset: 3px;
}

/* ---------------- Wide screens: sticky sidebar TOC ---------------- */

@media (min-width: 1100px) {
  .tlm-legal-content__inner {
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: start;
  }

  .tlm-legal-toc {
    order: 0;
    position: sticky;
    top: 7rem;
    max-height: calc(100vh - 9rem);
    overflow-y: auto;
  }
}

/* ---------------- Narrow screens ---------------- */

@media (max-width: 700px) {
  .tlm-legal-content__body { border-radius: 22px; padding: 1.5rem 1.25rem; }
  .tlm-legal-toc { border-radius: 20px; }
}

/* ---------------- Print ---------------- */

@media print {
  .tlm-footer,
  .ct-header,
  #offcanvas,
  .tlm-legal-toc,
  .tlm-legal-hero::before,
  .tlm-legal-hero::after {
    display: none !important;
  }

  .tlm-legal-hero,
  .tlm-legal-content {
    background: #fff;
    color: #000;
    padding-block: 1rem;
  }

  .tlm-legal-hero__title,
  .tlm-legal-hero__summary,
  .tlm-legal-hero__eyebrow,
  .tlm-legal-hero__updated { color: #000; background: none; padding: 0; }

  .tlm-legal-content__inner {
    display: block;
  }

  .tlm-legal-content__body {
    padding: 0;
    box-shadow: none;
    color: #000;
  }

  .tlm-legal-content__body > * { max-width: 100%; }

  .tlm-legal-content__body a {
    color: #000;
    text-decoration: underline;
  }
}
