/* ========================================
   HERO.CSS, Giardini Fioriti
   Immersive hero with hotspots (desktop)
   and scroll-snap cards (mobile)
   ======================================== */

/* ---- Hero Container ---- */
.hero-immersive {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--text-dark);
}

/* ---- Hero Image ---- */
.hero-image-wrapper {
    position: relative;
    width: 100%;
    height: 85vh;
    min-height: 500px;
    max-height: 900px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform-origin: 0 0;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Fallback gradient when no image is loaded */
.hero-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        var(--primary) 0%,
        var(--dark-green) 30%,
        var(--green) 60%,
        var(--grass) 100%
    );
}

/* ---- Hero Overlay (Tagline + CTA) ---- */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    padding: 3.5rem 4rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    pointer-events: none;
    max-width: 720px;
}

.hero-overlay::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 20%,
        rgba(26, 46, 26, 0.65) 0%,
        rgba(26, 46, 26, 0.35) 20%,
        rgba(26, 46, 26, 0.12) 40%,
        rgba(26, 46, 26, 0.03) 55%,
        transparent 70%
    );
    z-index: -1;
    pointer-events: none;
}

.hero-overlay * {
    pointer-events: auto;
}

.hero-overlay h1 {
    color: white;
    font-size: clamp(2.2rem, 5.5vw, 5.2rem);
    margin-bottom: 1.2rem;
    max-width: 680px;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.15;
}

.hero-overlay .hero-tagline {
    color: rgba(255, 255, 255, 0.9);
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.5rem);
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.hero-overlay .btn {
    position: relative;
    z-index: 11;
}

.mobile-only {
    display: none;
}

/* ---- Hotspots (Desktop Only) ---- */
.hero-hotspots {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.hotspot {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 2.5px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 0 4px rgba(255, 255, 255, 0.15);
}

.hotspot::before {
    content: '+';
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: white;
    line-height: 1;
    transition: transform 0.3s ease;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.hotspot:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%) scale(1.12);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3), 0 0 0 6px rgba(255, 255, 255, 0.2);
}

.hotspot:hover::before {
    transform: rotate(90deg);
}

.hotspot.active {
    background: var(--primary);
    border-color: white;
    box-shadow: 0 4px 20px rgba(0, 111, 59, 0.4), 0 0 0 4px rgba(0, 111, 59, 0.2);
}

.hotspot.active::before {
    content: '\00d7';
    font-size: 1.6rem;
    transform: none;
    text-shadow: none;
}

.hotspot:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 3px;
}

/* Pulse animation */
.hotspot-pulse {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    animation: hotspotPulse 2.5s ease-in-out infinite;
}

@keyframes hotspotPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.5); opacity: 0; }
}

/* Stagger pulse per hotspot */
.hotspot:nth-child(1) .hotspot-pulse { animation-delay: 0s; }
.hotspot:nth-child(2) .hotspot-pulse { animation-delay: 0.4s; }
.hotspot:nth-child(3) .hotspot-pulse { animation-delay: 0.8s; }
.hotspot:nth-child(4) .hotspot-pulse { animation-delay: 1.2s; }
.hotspot:nth-child(5) .hotspot-pulse { animation-delay: 1.6s; }
.hotspot:nth-child(6) .hotspot-pulse { animation-delay: 2.0s; }

.hotspot.active .hotspot-pulse {
    display: none;
}

/* Hotspot Label (always visible on desktop) */
.hotspot-label {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--text-dark);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hotspot-label::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: rgba(255, 255, 255, 0.92);
}

.hotspot:hover .hotspot-label {
    background: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.hotspot:hover .hotspot-label::before {
    border-right-color: white;
}

.hotspot.active .hotspot-label {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 111, 59, 0.3);
}

.hotspot.active .hotspot-label::before {
    border-right-color: var(--primary);
}

/* ---- Side Panel (Desktop) ---- */
.hero-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 380px;
    height: 100%;
    background: white;
    z-index: 20;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
}

.hero-panel.open {
    transform: translateX(0);
}

.hero-panel-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cream);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-dark);
    transition: background 0.2s ease;
    z-index: 1;
}

.hero-panel-close:hover {
    background: var(--background-green);
}

