/* Admin-managed policy pages (Terms, Privacy, and the like), served at
   /front/<slug>. The header and footer are the same markup the homepage
   uses; this sheet only styles the hero and the reading layout.

   The body markup is the small whitelist from ContentPages.sanitizeHtml:
   headings, paragraphs, lists, links, emphasis. A client script
   (legal-page.js) numbers the <h2> sections and fills the side index. */

.legal-page main { background: #f7f9fc; }

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

.legal-hero {
  padding: 56px 0 32px;
  background: #003b95;
  color: #fff;
}
.legal-hero__title {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
}
/* Kept for the unique-places hero, which reuses this sheet and layers its own
   .unique-places-page overrides on top. */
.legal-hero__lead {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .85);
}

/* ---- Layout: content + sticky side index ---------------------------- */

.legal-body { padding: 44px 0 72px; }

.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.legal-layout.has-side {
  grid-template-columns: 264px minmax(0, 1fr);
}

.legal-side { position: sticky; top: 96px; }
.legal-side__inner {
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  padding: 22px 20px;
  background: #fff;
  border: 1px solid #e4ebf3;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(16, 45, 81, .06);
}
.legal-side__label {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7286a0;
}
.legal-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: legal-toc;
}
.legal-toc li { margin: 2px 0; }
.legal-toc__link {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #45586f;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background-color .15s ease, color .15s ease;
}
.legal-toc__link:hover { background: #f2f7fc; color: #0b3d91; }
.legal-toc__link.is-active {
  background: #eef4fd;
  color: #0b3d91;
  font-weight: 600;
  border-left-color: #0878d1;
}
.legal-toc__num {
  min-width: 24px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #0b63b6;
  background: #eaf2fb;
  border-radius: 6px;
}
.legal-toc__link.is-active .legal-toc__num { color: #fff; background: #0878d1; }

/* ---- Article -------------------------------------------------------- */

.legal-article {
  display: block;
  padding: 44px 48px;
  background: #fff;
  border: 1px solid #e4ebf3;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(16, 45, 81, .06);
  color: #24374d;
  font-size: 15.5px;
  line-height: 1.85;
}
.legal-article > *:first-child { margin-top: 0; }
.legal-article > *:last-child { margin-bottom: 0; }

.legal-article h2 {
  margin: 44px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e9eef5;
  font-size: 23px;
  font-weight: 700;
  color: #102c51;
  scroll-margin-top: 96px;
}
.legal-article h2:first-child { margin-top: 0; }
.legal-article h2 .legal-article__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-right: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0b3d91, #0878d1);
  border-radius: 9px;
  vertical-align: 2px;
}
.legal-article h3 {
  margin: 28px 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: #102c51;
  scroll-margin-top: 96px;
}
.legal-article h4 {
  margin: 22px 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: #1c3a5e;
}
.legal-article p { margin: 0 0 16px; }
.legal-article ul,
.legal-article ol { margin: 0 0 16px; padding-left: 26px; }
.legal-article li { margin: 6px 0; }
.legal-article blockquote {
  margin: 0 0 16px;
  padding: 10px 20px;
  border-left: 3px solid #0878d1;
  color: #45586f;
  background: #f2f7fc;
  border-radius: 0 10px 10px 0;
}
.legal-article a {
  color: #0b63b6;
  text-decoration: underline;
}
.legal-article hr {
  margin: 30px 0;
  border: 0;
  border-top: 1px solid #e4ebf3;
}

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

@media (max-width: 1100px) {
  .legal-layout.has-side { grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 900px) {
  .legal-layout.has-side { grid-template-columns: minmax(0, 1fr); }
  .legal-side { display: none; }
}

@media (max-width: 640px) {
  .legal-hero { padding: 40px 0 24px; }
  .legal-hero__title { font-size: 27px; }
  .legal-body { padding: 26px 0 48px; }
  .legal-article { padding: 26px 20px; border-radius: 12px; }
  .legal-article h2 { font-size: 20px; }
  .legal-article h2 .legal-article__num {
    width: 28px; height: 28px; margin-right: 10px; font-size: 13px;
  }
}
