/* ============================================================
   Snap Media — Legal Pages Stylesheet
   ------------------------------------------------------------
   Shared by: privacy-policy, terms, cookie-policy,
              disclaimer, affiliate-terms, advertiser-terms
   Theme:     Cream + serif headings + dark green accents
   Compatible: iOS Safari, Android Chrome, modern browsers
   ============================================================ */

/* ---------- Root scope ---------- */
.lg {
    --lg-bg:          #f7f4ec;
    --lg-surface:     #ffffff;
    --lg-surface-2:   #f1eee5;
    --lg-ink:         #0f0f0f;
    --lg-ink-2:       #3a3a3a;
    --lg-muted:       #6b6b6b;
    --lg-line:        rgba(15, 15, 15, .10);
    --lg-line-2:      rgba(15, 15, 15, .18);
    --lg-brand:       #1a4d3a;
    --lg-brand-h:     #0f3d2e;
    --lg-on-brand:    #f5f2e8;
    --lg-accent:      #22c55e;
    --lg-warn:        #c9982b;
    --lg-brand-tint:  rgba(26, 77, 58, .08);
    --lg-brand-ring:  rgba(34, 197, 94, .35);
    --lg-font-d:      'Fraunces', 'Instrument Serif', 'Playfair Display', ui-serif, Georgia, serif;
    --lg-font-s:      'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --lg-r:           12px;
    --lg-r-sm:        8px;

    color: var(--lg-ink);
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
.lg *,
.lg *::before,
.lg *::after { box-sizing: border-box; }

/* ============================================================
   HERO META BAR — "Last updated · Effective · Applies worldwide"
   ============================================================ */
.lg-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    margin-top: .85rem;
    font-size: .82rem;
    color: var(--lg-muted);
}
.lg-meta span {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}
.lg-meta span::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--lg-accent);
    flex: 0 0 5px;
}

/* ============================================================
   LAYOUT — TOC + Content grid
   ============================================================ */
.lg-wrap {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
    align-items: start;
}
@media (min-width: 992px) {
    .lg-wrap {
        grid-template-columns: 260px minmax(0, 1fr);
        gap: 3rem;
    }
}

/* ============================================================
   TABLE OF CONTENTS
   - Sticky on desktop
   - Collapsible accordion on mobile/tablet
   ============================================================ */
.lg-toc {
    background: var(--lg-surface);
    border: 1px solid var(--lg-line);
    border-radius: var(--lg-r);
    padding: 1.25rem 1.35rem;
    position: sticky;
    top: 90px;
}
@media (max-width: 991px) {
    .lg-toc { position: static; }
    .lg-toc__body { display: none; }
    .lg-toc.is-open .lg-toc__body { display: block; }
}

.lg-toc__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .9rem;
    padding-bottom: .8rem;
    border-bottom: 1px solid var(--lg-line);
}
.lg-toc__title {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--lg-muted);
    margin: 0;
}

.lg-toc__toggle {
    display: none;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 1px solid var(--lg-line-2);
    border-radius: var(--lg-r-sm);
    padding: .35rem .65rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--lg-ink);
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
@media (max-width: 991px) {
    .lg-toc__toggle {
        display: inline-flex;
        align-items: center;
        gap: .35rem;
    }
}
.lg-toc__toggle svg {
    transition: transform .2s ease;
}
.lg-toc.is-open .lg-toc__toggle svg {
    transform: rotate(180deg);
}

