/* =============================================
   LA NOSTRA STORIA — pagina dedicata
   ============================================= */

.storia-hero {
    min-height: 60vh;
    background: linear-gradient(135deg, var(--royal-blue) 0%, var(--dark-blue) 50%, var(--royal-blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 140px 30px 80px;
    position: relative;
    overflow: hidden;
}
.storia-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><path d="M0,300 Q300,100 600,300 T1200,300" fill="none" stroke="rgba(186,192,198,0.12)" stroke-width="2"/></svg>');
    background-size: cover;
    animation: float 20s ease-in-out infinite;
}
.storia-hero-content { position: relative; z-index: 1; color: white; max-width: 760px; }
.storia-hero-eyebrow { font-size: 13px; letter-spacing: 4px; text-transform: uppercase; color: var(--silver); margin-bottom: 18px; }
.storia-hero h1 { font-family: 'Cormorant Garamond', serif; font-size: 56px; font-weight: 500; letter-spacing: 1px; margin-bottom: 22px; }
.storia-hero p { font-size: 18px; line-height: 1.9; color: var(--light-silver); font-weight: 300; }

.storia-testo {
    max-width: 780px;
    margin: 0 auto;
    padding: 90px 30px 40px;
}
.storia-testo p {
    font-size: 17px;
    line-height: 2;
    color: #555;
    margin-bottom: 24px;
    font-weight: 300;
}
.storia-testo p:first-letter {
    font-family: 'Cormorant Garamond', serif;
    font-size: 62px;
    color: var(--royal-blue);
    float: left;
    line-height: 0.8;
    margin: 8px 10px 0 0;
    font-weight: 600;
}

/* ---------------------------------------------
   GALLERY — scorrimento orizzontale "editoriale"
   niente carousel da prodotto: foto a altezze
   alternate, come un album sparso sul tavolo.
--------------------------------------------- */
.gallery-section { padding: 40px 0 120px; overflow: hidden; }
.gallery-heading { text-align: center; margin-bottom: 60px; padding: 0 30px; }
.gallery-heading .section-title { margin-bottom: 14px; }
.gallery-heading p { color: #888; font-size: 15px; letter-spacing: 1px; font-weight: 300; }

.gallery-track-wrap { position: relative; }

.gallery-track {
    display: flex;
    align-items: flex-end;
    gap: 34px;
    padding: 40px 8vw 60px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track.dragging { cursor: grabbing; scroll-snap-type: none; }

.gallery-frame {
    flex: 0 0 auto;
    width: 280px;
    scroll-snap-align: center;
    position: relative;
    transition: transform 0.4s ease;
}
.gallery-frame:nth-child(3n+1) { margin-bottom: 60px; }
.gallery-frame:nth-child(3n+2) { margin-bottom: 0px; width: 320px; }
.gallery-frame:nth-child(3n)   { margin-bottom: 90px; width: 250px; }

.gallery-frame-inner {
    background: white;
    padding: 14px 14px 46px;
    box-shadow: 0 18px 40px rgba(24,51,112,0.15);
    border-radius: 2px;
    transform: rotate(var(--tilt, 0deg));
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.gallery-frame:nth-child(4n) { --tilt: -2.5deg; }
.gallery-frame:nth-child(4n+1) { --tilt: 1.5deg; }
.gallery-frame:nth-child(4n+2) { --tilt: -1deg; }
.gallery-frame:nth-child(4n+3) { --tilt: 2deg; }

.gallery-frame:hover .gallery-frame-inner {
    transform: rotate(0deg) translateY(-8px);
    box-shadow: 0 28px 55px rgba(24,51,112,0.25);
}

.gallery-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 4 / 5;
    cursor: pointer;
}
.gallery-frame:nth-child(3n+2) img { aspect-ratio: 3 / 4; }

.gallery-caption {
    font-family: 'Dancing Script', cursive;
    text-align: center;
    color: var(--royal-blue);
    font-size: 20px;
    margin-top: 10px;
    padding: 0 4px;
}

.gallery-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 10px;
}
.gallery-nav-btn {
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 2px solid var(--royal-blue);
    background: white;
    color: var(--royal-blue);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
}
.gallery-nav-btn:hover { background: var(--royal-blue); color: white; transform: scale(1.08); }
.gallery-nav-btn svg { width: 20px; height: 20px; }

.gallery-empty {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
    padding: 60px 30px;
    color: #888;
    font-size: 15px;
    line-height: 1.8;
}

/* Lightbox */
.gallery-lightbox {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(18,38,84,0.94);
    display: none;
    align-items: center; justify-content: center;
    padding: 40px 20px;
}
.gallery-lightbox.open { display: flex; }
.gallery-lightbox img {
    max-width: 90vw; max-height: 82vh;
    object-fit: contain;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    animation: fadeInUp 0.35s ease-out;
}
.gallery-lightbox-close {
    position: absolute; top: 24px; right: 24px;
    width: 46px; height: 46px; border-radius: 50%;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.3);
    color: white; font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.gallery-lightbox-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.3);
    color: white; font-size: 22px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.gallery-lightbox-arrow.prev { left: 16px; }
.gallery-lightbox-arrow.next { right: 16px; }

.storia-cta {
    text-align: center;
    padding: 20px 30px 100px;
}

/* ---------------------------------------------
   RESPONSIVE
--------------------------------------------- */
@media (max-width: 768px) {
    .storia-hero { min-height: 46vh; padding: 120px 20px 60px; }
    .storia-hero h1 { font-size: 38px; }
    .storia-testo { padding: 60px 20px 20px; }
    .gallery-track { gap: 20px; padding: 30px 6vw 40px; }
    .gallery-frame,
    .gallery-frame:nth-child(3n+2),
    .gallery-frame:nth-child(3n) { width: 200px; }
    .gallery-frame:nth-child(3n+1),
    .gallery-frame:nth-child(3n+2),
    .gallery-frame:nth-child(3n) { margin-bottom: 30px; }
    .gallery-frame-inner { padding: 10px 10px 34px; }
}
