/* ==========================================================================
   WESTORX Hero Editorial — Premium Split Layout
   ========================================================================== */

.hero-editorial {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--header-height) - 38px);
    min-height: 600px;
    max-height: 850px;
    background: var(--color-white);
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

/* Make the parent .site-main start exactly under the header on homepage. */
.home .site-main,
.page-template-front-page .site-main {
    margin-top: calc(var(--header-height) - 0px) !important;
    padding-top: 0 !important;
}

body:not(.has-announcement).home .site-main {
    margin-top: calc(var(--header-height) - 0px) !important;
}

body:not(.has-announcement) .hero-editorial {
    height: calc(100vh - var(--header-height));
}

/* On mobile, announcement bar might be smaller — keep site-main margin correct */
@media (max-width: 767px) {
    .home .site-main,
    .page-template-front-page .site-main {
        margin-top: calc(var(--header-height) - 10px) !important;
    }
}

/* ── Side vertical watermark ────────────────────────────────────────────── */
.hero-watermark {
    position: absolute;
    top: 50%;
    left: 24px;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left center;
    font-family: var(--font-primary);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--color-gray-3);
    white-space: nowrap;
    z-index: 5;
    pointer-events: none;
}

/* ── Slide counter top right ────────────────────────────────────────────── */
.hero-counter {
    position: absolute;
    top: 40px;
    right: 40px;
    z-index: 5;
    font-family: var(--font-primary);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    color: var(--color-black);
    display: flex;
    align-items: center;
    gap: 8px;
}
.hero-counter-current {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-accent);
    line-height: 1;
    min-width: 28px;
    display: inline-block;
    transition: opacity .3s ease;
}
.hero-counter-divider {
    color: var(--color-gray-3);
    margin: 0 2px;
}
.hero-counter-total {
    color: var(--color-gray-3);
    font-size: 0.85rem;
}

/* ── Slides container ───────────────────────────────────────────────────── */
.hero-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .8s ease, visibility .8s ease;
    pointer-events: none;
}
.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
}

/* ── Grid: 50/50 split text + image ─────────────────────────────────────── */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
    width: 100%;
    min-height: 0; /* allow grid items to shrink properly */
}

/* Ensure both columns fill 100% height */
.hero-grid > * {
    height: 100%;
    min-height: 0;
}

/* ── Text side ──────────────────────────────────────────────────────────── */
.hero-text {
    padding: 0 8% 0 12%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    max-width: 720px;
    background: var(--color-white);
    height: 100%;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin: 0 0 32px 0;
    opacity: 0;
    transform: translateY(20px);
}
.hero-slide.is-active .hero-eyebrow {
    animation: hero-fade-up .9s cubic-bezier(.2,.7,.3,1) .2s forwards;
}

.hero-eyebrow-line {
    display: inline-block;
    width: 40px;
    height: 1px;
    background: var(--color-accent);
}

.hero-headline {
    font-family: var(--font-secondary);
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.01em;
    color: var(--color-black);
    margin: 0 0 28px 0;
}
.hero-headline-line {
    display: block;
    opacity: 0;
    transform: translateY(40px);
}
.hero-slide.is-active .hero-headline-line:nth-child(1) {
    animation: hero-fade-up 1s cubic-bezier(.2,.7,.3,1) .35s forwards;
}
.hero-slide.is-active .hero-headline-line:nth-child(2) {
    animation: hero-fade-up 1s cubic-bezier(.2,.7,.3,1) .5s forwards;
}

.hero-headline-accent {
    font-style: italic;
    color: var(--color-accent);
    position: relative;
}

.hero-lede {
    font-size: 1.05rem;
    line-height: 1.65;
    color: #4a4a4a;
    margin: 0 0 40px 0;
    max-width: 460px;
    font-weight: 300;
    letter-spacing: 0.01em;
    opacity: 0;
    transform: translateY(20px);
}
.hero-slide.is-active .hero-lede {
    animation: hero-fade-up 1s cubic-bezier(.2,.7,.3,1) .7s forwards;
}

/* ── Actions ────────────────────────────────────────────────────────────── */
.hero-actions {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(20px);
}
.hero-slide.is-active .hero-actions {
    animation: hero-fade-up 1s cubic-bezier(.2,.7,.3,1) .9s forwards;
}

.hero-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--color-black);
    color: var(--color-white);
    padding: 18px 32px;
    font-family: var(--font-primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid var(--color-black);
    transition: background var(--transition), border-color var(--transition), gap var(--transition);
}
.hero-btn-primary svg {
    transition: transform var(--transition);
}
.hero-btn-primary:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    gap: 16px;
}
.hero-btn-primary:hover svg {
    transform: translateX(4px);
}

