/* ============================================================
   NHR Legal Pages v3 — LEGAL-3 / L6 UI Refinement
   Privacy / Terms / Cookie Notice. Production-safe refinement on top of accepted L1.
   Header integration remains unchanged; all rules stay scoped to .nhr-legal.
   ============================================================ */

.nhr-legal {
    --nhr-legal-navy: #0d0b21;
    --nhr-legal-primary: #605dba;
    --nhr-legal-primary-2: #7b68ee;
    --nhr-legal-teal: #2ab5a5;
    --nhr-legal-text: #1f2937;
    --nhr-legal-muted: #667085;
    --nhr-legal-border: #e5e7eb;
    --nhr-legal-surface: #ffffff;
    --nhr-legal-page: #f8fafc;

    /* Article UI callout surfaces mirrored locally on Legal pages. */
    --nhr-legal-callout-notice: #FEFCE8;
    --nhr-legal-callout-risk: #FEF0F0;
    --nhr-legal-callout-success: #EDFDF3;
    --nhr-legal-callout-info: #EFF6FF;
    --nhr-legal-callout-neutral: #F9FAFB;
    --nhr-legal-callout-insight: #FAF5FF;

    color: var(--nhr-legal-text);
    background: var(--nhr-legal-page);

    /* Global Header v2 is fixed. Offset the Legal surface itself rather than
       adding ad-hoc hero padding, matching the accepted Contact integration. */
    padding-top: var(--nhr-shell-header-height, 80px);
    max-width: 100%;
    overflow-x: hidden;
}

.admin-bar .nhr-legal {
    padding-top: calc(var(--nhr-shell-header-height, 80px) + 32px);
}

@supports (overflow: clip) {
    .nhr-legal {
        overflow-x: clip;
    }
}

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

/* Keep in-page anchors visible below the fixed Global Header. */
.nhr-legal [id] {
    scroll-margin-top: calc(var(--nhr-shell-header-height, 80px) + 24px);
}

.nhr-legal-container {
    width: min(100% - 32px, 1180px);
    margin-inline: auto;
}

/* Hero */
.nhr-legal-hero {
    position: relative;
    overflow: hidden;
    padding: 58px 0 62px;
    background:
        radial-gradient(circle at 14% 18%, rgba(96, 93, 186, .24), transparent 30%),
        radial-gradient(circle at 86% 80%, rgba(42, 181, 165, .14), transparent 28%),
        var(--nhr-legal-navy);
    color: #fff;
}

.nhr-legal-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.88), transparent 96%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.88), transparent 96%);
    pointer-events: none;
}

.nhr-legal-hero__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 44px;
    align-items: center;
}

.nhr-legal-hero__eyebrow {
    margin: 0 0 14px;
    color: #78ddd4;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.nhr-legal-hero h1 {
    max-width: 760px;
    margin: 0;
    color: #fff;
    font-size: clamp(2.2rem, 4.2vw, 3.6rem);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.nhr-legal-hero__lead {
    max-width: 720px;
    margin: 18px 0 0;
    color: rgba(255,255,255,.66);
    font-size: 1rem;
    line-height: 1.8;
    text-wrap: pretty;
}

.nhr-legal-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.nhr-legal-hero__pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 999px;
    background: rgba(255,255,255,.055);
    color: rgba(255,255,255,.78);
    max-width: 100%;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}

.nhr-legal-hero__pill i {
    color: #78ddd4;
}

.nhr-legal-hero__icon {
    width: 104px;
    height: 104px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.04));
    box-shadow: 0 20px 54px rgba(0,0,0,.22);
    color: #78ddd4;
    font-size: 36px;
}

/* Main reading area */
.nhr-legal-main {
    padding: 50px 0 66px;
}

.nhr-legal-article {
    width: min(100%, 920px);
    margin-inline: auto;
    padding: 40px 46px;
    border: 1px solid var(--nhr-legal-border);
    border-radius: 24px;
    background: var(--nhr-legal-surface);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .05);
}

