/* APSAIDAL Legal Design System v3 */
.aps-legal-hero,
.aps-legal-body,
.aps-legal-content,
.aps-legal-toc,
.aps-legal-section,
.aps-legal-toc-item {
    font-family: Inter, "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
}

.aps-legal-hero .elementor-heading-title,
.aps-legal-body .elementor-heading-title {
    font-family: Inter, "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif !important;
}

.aps-legal-hero .elementor-heading-title {
    font-weight: 300 !important;
    letter-spacing: -0.028em;
}

.aps-legal-body .elementor-heading-title {
    letter-spacing: -0.018em;
}

.aps-legal-hero-media {
    position: relative;
    overflow: hidden;
}

.aps-legal-hero-media::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(90deg, rgba(245,243,239,0.92) 0%, rgba(245,243,239,0.48) 18%, rgba(245,243,239,0.10) 48%, rgba(245,243,239,0.00) 72%);
}

.aps-legal-toc {
    position: relative;
}

.aps-legal-toc-item {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 14px !important;
    align-items: start;
    padding: 2px 0;
}

.aps-legal-toc-item .aps-legal-toc-number,
.aps-legal-toc-item .aps-legal-toc-title {
    min-width: 0;
}

.aps-legal-toc-item a {
    transition: color .18s ease, opacity .18s ease;
}

.aps-legal-toc-item .aps-legal-toc-number .elementor-heading-title,
.aps-legal-toc-item .aps-legal-toc-title .elementor-heading-title {
    color: #4E555C !important;
    font-family: Inter, "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif !important;
}

.aps-legal-toc-item.is-active .aps-legal-toc-number .elementor-heading-title,
.aps-legal-toc-item.is-active .aps-legal-toc-title .elementor-heading-title {
    color: #A92332 !important;
}

.aps-legal-toc-item.is-active .aps-legal-toc-title .elementor-heading-title {
    font-weight: 600 !important;
}

.aps-legal-section {
    scroll-margin-top: 28px;
}

@media (max-width: 1024px) {
    .aps-legal-toc {
        border-right: 0 !important;
        border-bottom: 1px solid #E3DED8 !important;
        padding-right: 0 !important;
        padding-bottom: 28px !important;
    }

    .aps-legal-hero-media::before {
        background: linear-gradient(180deg, rgba(245,243,239,0.08) 0%, rgba(245,243,239,0.32) 100%);
    }
}

@media (max-width: 767px) {
    .aps-legal-toc-item {
        grid-template-columns: 28px minmax(0, 1fr);
        column-gap: 10px !important;
    }
}


/* Legal mobile/tablet QA closeout — 2026-09-21 */
/* Keep every legal page aligned with the approved Cookie Policy behavior.
 * The first TOC entry is no longer painted as a permanent red active state;
 * accent remains available on hover/focus only. */
.aps-legal-toc-item.is-active .aps-legal-toc-number .elementor-heading-title,
.aps-legal-toc-item.is-active .aps-legal-toc-title .elementor-heading-title {
    color: #4E555C !important;
    font-weight: 400 !important;
}
.aps-legal-toc-item a:hover .elementor-heading-title,
.aps-legal-toc-item a:focus-visible .elementor-heading-title {
    color: #A92332 !important;
}

