/* ── The legal pages ──
   Privacy Statement, Terms of Use, Cookie Policy. Rendered from
   inc/page-legal.php; their text is in legal/. Plan: roadmaps/Implemented/legal-pages.md.
   STYLING.md > A legal document.

   One reading column on the plain page ground: the theme's `h1` and body
   text, a date line, a contents list, then numbered sections. */

/* The documented outer clamp, above the title and below the last section.
   Blocksy's own content-area spacing is switched off on these pages
   (inc/page-legal.php), so this is the only spacing from the header and the
   footer. */
.pp-legal {
    padding: clamp(32px, 5vw, 64px) 0;
}

/* `alignfull` takes the root out of the constrained-layout cap; the column
   is the reading column on a prose page: `660px`, centred, `16px` gutter. */
.pp-legal__column {
    box-sizing: content-box;
    max-width: 660px;
    margin: 0 auto;
    padding: 0 16px;
}

.pp-legal__column > :last-child,
.pp-legal__section > :last-child {
    margin-bottom: 0;
}

/* The theme's `h1`; only its spacing is the page's. */
.pp-legal__title {
    margin: 0;
    text-wrap: balance;
}

/* The date line: meta text, under the title. */
.pp-legal__updated {
    margin: 4px 0 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--pp-steel-5);
}

.pp-legal__intro {
    margin-top: 32px;
}

/* ── Contents ──
   A numbered list of the sections between two hairlines (the account
   table's row rule), with no surface of its own. A disclosure, open from
   769px (js/page-legal.js), closed on a phone. */
.pp-legal__contents {
    margin: 32px 0 0;
    padding: 8px 0;
    border-top: 1px solid rgba(var(--pp-steel-7-rgb), 0.12);
    border-bottom: 1px solid rgba(var(--pp-steel-7-rgb), 0.12);
}

.pp-legal__contents-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    list-style: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--pp-steel-7);
}

.pp-legal__contents-toggle::-webkit-details-marker {
    display: none;
}

.pp-legal__contents-chevron {
    flex: none;
    fill: none;
    stroke: var(--pp-steel-5);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.15s ease;
}

.pp-legal__contents[open] .pp-legal__contents-chevron {
    transform: rotate(180deg);
}

.pp-legal__contents-list {
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
}

.pp-legal__contents-list li {
    margin: 0;
    break-inside: avoid;
}

.pp-legal__contents-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--pp-steel-7);
    text-decoration: none;
}

.pp-legal__contents-list a:hover,
.pp-legal__contents-list a:focus {
    color: var(--pp-steel-7);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pp-legal__contents-num {
    flex: none;
    min-width: 24px;
    color: var(--pp-steel-5);
    font-variant-numeric: tabular-nums;
}

.pp-legal__contents-toggle:focus-visible,
.pp-legal__contents-list a:focus-visible {
    outline: 2px solid var(--pp-focus-ring);
    outline-offset: 2px;
}

@media (min-width: 769px) {
    .pp-legal__contents-list {
        columns: 2;
        column-gap: 32px;
    }
}

/* ── Sections ──
   Each one an anchor, clear of the sticky header when jumped to. */
.pp-legal__section {
    scroll-margin-top: calc(var(--header-sticky-height, 56px) + 16px);
}

/* The paced reading column's subhead: `24px` / `700` / `1.3`, `--pp-steel-7`,
   `40px` above and `16px` below. Its number in `--pp-steel-5`. */
.pp-legal__heading {
    margin: 40px 0 16px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--pp-steel-7);
    text-wrap: balance;
}

.pp-legal__heading-num {
    color: var(--pp-steel-5);
    font-variant-numeric: tabular-nums;
}

/* A subsection: the running text's own size at `600`, `--pp-steel-7`, `24px`
   above and `8px` below. Blocksy draws `h3` at `26px` in the accent, so size
   and color are both set back here. */
.pp-legal__section h3 {
    margin: 24px 0 8px;
    font-size: inherit;
    font-weight: 600;
    line-height: 1.4;
    color: var(--pp-steel-7);
}

/* ── Facts ──
   An identity block (who runs the service, its numbers, its contact) as
   label-over-value pairs: the label in the meta treatment, the value as
   running text, `4px` apart (the account table's step for a value and its
   own label). */
.pp-legal__facts {
    display: grid;
    gap: 12px;
    margin: 0 0 var(--theme-content-spacing, 1.5em);
}

.pp-legal__facts > div {
    display: grid;
    gap: 4px;
}

.pp-legal__facts dt {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--pp-steel-5);
}

.pp-legal__facts dd {
    margin: 0;
}

/* ── The cookie settings button ──
   In the Cookie Policy, reopening Complianz's settings. The accent outline,
   the secondary button: `1px` at `rgba(var(--pp-accent-rgb), 0.28)`, no fill,
   the accent label at `0.9375rem` / `600`, `10px 16px`, `8px`, `44px` tall,
   `--pp-steel-1` with the border at `0.46` on hover, the focus ring. Every
   state is set, since the theme draws a filled button on hover and focus. */
.pp-legal__consent {
    margin: 0 0 var(--theme-content-spacing, 1.5em);
}

.pp-legal .pp-legal__consent-button,
.pp-legal .pp-legal__consent-button:hover,
.pp-legal .pp-legal__consent-button:focus {
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid rgba(var(--pp-accent-rgb), 0.28);
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    color: var(--theme-palette-color-5);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    text-transform: none;
    cursor: pointer;
}

.pp-legal .pp-legal__consent-button:hover {
    background: var(--pp-steel-1);
    border-color: rgba(var(--pp-accent-rgb), 0.46);
}

.pp-legal .pp-legal__consent-button:focus-visible {
    outline: 2px solid var(--pp-focus-ring);
    outline-offset: 2px;
}

/* In the app there is no banner to reopen (app-shell leaves it out); the
   policy's next paragraph says what the app does instead. */
html.pp-in-app .pp-legal__consent {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .pp-legal__contents-chevron {
        transition: none;
    }
}
