/* VN Elements — design tokens + shared page styles
   Source: Figma "Vista 101 mocks" via horizons/VN/Latest mockups (see context/vista-vn.md)
   Breakpoints: tablet ≤1024 · mobile ≤767 · small ≤480 */

/* ── Tokens ─────────────────────────────────────────────────────────── */

:root {
    /* Palette — Figma values consolidated; navy canonical value PROVISIONAL (#073172 vs #103271, open question) */
    --vn-navy:        #073172;
    --vn-navy-deep:   #012B63;
    --vn-footer:      #00316C;
    --vn-blue:        #3859A7;
    --vn-ink:         #222442;
    --vn-gold:        #C49237;
    --vn-white:       #FFFFFF;

    /* Light bands, cards, rules */
    --vn-mist:        #EAF1F9;
    --vn-mist-soft:   #F0F5FB;
    --vn-card:        #EFF4FC;
    --vn-card-deep:   #DCE8F6;
    --vn-circle:      #D5E2F5;
    --vn-scrim:       #D9EAF7;
    --vn-rule:        #B3D1FF;
    --vn-rule-soft:   #C7DAF0;
    --vn-rule-muted:  #7D92B2;

    /* Fonts */
    --vn-font-display: 'Lora', Georgia, serif;
    --vn-font-body:    'Afacad Flux', 'Helvetica Neue', Arial, sans-serif;
    --vn-font-script:  'Ms Madi', cursive;

    /* Type scale — fluid; 1920 Figma sizes are the max. Tuned per widget as they are built. */
    --vn-h1:        clamp(2.5rem, 1.6rem + 3vw, 4.25rem);
    --vn-h2:        clamp(1.75rem, 1.3rem + 1.4vw, 2.75rem);
    --vn-eyebrow:   clamp(1rem, 0.7rem + 0.9vw, 2.175rem);
    --vn-body-l:    clamp(1.125rem, 0.9rem + 0.7vw, 2rem);
    --vn-body:      clamp(1.0625rem, 0.95rem + 0.35vw, 1.375rem);

    /* Layout */
    --vn-content:   1600px;
    --vn-gutter:    clamp(16px, 4vw, 80px);
    --vn-radius:    16px;
}

/* ── Shared ─────────────────────────────────────────────────────────── */

.vn-script {
    font-family: var(--vn-font-script);
    font-weight: 400;
    letter-spacing: 0;
}

.vn-eyebrow {
    font-family: var(--vn-font-body);
    font-size: var(--vn-eyebrow);
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--vn-navy);
}

/* Widgets fill their container (BUG-039). Without an explicit width, Elementor's flex column
   measures the widget at an indefinite width, aspect-ratio photo boxes count as 0px tall, and the
   container ends up shorter than the grid — the next section overlaps it (seen at ≤480px). */
.e-con > .elementor-widget[class*="elementor-widget-vn-"] { width: 100%; }

/* Centered section heading (Home help grid + care cards) */
.vn-section-head .vn-section-heading {
    max-width: 1340px;
    margin: 0 auto clamp(36px, 4vw, 72px);
    padding: 0 24px;
    font-family: var(--vn-font-display);
    font-size: clamp(1.8rem, 2.1vw, 2.875rem);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.02em;
    text-align: center;
    color: var(--vn-navy);
}

/* Ruled variant: thin lines either side (Memory Care neighborhood) */
.vn-section-head--ruled .vn-section-heading {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2vw, 32px);
    max-width: 1709px;
    margin-bottom: clamp(28px, 3.5vw, 52px);
    padding: 0;
    font-size: clamp(1.7rem, 2vw, 2.375rem);
    white-space: nowrap;
}

.vn-section-head--ruled .vn-section-heading::before,
.vn-section-head--ruled .vn-section-heading::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--vn-rule-line, #CDD9EA);
}

@media (max-width: 1024px) {
    .vn-section-head .vn-section-heading { font-size: 1.6rem; margin-bottom: 32px; }
    .vn-section-head--ruled .vn-section-heading { gap: 20px; margin-bottom: 28px; }
}

@media (max-width: 767px) {
    .vn-section-head--ruled .vn-section-heading { white-space: normal; font-size: 1.4rem; gap: 14px; }
    .vn-section-head--ruled .vn-section-heading::before,
    .vn-section-head--ruled .vn-section-heading::after { flex: 0 0 20px; }
}

@media (max-width: 480px) {
    .vn-section-head .vn-section-heading { font-size: 1.35rem; padding: 0 16px; }
    .vn-section-head--ruled .vn-section-heading { font-size: 1.25rem; padding: 0; }
}

/* Images — two-class selectors beat `.elementor img { height:auto }` (BUG-024) */
.vn-img-cover,
.elementor .vn-img-cover {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: var(--vn-img-x, 50%) var(--vn-img-y, 50%);
}

/* Icons — set color + fill on wrapper, svg and shapes (BUG-025/026) */
.vn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--vn-navy);
    transition: color 0.2s ease;
}

.vn-icon i { color: inherit; }

.vn-icon svg {
    display: block;
    width: 48px;
    height: 48px;
}

.vn-icon .e-font-icon-svg,
.vn-icon .e-font-icon-svg path {
    fill: currentColor;
}

/* ── Scroll reveal (editor override BUG-010) ────────────────────────── */

.vn-js [data-vn-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.vn-js [data-vn-reveal].is-visible {
    opacity: 1;
    transform: none;
}

.elementor-editor-active [data-vn-reveal],
.elementor-editor-preview [data-vn-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .vn-js [data-vn-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