.hero-panel-image {
    width: 100%;
    height: 220px;
    background-size: 500%;
    background-position: center;
    background-color: var(--background-green);
    transition: background-position 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-panel-body {
    padding: 2rem;
    transition: opacity 0.25s ease;
}

.hero-panel-body.fading {
    opacity: 0;
}

.hero-panel-title {
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
}

.hero-panel-desc {
    font-size: 0.95rem;
    color: var(--text-medium);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.hero-panel-features {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.hero-panel-feature {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.hero-panel-feature::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

/* ---- Progress Dots ---- */
.hero-progress {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.6rem;
    z-index: 15;
}

.hero-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.hero-progress-dot.active {
    background: white;
    transform: scale(1.3);
}

.hero-progress-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* ---- Mobile Cards (< 1024px) ---- */
.hero-cards {
    display: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding: 2rem 1.5rem;
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
    background: var(--warm-white);
    scrollbar-width: none;
}

.hero-cards::-webkit-scrollbar {
    display: none;
}

.hero-card {
    scroll-snap-align: center;
    min-width: 280px;
    max-width: 300px;
    flex-shrink: 0;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.hero-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--background-green);
}

.hero-card-body {
    padding: 1.2rem;
}

.hero-card-title {
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.hero-card-desc {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.hero-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary);
    transition: gap 0.3s ease;
}

.hero-card-link:hover {
    gap: 0.7rem;
}

/* ---- Responsive ---- */

/* Desktop: show hotspots, hide cards */
@media (min-width: 1024px) {
    .hero-overlay {
        position: absolute;
        top: 4rem;
        left: 2rem;
        z-index: 10;
        background: none;
    }

    .hero-overlay::before {
        display: block;
    }

    .hero-hotspots {
        display: block;
    }

    .hero-cards {
        display: none !important;
    }
}

/* Tablet & Mobile: show hotspots + cards, no panel */
@media (max-width: 1023px) {
    .hero-hotspots {
        display: block;
    }

    .hotspot {
        width: 20px;
        height: 20px;
        pointer-events: auto;
        border-width: 1.5px;
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.5);
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
    }

    .hotspot::before {
        font-size: 0.55rem;
    }

    .hotspot.active::before {
        font-size: 0.6rem;
    }

    .hotspot-pulse {
        inset: -4px;
        border-width: 1.5px;
    }

    .hotspot-label {
        display: block;
        font-size: 0.6rem;
        padding: 0.2rem 0.5rem;
        left: calc(100% + 6px);
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .hotspot-label::before {
        border-width: 4px;
    }

    .hotspot.active {
        transform: translate(-50%, -50%) scale(1.1);
        background: rgba(255, 255, 255, 0.3);
    }

    .hero-cards {
        display: flex;
    }

    .hero-panel {
        display: none;
    }

    .hero-progress {
        display: none;
    }

    .hero-overlay {
        position: static;
        padding: 1.5rem 1.5rem 1.2rem;
        padding-left: max(1.5rem, env(safe-area-inset-left));
        max-width: 100%;
        background: var(--text-dark);
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        justify-content: space-between;
    }

    .hero-overlay::before {
        display: none;
    }

    .hero-overlay .hero-tagline {
        width: 100%;
    }

    .hero-overlay h1 {
        font-size: clamp(1.8rem, 7vw, 2.4rem);
        margin-bottom: 0;
        flex: 1;
    }

    .hero-overlay .btn {
        font-size: 0.7rem;
        padding: 0.45rem 0.9rem;
        align-self: center;
        text-align: center;
        line-height: 1.3;
        margin-left: auto;
        flex-shrink: 0;
    }

    .mobile-only {
        display: inline;
    }

    .desktop-only {
        display: none;
    }

    .hero-image-wrapper {
        height: auto;
        aspect-ratio: 16 / 9;
        min-height: 240px;
        max-height: 55vh;
    }

    .hero-cards {
        padding: 0.8rem 0.8rem;
        padding-left: max(0.8rem, env(safe-area-inset-left));
        padding-right: max(0.8rem, env(safe-area-inset-right));
        gap: 0.6rem;
    }

    .hero-card {
        min-width: 200px;
        max-width: 220px;
    }

    .hero-card-image {
        height: 90px;
    }

    .hero-card-body {
        padding: 0.7rem;
    }

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

    .hero-card-desc {
        font-size: 0.8rem;
        margin-bottom: 0.7rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* Mobile card active state */
.hero-card.active {
    box-shadow: 0 4px 20px rgba(0, 111, 59, 0.2);
    border: 2px solid var(--primary);
}

@media (max-width: 480px) {
    .hero-overlay {
        padding: 1rem 1rem 0.8rem;
    }

    .hero-overlay h1 {
        font-size: clamp(1.5rem, 6.5vw, 2rem);
        margin-bottom: 0;
    }

    .hero-overlay .btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
    }

    .hero-image-wrapper {
        aspect-ratio: 16 / 10;
        min-height: 220px;
        max-height: 50vh;
    }

    .hotspot {
        width: 16px;
        height: 16px;
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.4);
    }

    .hotspot::before {
        font-size: 0.45rem;
    }

    .hotspot.active::before {
        font-size: 0.5rem;
    }

    .hotspot-pulse {
        inset: -3px;
        border-width: 1px;
    }

    .hotspot-label {
        font-size: 0.5rem;
        padding: 0.12rem 0.35rem;
        left: calc(100% + 3px);
    }

    .hero-cards {
        padding: 0.6rem 0.6rem;
        gap: 0.5rem;
    }

    .hero-card {
        min-width: 160px;
        max-width: 180px;
        border-radius: 10px;
    }

    .hero-card-image {
        height: 70px;
    }

    .hero-card-body {
        padding: 0.5rem;
    }

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

    .hero-card-desc {
        display: none;
    }

    .hero-card-link {
        font-size: 0.8rem;
    }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    .hotspot-pulse {
        animation: none;
    }

    .hero-image {
        transition: none;
    }

    .hero-panel {
        transition: none;
    }
}