.nhr-legal-intro {
    margin: 0 0 14px;
    padding: 0 0 30px;
    border-bottom: 1px solid var(--nhr-legal-border);
    color: #475467;
    font-size: 1.02rem;
    line-height: 1.95;
    text-wrap: pretty;
}

.nhr-legal-section {
    padding: 31px 0;
    border-bottom: 1px solid var(--nhr-legal-border);
}

.nhr-legal-section:last-child {
    padding-bottom: 4px;
    border-bottom: 0;
}

.nhr-legal-section h2 {
    margin: 0 0 15px;
    color: #101828;
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    line-height: 1.35;
    font-weight: 850;
    letter-spacing: -.015em;
    text-wrap: balance;
}

.nhr-legal-section h3 {
    margin: 0 0 8px;
    color: #101828;
    font-size: 1rem;
    line-height: 1.45;
    font-weight: 800;
}

.nhr-legal-section p,
.nhr-legal-section li {
    color: #596579;
    font-size: .98rem;
    line-height: 1.9;
}

.nhr-legal-section p {
    margin: 0 0 13px;
}

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

.nhr-legal-section a {
    color: var(--nhr-legal-primary);
    font-weight: 750;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.nhr-legal-section a:hover {
    color: #4f46a5;
}

.nhr-legal-section a,
.nhr-legal-contact,
.nhr-legal-footer-nav__links a {
    overflow-wrap: anywhere;
}

.nhr-legal a[href^="mailto:"] {
    direction: ltr;
    unicode-bidi: isolate;
}

.nhr-legal-list {
    display: grid;
    gap: 12px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.nhr-legal-list li {
    position: relative;
    padding-inline-start: 28px;
}

.nhr-legal-list li::before {
    content: "";
    position: absolute;
    inset-inline-start: 4px;
    top: .72em;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--nhr-legal-teal);
}

/* Compact information rows */
.nhr-legal-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.nhr-legal-fact {
    min-height: 116px;
    display: flex;
    flex-direction: column;
    padding: 18px;
    border: 1px solid var(--nhr-legal-border);
    border-radius: 16px;
    background: #fbfcfe;
}

.nhr-legal-fact__icon,
.nhr-legal-right__icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    margin-bottom: 11px;
    border-radius: 10px;
    background: rgba(96,93,186,.09);
    color: var(--nhr-legal-primary);
    font-size: 14px;
}

.nhr-legal-fact h3 {
    line-height: 1.5;
}

.nhr-legal-fact p {
    margin: 0;
    font-size: .9rem;
    line-height: 1.7;
}

/* Callouts ---------------------------------------------------------------
 * LEGAL-3 L1 cross-check: mirror the Production Article UI visual grammar
 * locally instead of loading article.css on Legal pages. The established
 * Article component uses soft semantic surfaces, a 1px border, 1rem radius,
 * subtle shadow and a short logical top accent (not the legacy side rail).
 * Existing Legal HTML classes remain valid so L1 requires no content rewrite.
 */
.nhr-legal-callout {
    --nhr-legal-callout-bg: var(--nhr-legal-callout-insight);
    --nhr-legal-callout-border: #E3DDF5;
    --nhr-legal-callout-accent: var(--nhr-legal-primary);
    --nhr-legal-callout-icon-bg: #F0EDFF;
    --nhr-legal-callout-icon: var(--nhr-legal-primary);

    position: relative;
    isolation: isolate;
    margin-block: 2rem;
    padding: 1.35rem 1.5rem;
    border: 1px solid var(--nhr-legal-callout-border);
    border-radius: 1rem;
    background: var(--nhr-legal-callout-bg);
    color: #334155;
    line-height: 1.8;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .045), inset 0 1px 0 rgba(255, 255, 255, .65);
}

.nhr-legal-callout::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset-block-start: -1px;
    inset-inline-start: 1.4rem;
    width: 2.5rem;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: var(--nhr-legal-callout-accent);
    opacity: .78;
}

