/*
 * Legal pages (/policies/{slug}) — mobile-first raw CSS, matching the
 * nv-contact.css pattern (no live Tailwind build on this host, so only
 * already-compiled utility classes can be reused directly in markup; any
 * new styling here is written out in full rather than via @apply).
 *
 * Breakpoint plan (base = 320px, upgraded via min-width only):
 *   320 / 375 / 390 / 430px — single column. TOC collapses into a native
 *     <details> dropdown above the content (.nv-policy__toc-mobile shown,
 *     .nv-policy__toc-desktop hidden). Toolbar buttons wrap and stack.
 *   768px (tablet portrait) — TOC becomes a visible, non-collapsed left
 *     rail: 2-column grid (240px TOC + 1fr content). Toolbar goes to one row.
 *   1024px (tablet landscape / small laptop) — TOC sidebar becomes
 *     `position: sticky; top: 5.5rem` (same sticky pattern as the Contact
 *     page's channels card), content column widens.
 *   1280 / 1440 / 1920px — no further CSS needed: `.max-w-container`
 *     (1280px cap, from tailwind.config.js) already centers and bounds
 *     everything, same as the Contact page build.
 */

/* ---------- Breadcrumb ---------- */
.nv-policy__breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: rgba(41, 37, 34, 0.6);
}
.dark .nv-policy__breadcrumb { color: rgba(255, 255, 255, 0.6); }
.nv-policy__breadcrumb a { color: inherit; text-decoration: none; }
.nv-policy__breadcrumb a:hover { color: #C63A27; }
.nv-policy__breadcrumb [aria-current="page"] { color: #292522; font-weight: 600; }
.dark .nv-policy__breadcrumb [aria-current="page"] { color: #fff; }

/* ---------- Sibling quick-switch pills ---------- */
.nv-policy__siblings {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.nv-policy__pill {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #fff;
    border: 1px solid #E9E1DC;
    color: #292522;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.dark .nv-policy__pill { background: #241F1C; border-color: #3a332e; color: #fff; }
.nv-policy__pill:hover {
    border-color: #C63A27;
    color: #C63A27;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(198, 58, 39, 0.18);
}
.nv-policy__pill.is-active {
    background: linear-gradient(90deg, #C63A27, #E98232);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 18px rgba(198, 58, 39, 0.28);
}

/* ---------- Hero ---------- */
.nv-policy__hero {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.nv-policy__hero-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    background: rgba(198, 58, 39, 0.1);
    color: #C63A27;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nv-policy__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: rgba(41, 37, 34, 0.55);
}
.dark .nv-policy__meta { color: rgba(255, 255, 255, 0.55); }

/* ---------- Reading progress bar ---------- */
.nv-policy__progress {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 3px;
    background: rgba(41, 37, 34, 0.08);
    margin: 0 0 1rem;
    border-radius: 999px;
    overflow: hidden;
}
.dark .nv-policy__progress { background: rgba(255, 255, 255, 0.12); }
.nv-policy__progress span {
    display: block;
    height: 100%;
    width: 0%;
    background: #C63A27;
    transition: width 0.1s linear;
}

/* ---------- Toolbar ---------- */
.nv-policy__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid #E9E1DC;
    border-radius: 12px;
    background: #fff;
}
.dark .nv-policy__toolbar { background: #241F1C; border-color: #3a332e; }
.nv-policy__toolbar-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(41, 37, 34, 0.55);
}
.dark .nv-policy__toolbar-label { color: rgba(255, 255, 255, 0.55); }
.nv-policy__toolbar-group {
    display: inline-flex;
    gap: 0.25rem;
    border: 1px solid #E9E1DC;
    border-radius: 999px;
    padding: 0.15rem;
}
.dark .nv-policy__toolbar-group { border-color: #3a332e; }
.nv-policy__toolbar-group button {
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #292522;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}
.dark .nv-policy__toolbar-group button { color: #fff; }
.nv-policy__toolbar-group button:hover:not(.is-disabled) {
    background: linear-gradient(135deg, rgba(198, 58, 39, 0.14), rgba(233, 130, 50, 0.14));
    color: #C63A27;
    transform: scale(1.08);
}
.nv-policy__toolbar-group button.is-active { background: rgba(36, 80, 29, 0.12); color: #24501D; }
.nv-policy__toolbar-group button.is-disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- Shell: TOC + content ---------- */
.nv-policy__shell {
    display: block;
}

/* Mobile TOC (native <details> dropdown) */
.nv-policy__toc-mobile {
    margin-bottom: 1.5rem;
    border: 1px solid #E9E1DC;
    border-radius: 12px;
    background: #fff;
    padding: 0.85rem 1rem;
}
.dark .nv-policy__toc-mobile { background: #241F1C; border-color: #3a332e; }
.nv-policy__toc-mobile summary {
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    color: #292522;
}
.dark .nv-policy__toc-mobile summary { color: #fff; }
.nv-policy__toc-mobile ul { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.nv-policy__toc-mobile a { font-size: 0.85rem; color: rgba(41, 37, 34, 0.75); text-decoration: none; }
.dark .nv-policy__toc-mobile a { color: rgba(255, 255, 255, 0.75); }
.nv-policy__toc-mobile a:hover { color: #C63A27; }

/* Desktop TOC (hidden on mobile) */
.nv-policy__toc-desktop { display: none; }

/* FAQ, sections, feedback, report-cta all stack full-width at every size
   until the shell goes two-column at 768px below */
/* Text-size toolbar (A-/A+): rem is always relative to the ROOT font size,
   never to an ancestor's font-size, so a % change on .nv-policy__content
   itself has zero visible effect on any descendant declared in rem. Every
   rem-based font-size inside the content column is scaled instead via this
   custom property, set by JS (nv-policies.js) on #nv-policy-content. */
.nv-policy__content { --nv-font-scale: 1; }

.nv-policy__section { margin-bottom: 2.5rem; scroll-margin-top: 5.5rem; }
.nv-policy__section-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: Manrope, sans-serif;
    font-weight: 700;
    font-size: calc(1.25rem * var(--nv-font-scale, 1));
    margin-bottom: 0.85rem;
}

/* ---------- Colorful gradient headings with a right-to-left glow sweep ---------- */
.nv-policy__hero-title { margin-bottom: 0.5rem; }
.nv-policy__glow-text {
    position: relative;
    display: inline-block;
    background: linear-gradient(90deg, #C63A27 0%, #E98232 50%, #24501D 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: nvGlowShift 6s ease-in-out infinite;
    padding-bottom: 0.2em;
}
.nv-policy__glow-text--sm { font-size: inherit; padding-bottom: 0; }
/* Pulse/glow underline sweep: only on the top hero heading (H1), not on
   every section heading below it. */
.nv-policy__hero-title .nv-policy__glow-text::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #24501D, #E98232, #C63A27);
    background-size: 200% 100%;
    transform-origin: right center;
    animation: nvGlowSweep 2.6s ease-in-out infinite, nvGlowShift 6s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(233, 130, 50, 0.65), 0 0 18px rgba(198, 58, 39, 0.35);
}
@keyframes nvGlowShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes nvGlowSweep {
    0% { transform: scaleX(0); transform-origin: right center; opacity: 0.4; }
    45% { transform: scaleX(1); transform-origin: right center; opacity: 1; }
    55% { transform: scaleX(1); transform-origin: left center; opacity: 1; }
    100% { transform: scaleX(0); transform-origin: left center; opacity: 0.4; }
}
.nv-policy__copy-link {
    opacity: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: rgba(41, 37, 34, 0.4);
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}
.dark .nv-policy__copy-link { color: rgba(255, 255, 255, 0.4); }
.nv-policy__section-heading:hover .nv-policy__copy-link,
.nv-policy__copy-link:focus-visible { opacity: 1; }
.nv-policy__copy-link:hover { background: rgba(198, 58, 39, 0.1); color: #C63A27; }

.nv-policy__section-body { color: rgba(41, 37, 34, 0.85); line-height: 1.75; font-size: calc(0.95rem * var(--nv-font-scale, 1)); }
.dark .nv-policy__section-body { color: rgba(255, 255, 255, 0.85); }
.nv-policy__section-body p { margin-bottom: 0.9rem; }
.nv-policy__section-body a { color: #C63A27; text-decoration: underline; }

/* FAQ accordion — same visual language as the Contact page's nv-cfaq */
.nv-policy__faq { display: flex; flex-direction: column; gap: 0.6rem; }
.nv-policy__faq-item {
    border: 1px solid #E9E1DC;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background: #fff;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.dark .nv-policy__faq-item { background: #241F1C; border-color: #3a332e; }
.nv-policy__faq-item:hover {
    border-color: #E98232;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(233, 130, 50, 0.14);
}
.nv-policy__faq-item[open] { border-color: #C63A27; box-shadow: 0 10px 24px rgba(198, 58, 39, 0.12); }
.nv-policy__faq-item summary { font-weight: 600; font-size: calc(0.9rem * var(--nv-font-scale, 1)); cursor: pointer; color: #292522; }
.dark .nv-policy__faq-item summary { color: #fff; }
.nv-policy__faq-item p { margin-top: 0.6rem; font-size: calc(0.85rem * var(--nv-font-scale, 1)); color: rgba(41, 37, 34, 0.75); }
.dark .nv-policy__faq-item p { color: rgba(255, 255, 255, 0.75); }

/* Feedback widget */
.nv-policy__feedback {
    margin-top: 2rem;
    padding: 1rem;
    border: 1px dashed #E9E1DC;
    border-radius: 12px;
    text-align: center;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.dark .nv-policy__feedback { border-color: #3a332e; }
.nv-policy__feedback:hover { border-color: #24501D; box-shadow: 0 10px 24px rgba(36, 80, 29, 0.1); }
.nv-policy__feedback p { font-size: calc(0.85rem * var(--nv-font-scale, 1)); font-weight: 600; color: #292522; margin-bottom: 0.6rem; }
.dark .nv-policy__feedback p { color: #fff; }
.nv-policy__feedback-btns { display: flex; justify-content: center; gap: 0.5rem; }
.nv-policy__feedback-btns button {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #E9E1DC;
    font-size: calc(0.8rem * var(--nv-font-scale, 1));
    font-weight: 600;
    color: #292522;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.dark .nv-policy__feedback-btns button { color: #fff; border-color: #3a332e; }
.nv-policy__feedback-btns button:hover { border-color: #C63A27; color: #C63A27; transform: translateY(-1px) scale(1.04); }
.nv-policy__feedback[data-state="voted"] .nv-policy__feedback-btns { display: none; }
.nv-policy__feedback-thanks { font-size: calc(0.8rem * var(--nv-font-scale, 1)); color: #24501D; font-weight: 600; }

/* Report-a-concern CTA */
.nv-policy__report-cta {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: #FFF7F2;
    border: 1px solid transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.dark .nv-policy__report-cta { background: #241F1C; }
.nv-policy__report-cta:hover {
    transform: translateY(-2px);
    border-color: #E98232;
    box-shadow: 0 12px 28px rgba(233, 130, 50, 0.18);
}
.nv-policy__report-cta svg { color: #E98232; flex-shrink: 0; }
.nv-policy__report-cta-title { font-weight: 700; font-size: calc(0.9rem * var(--nv-font-scale, 1)); color: #292522; }
.dark .nv-policy__report-cta-title { color: #fff; }
.nv-policy__report-cta-body { font-size: calc(0.8rem * var(--nv-font-scale, 1)); color: rgba(41, 37, 34, 0.7); }
.dark .nv-policy__report-cta-body { color: rgba(255, 255, 255, 0.7); }
.nv-policy__report-cta a { font-size: calc(0.85rem * var(--nv-font-scale, 1)); font-weight: 700; color: #C63A27; text-decoration: none; }
.nv-policy__report-cta a:hover { text-decoration: underline; }

/* ---------- 430px: large mobile — tidy up toolbar/pill wrapping ---------- */
@media (min-width: 430px) {
    .nv-policy__toolbar { flex-wrap: nowrap; }
}

/* ---------- 768px: tablet portrait — TOC becomes a visible sidebar ---------- */
@media (min-width: 768px) {
    .nv-policy__toc-mobile { display: none; }
    .nv-policy__toc-desktop { display: block; }

    .nv-policy__hero { flex-direction: row; align-items: flex-start; }

    .nv-policy__shell {
        display: grid;
        grid-template-columns: 240px 1fr;
        gap: 2.5rem;
        align-items: start;
    }

    .nv-policy__toc-desktop {
        border-right: 1px solid #E9E1DC;
        padding-right: 1.25rem;
    }
    .dark .nv-policy__toc-desktop { border-color: #3a332e; }
    .nv-policy__toc-title {
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: rgba(41, 37, 34, 0.5);
        margin-bottom: 0.75rem;
    }
    .dark .nv-policy__toc-title { color: rgba(255, 255, 255, 0.5); }
    .nv-policy__toc-desktop ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
    .nv-policy__toc-desktop a {
        display: block;
        font-size: 0.82rem;
        color: rgba(41, 37, 34, 0.65);
        text-decoration: none;
        border-left: 2px solid transparent;
        padding: 0.3rem 0.6rem;
        margin-left: -0.6rem;
        border-radius: 0 8px 8px 0;
        transition: all 0.18s ease;
    }
    .dark .nv-policy__toc-desktop a { color: rgba(255, 255, 255, 0.65); }
    .nv-policy__toc-desktop a:hover {
        color: #C63A27;
        background: rgba(198, 58, 39, 0.06);
        transform: translateX(2px);
    }
    .nv-policy__toc-desktop a.is-active {
        color: #C63A27;
        border-left-color: #C63A27;
        background: rgba(198, 58, 39, 0.08);
        font-weight: 600;
    }
}

/* ---------- 1024px: tablet landscape / small laptop — sticky TOC ---------- */
@media (min-width: 1024px) {
    .nv-policy__shell { grid-template-columns: 260px 1fr; gap: 3.5rem; }
    .nv-policy__toc-desktop { position: sticky; top: 5.5rem; }
}

/* 1280 / 1440 / 1920px intentionally have no rules here — .max-w-container
   (1280px cap) already bounds and centers the whole section. */

@media (prefers-reduced-motion: reduce) {
    .nv-policy__progress span { transition: none; }
    .nv-policy__copy-link { transition: none; }
    .nv-policy__glow-text,
    .nv-policy__hero-title .nv-policy__glow-text::after {
        animation: none !important;
    }
    .nv-policy__hero-title .nv-policy__glow-text::after { transform: scaleX(1); opacity: 0.8; }
}
