﻿@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');

:root {
    --bg-dark: #f1f1f1;
    --bg-dark-alt: #aec7fa;
    --bg-card: rgba(174, 199, 250, 0.65);
    --border-color: rgba(17, 17, 17, 0.06);
    --accent: #2c1601; /* Golden Amber */
    --accent-glow: rgba(44, 22, 1, 0.3);
    --accent-hover: #36200b;
    --text-primary: #111111;
    --text-secondary: #303031;
    --text-dim: #d4dded;
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-elastic: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-dark);
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ------------------------------------
   HEADER & INTRO
------------------------------------ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    background: linear-gradient(to bottom, rgba(241, 241, 241, 0.8) 0%, rgba(241, 241, 241, 0) 100%);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.logo-container {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #111111 0%, #303031 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
    margin-top: 2px;
}

/* ------------------------------------
   SCROLL SYSTEM
   ------------------------------------ */
.scroll-container {
    height: 1000vh; /* 10 sections */
    position: relative;
}

.sticky-wrapper {
    position: sticky;
    top: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #cfdafc 0%, var(--bg-dark) 100%);
}

.horizontal-track {
    display: flex;
    width: 1000vw;
    height: 100%;
    will-change: transform;
    /* Rimosse transizioni per evitare scatti e lag durante lo scorrimento del dito */
}

/* ------------------------------------
   SLIDE LAYOUT
------------------------------------ */
.slide {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 4rem;
    position: relative;
    overflow: hidden;
}
.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    will-change: opacity;
}

.slide.active .slide-bg {
    opacity: 0.25;
}

.slide-bg-glow {
    position: absolute;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(44, 22, 1, 0.04) 0%, rgba(44, 22, 1, 0) 70%);
    z-index: 0;
    filter: blur(80px);
    pointer-events: none;
    transform: translate(-10%, -10%);
}

.slide:nth-child(even) .slide-bg-glow {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.04) 0%, rgba(99, 102, 241, 0) 70%); /* Subtle Indigo glow for contrast */
    right: -10%;
    left: auto;
}

.slide-inner {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    z-index: 1;
}

@media (max-width: 992px) {
    .slide-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
        max-width: 600px;
        text-align: center;
    }
}

.content {
    background-image: url('../assets/images/texture-carta.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #ffffff; /* Fallback per sfondo chiaro */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.1); /* Leggerissimo bordo scuro sottile */
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3); /* Ombra sfumata accentuata */
    position: relative;
    overflow: hidden;
}

.content h2, .content .title {
    color: #222222 !important; /* Grigio antracite scuro */
}

.content p, .content .description {
    color: #444444 !important; /* Grigio scuro leggibile */
}

.content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent), transparent);
}

/* ------------------------------------
   TEXT REVEAL ANIMATIONS
------------------------------------ */
.content .date,
.content .title,
.content .media-container,
.content .description,
.content .btn-approfondisci,
.graphic-panel {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.content .date { transition-delay: 0.1s; }
.content .title { transition-delay: 0.25s; }
.content .media-container { transition-delay: 0.38s; }
.content .description { transition-delay: 0.5s; }
.content .btn-approfondisci { transition-delay: 0.62s; }
.graphic-panel { 
    transition-delay: 0.75s; 
    transform: scale(0.9) translateY(40px);
}

.slide.active .content .date,
.slide.active .content .title,
.slide.active .content .media-container,
.slide.active .content .description,
.slide.active .content .btn-approfondisci {
    opacity: 1;
    transform: translateY(0);
}


.slide.active .graphic-panel {
    opacity: 0.85;
    transform: scale(1) translateY(0);
}

/* ------------------------------------
   TYPOGRAPHY
------------------------------------ */
.date {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 992px) {
    .date {
        justify-content: center;
    }
}

.date::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.title {
    font-family: var(--font-serif);
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.15;
    letter-spacing: -0.5px;
    color: #111111;
}

@media (max-width: 576px) {
    .title {
        font-size: 2.2rem;
    }
}

.description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    font-weight: 300;
}

.media-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.media-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    will-change: opacity;
}

.media-container.animating video {
    opacity: 1;
}

.historical-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}


/* ------------------------------------
   GRAPHIC PANELS (DECORATIVE SVG)
------------------------------------ */
.graphic-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

@media (max-width: 992px) {
    .graphic-panel {
        display: none; /* Hide graphic on mobile to keep focus on copy */
    }
}

.graphic-svg {
    width: 260px;
    height: 260px;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 10px rgba(44, 22, 1, 0.1));
    transition: var(--transition-elastic);
}

.graphic-svg:hover {
    transform: scale(1.08) rotate(3deg);
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 20px var(--accent-glow));
}

/* ------------------------------------
   PROGRESS BAR
------------------------------------ */
.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(17, 17, 17, 0.03);
    z-index: 101;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--accent), var(--accent-hover));
    width: 0%;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* ------------------------------------
   TIMELINE NAV (BOTTOM NAVIGATION)
------------------------------------ */
.timeline-nav {
    position: fixed;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: 90%;
    max-width: 900px;
    background: rgba(174, 199, 250, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 1rem 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.timeline-track-bg {
    position: absolute;
    top: 50%;
    left: 2.5rem;
    right: 2.5rem;
    height: 2px;
    background-color: rgba(17, 17, 17, 0.08);
    transform: translateY(-50%);
    z-index: 1;
}

.timeline-nodes {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.node-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-dim);
    border: 2px solid var(--bg-dark);
    transition: var(--transition-elastic);
    box-shadow: 0 0 0 0px var(--accent-glow);
}

.node-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 600;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-smooth);
}

