/* Shared layout for policy pages that embed PDFs (Terms, Cookie, Data Storage, Arbitration) */
:root {
    --teal: #1A5F7A;
    --teal-dark: #134A5F;
    --gold: #D4AC0D;
    --cream: #F9F3E9;
    --white: #FFFFFF;
    --text-dark: #333333;
    --text-medium: #555555;
    --border-color: #E5E5E5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.7;
    background-color: var(--cream);
    overflow-x: clip;
    scroll-padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--teal);
}

.hero {
    background: linear-gradient(135deg, var(--teal) 0%, var(--gold) 100%);
    color: white;
    text-align: center;
    padding-top: clamp(2.75rem, 8vw, 3.75rem);
    padding-bottom: clamp(2.5rem, 7vw, 3.125rem);
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.hero h1 {
    font-size: clamp(1.65rem, 5vw + 0.6rem, 2.5rem);
    margin-bottom: 12px;
    color: white;
    text-wrap: balance;
}

.hero p {
    font-size: clamp(0.95rem, 2.2vw + 0.65rem, 1.1rem);
    opacity: 0.95;
    max-width: 40rem;
    margin: 0 auto;
    text-wrap: balance;
}

.policy-content {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding-top: clamp(2rem, 5vw, 3.125rem);
    padding-bottom: calc(
        clamp(4.5rem, 14vw, 6rem) + env(safe-area-inset-bottom, 0px) + 24px
    );
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.policy-content a {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
    hyphens: manual;
}

.policy-meta {
    background: var(--white);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    font-size: 0.95rem;
    color: var(--text-medium);
}

.policy-meta strong {
    color: var(--teal);
}

.policy-meta .effective {
    margin-bottom: 16px;
}

.policy-meta__dates {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.9em;
    line-height: 1.55;
    word-break: break-word;
}

@media (min-width: 520px) {
    .policy-meta__dates {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        column-gap: 0;
    }

    .policy-meta__line + .policy-meta__line::before {
        content: '|';
        margin: 0 0.6em;
        opacity: 0.55;
        font-weight: 400;
    }
}

.policy-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-top: 12px;
}

.policy-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 16px;
    background: var(--cream);
    color: var(--teal);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s;
    word-break: normal;
    overflow-wrap: break-word;
}

.policy-links a:hover {
    background: #E8DFD0;
}

.policy-links a.active {
    background: var(--teal);
    color: var(--white);
}

.policy-intro {
    background: #FEF3E2;
    border-left: 4px solid var(--gold);
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin-bottom: 40px;
    font-size: clamp(0.88rem, 2.5vw, 0.95rem);
    color: #6B4D00;
    font-weight: 500;
    line-height: 1.65;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Matches privacy-policy.html notice / closing acknowledgment blocks */
.consent-banner {
    background: #FEF3E2;
    border-left: 4px solid var(--gold);
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin-bottom: 40px;
    font-size: clamp(0.88rem, 2.5vw, 0.95rem);
    color: #6B4D00;
    font-weight: 500;
    line-height: 1.65;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.section {
    background: var(--white);
    border-radius: 12px;
    padding: 32px 28px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    max-width: 100%;
    overflow-x: clip;
}

.section h2 {
    font-size: clamp(1.2rem, 3.5vw + 0.5rem, 1.6rem);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--cream);
    text-wrap: balance;
}

.section h3 {
    font-size: clamp(1rem, 2vw + 0.55rem, 1.15rem);
    margin: 24px 0 12px;
    color: var(--teal);
    text-wrap: balance;
}

.section p {
    margin-bottom: 14px;
    color: var(--text-medium);
}

.section ul {
    padding-left: 24px;
    margin-bottom: 14px;
}

.section ul li {
    margin-bottom: 8px;
    color: var(--text-medium);
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

/* Scrollable table (matches privacy-policy.html) */
.policy-table-wrap {
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    outline: none;
    min-width: 0;
}

.policy-table-wrap:focus-visible {
    box-shadow: 0 0 0 2px var(--teal), 0 0 0 4px var(--cream);
}

.ai-table {
    width: 100%;
    min-width: 44rem;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.9rem;
}

.ai-table th {
    background: var(--teal);
    color: var(--white);
    padding: 12px 14px;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
}

.ai-table th:first-child { border-radius: 8px 0 0 0; }
.ai-table th:last-child { border-radius: 0 8px 0 0; }

.ai-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ai-table tr:last-child td { border-bottom: none; }
.ai-table tr:nth-child(even) { background: #FAFAF8; }

.ai-table a {
    color: var(--teal);
    text-decoration: none;
    font-weight: 500;
}

.ai-table a:hover { text-decoration: underline; }

.deletion-table {
    width: 100%;
    min-width: 20rem;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.9rem;
}

.policy-table-wrap--compact .deletion-table {
    min-width: 18rem;
}

.deletion-table th {
    background: var(--teal);
    color: var(--white);
    padding: 10px 12px;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
}

.deletion-table th:first-child { border-radius: 8px 0 0 0; }
.deletion-table th:last-child { border-radius: 0 8px 0 0; }

.deletion-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.deletion-table tr:last-child td { border-bottom: none; }
.deletion-table tr:nth-child(even) { background: #FAFAF8; }

.policy-doc-viewer {
    background: var(--white);
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
    max-width: 100%;
}

.policy-doc-viewer iframe {
    width: 100%;
    min-height: min(85vh, 1400px);
    border: 0;
    display: block;
}

.policy-doc-fallback {
    padding: 20px 24px;
    text-align: center;
    color: var(--text-medium);
    font-size: 0.95rem;
    line-height: 1.55;
}

.policy-doc-fallback a {
    color: var(--teal);
    font-weight: 500;
    word-break: break-word;
}

.pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 20px;
    background: var(--cream);
    border-radius: 8px;
    color: var(--teal);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.pdf-link:hover { background: #E8DFD0; }

.policy-page__footer {
    text-align: center;
    color: var(--text-medium);
    margin-top: clamp(1.5rem, 4vw, 2rem);
    font-size: clamp(0.85rem, 2.8vw, 0.9rem);
    line-height: 1.65;
    overflow-wrap: anywhere;
    padding: 0 4px;
}

.policy-page__footer a {
    word-break: break-word;
}

@media (max-width: 1024px) {
    .policy-meta {
        padding: 22px 24px;
    }

    .section {
        padding: 28px 24px;
    }
}

@media (max-width: 768px) {
    .policy-meta {
        padding: 20px 18px;
    }

    .section {
        padding: 24px 20px;
    }

    .ai-table, .deletion-table { font-size: 0.8rem; }
    .ai-table th, .ai-table td,
    .deletion-table th, .deletion-table td { padding: 8px 10px; }
}

@media (max-width: 480px) {
    .section {
        padding: 22px 16px;
    }

    .section ul {
        padding-left: 20px;
    }

    .policy-links {
        flex-direction: column;
    }

    .policy-links a {
        width: 100%;
        text-align: center;
    }

    .pdf-link {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }

    .policy-intro {
        padding: 14px 16px;
    }

    .consent-banner {
        padding: 14px 16px;
    }
}
