/*
 * Legal pages (privacy, cookies, terms): same dark ground, type and accent as the homepage.
 * Header, buttons and footer styles come from godmode-home-v2/v3 through body.gm-homepage.
 */
body.gm-legal-page main {
    background: var(--gm-bg);
}

.gm-legal {
    background: var(--gm-bg);
    color: var(--gm-ink);
    font-family: "Barlow", system-ui, -apple-system, sans-serif;
    padding: calc(var(--gm-header-h) + clamp(48px, 8vw, 96px)) var(--gm-pad-x) clamp(72px, 10vw, 128px);
}

.gm-legal *,
.gm-legal *::before,
.gm-legal *::after {
    box-sizing: border-box;
}

.gm-legal__inner {
    width: 100%;
    max-width: var(--gm-max);
    margin-inline: auto;
}

.gm-legal__layout {
    display: grid;
    gap: 48px;
}

@media (min-width: 992px) {
    .gm-legal__layout {
        grid-template-columns: 260px minmax(0, 720px);
        gap: clamp(48px, 7vw, 112px);
        align-items: start;
        justify-content: center;
    }
}

/* Index: built from the h2 headings by godmode-legal.js, desktop only */
.gm-legal__toc {
    display: none;
}

@media (min-width: 992px) {
    .gm-legal__toc {
        display: block;
        position: sticky;
        top: calc(var(--gm-header-h) + 32px);
        max-height: calc(100vh - var(--gm-header-h) - 64px);
        overflow-y: auto;
        padding-right: 8px;
    }
}

.gm-legal__toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 2px;
}

.gm-legal__toc a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 500;
    color: var(--gm-soft);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.gm-legal__toc a:hover {
    color: var(--gm-ink);
    background: var(--gm-s1);
}

.gm-legal__toc a.is-active {
    color: var(--gm-ink);
    background: var(--gm-s2);
}

.gm-legal__body {
    min-width: 0;
    max-width: 720px;
}

.gm-legal__body h1 {
    margin: 0 0 16px;
    font-family: inherit;
    font-size: clamp(36px, 5.2vw, 64px);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--gm-ink);
    text-transform: none;
}

.gm-legal__body > p.text-muted {
    margin: 0 0 clamp(40px, 6vw, 72px);
    font-size: 16px;
    color: var(--gm-soft) !important;
}

.gm-legal__body p.text-muted em {
    font-style: normal;
}

.gm-legal__body h2 {
    margin: clamp(48px, 6vw, 72px) 0 16px;
    padding: 0;
    font-family: inherit;
    font-size: clamp(24px, 2.6vw, 32px);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--gm-ink);
    text-transform: none;
    scroll-margin-top: calc(var(--gm-header-h) + 24px);
}

.gm-legal__body h3 {
    margin: 32px 0 12px;
    font-family: inherit;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--gm-ink);
    text-transform: none;
}

.gm-legal__body p,
.gm-legal__body li {
    font-size: 17px;
    line-height: 1.75;
    color: var(--gm-ink);
}

.gm-legal__body p {
    margin: 0 0 16px;
}

.gm-legal__body ul,
.gm-legal__body ol {
    margin: 0 0 20px;
    padding-left: 22px;
    list-style: disc outside;
}

.gm-legal__body ol {
    list-style: decimal outside;
}

.gm-legal__body li {
    display: list-item;
    list-style: inherit;
    margin-bottom: 8px;
    padding-left: 4px;
}

.gm-legal__body li::marker {
    color: var(--gm-accent);
}

.gm-legal__body strong {
    font-weight: 600;
}

.gm-legal__body a:not(.gm-legal__back) {
    color: var(--gm-accent-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.gm-legal__body table {
    width: 100%;
    margin: 0 0 24px;
    border-collapse: collapse;
    font-size: 16px;
}

.gm-legal__body th,
.gm-legal__body td {
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
    color: var(--gm-ink);
}

.gm-legal__body th {
    background: var(--gm-s2);
    font-weight: 600;
}

.gm-legal__body td {
    background: var(--gm-s1);
}

.gm-legal__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    margin-top: clamp(40px, 6vw, 72px);
    padding: 14px 28px;
    border-radius: 999px;
    background: var(--gm-accent);
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.gm-legal__back:hover {
    background: var(--gm-accent-hover);
    transform: translateY(-2px);
}

.gm-legal__back:active {
    transform: scale(0.98);
}

.gm-legal a:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .gm-legal__back,
    .gm-legal__toc a {
        transition: none;
    }
}
