/* ═══════════════════════════════════════════════
   Legal Pages — Terms, Privacy, Shipping
   2instincts design system extension
   ═══════════════════════════════════════════════ */

/* ── Layout ── */
.legal-layout {
    display: grid;
    gap: 3rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .legal-layout {
        grid-template-columns: 260px 1fr;
        gap: 4rem;
    }
}

/* ── TOC ── */
.legal-toc {
    position: relative;
}

@media (min-width: 1024px) {
    .legal-toc {
        position: sticky;
        top: 100px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

.legal-toc-title {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--brand-mist, #8A8A8A);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.legal-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.legal-toc a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.875rem;
    border-radius: 6px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--brand-slate, #4A4A4A);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    cursor: pointer;
    position: relative;
}

.legal-toc a::after {
    content: '→';
    font-size: 0.75rem;
    color: var(--brand-gold, #B8966A);
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s ease;
}

.legal-toc a:hover,
.legal-toc a:focus {
    background: rgba(184,150,106,0.1);
    color: var(--brand-ink, #1A1A1A);
    border-left-color: rgba(184,150,106,0.3);
}

.legal-toc a:hover::after,
.legal-toc a:focus::after {
    opacity: 1;
    transform: translateX(0);
}

.legal-toc a.active {
    border-left-color: var(--brand-gold, #B8966A);
    background: rgba(184,150,106,0.12);
    color: var(--brand-ink, #1A1A1A);
    font-weight: 600;
}

.legal-toc a.active::after {
    opacity: 1;
    transform: translateX(0);
}

/* ── Content ── */
.legal-content {
    max-width: 720px;
}

/* Last updated badge */
.legal-updated {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--brand-mist, #8A8A8A);
    margin-bottom: 2.5rem;
    padding: 0.4rem 0.875rem;
    background: rgba(0,0,0,0.02);
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.04);
}

.legal-updated::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-gold, #B8966A);
    opacity: 0.6;
}

/* Typography overrides for Wix HTML */
.legal-content h2 {
    font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: clamp(1.35rem, 2.5vw, 1.65rem);
    font-weight: 400;
    line-height: 1.25;
    color: var(--brand-ink, #1A1A1A);
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    scroll-margin-top: 90px;
}

.legal-content h2:first-child {
    margin-top: 0;
}

.legal-content h3 {
    font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--brand-ink, #1A1A1A);
    margin-top: 2.25rem;
    margin-bottom: 0.875rem;
    scroll-margin-top: 90px;
}

.legal-content p {
    font-size: 0.9375rem;
    line-height: 1.85;
    color: var(--brand-graphite, #3D3D3D);
    margin-bottom: 1.25rem;
}

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

.legal-content a {
    color: var(--brand-gold, #B8966A);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(184,150,106,0.4);
    transition: text-decoration-color 0.2s;
}

.legal-content a:hover {
    text-decoration-color: var(--brand-gold, #B8966A);
}

.legal-content strong,
.legal-content b {
    font-weight: 600;
    color: var(--brand-ink, #1A1A1A);
}

.legal-content em,
.legal-content i {
    font-style: italic;
    color: var(--brand-slate, #4A4A4A);
}

/* Lists */
.legal-content ul,
.legal-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.legal-content ul {
    list-style: none;
    padding-left: 0;
}

.legal-content ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.625rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--brand-graphite, #3D3D3D);
}

.legal-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand-gold, #B8966A);
    opacity: 0.5;
}

.legal-content ol {
    list-style: decimal;
    padding-left: 1.75rem;
}

.legal-content ol li {
    margin-bottom: 0.625rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--brand-graphite, #3D3D3D);
    padding-left: 0.5rem;
}

.legal-content ol li::marker {
    color: var(--brand-gold, #B8966A);
    font-weight: 500;
    font-size: 0.85rem;
}

/* Nested lists */
.legal-content ul ul,
.legal-content ol ol,
.legal-content ul ol,
.legal-content ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Blockquote */
.legal-content blockquote {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 3px solid var(--brand-gold, #B8966A);
    background: rgba(184,150,106,0.04);
    border-radius: 0 4px 4px 0;
    font-style: italic;
}

.legal-content blockquote p {
    margin-bottom: 0.75rem;
}

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

/* Tables (if any) */
.legal-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.legal-content th,
.legal-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.legal-content th {
    font-weight: 500;
    color: var(--brand-ink, #1A1A1A);
    background: rgba(0,0,0,0.02);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.legal-content td {
    color: var(--brand-graphite, #3D3D3D);
}

/* Section dividers (auto-generated) */
.legal-content hr {
    border: none;
    height: 1px;
    background: rgba(0,0,0,0.06);
    margin: 3rem 0;
}

/* Print */
@media print {
    .legal-toc {
        display: none;
    }
    .legal-layout {
        grid-template-columns: 1fr;
    }
}
