/*
    Path in theme: platform/themes/real-scout/public/css/home-page-new/legal.css
    Loaded via:    config.php's beforeRenderTheme, gated on the URLs of the
                    "legal"-template pages (Terms & Conditions, Privacy
                    Policy, FAQ, Shipping/Delivery Policy, Disclaimer). This
                    page template isn't the homepagenew layout, so
                    home-page-new/header.css isn't guaranteed to be loaded -
                    this file defines its own --header-* fallbacks, same
                    pattern as site-footer.css.
*/

:root {
    --header-navy: #1a1d24;
    --header-navy-light: #22262f;
    --header-gold: #e0a63e;
    --header-gold-hover: #cf9530;
    --header-white: #ffffff;
    --header-text-muted: #c9cdd3;
    --header-font-heading: 'Playfair Display', Georgia, serif;
    --header-font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --header-max-width: 1320px;
}

/* Defensive fallback: the page module's clean() helper auto-wraps a
   shortcode-only page's raw "[gem-*]" content in a <p> before the
   shortcode expands. The hero is rendered separately by page.blade.php
   (outside this purified/shortcode content), so this shouldn't occur in
   practice any more, but zero it out if it ever does rather than let a
   stray empty <p>'s default browser margin show as a gap under the header. */
#app > p:has(+ .legal-hero) {
    margin: 0;
    padding: 0;
}

