/*
 * ED Legal Pages v1.0.0
 * Styling is intentionally scoped to body.ed-legal-page so it cannot leak into shop, checkout,
 * account, blog, contact or other site areas.
 */

body.ed-legal-page {
    --ed-legal-bg: #111111;
    --ed-legal-panel: #181818;
    --ed-legal-panel-2: #1e1e1e;
    --ed-legal-text: #f3f3f3;
    --ed-legal-muted: #b8b8b8;
    --ed-legal-border: rgba(255, 255, 255, 0.10);
    --ed-legal-gold: #c5a45a;
    --ed-legal-gold-soft: rgba(197, 164, 90, 0.16);
    --ed-legal-radius: 22px;
    --ed-legal-shadow: 0 20px 55px rgba(0, 0, 0, 0.24);
    background: var(--ed-legal-bg);
    color: var(--ed-legal-text);
}

/* Keep header/footer implementation intact; only harmonize the page canvas. */
body.ed-legal-page #content,
body.ed-legal-page .site-content,
body.ed-legal-page .content-area,
body.ed-legal-page main.site-main {
    background: var(--ed-legal-bg);
}

/* Support Elementor containers/sections and classic theme content without changing the source content. */
body.ed-legal-page .site-content > .container,
body.ed-legal-page #content > .container,
body.ed-legal-page .content-area > .container,
body.ed-legal-page main.site-main > .container,
body.ed-legal-page article.page,
body.ed-legal-page .type-page > .entry-content,
body.ed-legal-page .elementor-location-single,
body.ed-legal-page .elementor > .elementor-element:first-child {
    position: relative;
}

/* Main reading card. Woostify/classic-page fallback + Elementor page wrappers. */
body.ed-legal-page article.page .entry-content,
body.ed-legal-page .page-content,
body.ed-legal-page .elementor-widget-theme-post-content > .elementor-widget-container,
body.ed-legal-page .elementor-widget-text-editor > .elementor-widget-container,
body.ed-legal-page .entry-content.elementor {
    color: var(--ed-legal-text);
}

body.ed-legal-page article.page > .entry-content:not(.elementor),
body.ed-legal-page .type-page > .entry-content:not(.elementor) {
    width: min(1120px, calc(100% - 40px));
    margin: 56px auto 72px;
    padding: clamp(28px, 4vw, 56px);
    background: linear-gradient(180deg, var(--ed-legal-panel-2), var(--ed-legal-panel));
    border: 1px solid var(--ed-legal-border);
    border-radius: var(--ed-legal-radius);
    box-shadow: var(--ed-legal-shadow);
}

/* Elementor: give the editable page a premium canvas, but don't override individual widget geometry. */
body.ed-legal-page .elementor:not(.elementor-location-header):not(.elementor-location-footer) {
    --ed-legal-content-width: 1120px;
}

body.ed-legal-page .elementor:not(.elementor-location-header):not(.elementor-location-footer) > .elementor-element:first-child {
    padding-top: clamp(38px, 6vw, 76px);
}

body.ed-legal-page .elementor:not(.elementor-location-header):not(.elementor-location-footer) > .elementor-element:last-child {
    padding-bottom: clamp(50px, 7vw, 90px);
}

/* Typography */
body.ed-legal-page .entry-content h1,
body.ed-legal-page .entry-content h2,
body.ed-legal-page .entry-content h3,
body.ed-legal-page .entry-content h4,
body.ed-legal-page .page-content h1,
body.ed-legal-page .page-content h2,
body.ed-legal-page .page-content h3,
body.ed-legal-page .elementor-widget-text-editor h1,
body.ed-legal-page .elementor-widget-text-editor h2,
body.ed-legal-page .elementor-widget-text-editor h3,
body.ed-legal-page .elementor-widget-heading .elementor-heading-title {
    color: var(--ed-legal-text);
    letter-spacing: -0.02em;
}