@media (max-width: 1024px) {
    .aps-legal-body {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .aps-legal-body > .aps-legal-toc,
    .aps-legal-body > .aps-legal-content,
    .aps-legal-toc,
    .aps-legal-content {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto !important;
        min-width: 0 !important;
    }

    .aps-legal-toc {
        margin: 0 !important;
        padding-left: 0 !important;
    }

    .aps-legal-toc-item {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 767px) {
    .aps-legal-body {
        gap: 34px !important;
    }

    .aps-legal-toc {
        padding-bottom: 24px !important;
    }

    .aps-legal-toc-item {
        grid-template-columns: 30px minmax(0, 1fr) !important;
        column-gap: 12px !important;
        padding: 4px 0 !important;
    }

    .aps-legal-toc-item .elementor-heading-title {
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
    }
}


/* Legal TOC hardening — QA 2026-09-21
 * Legacy Elementor copies do not all carry the same APSAIDAL classes. JS marks
 * the surviving TOC as canonical; style the links themselves so theme accent
 * colours cannot leak through on Privacy / Terms / Legal Notice. */
.aps-legal-toc--canonical,
.aps-legal-toc-normalized {
    color: #4E555C !important;
}

.aps-legal-toc--canonical a[href^="#"],
.aps-legal-toc--canonical a[href*="#legal-"],
.aps-legal-toc-normalized a[href^="#"],
.aps-legal-toc-normalized a[href*="#legal-"],
.aps-legal-toc--canonical a[href^="#"] *,
.aps-legal-toc--canonical a[href*="#legal-"] *,
.aps-legal-toc-normalized a[href^="#"] *,
.aps-legal-toc-normalized a[href*="#legal-"] * {
    color: #4E555C !important;
    font-weight: 400 !important;
    text-decoration: none !important;
}

.aps-legal-toc--canonical a[href^="#"]:hover,
.aps-legal-toc--canonical a[href*="#legal-"]:hover,
.aps-legal-toc--canonical a[href^="#"]:focus-visible,
.aps-legal-toc--canonical a[href*="#legal-"]:focus-visible,
.aps-legal-toc-normalized a[href^="#"]:hover,
.aps-legal-toc-normalized a[href*="#legal-"]:hover,
.aps-legal-toc-normalized a[href^="#"]:focus-visible,
.aps-legal-toc-normalized a[href*="#legal-"]:focus-visible {
    color: #A92332 !important;
}

.aps-legal-toc--canonical a[href^="#"]:hover *,
.aps-legal-toc--canonical a[href*="#legal-"]:hover *,
.aps-legal-toc--canonical a[href^="#"]:focus-visible *,
.aps-legal-toc--canonical a[href*="#legal-"]:focus-visible *,
.aps-legal-toc-normalized a[href^="#"]:hover *,
.aps-legal-toc-normalized a[href*="#legal-"]:hover *,
.aps-legal-toc-normalized a[href^="#"]:focus-visible *,
.aps-legal-toc-normalized a[href*="#legal-"]:focus-visible * {
    color: #A92332 !important;
}

/* Duplicate legacy TOCs are hidden by JS; this rule makes that deterministic
 * even when Elementor or another stylesheet later overrides [hidden]. */
.aps-legal-toc--duplicate-hidden {
    display: none !important;
}


/* Targeted legal TOC cleanup — 2026-09-21
 * Keep only the canonical Elementor TOC list on the three legacy legal pages.
 * This deliberately does not alter widths, columns or the approved Legal v3
 * page geometry. */
body.page-id-242 .aps-legal-toc-list,
body.page-id-244 .aps-legal-toc-list,
body.page-id-263 .aps-legal-toc-list {
    display: none !important;
}

body.page-id-242 .aps-legal-toc .aps-legal-toc-list,
body.page-id-244 .aps-legal-toc .aps-legal-toc-list,
body.page-id-263 .aps-legal-toc .aps-legal-toc-list {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Privacy already has separate number/title spans, so keep the approved
 * two-column rhythm. Terms and Legal Notice store "01  Title" as one text
 * node; forcing that through a 34px grid column is what caused the severe
 * wrapping seen in QA. */
body.page-id-242 .aps-legal-toc .aps-legal-toc-item {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    column-gap: 14px !important;
}

body.page-id-244 .aps-legal-toc .aps-legal-toc-item,
body.page-id-263 .aps-legal-toc .aps-legal-toc-item {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    line-height: 1.35 !important;
    padding: 3px 0 !important;
}

body.page-id-242 .aps-legal-toc .aps-legal-toc-item,
body.page-id-244 .aps-legal-toc .aps-legal-toc-item,
body.page-id-263 .aps-legal-toc .aps-legal-toc-item,
body.page-id-242 .aps-legal-toc .aps-legal-toc-item *,
body.page-id-244 .aps-legal-toc .aps-legal-toc-item *,
body.page-id-263 .aps-legal-toc .aps-legal-toc-item * {
    color: #4E555C !important;
    font-weight: 400 !important;
    text-decoration: none !important;
}

body.page-id-242 .aps-legal-toc .aps-legal-toc-item:hover,
body.page-id-244 .aps-legal-toc .aps-legal-toc-item:hover,
body.page-id-263 .aps-legal-toc .aps-legal-toc-item:hover,
body.page-id-242 .aps-legal-toc .aps-legal-toc-item:focus-visible,
body.page-id-244 .aps-legal-toc .aps-legal-toc-item:focus-visible,
body.page-id-263 .aps-legal-toc .aps-legal-toc-item:focus-visible {
    color: #A92332 !important;
}