/* Backward-compatible alias: current Legal v2 markup uses --teal. */
.nhr-legal-callout--teal,
.nhr-legal-callout--success {
    --nhr-legal-callout-bg: var(--nhr-legal-callout-success);
    --nhr-legal-callout-border: #CDEED8;
    --nhr-legal-callout-accent: #16A34A;
    --nhr-legal-callout-icon-bg: #DCFCE7;
    --nhr-legal-callout-icon: #15803D;
}

.nhr-legal-callout--info {
    --nhr-legal-callout-bg: var(--nhr-legal-callout-info);
    --nhr-legal-callout-border: #D7E7FB;
    --nhr-legal-callout-accent: #2563EB;
    --nhr-legal-callout-icon-bg: #DBEAFE;
    --nhr-legal-callout-icon: #1D4ED8;
}

.nhr-legal-callout--warning {
    --nhr-legal-callout-bg: var(--nhr-legal-callout-notice);
    --nhr-legal-callout-border: #EFE6A7;
    --nhr-legal-callout-accent: #B88708;
    --nhr-legal-callout-icon-bg: #FEF3C7;
    --nhr-legal-callout-icon: #A16207;
}

.nhr-legal-callout--risk {
    --nhr-legal-callout-bg: var(--nhr-legal-callout-risk);
    --nhr-legal-callout-border: #F1D1D1;
    --nhr-legal-callout-accent: #DC2626;
    --nhr-legal-callout-icon-bg: #FEE2E2;
    --nhr-legal-callout-icon: #B91C1C;
}

.nhr-legal-callout--neutral {
    --nhr-legal-callout-bg: var(--nhr-legal-callout-neutral);
    --nhr-legal-callout-border: #E3E7ED;
    --nhr-legal-callout-accent: #64748B;
    --nhr-legal-callout-icon-bg: #F1F5F9;
    --nhr-legal-callout-icon: #475569;
}

.nhr-legal-callout--insight {
    --nhr-legal-callout-bg: var(--nhr-legal-callout-insight);
    --nhr-legal-callout-border: #E3DDF5;
    --nhr-legal-callout-accent: var(--nhr-legal-primary);
    --nhr-legal-callout-icon-bg: #F0EDFF;
    --nhr-legal-callout-icon: var(--nhr-legal-primary);
}

.nhr-legal-callout > :first-child {
    margin-block-start: 0;
}

.nhr-legal-callout > :last-child {
    margin-block-end: 0;
}

.nhr-legal-callout h3 {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-block-end: .65rem;
    color: #1E293B;
    line-height: 1.5;
}

/* Current Legal markup already places Font Awesome icons inside H3. Turn that
   icon into a compact surface without coupling Legal pages to article.css. */
.nhr-legal-callout h3 i {
    width: 2.15rem;
    height: 2.15rem;
    display: inline-grid;
    place-items: center;
    flex: 0 0 2.15rem;
    border-radius: .65rem;
    background: var(--nhr-legal-callout-icon-bg);
    color: var(--nhr-legal-callout-icon);
    font-size: .9rem;
}

.nhr-legal-callout p,
.nhr-legal-callout ul,
.nhr-legal-callout ol {
    color: inherit;
}

.nhr-legal-callout p {
    margin: 0;
}

.nhr-legal-callout strong,
.nhr-legal-callout b {
    color: #1E293B;
}