/* Node active & hover states */
.timeline-node:hover .node-dot {
    background-color: var(--text-primary);
    transform: scale(1.3);
}

.timeline-node:hover .node-label {
    color: var(--text-primary);
}

.timeline-node.active .node-dot {
    background-color: var(--accent);
    transform: scale(1.5);
    box-shadow: 0 0 0 6px var(--accent-glow);
    border-color: #111111;
}

.timeline-node.active .node-label {
    color: var(--accent);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(44, 22, 1, 0.1);
}

@media (max-width: 768px) {
    .timeline-nav {
        padding: 0.8rem 1rem;
        bottom: 1.5rem;
    }
    
    .timeline-track-bg, .node-label {
        display: none; /* Simplify on mobile */
    }
    
    .timeline-nodes {
        justify-content: space-around;
        width: 100%;
    }
    
    .node-dot {
        width: 16px;
        height: 16px;
    }
}

/* ------------------------------------
   PROGRESSIVE ENHANCEMENT: SCROLL-DRIVEN ANIMATIONS
------------------------------------ */
@supports (animation-timeline: scroll()) {
    .horizontal-track {
        animation: horizontal-scroll-animation linear both;
        animation-timeline: scroll(root block);
        /* Rimuoviamo le transizioni per evitare scatti in concomitanza dello scroll diretto */
        transition: none;
    }
    
    .progress-bar {
        animation: progress-grow-animation linear both;
        animation-timeline: scroll(root block);
    }
}

@keyframes horizontal-scroll-animation {
    to {
        /* Traslazione orizzontale con translate3d per accelerazione hardware GPU */
        transform: translate3d(-900vw, 0, 0);
    }
}

@keyframes progress-grow-animation {
    to {
        width: 100%;
    }
}

/* ------------------------------------
   BOTTONI E APPROFONDIMENTI
------------------------------------ */
.btn-approfondisci {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    background-color: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    transition: var(--transition-smooth);
    margin-top: 1.5rem;
    cursor: pointer;
}

.btn-approfondisci:hover {
    background-color: var(--accent);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-ritorno {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    background-color: var(--accent);
    color: var(--bg-dark);
    border: 2px solid var(--accent);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.btn-ritorno:hover {
    background-color: transparent;
    color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-2px);
}

/* Stili per la pagina di approfondimento verticale */
.deep-dive-body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.8;
    padding: 4rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    background: radial-gradient(circle at 50% 50%, #cfdafc 0%, var(--bg-dark) 100%);
}

.deep-dive-container {
    max-width: 800px;
    width: 100%;
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

@media (max-width: 576px) {
    .deep-dive-container {
        padding: 2rem 1.5rem;
    }
}

.deep-dive-container h1 {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    color: #111111;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

@media (max-width: 576px) {
    .deep-dive-container h1 {
        font-size: 2rem;
    }
}

.deep-dive-container .era-date {
    font-size: 1rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.deep-dive-container .era-date::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.deep-dive-content {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    font-weight: 300;
}

.deep-dive-content p {
    margin-bottom: 1.5rem;
}

.deep-dive-content h3 {
    color: #111111;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

/* --- BOTTONE AUDIO FISSO --- */
.audio-toggle-btn {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(174, 199, 250, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 150;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.audio-toggle-btn:hover {
    background-color: var(--accent-color);
    color: #111111;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(44, 22, 1, 0.4);
    transform: scale(1.1);
}

.audio-icon {
    transition: transform 0.3s ease;
}

.audio-toggle-btn:active .audio-icon {
    transform: scale(0.85);
}

/* Riposizionamento mobile per evitare sovrapposizioni */
@media (max-width: 768px) {
    .audio-toggle-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 40px;
        height: 40px;
    }
    .audio-icon {
        width: 16px !important;
        height: 16px !important;
    }
}

/* --- CLUSTER NAVIGAZIONE IN ALTO --- */
.top-nav-cluster {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 1000;
}

.btn-nav-top {
    background-color: rgba(241, 241, 241, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    border: 1px solid var(--accent);
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: inline-block;
}

.btn-nav-top:hover {
    background-color: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
    border-color: #ff3b30;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.2);
}
.btn-nav-top:hover svg {
    stroke: #ff3b30 !important;
}

.nav-icon {
    display: none;
}

@media (max-width: 768px) {
    .top-nav-cluster {
        top: 15px;
        right: 15px;
        gap: 6px;
    }

    .top-nav-cluster a {
        width: 42px;
        height: 42px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: transparent;
        border: 1px solid rgba(44, 22, 1, 0.4);
    }

    .top-nav-cluster a span {
        display: none;
    }

    .top-nav-cluster a .nav-icon {
        display: block;
        width: 22px;
        height: 22px;
    }

    .logo-main {
        font-size: 1.25rem;
    }

    .logo-sub {
        font-size: 0.65rem;
        letter-spacing: 2px;
    }

    .header {
        padding: 1rem 1.5rem;
    }
}

/* Floating Exhibition Button (Temple Icon) for index.html */
.exhibition-floating-badge {
    position: fixed;
    bottom: 2.5rem;
    right: 6.5rem; /* a fianco del pulsante audio */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(174, 199, 250, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.exhibition-floating-badge:hover {
    background-color: var(--accent-color);
    color: #111111;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(44, 22, 1, 0.4);
    transform: scale(1.1);
}

.exhibition-floating-badge svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .exhibition-floating-badge {
        bottom: 1.5rem;
        right: 5rem; /* a fianco del pulsante audio su mobile */
        width: 40px;
        height: 40px;
    }
    .exhibition-floating-badge svg {
        width: 16px;
        height: 16px;
    }
}