.hero-btn-link {
    position: relative;
    display: inline-block;
    color: var(--color-black);
    font-family: var(--font-primary);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    padding-bottom: 6px;
    transition: color var(--transition);
}
.hero-btn-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--color-accent);
    transform: scaleX(0.5);
    transform-origin: left;
    transition: transform var(--transition), background var(--transition);
}
.hero-btn-link:hover {
    color: var(--color-accent);
}
.hero-btn-link:hover::after {
    transform: scaleX(1);
}

/* ── Visual side ────────────────────────────────────────────────────────── */
.hero-visual {
    position: relative;
    overflow: hidden;
    background: var(--color-gray-1);
}

.hero-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    /* Fallback gradient for missing images */
    background-image: linear-gradient(135deg, rgba(200, 169, 110, 0.15) 0%, rgba(10, 10, 10, 0.7) 50%, #0a0a0a 100%);
    transform: scale(1.05);
    opacity: 0.9;
    transition: transform 10s ease-out;
}
.hero-slide.is-active .hero-image {
    animation: hero-kenburns 12s ease-out forwards;
}

.hero-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.25) 100%);
    pointer-events: none;
}

.hero-visual-tag {
    position: absolute;
    bottom: 40px;
    right: 40px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--color-black);
    padding: 8px 18px;
    font-family: var(--font-primary);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    z-index: 3;
    opacity: 0;
    transform: translateY(20px);
}
.hero-slide.is-active .hero-visual-tag {
    animation: hero-fade-up 1s cubic-bezier(.2,.7,.3,1) 1.1s forwards;
}

/* ── Navigation (bottom center) ─────────────────────────────────────────── */
.hero-nav {
    position: absolute;
    bottom: 50px;
    left: 12%;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 24px;
}

.hero-nav-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--color-gray-2);
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-black);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    padding: 0;
}
.hero-nav-btn:hover {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
}

.hero-dots {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-dot {
    width: 36px;
    height: 2px;
    background: var(--color-gray-2);
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background var(--transition);
}
.hero-dot.is-active {
    background: rgba(200, 169, 110, 0.25);
}
.hero-dot-progress {
    position: absolute;
    inset: 0;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
}
.hero-dot.is-active .hero-dot-progress {
    animation: hero-dot-fill 6s linear forwards;
}

/* ── Scroll indicator bottom right ──────────────────────────────────────── */
.hero-scroll {
    position: absolute;
    bottom: 50px;
    right: 12%;
    z-index: 5;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--color-black);
    font-family: var(--font-primary);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    opacity: 0;
}
.hero-slide.is-active ~ .hero-scroll,
.hero-editorial .hero-scroll {
    animation: hero-fade-up 1s cubic-bezier(.2,.7,.3,1) 1.4s forwards;
}
.hero-scroll-text {
    transform: rotate(0deg);
    writing-mode: horizontal-tb;
}
.hero-scroll-line {
    width: 1px;
    height: 40px;
    background: var(--color-black);
    position: relative;
    overflow: hidden;
}
.hero-scroll-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-accent);
    transform: translateY(-100%);
    animation: hero-scroll-pulse 2s ease-in-out infinite;
}

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes hero-fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes hero-kenburns {
    from { transform: scale(1.05); opacity: 0.9; }
    to   { transform: scale(1.15); opacity: 1; }
}

