/**
 * Rules & Policies pages (page-templates/legal.php)
 *
 * A document column beside a sticky table of contents. The document's
 * markup comes from inc/legal-page.php: .legal-heading sections, one
 * continuous numbering across every .legal-ol (the counter lives on
 * .legal-doc), and nested .legal-sub lists whose markers are the
 * document's own, carried in data-marker.
 *
 * @since 2.49.0
 */

.legal-section {
    padding: 0 0 80px;
}

.legal-grid {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    /* Legal text reads best around 80 characters a line; the grid, not
       the container, sets the measure. */
    max-width: 1200px;
    margin: 0 auto;
}

.legal-grid--single {
    grid-template-columns: minmax(0, 1fr);
    max-width: 900px;
}

/* ---- Table of contents ---------------------------------------------- */

/* The fixed header is in its one-line minimized state whenever the page
   is scrolled far enough to be reading the document, so the column and
   the anchor targets clear that height, not the full header's. */
.legal-aside {
    position: sticky;
    top: 96px;
}

.legal-grid--single .legal-aside {
    position: static;
}

.legal-toc {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 22px 24px 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
}

.legal-toc-title {
    margin: 0 0 8px;
    font-family: var(--font-heading);
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.legal-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: legal-toc;
}

.legal-toc li {
    counter-increment: legal-toc;
    margin: 0;
}

.legal-toc a {
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding: 10px 0;
    border-top: 1px solid var(--color-border);
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.15s ease;
}

.legal-toc a::before {
    content: counter(legal-toc, decimal-leading-zero);
    flex: 0 0 auto;
    font-size: var(--font-size-xs);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-subtle);
}

.legal-toc a:hover,
.legal-toc a:focus-visible {
    color: var(--color-primary);
}

.legal-meta {
    margin: 18px 8px 0;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.legal-updated {
    margin: 0 0 12px;
    line-height: 1.5;
}

.legal-updated span {
    display: block;
    font-size: var(--font-size-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-subtle);
}

.legal-updated time {
    font-weight: 600;
    color: var(--color-text);
}

.legal-print {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    background: var(--color-surface);
    transition: border-color 0.15s ease, color 0.15s ease;
}

.legal-print:hover,
.legal-print:focus-visible {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ---- The document --------------------------------------------------- */

.legal-doc {
    background: var(--color-surface);
    border-radius: 20px;
    padding: 48px 56px 56px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.12);
    font-family: var(--font-primary);
    font-size: 17px;
    line-height: 1.75;
    color: var(--color-text);
    counter-reset: legal-item;
    overflow-wrap: anywhere;
}

.legal-doc > :first-child {
    margin-top: 0;
}

.legal-doc p {
    margin: 0 0 14px;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.legal-doc a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-doc a:hover {
    color: var(--color-primary-hover);
}

/* Section headings: a rule above, the brand's short bar beneath. */
.legal-heading {
    margin: 44px 0 18px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
    font-family: var(--font-heading);
    font-size: var(--font-size-h4);
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-heading);
    scroll-margin-top: 96px;
}

.legal-heading::after {
    content: '';
    display: block;
    width: 44px;
    height: 3px;
    margin-top: 12px;
    border-radius: 2px;
    background: var(--color-primary);
}

.legal-doc > .legal-heading:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

/* Numbered clauses: one sequence through the whole document. */
.legal-doc .legal-ol {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
}

.legal-doc .legal-ol > li {
    position: relative;
    margin: 0 0 20px;
    padding-left: 3.25rem;
    counter-increment: legal-item;
}

.legal-doc .legal-ol > li::before {
    content: counter(legal-item) '.';
    position: absolute;
    left: 0;
    top: 0;
    width: 2.4rem;
    text-align: right;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-primary);
}

/* Bullet lists: the same rhythm as the numbered clauses, with the brand's
   dash in place of a number, so a section that mixes the two reads as one
   document rather than two. */