.legal-hero,
.legal-content {
    font-family: var(--header-font-body);
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

.legal-hero *,
.legal-content * {
    box-sizing: border-box;
}

/* =========================================================
   HERO (generic - rendered by page.blade.php from $page->name
   for every page using the "legal" template)
   ========================================================= */
.legal-hero {
    background: var(--header-navy);
    padding: 64px 0 56px;
    text-align: center;
}

.legal-hero__inner {
    max-width: var(--header-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.legal-hero__eyebrow {
    display: inline-block;
    color: var(--header-gold);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.legal-hero__heading {
    font-family: var(--header-font-heading);
    font-weight: 700;
    color: var(--header-white);
    font-size: 42px;
    line-height: 1.2;
    margin: 0 0 16px;
}

.legal-hero__heading--accent {
    color: var(--header-gold);
}

/* Playfair Display's "&" is a heavily stylized ligature - pages whose
   title contains one (e.g. "Terms & Conditions") use the plain body font
   for the heading instead, so it doesn't look overly decorative. */
.legal-hero__heading--plain {
    font-family: var(--header-font-body);
    font-weight: 600;
}

.legal-hero__breadcrumb {
    color: var(--header-text-muted);
    font-size: 14px;
    margin: 0;
}

.legal-hero__breadcrumb a {
    color: var(--header-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-hero__breadcrumb a:hover {
    color: var(--header-gold);
}

.legal-hero__breadcrumb span {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.3);
}

/* =========================================================
   CONTENT SHELL
   ========================================================= */
.legal-content {
    background: var(--header-white);
    padding: 80px 0 100px;
}

.legal-content__inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

.legal-content__updated {
    color: #9ca3af;
    font-size: 13px;
    margin: 0 0 32px;
}

/* Baseline typography for plain admin-authored content (e.g. Terms &
   Conditions, pasted straight into the Page WYSIWYG) that isn't built from
   the .legal-section/.legal-content__intro markup below. The purifier only
   lets a limited tag set through (div, b/strong, i/em, u, a, ul/ol/li,
   p[style], br, span[style], img) - style these generically so any of
   those looks reasonable without page-specific markup. */
.legal-content__inner > p,
.legal-content__inner > div > p {
    color: #4b5563;
    font-size: 15px;
    line-height: 1.8;
    margin: 0 0 16px;
}

.legal-content__inner > ul,
.legal-content__inner > ol,
.legal-content__inner > div > ul,
.legal-content__inner > div > ol {
    color: #4b5563;
    font-size: 15px;
    line-height: 1.8;
    margin: 0 0 16px;
    padding-left: 22px;
}

.legal-content__inner li {
    margin-bottom: 8px;
}

.legal-content__inner a {
    color: var(--header-gold-hover);
}

.legal-content__inner strong,
.legal-content__inner b {
    color: var(--header-navy);
}

.legal-content__inner img {
    max-width: 100%;
    height: auto;
}

.legal-content__intro {
    margin-bottom: 48px;
}

.legal-content__intro p {
    color: #4b5563;
    font-size: 16px;
    line-height: 1.8;
    margin: 0 0 16px;
}

/* =========================================================
   NUMBERED SECTIONS (Privacy Policy, Shipping/Delivery Policy,
   Disclaimer)
   ========================================================= */
.legal-content__sections {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.legal-section {
    display: flex;
    gap: 24px;
    padding-bottom: 36px;
    border-bottom: 1px solid #ececec;
}

.legal-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.legal-section__number {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(224, 166, 62, 0.12);
    color: var(--header-gold);
    font-family: var(--header-font-heading);
    font-weight: 700;
    font-size: 16px;
}

.legal-section__body {
    min-width: 0;
}

.legal-section__body h2 {
    font-family: var(--header-font-heading);
    font-weight: 700;
    color: var(--header-navy);
    font-size: 22px;
    line-height: 1.3;
    margin: 6px 0 14px;
}

.legal-section__body p {
    color: #4b5563;
    font-size: 15px;
    line-height: 1.8;
    margin: 0 0 14px;
}

.legal-section__body p:last-child {
    margin-bottom: 0;
}

.legal-section__list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legal-section__list:last-child {
    margin-bottom: 0;
}

.legal-section__list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 0;
}

.legal-section__list li i {
    flex-shrink: 0;
    margin-top: 4px;
    color: var(--header-gold);
    font-size: 12px;
}

/* =========================================================
   FAQ ACCORDION
   ========================================================= */
.legal-faq {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.legal-faq__item {
    border: 1px solid #ececec;
    border-radius: 10px;
    overflow: hidden;
}

.legal-faq__question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: var(--header-white);
    border: none;
    text-align: left;
    font-family: var(--header-font-body);
    font-weight: 600;
    font-size: 15px;
    color: var(--header-navy);
    cursor: pointer;
    list-style: none;
}

/* .legal-faq__item is a <details> element, .legal-faq__question its
   <summary> - reset the default disclosure triangle/marker so only our
   own .legal-faq__icon shows. */
.legal-faq__question::-webkit-details-marker {
    display: none;
}

.legal-faq__question::marker {
    content: '';
}

.legal-faq__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(224, 166, 62, 0.12);
    color: var(--header-gold);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.legal-faq__item[open] .legal-faq__icon {
    transform: rotate(45deg);
}

/* Override the browser's default "display: none" on closed <details>
   content with a max-height collapse instead, so opening/closing animates. */
.legal-faq__answer {
    display: block;
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
    transition: max-height 0.25s ease, padding 0.25s ease;
}

.legal-faq__item[open] .legal-faq__answer {
    max-height: 600px;
    padding: 0 20px 20px;
}

.legal-faq__answer p {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.75;
    margin: 0;
}

/* =========================================================
   CONTACT CARD
   ========================================================= */
.legal-contact-card {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-top: 56px;
    padding: 32px;
    border-radius: 14px;
    background: var(--header-navy);
    background-image: linear-gradient(135deg, var(--header-navy) 0%, var(--header-navy-light) 100%);
}

.legal-contact-card__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--header-gold);
    color: var(--header-navy);
    font-size: 18px;
}

.legal-contact-card__body h3 {
    font-family: var(--header-font-heading);
    font-weight: 700;
    color: var(--header-white);
    font-size: 19px;
    margin: 4px 0 10px;
}

.legal-contact-card__body > p {
    color: var(--header-text-muted);
    font-size: 14px;
    line-height: 1.7;
    margin: 0 0 18px;
}

.legal-contact-card__details {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legal-contact-card__details li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--header-text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 0;
}

.legal-contact-card__details a {
    color: var(--header-text-muted);
    text-decoration: none;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.legal-contact-card__details a:hover {
    color: var(--header-gold);
}

.legal-contact-card__details i {
    color: var(--header-gold);
    font-size: 13px;
    margin-top: 3px;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 640px) {
    .legal-hero {
        padding: 48px 0 40px;
    }

    .legal-hero__heading {
        font-size: 32px;
    }

    .legal-content {
        padding: 56px 0 70px;
    }

    .legal-section {
        gap: 16px;
    }

    .legal-section__number {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .legal-section__body h2 {
        font-size: 19px;
    }

    .legal-contact-card {
        flex-direction: column;
        padding: 24px;
    }
}