body.ed-legal-page .entry-content h1,
body.ed-legal-page .page-content h1,
body.ed-legal-page .elementor-widget-text-editor h1,
body.ed-legal-page .elementor-widget-heading h1.elementor-heading-title {
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.04;
    margin-bottom: 18px;
}

body.ed-legal-page .entry-content h2,
body.ed-legal-page .page-content h2,
body.ed-legal-page .elementor-widget-text-editor h2,
body.ed-legal-page .elementor-widget-heading h2.elementor-heading-title {
    position: relative;
    font-size: clamp(23px, 3vw, 31px);
    line-height: 1.18;
    margin-top: 42px;
    margin-bottom: 18px;
    padding-left: 18px;
}

body.ed-legal-page .entry-content h2::before,
body.ed-legal-page .page-content h2::before,
body.ed-legal-page .elementor-widget-text-editor h2::before,
body.ed-legal-page .elementor-widget-heading h2.elementor-heading-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.15em;
    bottom: 0.15em;
    width: 4px;
    border-radius: 999px;
    background: var(--ed-legal-gold);
}

body.ed-legal-page .entry-content h3,
body.ed-legal-page .page-content h3,
body.ed-legal-page .elementor-widget-text-editor h3,
body.ed-legal-page .elementor-widget-heading h3.elementor-heading-title {
    color: var(--ed-legal-gold);
    font-size: clamp(18px, 2.2vw, 22px);
    line-height: 1.35;
    margin-top: 28px;
    margin-bottom: 10px;
}

body.ed-legal-page .entry-content p,
body.ed-legal-page .entry-content li,
body.ed-legal-page .page-content p,
body.ed-legal-page .page-content li,
body.ed-legal-page .elementor-widget-text-editor p,
body.ed-legal-page .elementor-widget-text-editor li {
    color: var(--ed-legal-muted);
    font-size: clamp(15px, 1.5vw, 17px);
    line-height: 1.8;
}

body.ed-legal-page .entry-content p,
body.ed-legal-page .page-content p,
body.ed-legal-page .elementor-widget-text-editor p {
    margin-bottom: 16px;
}

body.ed-legal-page .entry-content strong,
body.ed-legal-page .page-content strong,
body.ed-legal-page .elementor-widget-text-editor strong {
    color: var(--ed-legal-text);
    font-weight: 650;
}

body.ed-legal-page .entry-content a,
body.ed-legal-page .page-content a,
body.ed-legal-page .elementor-widget-text-editor a {
    color: var(--ed-legal-gold);
    text-decoration-color: rgba(197, 164, 90, 0.45);
    text-underline-offset: 3px;
    transition: opacity .18s ease, text-decoration-color .18s ease;
}

body.ed-legal-page .entry-content a:hover,
body.ed-legal-page .page-content a:hover,
body.ed-legal-page .elementor-widget-text-editor a:hover {
    color: var(--ed-legal-gold);
    opacity: .82;
    text-decoration-color: var(--ed-legal-gold);
}

/* Lists */
body.ed-legal-page .entry-content ul,
body.ed-legal-page .entry-content ol,
body.ed-legal-page .page-content ul,
body.ed-legal-page .page-content ol,
body.ed-legal-page .elementor-widget-text-editor ul,
body.ed-legal-page .elementor-widget-text-editor ol {
    margin: 12px 0 24px;
    padding-left: 1.35em;
}

body.ed-legal-page .entry-content li,
body.ed-legal-page .page-content li,
body.ed-legal-page .elementor-widget-text-editor li {
    margin-bottom: 8px;
    padding-left: 4px;
}

body.ed-legal-page .entry-content li::marker,
body.ed-legal-page .page-content li::marker,
body.ed-legal-page .elementor-widget-text-editor li::marker {
    color: var(--ed-legal-gold);
}

/* Horizontal rules become subtle ED separators. */
body.ed-legal-page .entry-content hr,
body.ed-legal-page .page-content hr,
body.ed-legal-page .elementor-widget-text-editor hr {
    height: 1px;
    margin: 32px 0;
    border: 0;
    background: linear-gradient(90deg, transparent, var(--ed-legal-border) 12%, var(--ed-legal-border) 88%, transparent);
}