/* Rights */
.nhr-legal-rights {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.nhr-legal-right {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 13px;
    align-items: start;
    padding: 14px 0;
    border-bottom: 1px solid #eef0f3;
}

.nhr-legal-right:last-child {
    border-bottom: 0;
}

.nhr-legal-right__icon {
    margin: 1px 0 0;
    background: rgba(42,181,165,.10);
    color: var(--nhr-legal-teal);
}

.nhr-legal-right h3 {
    margin-bottom: 4px;
}

.nhr-legal-right p {
    margin: 0;
    font-size: .92rem;
}

/* Contact */
.nhr-legal-contact {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin-top: 9px;
    padding: 10px 14px;
    border: 1px solid var(--nhr-legal-border);
    border-radius: 12px;
    background: #fbfcfe;
    color: var(--nhr-legal-text);
    text-decoration: none !important;
}

.nhr-legal-contact i {
    color: var(--nhr-legal-primary);
}

.nhr-legal-contact:hover {
    border-color: rgba(96, 93, 186, .36);
    background: #f8f7ff;
    color: #37327f;
}

/* Related legal navigation */
.nhr-legal-footer-nav {
    padding: 0 0 68px;
}

.nhr-legal-footer-nav__panel {
    width: min(100%, 920px);
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 24px;
    border: 1px solid var(--nhr-legal-border);
    border-radius: 18px;
    background: #fff;
}

.nhr-legal-footer-nav__copy strong {
    display: block;
    margin-bottom: 3px;
    color: #101828;
    font-size: 1rem;
}

.nhr-legal-footer-nav__copy span {
    color: var(--nhr-legal-muted);
    font-size: .9rem;
    line-height: 1.65;
}

.nhr-legal-footer-nav__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
}

.nhr-legal-footer-nav__links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid #dedff0;
    border-radius: 11px;
    color: #37327f;
    background: #fafaff;
    font-size: .86rem;
    font-weight: 800;
    text-decoration: none;
    transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.nhr-legal-footer-nav__links a:hover {
    border-color: rgba(96,93,186,.45);
    background: #f5f4ff;
    transform: translateY(-1px);
}

/* Keyboard focus — aligned with the Global Shell treatment. */
.nhr-legal a:focus-visible {
    outline: 3px solid rgba(78, 205, 196, .72);
    outline-offset: 3px;
    border-radius: .35rem;
}

/* RTL */
[dir="rtl"] .nhr-legal-hero__eyebrow {
    letter-spacing: .06em;
    text-transform: none;
}

[dir="rtl"] .nhr-legal-hero h1,
[dir="rtl"] .nhr-legal-section h2,
[dir="rtl"] .nhr-legal-section h3 {
    letter-spacing: 0;
}

[dir="rtl"] .nhr-legal-hero h1 {
    line-height: 1.22;
}

[dir="rtl"] .nhr-legal-section h2 {
    line-height: 1.5;
}

[dir="rtl"] .nhr-legal-section p,
[dir="rtl"] .nhr-legal-section li,
[dir="rtl"] .nhr-legal-intro {
    line-height: 2;
}

[dir="rtl"] .nhr-legal-footer-nav__links {
    justify-content: flex-start;
}

