/* ============================================================
   HOME.CSS — Dimora Sovrana
   Stili specifici per index.html.
   Richiede base.css caricato prima.
   ============================================================ */


/* ------------------------------------------------------------
   1. HERO
   ------------------------------------------------------------ */
#hero {
    height: 100vh;
    height: var(--screen-h, 100vh);
}

.hero-content { transform: translateY(20px); }

.hero-content.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Badge premium sopra il titolo */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(232,215,185,0.3);
    border-radius: 9999px;
    padding: 6px 18px;
    font-size: 0.72rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--color-gold, #E8D7B9);
    backdrop-filter: blur(4px);
    background: rgba(0,0,0,0.25);
    margin-bottom: 28px;
}

/* Scroll button hero */
#scroll-btn,
#scroll-btn:focus,
#scroll-btn:active {
    bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 18px)) !important;
    transform: translateX(-50%) !important;
    padding: 10px 16px !important;
    position: absolute;
    left: 50%;
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

@media (max-height: 580px) {
    #scroll-btn {
        bottom: max(10px, calc(env(safe-area-inset-bottom, 0px) + 8px)) !important;
    }
}
@media (max-height: 640px) {
    #scroll-btn .scroll-text { font-size: 0.65rem; }
}

#scroll-btn:hover .scroll-text,
#scroll-btn:hover .scroll-arrow {
    filter: drop-shadow(0 0 4px rgba(255,255,255,0.45));
}

#scroll-btn.clicked  { animation: scroll-disappear 0.6s ease forwards; }
#scroll-btn.reappear { animation: scroll-reappear 0.8s ease forwards; }

#scroll-btn .scroll-arrow {
    animation: arrow-pulse 2.4s ease-in-out infinite;
    opacity: 0.8;
}

@keyframes arrow-pulse {
    0%, 100% { transform: translateY(0); opacity: 0.8; }
    50%       { transform: translateY(3px); opacity: 1; }
}

@keyframes scroll-disappear {
    to { opacity: 0; transform: translateX(-50%) translateY(10px); }
}
@keyframes scroll-reappear {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}


/* ------------------------------------------------------------
   2. SFONDO PARALLAX GLOBALE
   ------------------------------------------------------------ */
.parallax-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100vh;
    height: var(--screen-h, 100vh);
    background-image: url('../img/narghile.jpg');
    opacity: 0.2;
    background-size: cover;
    background-position: center;
    z-index: -1;
    transform: translateZ(0);
}


/* ------------------------------------------------------------
   3. SEZIONE MENU (galleria artistica homepage)
   ------------------------------------------------------------ */
#menu {
    background-image: url('../img/bg_dimora2.png');
    background-size: cover;
    background-position: center;
    /* Rimosso background-attachment:fixed — causa jank su iOS.
       Usare pseudo-elemento fisso se l'effetto parallax è desiderato. */
    position: relative;
}

/* Griglia artistica piatti */
.gallery-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 100px 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.art-item {
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.4s ease;
}

/* Offset asimmetrici desktop */
.item-1 { margin-top: 0; }
.item-2 { margin-top: 80px; width: 85%; justify-self: end; }
.item-3 { margin-top: -40px; width: 90%; }
.item-4 { margin-top: 40px; }

.art-frame {
    overflow: hidden;
    background: #111;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    position: relative;
}

.item-1 .art-frame { aspect-ratio: 4/5; }
.item-2 .art-frame { aspect-ratio: 1/1; }
.item-3 .art-frame { aspect-ratio: 16/9; }
.item-4 .art-frame { aspect-ratio: 3/4; }

.art-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.1) contrast(1.05);
    transition: transform 0.8s cubic-bezier(0.2, 0, 0.2, 1);
}
.art-item:hover img { transform: scale(1.1); }

.art-info {
    margin-top: 20px;
    padding: 0 5px;
}
.art-info h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: #dfc08d;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.art-info p {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: #a3a3a3;
    font-style: italic;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    .art-item {
        margin-top: 0 !important;
        width: 100% !important;
        justify-self: center !important;
    }
    #menu {
        padding-top: 60px;
        padding-bottom: 60px;
    }
}


/* ------------------------------------------------------------
   4. SEZIONE ABOUT — stats bar
   ------------------------------------------------------------ */
.stat-bar {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
}
.stat-bar .stat-item { text-align: center; }
@media (min-width: 1024px) { .stat-bar .stat-item { text-align: left; } }


/* ------------------------------------------------------------
   5. ZONES SLIDER STICKY
   ------------------------------------------------------------ */
#zones {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    height: var(--screen-h, 100vh);
    overflow: hidden;
    z-index: 10;
}

#zonesSlider {
    display: flex;
    width: 100%;
    height: 100%;
}

.zone-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}

/* Header fisso nella sezione zones */
#zones-header {
    position: relative;
    z-index: 50;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Stage */
#zones-stage {
    position: relative;
    flex: 1;
    overflow: hidden;
}

/* Overview overlay */
#zones-overview.is-active { pointer-events: auto; }

