/* ==========================================================================
   Legal and policy pages (page group "legal", see kt_page_group()):
   privacy-policy, terms-and-conditions, packdash-data-security, packdash-policy,
   trustdash-policy, trustdash-help-and-support.
   One section: a two-tone title above a single column of running text
   (template-parts/layouts/legal.php). Values are design px / 10 (see main.css).
   ========================================================================== */

/* The section starts below the fixed header (a margin, so its box is the original's box) and
   spans the page; its content is "capped" (see wide.css): .legal__inner carries .is-capped, so
   above 1600px it stops growing and sits centred while the section stays full width.
   Title and text share one grid cell and the text is pushed down by a fixed offset, exactly like
   the original. A one-line title leaves a 2.6rem gap above the text. A title that wraps to two
   lines (on mobile: packdash-policy, trustdash-policy, trustdash-help-and-support) runs into the
   first line of text; the original does the same, so it is kept. To let the text follow the title
   instead (nothing moves while the title fits on one line), use two rows:
     .legal__inner { grid-template-rows: auto 1fr; min-height: calc(63.9492rem + var(--legal-pb)); }
     .legal__title { grid-area: 1 / 1; }
     .legal__body  { grid-area: 2 / 1; margin-top: 2.59rem; }
   and on mobile .legal__inner { min-height: 21.1847rem; } .legal__body { margin-top: .904rem; }
   --legal-pb: bottom padding (the app pages have less).
   --legal-title-w: width of the title box on desktop (it only matters for long titles and for the
   pivot of the title's entrance animation); a page can override it in its own stylesheet. */
.legal { --legal-pb: 11.4195rem; margin-top: var(--hdr-h); background: #fff; }
.legal--app { --legal-pb: 8rem; }
.legal__inner { display: grid; grid-template: minmax(57.0975rem, auto) / minmax(0, 1fr); padding: 6.8517rem 4.5678rem var(--legal-pb); }
.legal__title, .legal__body { grid-area: 1 / 1; align-self: start; }
.legal__title { width: var(--legal-title-w, 65.461%); margin: -.0565rem 0 0 -.0565rem; }
.legal__body { width: 100.1116%; margin: 9.3616rem 0 0 -.0567rem; font-size: 1.82712rem; line-height: 1.6em; overflow-wrap: break-word; }

/* ---------- Running text ---------- */
.legal__body strong { font-weight: 700; }
.legal__body mark { background: #c2c2c2; color: inherit; }
.legal__body ul, .legal__body ol { margin-left: .5em; padding-left: 1.3em; }
.legal__body ul { list-style: disc; }
.legal__body ol { list-style: decimal; }
/* Links look like the surrounding text unless the original underlines them. */
.legal-u { text-decoration: underline; }

/* The original spaces its text with empty lines, not margins: blocks sit flush against each other
   and every gap is a whole number of lines. Done the same way here, with a generated line break,
   so the vertical rhythm matches to the pixel (line-heights are in em for the same reason: the
   browser rounds them like the original's). */
.legal-gap::before, .legal-h::before { content: "\A"; white-space: pre; }

/* Section labels are bold paragraphs (the original has no headings below the title). They are set
   with the heading line-height and follow one empty line of that height; --loose keeps the body
   line-height, --2 follows two empty lines. */
.legal-h { line-height: 1.3em; }
.legal-h--loose { line-height: inherit; }
.legal-h--2::before { content: "\A\A"; }

/* Lists the original types as plain lines ("• text", "1. text"): no indent, marker in the text. */
.legal__body .legal-lines { margin-left: 0; padding-left: 0; list-style: none; }
ul.legal-lines > li::before { content: "\2022\20"; }
ol.legal-lines { counter-reset: legal-line; }
ol.legal-lines > li { counter-increment: legal-line; }
ol.legal-lines > li::before { content: counter(legal-line) ".\20"; }

/* ---------- Entrance ----------
   The title tilts in and the text fades in. Both are the original's own animations, run by the
   interaction runtime from assets/motion/<page>.json (data-kt-motion on the two elements, see
   legal.php); no CSS here, so nothing holds them hidden or transformed. */

/* ==========================================================================
   Mobile (design width 390)
   ========================================================================== */
@media (max-width: 750px) {
	.legal__inner { grid-template-rows: minmax(15.4639rem, auto); padding: 2.628rem 1.5768rem 3.0928rem; }
	.legal__title { justify-self: end; width: 100.1086%; margin: 0 -.0397rem 0 0; }
	.legal__body { justify-self: center; width: 100.1109%; margin: 4.7305rem 0 0 .0698rem; font-size: 1.5768rem; text-align: justify; }
	.legal--app .legal__body { text-align: left; }
}

/* .legal--stack: the text follows the title (two grid rows), for WordPress-only pages with long titles
   (privacy-policy-ai-social-manager, data-deletion) so a wrapped title never runs into the text. */
.legal--stack .legal__inner { grid-template-rows: auto 1fr; min-height: calc(63.9492rem + var(--legal-pb)); }
.legal--stack .legal__title { grid-area: 1 / 1; width: 100%; }
.legal--stack .legal__body { grid-area: 2 / 1; margin-top: 2.59rem; }
@media (max-width: 750px) {
	.legal--stack .legal__inner { min-height: 21.1847rem; }
	.legal--stack .legal__body { margin-top: .904rem; }
}
