/**
 * Castlo Industrial — Hero Carousel
 * Depends on style.css (castlo-industrial handle).
 * Only defines vars not present in style.css and hero-specific rules.
 */

/* ============================================================
   ADDITIONAL CSS VARIABLES (not in style.css)
   nav-height, font-body alias, container-max, transition-normal
============================================================ */
:root {
    --nav-height: 48px;
    --font-body: 'Open Sans', Arial, sans-serif;
    --container-max: 1280px;
    --container-padding: 0 1.5rem;
    --transition-normal: 0.28s ease;
}

/* ============================================================
   HERO WRAPPER
============================================================ */
#castlo-hero {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: block;
}

/* ============================================================
   HERO SLIDE
   JS toggles .active via addClass/removeClass — display:none is
   the visibility mechanism. Opacity transition is on .active only
   so the appearing slide fades in from the browser's paint cycle.
============================================================ */
.hero-slide {
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    min-height: max(
        calc(100vh - var(--header-height) - var(--topbar-height) - var(--nav-height)),
        520px
    );
    width: 100%;
    padding: 4rem 1.5rem;
    box-sizing: border-box;
    gap: 3rem;
}

.hero-slide.active {
    display: flex;
    animation: heroFadeIn var(--transition-normal) ease both;
}

@keyframes heroFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
   HERO CONTENT — LEFT COLUMN (55%)
============================================================ */
.hero-content {
    flex: 0 0 55%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    color: var(--castlo-white);
}

.hero-badge {
    display: inline-block;
    background-color: var(--castlo-orange);
    color: var(--castlo-white);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    width: fit-content;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.1;
    color: var(--castlo-white);
    margin: 0;
    letter-spacing: 0.02em;
}

.hero-title span {
    color: var(--castlo-orange);
}

.hero-description {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.85);
    max-width: 480px;
    margin: 0;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
}

/*
 * Override global .btn-outline and .btn-lg for the dark hero background.
 * Global .btn-outline:hover flips to white bg + navy text (fine on light pages);
 * on a dark hero slide the subtle glass effect is more appropriate.
 * Global .btn-lg uses tighter padding; hero CTAs need the larger touch target.
 */
.hero-actions .btn-outline:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--castlo-white);
    color: var(--castlo-white);
}

.hero-actions .btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1.05rem;
}

/* ============================================================
   HERO STATS — RIGHT COLUMN (45%)
============================================================ */
.hero-stats {
    flex: 0 0 45%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-stats-inner {
    background: rgba(0, 0, 0, 0.28);
    border-left: 3px solid var(--castlo-orange);
    border-radius: var(--radius-md);
    padding: 2rem 1.75rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.hero-stat {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.hero-stat-icon {
    font-size: 1.6rem;
    color: var(--castlo-orange);
    line-height: 1;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.hero-stat > div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.hero-stat-value {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--castlo-white);
    line-height: 1;
    letter-spacing: 0.02em;
}

.hero-stat-label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
}

/* ============================================================
   NAVIGATION ARROWS
============================================================ */
.hero-prev,
.hero-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.18);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--castlo-white);
    cursor: pointer;
    transition: background var(--transition-fast);
    line-height: 1;
    padding: 0;
}

.hero-prev { left: 1.25rem; }
.hero-next { right: 1.25rem; }

.hero-prev:hover,
.hero-next:hover {
    background: rgba(255, 255, 255, 0.38);
}

.hero-prev:focus-visible,
.hero-next:focus-visible {
    outline: 2px solid var(--castlo-orange);
    outline-offset: 2px;
}

/* ============================================================
   DOTS NAVIGATION
============================================================ */
.hero-dots {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
}

.hero-dot {
    height: 8px;
    width: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: width var(--transition-normal), background var(--transition-normal);
}

.hero-dot.active {
    width: 24px;
    background: var(--castlo-white);
}

.hero-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.65);
}

.hero-dot:focus-visible {
    outline: 2px solid var(--castlo-orange);
    outline-offset: 2px;
}

/* ============================================================
   RESPONSIVE — TABLET (max 768px)
============================================================ */
@media (max-width: 768px) {
    .hero-slide {
        flex-direction: column;
        align-items: flex-start;
        min-height: auto;
        padding: 3rem 1.25rem 4.5rem;
        gap: 2rem;
    }

    .hero-content,
    .hero-stats {
        flex: none;
        width: 100%;
        max-width: 100%;
    }

    .hero-stats-inner {
        max-width: 100%;
        grid-template-columns: 1fr 1fr;
        padding: 1.5rem 1.25rem;
        gap: 1.25rem 1.5rem;
    }

    .hero-prev { left: 0.75rem; }
    .hero-next { right: 0.75rem; }
}

/* ============================================================
   RESPONSIVE — MOBILE (max 480px)
============================================================ */
@media (max-width: 480px) {
    .hero-slide {
        padding: 2.5rem 1rem 4rem;
        gap: 1.5rem;
    }

    .hero-title { font-size: 1.85rem; }
    .hero-description { font-size: 0.9rem; }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-actions .btn,
    .hero-actions .btn-lg {
        width: 100%;
        justify-content: center;
    }

    .hero-stats-inner {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hero-stat-value { font-size: 1.35rem; }

    .hero-prev,
    .hero-next {
        width: 38px;
        height: 38px;
        font-size: 1.5rem;
    }
}