.legal-doc ul {
    list-style: none;
    margin: 12px 0 18px;
    padding: 0;
}

.legal-doc ul > li {
    position: relative;
    margin: 0 0 12px;
    padding-left: 3.25rem;
}

.legal-doc ul > li::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 0.8em;
    width: 10px;
    height: 2px;
    border-radius: 1px;
    background: var(--color-primary);
}

.legal-doc ul > li:last-child {
    margin-bottom: 0;
}

/* A bold lead-in on a bullet ("Photos.") is the point being made. */
.legal-doc ul > li > p > strong:first-child,
.legal-doc ul > li > strong:first-child {
    color: var(--color-heading);
}

/* Sub-points keep the document's own markers. */
.legal-doc .legal-sub {
    list-style: none;
    margin: 12px 0 4px;
    padding: 0;
}

.legal-doc .legal-sub > li {
    position: relative;
    margin: 0 0 12px;
    padding-left: 2.75rem;
}

.legal-doc .legal-sub > li::before {
    content: attr(data-marker);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.1rem;
    text-align: right;
    font-weight: 600;
    color: var(--color-text-muted);
}

.legal-doc .legal-sub--2 > li::before {
    font-weight: 500;
    color: var(--color-text-subtle);
}

.legal-doc li > p:last-child {
    margin-bottom: 0;
}

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

@media (max-width: 1023px) {
    .legal-heading {
        scroll-margin-top: calc(var(--weeu-header-height, 150px) + 16px);
    }

    .legal-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .legal-aside {
        position: static;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 16px 24px;
        align-items: end;
    }

    .legal-toc {
        grid-column: 1 / -1;
    }

    .legal-meta {
        grid-column: 1 / -1;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: 0 8px;
    }

    .legal-updated {
        margin: 0;
    }
}

@media (max-width: 767px) {
    .legal-section {
        padding-bottom: 56px;
    }

    .legal-doc {
        padding: 30px 22px 36px;
        border-radius: 16px;
        font-size: 16px;
    }

    .legal-heading {
        margin-top: 36px;
        padding-top: 26px;
        font-size: var(--font-size-h5);
    }

    .legal-doc .legal-ol > li {
        padding-left: 2.5rem;
    }

    .legal-doc .legal-ol > li::before {
        width: 1.9rem;
    }

    .legal-doc ul > li {
        padding-left: 2.25rem;
    }

    .legal-doc ul > li::before {
        left: 0.75rem;
    }

    .legal-doc .legal-sub > li {
        padding-left: 2.25rem;
    }

    .legal-doc .legal-sub > li::before {
        width: 1.75rem;
    }

    .legal-meta {
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* ---- Print ----------------------------------------------------------- */

@media print {
    .site-header,
    .site-footer,
    .legal-aside,
    .breadcrumbs,
    .hero-bg,
    .hero-overlay,
    .hero-fg,
    .score-crawl,
    .cookie-notice,
    #cookie-law-info-bar {
        display: none !important;
    }

    body {
        padding-top: 0 !important;
        background: #fff;
    }

    /* The hero prints as a plain title. */
    .legal-page .weeu-page-hero {
        min-height: 0;
        margin: 0 0 12pt;
        padding: 0;
        background: none !important;
        color: #000;
    }

    .legal-page .hero-title {
        margin: 0;
        font-size: 22pt;
        color: #000;
        text-shadow: none;
    }

    .legal-page .hero-subtitle {
        color: #333;
    }

    .legal-grid {
        display: block;
        max-width: none;
    }

    .legal-doc {
        padding: 0;
        box-shadow: none;
        border-radius: 0;
        font-size: 11pt;
        line-height: 1.5;
    }

    .legal-heading {
        break-after: avoid;
    }

    .legal-doc .legal-ol > li,
    .legal-doc .legal-sub > li {
        break-inside: avoid;
    }

    .legal-doc a {
        color: inherit;
        text-decoration: none;
    }
}