/* Responsive */
@media (max-width: 980px) and (min-width: 768px) {
    .nhr-legal-hero__inner {
        gap: 28px;
    }

    .nhr-legal-article {
        padding: 36px 34px;
    }

    .nhr-legal-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) and (min-width: 768px) {
    .nhr-legal-footer-nav__panel {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .nhr-legal-footer-nav__links {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 782px) {
    .admin-bar .nhr-legal {
        padding-top: calc(var(--nhr-shell-header-height, 68px) + 46px);
    }
}

@media (max-width: 767px) {
    .nhr-legal-container {
        width: min(100% - 28px, 1180px);
    }

    .nhr-legal-hero {
        padding: 38px 0 40px;
    }

    .nhr-legal-hero__inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .nhr-legal-hero h1 {
        font-size: clamp(2rem, 9vw, 2.5rem);
    }

    .nhr-legal-hero__lead {
        margin-top: 14px;
        font-size: .96rem;
        line-height: 1.75;
    }

    .nhr-legal-hero__meta {
        margin-top: 20px;
        gap: 8px;
    }

    .nhr-legal-hero__pill {
        min-height: 34px;
        padding: 7px 10px;
        font-size: 11.5px;
    }

    /* Decorative only; removing it on phones keeps Legal heroes concise. */
    .nhr-legal-hero__icon {
        display: none;
    }

    .nhr-legal-main {
        padding: 28px 0 38px;
    }

    .nhr-legal-article {
        padding: 24px 20px;
        border-radius: 18px;
    }

    .nhr-legal-intro {
        padding-bottom: 24px;
        line-height: 1.85;
    }

    .nhr-legal-section {
        padding: 24px 0;
    }

    .nhr-legal-section h2 {
        margin-bottom: 13px;
        font-size: clamp(1.28rem, 6vw, 1.48rem);
    }

    .nhr-legal-section p,
    .nhr-legal-section li {
        font-size: .94rem;
        line-height: 1.85;
    }

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

    .nhr-legal-fact {
        min-height: 0;
    }

    .nhr-legal-callout {
        margin-block: 1.5rem;
        padding: 1.15rem 1.1rem;
        border-radius: .9rem;
    }

    .nhr-legal-callout::before {
        inset-inline-start: 1.1rem;
    }

    .nhr-legal-callout h3 {
        align-items: flex-start;
        gap: .6rem;
    }

    .nhr-legal-footer-nav {
        padding-bottom: 46px;
    }

    .nhr-legal-footer-nav__panel {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
        padding: 19px;
    }

    .nhr-legal-footer-nav__links {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 420px) {
    .nhr-legal-container {
        width: min(100% - 20px, 1180px);
    }

    .nhr-legal-article {
        padding-inline: 17px;
        border-radius: 16px;
    }

    .nhr-legal-callout {
        padding: 1.05rem 1rem;
    }

    .nhr-legal-footer-nav__panel {
        padding: 17px;
        border-radius: 16px;
    }

    .nhr-legal-footer-nav__links a {
        width: 100%;
    }
}

@media (prefers-contrast: more) {
    .nhr-legal-article,
    .nhr-legal-fact,
    .nhr-legal-callout,
    .nhr-legal-contact,
    .nhr-legal-footer-nav__panel,
    .nhr-legal-footer-nav__links a {
        border-color: #94a3b8;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nhr-legal *,
    .nhr-legal *::before,
    .nhr-legal *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }

    .nhr-legal-footer-nav__links a:hover {
        transform: none;
    }
}

/* COOKIE-1 / C6.1 — Cookie Notice dynamic inventory -----------------------
 * Keep Complianz-generated content inside the existing Legal v3 surface.
 * The shortcode remains the owner of the live inventory and consent controls;
 * these rules only normalize spacing, typography, overflow and RTL behavior.
 */
.nhr-cookie-notice__inventory,
.nhr-cookie-notice__consent-manager {
    margin-top: 18px;
    max-width: 100%;
}

.nhr-cookie-notice__inventory {
    padding: 20px;
    border: 1px solid var(--nhr-legal-border);
    border-radius: 16px;
    background: #fbfcfe;
    overflow-x: auto;
}

.nhr-cookie-notice__inventory #cmplz-cookies-overview,
.nhr-cookie-notice__inventory #cmplz-document,
.nhr-cookie-notice__consent-manager #cmplz-manage-consent {
    max-width: 100%;
    font-family: inherit;
    color: var(--nhr-legal-text);
}

.nhr-cookie-notice__inventory h3,
.nhr-cookie-notice__inventory h4,
.nhr-cookie-notice__inventory h5,
.nhr-cookie-notice__consent-manager h3,
.nhr-cookie-notice__consent-manager h4 {
    color: #101828;
    font-family: inherit;
}

.nhr-cookie-notice__inventory a,
.nhr-cookie-notice__consent-manager a {
    color: var(--nhr-legal-primary);
    overflow-wrap: anywhere;
}

.nhr-cookie-notice__inventory table {
    max-width: 100%;
}

[dir="rtl"] .nhr-cookie-notice__inventory,
[dir="rtl"] .nhr-cookie-notice__consent-manager {
    text-align: start;
}

@media (max-width: 767px) {
    .nhr-cookie-notice__inventory {
        padding: 15px;
        border-radius: 14px;
    }
}
