/*
 * Shared styling for the four policy pages: terms, privacy, returns,
 * delivery.
 *
 * **One file rather than four inline <style> blocks**, which is what
 * privacy.php and terms.php each carried before - the same ~50 lines twice,
 * already slightly diverged, and re-downloaded on every page view. This is
 * cached once and versioned by mtime through tcnAsset().
 *
 * **Every colour is a token.** The old blocks hardcoded #8b4513 headings,
 * #5d4e37 body text and rgba(255,255,255,0.9) panels, so in dark mode the
 * page went dark around a set of glaring near-white cards. The storefront
 * redefines all of these under [data-theme="dark"]; nothing here needs to
 * know which theme is running.
 */

.legal-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.legal-page .legal-header {
    margin-bottom: 2rem;
}

.legal-page h1 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* The effective date. First thing asked in any dispute about which version
   somebody agreed to, so it sits under the title rather than in a footnote. */
.legal-page .legal-effective {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* A short plain-English summary above the formal text. Not a substitute for
   the terms and says so; it exists because a policy nobody reads protects
   nobody. */
.legal-page .legal-summary {
    background: var(--hover-bg);
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
    padding: 1.1rem 1.3rem;
    margin: 1.5rem 0 2.5rem;
}

.legal-page .legal-summary p {
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0 0 0.6rem;
}

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

.legal-page .legal-summary strong {
    color: var(--primary);
}

.legal-item {
    margin-bottom: 1.75rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
}

.legal-item h2 {
    color: var(--primary);
    font-size: 1.2rem;
    margin: 0 0 0.9rem;
    font-family: Georgia, 'Times New Roman', serif;
}

.legal-item h3 {
    color: var(--text-dark);
    font-size: 1rem;
    margin: 1.3rem 0 0.5rem;
}

.legal-item p,
.legal-item li {
    color: var(--text-dark);
    line-height: 1.65;
}

.legal-item p {
    margin: 0 0 0.8rem;
}

.legal-item p:last-child,
.legal-item ul:last-child,
.legal-item dl:last-child {
    margin-bottom: 0;
}

.legal-item ul {
    margin: 0 0 0.9rem;
    padding-left: 1.4rem;
}

.legal-item li {
    margin-bottom: 0.45rem;
}

.legal-item a {
    color: var(--primary);
}

/* Who we share data with, and what each one does with it - a definition
   list reads better than prose for this and is easier to keep current. */
.legal-item dl {
    margin: 0 0 0.9rem;
}

.legal-item dt {
    color: var(--text-dark);
    font-weight: 600;
    margin-top: 0.8rem;
}

.legal-item dd {
    color: var(--text-light);
    margin: 0.15rem 0 0;
    line-height: 1.6;
}

/* Used for the points a reader would be annoyed to discover later - import
   duties, the no-change-of-mind rule, the window for reporting damage. */
.legal-item .legal-callout {
    background: var(--hover-bg);
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    margin: 1rem 0;
}

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

.legal-contact {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
}

.legal-contact h2 {
    color: var(--primary);
    font-size: 1.2rem;
    margin: 0 0 0.9rem;
    font-family: Georgia, 'Times New Roman', serif;
}

.legal-contact p {
    color: var(--text-dark);
    line-height: 1.65;
    margin: 0 0 0.5rem;
}

.legal-contact address {
    color: var(--text-light);
    font-style: normal;
    line-height: 1.6;
    margin-top: 0.8rem;
}

/* Cross-links between the four policies, so a reader looking for the refund
   rule does not have to go back to the footer to find it. */
.legal-related {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.legal-related a {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.legal-related a:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--hover-bg);
}

@media (max-width: 576px) {
    .legal-page {
        padding: 1rem 0 3rem;
    }

    .legal-item {
        padding: 1.15rem;
    }
}