.lg-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.lg-toc__list a {
    display: block;
    padding: .5rem .65rem;
    border-radius: var(--lg-r-sm);
    font-size: .86rem;
    line-height: 1.4;
    color: var(--lg-ink-2);
    text-decoration: none;
    transition: background .18s ease, color .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.lg-toc__list a:hover {
    background: var(--lg-brand-tint);
    color: var(--lg-brand);
}
.lg-toc__list a:focus-visible {
    outline: 2px solid var(--lg-brand-ring);
    outline-offset: 2px;
}
.lg-toc__list a.is-active {
    background: var(--lg-brand-tint);
    color: var(--lg-brand);
    font-weight: 600;
}

/* ============================================================
   CONTENT — article wrapper
   ============================================================ */
.lg-content {
    background: var(--lg-surface);
    border: 1px solid var(--lg-line);
    border-radius: var(--lg-r);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    min-width: 0; /* prevents grid overflow on long words */
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.lg-content > *:first-child { margin-top: 0; }
.lg-content > *:last-child { margin-bottom: 0; }

/* ---------- Headings ---------- */
.lg-content h2 {
    font-family: var(--lg-font-d);
    font-weight: 500;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    letter-spacing: -.015em;
    line-height: 1.25;
    color: var(--lg-ink);
    margin: 2.25rem 0 .9rem;
    scroll-margin-top: 90px;
}
.lg-content h2:first-of-type { margin-top: 0; }

.lg-content h3 {
    font-family: var(--lg-font-s);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--lg-ink);
    margin: 1.5rem 0 .5rem;
    letter-spacing: -.005em;
}

.lg-content h4 {
    font-family: var(--lg-font-s);
    font-weight: 600;
    font-size: .92rem;
    line-height: 1.45;
    color: var(--lg-ink);
    margin: 1.25rem 0 .4rem;
}

/* ---------- Paragraphs & lists ---------- */
.lg-content p {
    font-size: .95rem;
    line-height: 1.75;
    color: var(--lg-ink-2);
    margin: 0 0 1rem;
}

.lg-content ul,
.lg-content ol {
    margin: 0 0 1.25rem;
    padding-left: 1.35rem;
    color: var(--lg-ink-2);
    font-size: .95rem;
    line-height: 1.75;
}
.lg-content ul li,
.lg-content ol li {
    margin-bottom: .5rem;
}
.lg-content ul li::marker { color: var(--lg-accent); }
.lg-content ol li::marker {
    color: var(--lg-brand);
    font-weight: 600;
}
.lg-content li > ul,
.lg-content li > ol {
    margin-top: .5rem;
    margin-bottom: .5rem;
}

/* ---------- Links ---------- */
.lg-content a {
    color: var(--lg-brand);
    text-decoration: none;
    border-bottom: 1px solid var(--lg-line-2);
    padding-bottom: 1px;
    transition: border-color .2s ease, color .2s ease;
}
.lg-content a:hover {
    color: var(--lg-brand-h);
    border-color: var(--lg-brand);
}
.lg-content a:focus-visible {
    outline: 2px solid var(--lg-brand-ring);
    outline-offset: 2px;
    border-radius: 3px;
}

/* ---------- Strong / bold ---------- */
.lg-content strong {
    color: var(--lg-ink);
    font-weight: 600;
}

/* ---------- Blockquote ---------- */
.lg-content blockquote {
    margin: 1.25rem 0;
    padding: .75rem 1.1rem;
    border-left: 3px solid var(--lg-line-2);
    color: var(--lg-muted);
    font-style: italic;
    font-size: .93rem;
    line-height: 1.7;
}

/* ---------- Code ---------- */
.lg-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .85em;
    padding: .15rem .4rem;
    border-radius: 4px;
    background: var(--lg-surface-2);
    color: var(--lg-brand);
    word-break: break-word;
}

/* ---------- Horizontal rule ---------- */
.lg-content hr {
    border: 0;
    border-top: 1px solid var(--lg-line);
    margin: 2rem 0;
}

/* ---------- Images ---------- */
.lg-content img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--lg-r-sm);
    margin: 1rem 0;
}

/* ============================================================
   TABLES
   ============================================================ */
