/* ==========================================================================
   Flexable — Privacy Policy (legal page)

   Reuses the V3 tokens, .flxb-wrap, nav and footer from base.css, so this
   file only carries the legal-page layout: hero, sticky table of contents
   and the numbered content sections.

   Everything stays scoped under .flxb-home for the same reason base.css is —
   the parent theme styles bare h1/h2/p/ul/li and would otherwise win.
   ========================================================================== */

/* ---------- Hero ---------- */

.flxb-legal-hero {
  padding: 78px 0 58px;
  border-bottom: 1px solid var(--flxb-line);
}

.flxb-legal-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--flxb-brand);
  margin-bottom: 18px;
}

.flxb-home .flxb-legal-title {
  font-size: clamp(44px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  margin: 0 0 20px;
  font-weight: 700;
  color: var(--flxb-ink);
}

.flxb-home .flxb-legal-lede {
  max-width: 640px;
  font-size: 18px;
  line-height: 1.65;
  color: #5f6267;
  margin: 0;
}

.flxb-legal-meta {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 28px;
  font-size: 13px;
  color: #85888b;
}

.flxb-legal-meta strong {
  color: #4d5054;
  font-weight: 600;
}

/* ---------- Shell: sticky TOC + content ---------- */

.flxb-legal-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 760px);
  gap: 86px;
  padding: 66px 0 40px;
  align-items: start;
}

.flxb-toc {
  position: sticky;
  top: calc(var(--flxb-nav-h) + 36px);
  /* Grid items default to min-width:auto, which lets the nowrap chip rail on
     mobile stretch its track and widen the whole page instead of scrolling
     inside itself. */
  min-width: 0;
}

/* Clear the WP admin bar so the sticky TOC doesn't hide under it. */
body.admin-bar .flxb-toc {
  top: calc(var(--flxb-nav-h) + 68px);
}

@media screen and (max-width: 782px) {
  body.admin-bar .flxb-toc {
    top: calc(var(--flxb-nav-h) + 82px);
  }
}

.flxb-toc-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #9a9ca0;
  font-weight: 700;
  margin-bottom: 16px;
}

.flxb-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* base.css pins .flxb-home a to line-height:16px — undo that here. */
.flxb-home .flxb-toc-nav a {
  display: block;
  padding: 8px 10px;
  border-radius: 9px;
  color: #777a7e;
  font-size: 13px;
  line-height: 1.25;
  transition: 0.16s ease;
}

.flxb-home .flxb-toc-nav a:hover {
  background: var(--flxb-soft);
  color: var(--flxb-ink);
}

.flxb-home .flxb-toc-nav a.is-active {
  background: var(--flxb-active);
  color: #08783d;
  font-weight: 600;
}

/* ---------- Content ---------- */

/* Posts with too few headings to justify a sidebar drop the TOC column and
   centre the article instead of leaving a 230px gap. */
.flxb-legal-shell-single {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

.flxb-legal-content {
  min-width: 0;
  /* "flexable.work" and similar unbroken tokens would otherwise push the
     column wider than the screen on narrow phones. */
  overflow-wrap: break-word;
}

.flxb-home .flxb-legal-intro {
  font-size: 14px;
  line-height: 1.75;
  color: #65686d;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--flxb-line);
  margin: 0 0 4px;
}

.flxb-legal-section {
  padding: 42px 0 38px;
  border-bottom: 1px solid var(--flxb-line);
}

.flxb-legal-section:last-child {
  border-bottom: 0;
}

.flxb-legal-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #a1a3a7;
  margin-bottom: 11px;
}

.flxb-home .flxb-legal-section h2 {
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin: 0 0 16px;
  font-weight: 700;
  color: var(--flxb-ink);
}

.flxb-home .flxb-legal-section p {
  font-size: 15px;
  line-height: 1.78;
  color: #55595e;
  margin: 0 0 15px;
}

.flxb-home .flxb-legal-section p:last-child {
  margin-bottom: 0;
}

.flxb-home .flxb-legal-section ul {
  margin: 14px 0 0;
  padding-left: 19px;
  color: #55595e;
  list-style: disc;
}

.flxb-home .flxb-legal-section li {
  font-size: 15px;
  line-height: 1.7;
  margin: 7px 0;
  padding-left: 3px;
}

.flxb-home .flxb-legal-section strong {
  color: #222326;
  font-weight: 600;
}

.flxb-legal-callout {
  margin-top: 22px;
  padding: 18px 19px;
  background: var(--flxb-soft);
  border: 1px solid #eceeef;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.65;
  color: #62656a;
}

.flxb-home .flxb-legal-callout strong {
  display: block;
  margin-bottom: 3px;
}

/* Keep the footer clear of the last section. */
.flxb-legal-main {
  padding-bottom: 32px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  /* minmax(0, 1fr), not 1fr — see the min-width note on .flxb-toc above. */
  .flxb-legal-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  /* TOC becomes a horizontal chip rail above the content. */
  .flxb-toc,
  body.admin-bar .flxb-toc {
    position: relative;
    top: auto;
    border-bottom: 1px solid var(--flxb-line);
    padding-bottom: 24px;
  }

  .flxb-toc-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 5px;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  /* Chips must not shrink, or they compress instead of scrolling. */
  .flxb-home .flxb-toc-nav a {
    flex: 0 0 auto;
  }

  .flxb-toc-nav::-webkit-scrollbar {
    display: none;
  }

  .flxb-home .flxb-toc-nav a {
    white-space: nowrap;
    border: 1px solid var(--flxb-line);
    background: #fff;
  }
}

@media (max-width: 760px) {
  .flxb-legal-hero {
    padding: 54px 0 44px;
  }

  /* The mockup pins this at a flat 48px for every width below 760px. At 360px
     "Privacy Policy" then almost exactly fills the line box and breaks to a
     second line; by 320px it is cramped. Scaling with the viewport keeps it on
     one line down to the narrowest phones. */
  .flxb-home .flxb-legal-title {
    font-size: clamp(30px, 9vw, 48px);
    margin-bottom: 16px;
  }

  .flxb-home .flxb-legal-lede {
    font-size: 16px;
  }

  .flxb-legal-meta {
    gap: 6px 18px;
    margin-top: 22px;
  }

  .flxb-legal-shell {
    padding-top: 38px;
  }

  .flxb-legal-section {
    padding: 34px 0 32px;
  }

  .flxb-home .flxb-legal-section h2 {
    font-size: 22px;
  }

  .flxb-legal-callout {
    padding: 16px;
    margin-top: 18px;
  }
}

@media (max-width: 480px) {
  .flxb-legal-hero {
    padding: 44px 0 36px;
  }

  .flxb-legal-shell {
    padding-top: 30px;
  }

  .flxb-legal-section {
    padding: 30px 0 28px;
  }

  .flxb-home .flxb-legal-section h2 {
    font-size: 20px;
  }

  /* Stack the two dates rather than letting them wrap mid-pair. */
  .flxb-legal-meta {
    flex-direction: column;
    gap: 7px;
  }

  .flxb-home .flxb-legal-section ul {
    padding-left: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flxb-home .flxb-toc-nav a {
    transition: none;
  }
}