/* Tables if a future policy uses them. */
body.ed-legal-page .entry-content table,
body.ed-legal-page .page-content table,
body.ed-legal-page .elementor-widget-text-editor table {
    width: 100%;
    margin: 24px 0;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--ed-legal-border);
    border-radius: 14px;
    background: rgba(255,255,255,.02);
}

body.ed-legal-page .entry-content th,
body.ed-legal-page .entry-content td,
body.ed-legal-page .page-content th,
body.ed-legal-page .page-content td,
body.ed-legal-page .elementor-widget-text-editor th,
body.ed-legal-page .elementor-widget-text-editor td {
    padding: 14px 16px;
    border-right: 1px solid var(--ed-legal-border);
    border-bottom: 1px solid var(--ed-legal-border);
    color: var(--ed-legal-muted);
}

body.ed-legal-page .entry-content th,
body.ed-legal-page .page-content th,
body.ed-legal-page .elementor-widget-text-editor th {
    color: var(--ed-legal-text);
    background: var(--ed-legal-gold-soft);
}

/* Optional reusable Elementor class: add ed-legal-card to any Container/Section for highlighted legal blocks. */
body.ed-legal-page .ed-legal-card {
    padding: clamp(20px, 3vw, 30px) !important;
    background: var(--ed-legal-panel) !important;
    border: 1px solid var(--ed-legal-border) !important;
    border-radius: 18px !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .18);
}

/* Optional reusable Elementor class: ed-legal-intro for the opening paragraph/date area. */
body.ed-legal-page .ed-legal-intro {
    padding: 20px 22px !important;
    background: var(--ed-legal-gold-soft) !important;
    border: 1px solid rgba(197, 164, 90, .25) !important;
    border-radius: 16px !important;
}

/* Avoid giant theme title spacing if Woostify prints a page header outside Elementor. */
body.ed-legal-page .page-header,
body.ed-legal-page .entry-header {
    background: transparent;
}

body.ed-legal-page .entry-header .entry-title,
body.ed-legal-page .page-header .page-title {
    color: var(--ed-legal-text);
    text-align: center;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.08;
    margin: 42px auto 10px;
}

@media (max-width: 767px) {
    body.ed-legal-page article.page > .entry-content:not(.elementor),
    body.ed-legal-page .type-page > .entry-content:not(.elementor) {
        width: min(100% - 24px, 1120px);
        margin-top: 28px;
        margin-bottom: 44px;
        padding: 24px 20px 28px;
        border-radius: 16px;
    }

    body.ed-legal-page .entry-content h2,
    body.ed-legal-page .page-content h2,
    body.ed-legal-page .elementor-widget-text-editor h2,
    body.ed-legal-page .elementor-widget-heading h2.elementor-heading-title {
        margin-top: 32px;
        padding-left: 14px;
    }

    body.ed-legal-page .entry-content h2::before,
    body.ed-legal-page .page-content h2::before,
    body.ed-legal-page .elementor-widget-text-editor h2::before,
    body.ed-legal-page .elementor-widget-heading h2.elementor-heading-title::before {
        width: 3px;
    }

    body.ed-legal-page .entry-content p,
    body.ed-legal-page .entry-content li,
    body.ed-legal-page .page-content p,
    body.ed-legal-page .page-content li,
    body.ed-legal-page .elementor-widget-text-editor p,
    body.ed-legal-page .elementor-widget-text-editor li {
        line-height: 1.72;
    }

    body.ed-legal-page .entry-content table,
    body.ed-legal-page .page-content table,
    body.ed-legal-page .elementor-widget-text-editor table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ed-legal-page .entry-content a,
    body.ed-legal-page .page-content a,
    body.ed-legal-page .elementor-widget-text-editor a {
        transition: none;
    }
}