.lg-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.25rem;
    font-size: .88rem;
    color: var(--lg-ink-2);
}
.lg-content table th,
.lg-content table td {
    text-align: left;
    padding: .65rem .8rem;
    border-bottom: 1px solid var(--lg-line);
    vertical-align: top;
}
.lg-content table th {
    font-weight: 600;
    color: var(--lg-ink);
    background: var(--lg-surface-2);
    font-size: .76rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.lg-content table tr:last-child td {
    border-bottom: 0;
}

/* Mobile table: allow horizontal scroll */
@media (max-width: 640px) {
    .lg-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .lg-content table th,
    .lg-content table td {
        padding: .55rem .7rem;
        white-space: normal;
        min-width: 120px;
    }
}

/* ============================================================
   CALLOUTS
   ============================================================ */
.lg-callout {
    background: var(--lg-brand-tint);
    border-left: 3px solid var(--lg-accent);
    border-radius: var(--lg-r-sm);
    padding: 1rem 1.15rem;
    margin: 1.5rem 0;
}
.lg-callout p {
    margin: 0;
    font-size: .9rem;
    color: var(--lg-ink-2);
    line-height: 1.7;
}
.lg-callout p + p {
    margin-top: .5rem;
}
.lg-callout a {
    color: var(--lg-brand);
    border-bottom-color: transparent;
}
.lg-callout a:hover {
    border-bottom-color: var(--lg-brand);
}

/* Warning variant */
.lg-callout--warn {
    background: rgba(201, 152, 43, .10);
    border-left-color: var(--lg-warn);
}

/* Neutral / note variant */
.lg-callout--note {
    background: var(--lg-surface-2);
    border-left-color: var(--lg-line-2);
}

/* ============================================================
   CONTACT BLOCK — bottom of legal pages
   ============================================================ */
.lg-contact {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background: var(--lg-surface-2);
    border-radius: var(--lg-r);
    border: 1px solid var(--lg-line);
}
.lg-contact h3 {
    font-family: var(--lg-font-d);
    font-weight: 500;
    font-size: 1.15rem;
    margin: 0 0 .5rem;
    color: var(--lg-ink);
    letter-spacing: -.01em;
}
.lg-contact > p {
    margin: 0 0 .75rem;
    font-size: .92rem;
    line-height: 1.65;
    color: var(--lg-ink-2);
}
.lg-contact__rows {
    display: grid;
    gap: .85rem;
    margin-top: .85rem;
}
@media (min-width: 640px) {
    .lg-contact__rows {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.lg-contact__row {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    font-size: .88rem;
    color: var(--lg-ink-2);
    min-width: 0;
}
.lg-contact__row b {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--lg-muted);
    margin-bottom: .2rem;
}
.lg-contact__row span {
    color: var(--lg-ink);
    display: block;
    line-height: 1.5;
    overflow-wrap: break-word;
    word-break: break-word;
}
.lg-contact__row span a {
    color: var(--lg-ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease, color .2s ease;
}
.lg-contact__row span a:hover {
    color: var(--lg-brand);
    border-bottom-color: var(--lg-brand);
}
.lg-contact__row svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: var(--lg-brand);
    margin-top: 3px;
}

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
.lg-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--lg-brand);
    color: var(--lg-on-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(26, 77, 58, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 40;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.lg-top.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.lg-top:hover {
    transform: translateY(-3px);
}
.lg-top:focus-visible {
    outline: 3px solid var(--lg-brand-ring);
    outline-offset: 2px;
}
@media (max-width: 560px) {
    .lg-top {
        right: 1rem;
        bottom: 1rem;
        width: 42px;
        height: 42px;
    }
}

/* ============================================================
   RESPONSIVE — Tablet & Mobile tweaks
   ============================================================ */
@media (max-width: 768px) {
    .lg-content {
        padding: 1.35rem 1.15rem;
    }
    .lg-content h2 {
        margin-top: 2rem;
    }
    .lg-content h3 {
        margin-top: 1.35rem;
    }
    .lg-contact {
        padding: 1.25rem 1.15rem;
    }
}

@media (max-width: 480px) {
    .lg-meta {
        gap: .4rem 1rem;
        font-size: .78rem;
    }
    .lg-content {
        padding: 1.2rem 1rem;
    }
    .lg-content p,
    .lg-content ul,
    .lg-content ol {
        font-size: .92rem;
    }
    .lg-content ul,
    .lg-content ol {
        padding-left: 1.15rem;
    }
}

/* ============================================================
   ACCESSIBILITY — Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .lg *,
    .lg *::before,
    .lg *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
    .lg-top { transition: none; }
    .lg-toc__toggle svg { transition: none; }
}

/* ============================================================
   PRINT — Clean legal printouts
   ============================================================ */
@media print {
    .lg-toc,
    .lg-top {
        display: none !important;
    }
    .lg-wrap {
        display: block !important;
    }
    .lg-content {
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        background: #fff !important;
    }
    .lg-content a {
        color: #000 !important;
        border-bottom: 0 !important;
    }
    .lg-content a::after {
        content: " (" attr(href) ")";
        font-size: .8em;
        color: #555;
    }
    .lg-callout {
        border: 1px solid #ccc !important;
        background: #f5f5f5 !important;
    }
    .lg-contact {
        background: #f5f5f5 !important;
        border: 1px solid #ccc !important;
    }
    .lg-content h2,
    .lg-content h3 {
        page-break-after: avoid;
    }
    .lg-content table,
    .lg-content ul,
    .lg-content ol {
        page-break-inside: avoid;
    }
}

/* ============================================================
   HIGH CONTRAST MODE (Windows / forced-colors)
   ============================================================ */
@media (forced-colors: active) {
    .lg-toc,
    .lg-content,
    .lg-callout,
    .lg-contact {
        border: 1px solid CanvasText;
    }
    .lg-top {
        border: 1px solid CanvasText;
    }
    .lg-toc__list a.is-active {
        outline: 2px solid Highlight;
    }
}