/*
 * Starliçe legal texts. 15 Oct 2026: the left column used to hold only the title, leaving a page-long
 * empty strip beside the text, and the constrained layout centred every block on its own width, so
 * paragraphs sat indented under the much wider headings. The left column is now a sticky guide
 * (date, sections, other texts) and every block in the reading column starts on the same line.
 */
body.sx-legal main.standard-page {
  --legal-ink: #332c29;
  --legal-body: #4b4540;
  --legal-muted: #7a6f66;
  --legal-line: #ddd3c6;
  --legal-gold: #856b47;
  width: min(100%, 1320px);
  max-width: 1320px !important;
  margin: 0 auto;
  padding: clamp(52px, 5.6vw, 88px) clamp(24px, 5vw, 80px) clamp(80px, 8vw, 112px);
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1.3fr);
  align-items: start;
  column-gap: clamp(56px, 8vw, 128px);
  background: var(--paper);
  counter-reset: legal;
}

/* ---------- Guide column ---------- */
body.sx-legal .sx-legal-head {
  position: sticky;
  top: calc(var(--wp-admin--admin-bar--height, 0px) + 28px);
  max-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px) - 56px);
  overflow-y: auto;
  scrollbar-width: none;
}

body.sx-legal .sx-legal-eyebrow {
  margin: 0 0 20px;
  color: var(--legal-gold);
  font: 700 10px/1.4 Manrope, Arial, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body.sx-legal .sx-legal-head h1 {
  max-width: none !important;
  margin: 0;
  padding: 0;
  color: var(--legal-ink);
  font-size: clamp(42px, 4.2vw, 62px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

body.sx-legal .sx-legal-updated {
  margin: 18px 0 0;
  color: var(--legal-muted);
  font: 500 13px/1.5 Manrope, Arial, sans-serif;
}

body.sx-legal .sx-legal-label {
  margin: 0 0 10px;
  color: var(--legal-gold);
  font: 700 10px/1.4 Manrope, Arial, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body.sx-legal :is(.sx-legal-toc, .sx-legal-related) {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--legal-line);
}

body.sx-legal :is(.sx-legal-toc, .sx-legal-related) :is(ol, ul) {
  margin: 0;
  padding: 0;
  list-style: none;
}

body.sx-legal .sx-legal-toc ol { counter-reset: toc; }
body.sx-legal .sx-legal-toc li { counter-increment: toc; }
body.sx-legal .sx-legal-toc a::before {
  content: counter(toc) ".";
  display: inline-block;
  min-width: 1.6em;
  color: var(--legal-gold);
}

body.sx-legal :is(.sx-legal-toc, .sx-legal-related) a {
  display: block;
  padding: 5px 0;
  color: var(--legal-body);
  font: 500 14px/1.45 Manrope, Arial, sans-serif;
  text-decoration: none;
}

body.sx-legal :is(.sx-legal-toc, .sx-legal-related) a:is(:hover, :focus-visible) {
  color: #5a3738;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.sx-legal .sx-legal-related a { color: var(--legal-muted); font-size: 13px; }

/* ---------- Reading column ---------- */
body.sx-legal main.standard-page > .wp-block-post-content {
  width: 100%;
  max-width: 68ch !important;
  min-width: 0;
  margin: 0 !important;
  color: var(--legal-body);
}

/* The constrained layout centres each block on its own max-width; legal text reads from one edge. */
body.sx-legal main.standard-page > .wp-block-post-content > * {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.sx-legal main.standard-page .wp-block-post-content h2 {
  counter-increment: legal;
  margin: 40px 0 14px;
  padding: 28px 0 0;
  border-top: 1px solid var(--legal-line);
  color: var(--legal-ink);
  font-size: clamp(26px, 2.2vw, 32px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
  scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + 24px);
}

body.sx-legal main.standard-page .wp-block-post-content h2::before {
  content: counter(legal) ".";
  display: inline-block;
  min-width: 1.35em;
  color: var(--legal-gold);
}

body.sx-legal main.standard-page .wp-block-post-content > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

body.sx-legal main.standard-page .wp-block-post-content :is(p, li) {
  font-size: 15.5px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

body.sx-legal main.standard-page .wp-block-post-content p { margin: 0 0 16px; }

body.sx-legal main.standard-page .wp-block-post-content :is(ul, ol) {
  margin: 0 0 18px !important;
  padding-left: 1.25em;
}

body.sx-legal main.standard-page .wp-block-post-content li + li { margin-top: 8px; }
body.sx-legal main.standard-page .wp-block-post-content strong { color: var(--legal-ink); font-weight: 650; }

body.sx-legal main.standard-page .wp-block-post-content a {
  color: #5a3738;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* The seller block that opens most texts reads as an identity card, not as running text. */
body.sx-legal main.standard-page .wp-block-post-content p.sx-legal-seller {
  padding: 16px 18px;
  border-left: 3px solid #a98653;
  background: #eee7dc;
  color: #52483e;
  font-size: 14px;
  line-height: 1.7;
}

/* ---------- Cookie list ---------- */
body.sx-legal .sx-cookie-table {
  margin: 0 0 18px;
  overflow-x: auto;
  border: 1px solid var(--legal-line);
}

body.sx-legal .sx-cookie-table table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font: 400 13px/1.5 Manrope, Arial, sans-serif;
}

body.sx-legal .sx-cookie-table :is(th, td) {
  padding: 10px 12px;
  border-bottom: 1px solid var(--legal-line);
  text-align: left;
  vertical-align: top;
}

body.sx-legal .sx-cookie-table th {
  background: #eee7dc;
  color: var(--legal-ink);
  font-weight: 700;
}

body.sx-legal .sx-cookie-table tr:last-child td { border-bottom: 0; }
body.sx-legal .sx-cookie-table code { font-size: 12px; overflow-wrap: anywhere; }

/* ---------- Narrow screens: one column, the contents list stays, the other texts are in the footer ---------- */
@media (max-width: 900px) {
  body.sx-legal main.standard-page {
    display: block;
    padding: 44px clamp(20px, 6vw, 48px) 76px;
  }

  body.sx-legal .sx-legal-head {
    position: static;
    max-height: none;
    overflow: visible;
    margin-bottom: 36px;
  }

  body.sx-legal .sx-legal-head h1 { font-size: clamp(38px, 9vw, 54px); }
  body.sx-legal .sx-legal-related { display: none; }
  body.sx-legal main.standard-page > .wp-block-post-content { max-width: none !important; }
}

@media (max-width: 520px) {
  body.sx-legal main.standard-page .wp-block-post-content h2 { font-size: clamp(24px, 7vw, 29px); }
  body.sx-legal main.standard-page .wp-block-post-content :is(p, li) { font-size: 15px; line-height: 1.72; }
}

/* ---------- Print / save as PDF: the text alone ---------- */
@media print {
  body.sx-legal :is(.wp-site-blocks > header, .wp-site-blocks > footer, .sx-legal-toc, .sx-legal-related, .sx-buybar, #wpadminbar) { display: none !important; }
  body.sx-legal main.standard-page { display: block; padding: 0; background: #fff; }
  body.sx-legal .sx-legal-head { position: static; max-height: none; overflow: visible; margin-bottom: 24px; }
  body.sx-legal main.standard-page > .wp-block-post-content { max-width: none !important; }
  body.sx-legal main.standard-page .wp-block-post-content h2 { break-after: avoid; }
}
