/* Heart of Scotland Charity Digs — Shared modern legal page styling */

.legal-page {
    background: #f4f8f5;
    color: #172119;
}

.legal-shell {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
}

.legal-hero {
    position: relative;
    overflow: hidden;
    padding: 76px 0 68px;
    color: #fff;
    background:
        radial-gradient(circle at 82% 12%, rgba(95, 190, 139, 0.18), transparent 30%),
        linear-gradient(135deg, #0c281c, #174f38);
}

.legal-page-waiver .legal-hero {
    background:
        radial-gradient(circle at 82% 12%, rgba(222, 181, 89, 0.18), transparent 30%),
        linear-gradient(135deg, #17271f, #4a3b16);
}

.legal-page-terms .legal-hero {
    background:
        radial-gradient(circle at 82% 12%, rgba(113, 178, 229, 0.14), transparent 30%),
        linear-gradient(135deg, #0c281c, #163a31);
}

.legal-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 42px 42px;
}

.legal-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
    gap: 50px;
    align-items: center;
}

.legal-kicker {
    display: inline-block;
    color: #8ee0b1;
    font-size: .8rem;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.legal-page-waiver .legal-kicker {
    color: #efd08a;
}

.legal-hero h1 {
    margin: 12px 0 18px;
    color: #fff;
    font-size: clamp(3rem, 6vw, 5.5rem);
    line-height: .98;
    letter-spacing: -.055em;
}

.legal-hero-copy > p {
    max-width: 740px;
    margin: 0;
    color: rgba(255,255,255,.78);
    font-size: 1.08rem;
    line-height: 1.8;
}

.legal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-top: 28px;
}

.legal-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.72);
    font-size: .82rem;
    font-weight: 650;
}

.legal-meta-item svg {
    width: 17px;
    height: 17px;
    fill: #8ee0b1;
}

.legal-page-waiver .legal-meta-item svg {
    fill: #efd08a;
}

.legal-hero-card {
    padding: 30px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 22px;
    background: rgba(255,255,255,.08);
    box-shadow: 0 18px 45px rgba(0,0,0,.16);
    backdrop-filter: blur(10px);
}

.legal-hero-card-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 17px;
    background: rgba(142,224,177,.14);
    color: #98e7b9;
}

.legal-page-waiver .legal-hero-card-icon {
    background: rgba(239,208,138,.13);
    color: #efd08a;
}

.legal-hero-card-icon svg {
    width: 29px;
    height: 29px;
    fill: currentColor;
}

.legal-hero-card strong {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-size: 1.15rem;
}

.legal-hero-card p {
    margin: 0;
    color: rgba(255,255,255,.7);
    line-height: 1.6;
}

.legal-body {
    padding: 54px 0 80px;
}

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

.legal-sidebar {
    position: sticky;
    top: 92px;
}

.legal-toc,
.legal-sidebar-note {
    border: 1px solid #dbe6df;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(18,58,42,.055);
}

.legal-toc {
    padding: 20px;
}

