/* ============================================================
   LEGAL PAGES (Privacy Policy / Terms & Conditions)
   Shared styling — matches the site's brand, typography and
   spacing while staying lightweight (no canvas / three.js).
   ============================================================ */

/* ---------- Hero banner ---------- */
.legal-hero {
    position: relative;
    padding: 160px 0 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    overflow: hidden;
}

.legal-hero::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -100px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.legal-hero::after {
    content: '';
    position: absolute;
    bottom: -140px;
    left: -80px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.12);
}

.legal-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.legal-hero .section-label {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.legal-hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 16px 0 14px;
}

.legal-hero p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 640px;
}

.legal-hero .legal-updated {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 6px 16px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.78rem;
    font-weight: 600;
}

/* ---------- Body layout: sticky TOC + prose ---------- */
.legal-body {
    padding: 64px 0 96px;
    background: var(--white);
}

.legal-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
}

/* Sidebar table of contents */
.legal-toc {
    position: sticky;
    top: 120px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 22px 20px;
}

.legal-toc h4 {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 14px;
}

.legal-toc ol {
    list-style: none;
    counter-reset: legal-toc-counter;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.legal-toc a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
    line-height: 1.4;
    transition: var(--transition);
}

.legal-toc a::before {
    content: counter(legal-toc-counter);
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.legal-toc a:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.legal-toc a:hover::before {
    background: var(--primary);
    color: #fff;
}

/* Mobile TOC: rendered as a horizontally-scrollable chip row instead
   of a sticky sidebar (see media query below). */
.legal-toc-mobile {
    display: none;
}

/* ---------- Prose content ---------- */
.legal-content {
    max-width: 760px;
    color: var(--gray-700);
    min-width: 0;
}

.legal-content section {
    scroll-margin-top: 130px;
    padding-bottom: 40px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--gray-100);
}

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

.legal-content .legal-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 800;
    margin-right: 12px;
    flex-shrink: 0;
}

.legal-content h2 {
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}

.legal-content h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 22px 0 10px;
}

.legal-content p {
    font-size: 0.98rem;
    line-height: 1.8;
    margin-bottom: 14px;
}

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

.legal-content ul,
.legal-content ol.legal-list {
    margin: 0 0 14px 0;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legal-content ul li,
.legal-content ol.legal-list li {
    position: relative;
    padding-left: 26px;
    font-size: 0.96rem;
    line-height: 1.7;
    color: var(--gray-700);
}

.legal-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teal);
}

.legal-content ol.legal-list {
    counter-reset: legal-item;
}

.legal-content ol.legal-list li::before {
    counter-increment: legal-item;
    content: counter(legal-item);
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.legal-content a.inline-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-content strong {
    color: var(--gray-900);
}

.legal-highlight-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--teal);
    border-radius: 12px;
    padding: 18px 20px;
    margin: 18px 0;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--gray-600);
}

/* Simple responsive table for e.g. data-retention / cookie tables */
.legal-table-wrap {
    overflow-x: auto;
    margin: 18px 0;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
}

.legal-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.legal-table th,
.legal-table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.legal-table th {
    background: var(--gray-50);
    color: var(--gray-900);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.legal-table tr:last-child td {
    border-bottom: none;
}

/* Contact card at the bottom of each legal page */
.legal-contact-card {
    margin-top: 8px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 26px 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px 32px;
    align-items: center;
    justify-content: space-between;
}

.legal-contact-card .lcc-text h4 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.legal-contact-card .lcc-text p {
    font-size: 0.88rem;
    color: var(--gray-500);
    margin: 0;
}

.legal-contact-card .lcc-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.legal-contact-card .lcc-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 100px;
    background: #fff;
    border: 1px solid var(--gray-200);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    transition: var(--transition);
    white-space: nowrap;
}

.legal-contact-card .lcc-links a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Cross-link between the two legal pages */
.legal-crosslink {
    margin-top: 28px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-500);
}

.legal-crosslink a {
    color: var(--primary);
    font-weight: 700;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .legal-layout {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 36px;
    }
    .legal-hero {
        padding: 150px 0 48px;
    }
    .legal-hero h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 860px) {
    /* Collapse the sticky sidebar TOC into a horizontally scrollable
       chip row pinned above the content — keeps quick section-jumping
       without eating vertical space on phones/tablets. */
    .legal-layout {
        display: block;
    }
    .legal-toc {
        display: none;
    }
    .legal-toc-mobile {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4px 4px 14px;
        margin-bottom: 28px;
        border-bottom: 1px solid var(--gray-100);
        scrollbar-width: thin;
    }
    .legal-toc-mobile::-webkit-scrollbar {
        height: 4px;
    }
    .legal-toc-mobile::-webkit-scrollbar-thumb {
        background: var(--gray-200);
        border-radius: 4px;
    }
    .legal-toc-mobile a {
        flex-shrink: 0;
        padding: 8px 16px;
        border-radius: 100px;
        background: var(--gray-50);
        border: 1px solid var(--gray-200);
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--gray-600);
        white-space: nowrap;
        transition: var(--transition);
    }
    .legal-toc-mobile a:hover,
    .legal-toc-mobile a:active {
        background: var(--primary);
        border-color: var(--primary);
        color: #fff;
    }
    .legal-content {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .legal-hero {
        padding: 138px 0 40px;
    }
    .legal-hero h1 {
        font-size: 1.7rem;
    }
    .legal-hero p {
        font-size: 0.95rem;
    }
    .legal-body {
        padding: 48px 0 64px;
    }
    .legal-content section {
        scroll-margin-top: 96px;
        padding-bottom: 28px;
        margin-bottom: 28px;
    }
    .legal-content h2 {
        font-size: 1.18rem;
    }
    .legal-content .legal-num {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
        margin-right: 10px;
    }
    .legal-contact-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px 20px;
    }
    .legal-contact-card .lcc-links {
        width: 100%;
    }
    .legal-contact-card .lcc-links a {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .legal-hero {
        padding: 128px 0 36px;
    }
    .legal-hero h1 {
        font-size: 1.45rem;
    }
    .legal-hero .legal-updated {
        font-size: 0.7rem;
        padding: 5px 12px;
    }
    .legal-content h2 {
        font-size: 1.05rem;
    }
    .legal-content p,
    .legal-content ul li,
    .legal-content ol.legal-list li {
        font-size: 0.92rem;
    }
    .legal-table {
        min-width: 420px;
        font-size: 0.8rem;
    }
}