@keyframes hero-dot-fill {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

@keyframes hero-scroll-pulse {
    0%   { transform: translateY(-100%); }
    50%  { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

/* ── Tablet ─────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .hero-text {
        padding: 0 6% 0 8%;
    }
    .hero-headline {
        font-size: clamp(2.5rem, 5vw, 4rem);
    }
    .hero-nav { left: 8%; }
    .hero-scroll { right: 8%; }
}

/* ── Mobile (768px and below) ───────────────────────────────────────────── */
@media (max-width: 767px) {
    /* Hero container — auto height to fit content */
    .hero-editorial {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        background: var(--color-white);
        padding-bottom: 90px; /* room for nav at the bottom */
    }

    /* Slides container needs real height — let it grow with content */
    .hero-slides {
        position: relative;
        width: 100%;
        height: auto;
    }

    /* Slides: stack but only show active. NOT position absolute on mobile. */
    .hero-slide {
        position: relative !important;
        inset: auto !important;
        width: 100%;
        height: auto !important;
        display: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    .hero-slide.is-active {
        display: block !important;
    }

    /* Hide watermark on mobile (no room) */
    .hero-watermark {
        display: none;
    }

    /* Counter top right, compact */
    .hero-counter {
        top: 16px;
        right: 16px;
        font-size: 0.65rem;
        gap: 6px;
    }
    .hero-counter-current {
        font-size: 1.1rem;
        min-width: 22px;
    }
    .hero-counter-total {
        font-size: 0.75rem;
    }

    /* Stack vertically: image on top, text below */
    .hero-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto;
        height: auto !important;
        width: 100%;
    }
    .hero-grid > * {
        height: auto !important;
    }

    /* Image on TOP - fixed height with relative positioning */
    .hero-visual {
        order: 1;
        position: relative;
        width: 100%;
        height: 50vh;
        min-height: 320px;
        max-height: 480px;
    }
    .hero-image {
        position: absolute;
        inset: 0;
        background-size: cover;
        background-position: center;
        opacity: 1;
        transform: scale(1.02);
    }

    /* Text BELOW image */
    .hero-text {
        order: 2;
        padding: 32px 20px 24px;
        max-width: 100%;
        height: auto;
        background: var(--color-white);
        display: block;
    }

    /* Show text content on mobile without animation issues */
    .hero-slide.is-active .hero-eyebrow,
    .hero-slide.is-active .hero-headline-line,
    .hero-slide.is-active .hero-lede,
    .hero-slide.is-active .hero-actions,
    .hero-slide.is-active .hero-visual-tag {
        opacity: 1;
        transform: none;
        animation: none;
    }

    /* Eyebrow */
    .hero-eyebrow {
        font-size: 0.6rem;
        letter-spacing: 0.25em;
        margin-bottom: 14px;
        gap: 10px;
    }
    .hero-eyebrow-line {
        width: 24px;
    }

    /* Headline */
    .hero-headline {
        font-size: clamp(2.2rem, 11vw, 3.2rem);
        line-height: 1;
        margin-bottom: 16px;
    }
    .hero-headline-line {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Lede */
    .hero-lede {
        font-size: 0.88rem;
        line-height: 1.55;
        margin-bottom: 24px;
        max-width: 100%;
    }

    /* Actions stack vertically on small mobile */
    .hero-actions {
        gap: 14px;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    .hero-btn-primary {
        padding: 14px 22px;
        font-size: 0.62rem;
        letter-spacing: 0.18em;
        justify-content: center;
        width: 100%;
    }
    .hero-btn-link {
        font-size: 0.62rem;
        text-align: center;
        padding: 6px 0;
        align-self: center;
    }

    /* Visual tag */
    .hero-visual-tag {
        bottom: 14px;
        right: 14px;
        padding: 5px 10px;
        font-size: 0.55rem;
        letter-spacing: 0.18em;
        opacity: 1 !important;
        transform: none !important;
    }

    /* Nav at the very bottom of hero, centered */
    .hero-nav {
        position: absolute;
        bottom: 28px;
        left: 50%;
        transform: translateX(-50%);
        gap: 12px;
    }
    .hero-nav-btn {
        width: 36px;
        height: 36px;
    }
    .hero-nav-btn svg {
        width: 12px;
        height: 12px;
    }
    .hero-dots {
        gap: 6px;
    }
    .hero-dot {
        width: 20px;
        height: 2px;
    }

    /* Hide scroll indicator on mobile */
    .hero-scroll {
        display: none !important;
    }
}

/* ── Small mobile (480px and below) ─────────────────────────────────────── */
@media (max-width: 480px) {
    .hero-visual {
        aspect-ratio: 1 / 1;
        max-height: 50vh;
    }
    .hero-text {
        padding: 28px 16px 110px;
    }
    .hero-headline {
        font-size: clamp(2rem, 12vw, 2.8rem);
    }
    .hero-lede {
        font-size: 0.85rem;
    }
}

/* ── Reduced motion accessibility ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .hero-slide.is-active .hero-eyebrow,
    .hero-slide.is-active .hero-headline-line,
    .hero-slide.is-active .hero-lede,
    .hero-slide.is-active .hero-actions,
    .hero-slide.is-active .hero-visual-tag,
    .hero-editorial .hero-scroll {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .hero-slide.is-active .hero-image {
        animation: none !important;
        transform: scale(1.05) !important;
    }
    .hero-dot.is-active .hero-dot-progress {
        animation: none !important;
        transform: scaleX(1) !important;
    }
}