.legal-toc-label {
    display: block;
    margin-bottom: 10px;
    color: #769083;
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.legal-toc nav {
    display: grid;
    gap: 2px;
}

.legal-toc a {
    display: block;
    padding: 8px 10px;
    border-radius: 9px;
    color: #5d6f65;
    text-decoration: none;
    font-size: .78rem;
    line-height: 1.35;
    transition: background .16s ease, color .16s ease;
}

.legal-toc a:hover,
.legal-toc a.is-active {
    background: #eaf4ee;
    color: #176643;
}

.legal-page-waiver .legal-toc a:hover,
.legal-page-waiver .legal-toc a.is-active {
    background: #f8f2e5;
    color: #7c5c18;
}

.legal-sidebar-note {
    margin-top: 16px;
    padding: 20px;
    background: #153f2d;
    color: #fff;
}

.legal-page-waiver .legal-sidebar-note {
    background: #4a3b16;
}

.legal-sidebar-note span {
    display: block;
    margin-bottom: 7px;
    color: #85dba9;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.legal-page-waiver .legal-sidebar-note span {
    color: #efd08a;
}

.legal-sidebar-note strong {
    display: block;
    font-size: .98rem;
}

.legal-sidebar-note p {
    margin: 8px 0 12px;
    color: rgba(255,255,255,.7);
    font-size: .8rem;
    line-height: 1.5;
}

.legal-sidebar-note a {
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    text-decoration: none;
}

.legal-content {
    min-width: 0;
}

.legal-section {
    scroll-margin-top: 110px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 20px;
    padding: 30px;
    border: 1px solid #dce7e0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(18,58,42,.045);
}

.legal-section-number {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #e7f3eb;
    color: #28764f;
    font-size: .77rem;
    font-weight: 900;
    letter-spacing: .05em;
}

.legal-page-waiver .legal-section-number {
    background: #f7efdc;
    color: #80621e;
}

.legal-section-content h2 {
    margin: 3px 0 15px;
    color: #11271b;
    font-size: clamp(1.45rem, 2.4vw, 1.9rem);
    line-height: 1.15;
    letter-spacing: -.03em;
}

.legal-section-content h3 {
    margin: 0 0 9px;
    color: #163626;
    font-size: 1rem;
}

.legal-section-content p,
.legal-section-content li {
    color: #617067;
    font-size: .95rem;
    line-height: 1.72;
}

.legal-section-content p {
    margin: 0 0 14px;
}

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

.legal-section-content ul {
    margin: 10px 0 14px;
    padding-left: 20px;
}

.legal-info-card {
    padding: 22px;
    margin-top: 16px;
    border: 1px solid #e0eae4;
    border-radius: 14px;
    background: #f9fbfa;
}

.legal-check-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 20px;
    padding-left: 0 !important;
    list-style: none;
}

.legal-check-list li {
    position: relative;
    padding-left: 25px;
}

.legal-check-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: #2e8b57;
    font-weight: 900;
}

.legal-risk-list li::before {
    content: "•";
    color: #8a6a20;
    font-size: 1.25rem;
    line-height: 1.25;
}

.legal-highlight-box {
    padding: 20px;
    margin-top: 14px;
    border-left: 4px solid #2e8b57;
    border-radius: 0 13px 13px 0;
    background: #f1f8f4;
}

.legal-highlight-box strong {
    display: block;
    margin-bottom: 7px;
    color: #164c35;
}

.legal-highlight-box p {
    margin: 0;
}

.legal-warning-box {
    border-left-color: #9d7622;
    background: #fbf5e8;
}

.legal-agreement-card {
    padding: 24px;
    border: 1px solid #dce7e0;
    border-radius: 16px;
    background: linear-gradient(145deg, #f8fbf9, #edf6f1);
}

.legal-agreement-card strong {
    display: block;
    margin-bottom: 8px;
    color: #173e2c;
}

.legal-contact-section {
    margin-bottom: 0;
}

.legal-contact-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding: 18px;
    border-radius: 14px;
    background: #153f2d;
    color: #fff;
}

.legal-contact-icon {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(255,255,255,.10);
    color: #8fe0b1;
}

.legal-contact-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.legal-contact-card strong,
.legal-contact-card a {
    display: block;
}

.legal-contact-card strong {
    margin-bottom: 4px;
}

.legal-contact-card a {
    color: #a8ecc4;
    font-size: .86rem;
    word-break: break-word;
}

@media (max-width: 960px) {
    .legal-hero-grid {
        grid-template-columns: 1fr;
    }

    .legal-hero-card {
        max-width: 520px;
    }

    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-sidebar {
        position: static;
    }

    .legal-toc {
        display: none;
    }

    .legal-sidebar-note {
        margin-top: 0;
    }
}

@media (max-width: 700px) {
    .legal-shell {
        width: min(100% - 24px, 1180px);
    }

    .legal-hero {
        padding: 52px 0 46px;
    }

    .legal-hero h1 {
        font-size: clamp(2.8rem, 13vw, 4.2rem);
    }

    .legal-body {
        padding: 28px 0 48px;
    }

    .legal-section {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 22px;
        border-radius: 16px;
    }

    .legal-section-number {
        width: 42px;
        height: 42px;
    }

    .legal-check-list {
        grid-template-columns: 1fr;
    }

    .legal-contact-card {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .legal-toc a {
        transition: none;
    }
}
