/* App-specific legal page; shared Nexus colors and typography live in style.css. */
.terms-page {
    font-size: 1rem;
}

.terms-page a:focus-visible {
    outline: 3px solid #0f7c90;
    outline-offset: 5px;
    border-radius: 3px;
}

.terms-page .site-header a:focus-visible,
.terms-page .site-footer a:focus-visible {
    outline-color: #ffffff;
}

.terms-skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    padding: 12px 18px;
    background: #ffffff;
    color: var(--navy-dark);
    transform: translateY(-180%);
}

.terms-skip-link:focus {
    transform: translateY(0);
}

.terms-header-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px 24px;
}

.terms-page .brand-subtitle {
    font-size: 0.875rem;
    letter-spacing: 0.04em;
}

.terms-hero {
    margin: 32px 0;
    padding: 44px 40px;
    border-radius: var(--radius-lg);
    background: var(--hero-bg);
    color: #ffffff;
    box-shadow: var(--shadow-card);
}

.terms-eyebrow {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.terms-hero h1 {
    margin: 12px 0;
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.15;
    font-weight: 800;
}

.terms-intro {
    max-width: 700px;
    font-size: 1.0625rem;
}

.terms-date {
    margin-top: 24px;
    font-size: 0.875rem;
}

.terms-date span {
    margin: 0 8px;
}

.terms-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
    gap: 32px;
    margin-bottom: 64px;
}

.terms-toc {
    position: sticky;
    top: 100px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    max-height: calc(100vh - 124px);
    overflow-y: auto;
}

.terms-sidebar {
    position: sticky;
    top: 100px;
}

.terms-toc h2 {
    margin-bottom: 16px;
    font-family: var(--font-heading);
    font-size: 1.125rem;
    color: var(--navy-dark);
}

.terms-toc ol {
    padding-left: 20px;
    font-size: 0.875rem;
    color: #475569;
}

.terms-toc li + li {
    margin-top: 10px;
}

.terms-toc a {
    color: #334155;
    text-decoration: none;
}

.terms-toc a:hover {
    color: var(--teal-dark);
    text-decoration: underline;
}

.terms-content {
    min-width: 0;
    padding: 12px 36px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    line-height: 1.8;
}

.terms-section {
    padding: 26px 0;
    scroll-margin-top: 100px;
}

.terms-section + .terms-section {
    border-top: 1px solid var(--border-light);
}

.terms-section h2 {
    margin-bottom: 16px;
    font-family: var(--font-heading);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--navy-dark);
}

.terms-section p + p,
.terms-section ul + p {
    margin-top: 14px;
}

.terms-section ul {
    margin: 14px 0;
    padding-left: 24px;
}

.terms-section li + li {
    margin-top: 8px;
}

.terms-section a {
    color: #0b6054;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.terms-section code {
    font-size: 0.9375rem;
    overflow-wrap: anywhere;
}

.terms-note {
    margin-top: 20px;
    padding: 18px 20px;
    background: #eff8f5;
    border-left: 4px solid var(--teal-medium);
    border-radius: 0 10px 10px 0;
}

.terms-note strong {
    display: block;
    margin-bottom: 4px;
    color: #134e4a;
}

.terms-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    padding: 20px;
    margin: 20px 0;
    background: #f1f5f9;
    border-radius: var(--radius-md);
}

.terms-contact-grid h3 {
    margin-bottom: 6px;
    font-size: 1rem;
    color: var(--navy-dark);
}

.terms-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    font-size: 0.875rem;
}

.terms-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.terms-footer a {
    color: #ffffff;
    text-underline-offset: 4px;
}

@media (max-width: 991px) {
    .terms-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .terms-sidebar,
    .terms-toc {
        position: static;
        max-height: none;
    }

    .terms-toc ol {
        columns: 2;
        column-gap: 36px;
    }

    .terms-toc li {
        break-inside: avoid;
    }
}

@media (max-width: 640px) {
    .terms-page .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .terms-page .nav-wrap {
        height: auto;
        min-height: 76px;
        gap: 16px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .terms-page .brand-link {
        gap: 8px;
    }

    .terms-page .brand-logo-img {
        width: 32px;
        height: 32px;
    }

    .terms-page .brand-title {
        font-size: 1.125rem;
    }

    .terms-header-links {
        gap: 8px 12px;
    }

    .terms-header-links .nav-link {
        font-size: 0.875rem;
    }

    .terms-hero {
        margin: 20px 0;
        padding: 28px 24px;
    }

    .terms-content {
        padding: 0 20px;
    }

    .terms-toc {
        padding: 20px;
    }

    .terms-toc ol {
        columns: 1;
    }

    .terms-contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html:has(.terms-page) {
        scroll-behavior: auto;
    }
}

@media print {
    .terms-page {
        background: #ffffff;
        color: #000000;
    }

    .terms-page .site-header,
    .terms-sidebar,
    .terms-page .site-footer,
    .terms-skip-link {
        display: none;
    }

    .terms-page .container,
    .terms-content {
        max-width: none;
        padding: 0;
    }

    .terms-hero {
        padding: 0 0 20px;
        background: none;
        color: #000000;
    }

    .terms-layout {
        display: block;
    }

    .terms-content,
    .terms-hero {
        border: 0;
        box-shadow: none;
    }

    .terms-section h2 {
        break-after: avoid;
    }

    .terms-note,
    .terms-contact-grid {
        break-inside: avoid;
    }
}