/* Griglia overview */
#overview-grid {
    display: grid;
    grid-template-rows: 1fr 1fr 1fr;
    overflow: hidden;
}
@media (min-width: 768px) {
    #overview-grid { grid-template-rows: 1fr 1fr; }
}

.overview-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.06);
    background: #111;
    transform-origin: center center;
    will-change: transform;
}
.overview-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 55%, transparent 100%);
    z-index: 2;
    transition: opacity 0.4s ease;
}
.overview-card:hover::before { opacity: 0.7; }
.overview-card img {
    position: absolute;
    inset: -5%;
    width: 110%;
    height: 110%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
.overview-card:hover img { transform: scale(1.06); }

.overview-card-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 10px 12px;
    z-index: 3;
    pointer-events: none;
}
.overview-card-num {
    font-family: var(--font-serif);
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    color: var(--color-gold);
    opacity: 0.6;
    display: block;
    margin-bottom: 2px;
}
.overview-card-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: #fff;
    font-weight: 500;
    letter-spacing: 0.03em;
    line-height: 1.2;
}
.overview-card-sub {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 2px;
}
.overview-card .parallax-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* Frecce navigazione */
.zone-arrow-minimal {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    background: transparent;
    border: none;
    opacity: 0.5;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.zone-arrow-minimal:hover  { opacity: 1; transform: translateY(-50%) scale(1.1); }
.zone-arrow-minimal:active { transform: translateY(-50%) scale(0.95); }

.arrow-tip {
    display: block;
    width: 20px;
    height: 20px;
    border-top: 2px solid white;
    border-right: 2px solid white;
}
.arrow-left  { transform: rotate(-135deg); }
.arrow-right { transform: rotate(45deg); }

/* Dots */
.zone-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.zone-dot:hover  { background: rgba(255,255,255,0.5); }
.zone-dot.active { width: 30px; background: var(--color-gold-strong); border-radius: 10px; }

/* Slide content */
.slide-content {
    opacity: 0;
    transform: translateY(30px);
    will-change: opacity, transform;
}

/* Parallax immagine */
.parallax-img-wrapper { overflow: hidden; will-change: transform; }
.parallax-img-wrapper img { will-change: transform; height: 120% !important; top: -10%; }

/* Side nav desktop */
#zones-sidenav { z-index: 801; }
#zones-sidenav.is-active { pointer-events: auto; }

.sidenav-thumb {
    width: 108px;
    height: 76px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1.5px solid rgba(255,255,255,0.08);
    position: relative;
    flex-shrink: 0;
    transition: border-color 0.3s ease, transform 0.3s ease;
    background: #111;
}
.sidenav-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.65;
    transition: opacity 0.3s ease;
}
.sidenav-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,0.7) 100%);
}
.sidenav-thumb:hover img,
.sidenav-thumb.active img { opacity: 1; }
.sidenav-thumb:hover,
.sidenav-thumb.active {
    border-color: var(--color-gold);
    transform: scale(1.04);
}
.sidenav-thumb .thumb-num {
    position: absolute;
    bottom: 5px; left: 0; right: 0;
    text-align: center;
    font-family: var(--font-serif);
    font-size: 0.55rem;
    color: var(--color-gold);
    opacity: 0.8;
    letter-spacing: 0.15em;
    z-index: 2;
}
.sidenav-thumb.active::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 2px;
    background: var(--color-gold);
    border-radius: 0 2px 2px 0;
    z-index: 3;
}

/* Bottom nav mobile */
#zones-bottomnav {
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}
#zones-bottomnav.is-active { pointer-events: auto; }

.bottomnav-viewport {
    position: relative;
    max-width: 260px;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#bottomnav-cards {
    display: flex;
    gap: 6px;
    padding: 0 64px;
    height: 100%;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    mask-image: linear-gradient(to right, transparent 0%, black 20%, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 20%, black 80%, transparent 100%);
}

.bottomnav-viewport::before,
.bottomnav-viewport::after { content: none; }

.bottomnav-thumb {
    min-width: 80px; width: 80px; height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1.5px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    scroll-snap-align: center;
    position: relative;
    background: #111;
    transition: border-color 0.3s ease;
    touch-action: manipulation;
}
.bottomnav-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}
.bottomnav-thumb.active { border-color: var(--color-gold); }
.bottomnav-thumb.active img { opacity: 1; }

@media (min-width: 768px) {
    #zones-container.sidenav-active #prevZone {
        left: 120px !important;
    }
}

/* Modale zona */
.modal-open { overflow: hidden !important; }

#modalImg {
    mix-blend-mode: lighten;
    filter: brightness(0.8);
}

#zoneModal {
    position: fixed !important;
    z-index: 99999 !important;
}

#zoneModal::-webkit-scrollbar       { width: 6px; }
#zoneModal::-webkit-scrollbar-track { background: #0a0a0a; }
#zoneModal::-webkit-scrollbar-thumb { background: var(--color-gold-strong); border-radius: 10px; }
