/* ============================================================
   SORMANI CUCINE — galleria.css
   Stili della sola pagina Galleria (galleria.php).
   Caricato DOPO style.min.css e responsive.min.css: l'ordine conta.
   ============================================================ */

/* =============================================
   CSS VARIABLES — Sormani Cucine brand palette
   ============================================= */
:root {
    --bordeaux:     #9B1B1B;
    --bordeaux-dark:#7a1515;
    --white-warm:   #FAFAF8;
    --anthracite:   #2E2E2E;
    --beige:        #F0EBE3;
    --beige-dark:   #e0d8cc;
    --gray-mid:     #888;
    --font-title:   'Playfair Display', Georgia, serif;
    --font-body:    'Lato', sans-serif;
    --transition:   0.32s cubic-bezier(.4,0,.2,1);
    --shadow-card:  0 4px 24px rgba(46,46,46,.10);
    --shadow-hover: 0 12px 40px rgba(155,27,27,.18);
}

/* =============================================
   RESET & BASE
   ============================================= */
body {
    font-family: var(--font-body);
    /* colore e sfondo ripetono il foglio comune, ma in stampa vincono sul nero su bianco */
    background: var(--white-warm);
    color: var(--anthracite);
    font-size: 16px; /* sotto i 480px il foglio comune mette 15px: qui resta 16px */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* =============================================
   HEADER / NAVBAR
   ============================================= */
.site-header {
    background: rgba(250,250,248,.97);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--beige-dark);
    transition: box-shadow var(--transition);
}

/* =============================================
   PAGE HERO
   ============================================= */
.page-hero {
    margin-top: 72px;
    position: relative;
    background: var(--beige);
    padding: 80px 32px 60px;
    overflow: hidden;
    text-align: center;
}

/* Decorative lines */
.page-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--bordeaux);
}

.page-hero-inner {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.page-hero-label {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--bordeaux);
    margin-bottom: 20px;
}

.page-hero h1 {
    font-family: var(--font-title);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: var(--anthracite);
    line-height: 1.15;
    margin-bottom: 18px;
}

.page-hero p {
    font-size: 1.05rem;
    color: #5a5a5a;
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto;
}

/* Decorative ornament */
.ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.ornament-line {
    width: 40px;
    height: 1px;
    background: var(--bordeaux);
    opacity: .4;
}

.ornament-diamond {
    width: 6px;
    height: 6px;
    background: var(--bordeaux);
    transform: rotate(45deg);
}

/* =============================================
   FILTER BAR
   ============================================= */
.filter-bar {
    background: var(--white-warm);
    border-bottom: 1px solid var(--beige-dark);
    position: sticky;
    top: 72px;
    z-index: 100;
}

.filter-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-inner::-webkit-scrollbar { display: none; }

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 18px 24px;
    font-family: var(--font-body);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gray-mid);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
    outline: none;
}

.filter-btn:hover {
    color: var(--anthracite);
}

.filter-btn.active {
    color: var(--bordeaux);
    border-bottom-color: var(--bordeaux);
}

/* =============================================
   GALLERY SECTION
   ============================================= */
.gallery-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 56px 32px 100px;
}

/* Masonry-style grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    background: var(--beige);
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
    aspect-ratio: 4/3;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(.4,0,.2,1);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Overlay on hover */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(46,46,46,.72) 0%, rgba(46,46,46,0) 60%);
    opacity: 0;
    transition: opacity var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255,255,255,.7);
    margin-bottom: 4px;
}

.gallery-overlay-caption {
    font-family: var(--font-title);
    font-size: 1rem;
    color: white;
    line-height: 1.3;
}

.gallery-overlay-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-overlay-icon svg {
    width: 16px;
    height: 16px;
    fill: white;
}

/* Item filter transitions */
.gallery-item.hidden {
    display: none;
}

.gallery-item.fade-in {
    animation: fadeIn .25s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Empty state */
.gallery-empty {
    display: none;
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 32px;
}

.gallery-empty.visible { display: block; }

.gallery-empty p {
    font-family: var(--font-title);
    font-size: 1.2rem;
    color: var(--gray-mid);
    font-style: italic;
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto 24px;
}

.gallery-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bordeaux);
    color: white;
    padding: 12px 28px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    border-radius: 2px;
    transition: background var(--transition), transform var(--transition);
}

.gallery-empty-cta:hover {
    background: var(--bordeaux-dark);
    transform: translateY(-2px);
}

/* =============================================
   LIGHTBOX
   ============================================= */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.lightbox.open {
    opacity: 1;
    pointer-events: all;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20,10,10,.92);
    backdrop-filter: blur(6px);
    cursor: zoom-out;
}

.lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(.95);
    transition: transform .3s ease;
}

.lightbox.open .lightbox-content {
    transform: scale(1);
}

.lightbox-img-wrap {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    border-radius: 3px;
    box-shadow: 0 32px 80px rgba(0,0,0,.6);
}

.lightbox-img-wrap img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

.lightbox-caption {
    margin-top: 14px;
    font-family: var(--font-title);
    font-size: .95rem;
    color: rgba(255,255,255,.7);
    font-style: italic;
    text-align: center;
}

.lightbox-close {
    position: fixed;
    top: 24px;
    right: 28px;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    z-index: 2;
}

.lightbox-close:hover { background: rgba(255,255,255,.2); }

.lightbox-close svg {
    width: 18px;
    height: 18px;
    stroke: white;
    stroke-width: 2;
    fill: none;
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    z-index: 2;
}

.lightbox-nav:hover { background: rgba(255,255,255,.22); }

.lightbox-nav svg {
    width: 20px;
    height: 20px;
    stroke: white;
    stroke-width: 2;
    fill: none;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-counter {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    color: rgba(255,255,255,.5);
    text-transform: uppercase;
}

/* =============================================
   CTA SECTION
   ============================================= */
.cta-section {
    padding: 80px 32px;
    text-align: center;
}

.cta-inner {
    max-width: 640px;
    margin: 0 auto;
}

.cta-section h2 {
    font-family: var(--font-title);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    color: white;
    margin-bottom: 16px;
    font-weight: 700;
}

.cta-section p {
    font-size: 1rem;
    color: rgba(255,255,255,.82);
    line-height: 1.7;
    margin-bottom: 36px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-white {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: var(--bordeaux);
    padding: 14px 30px;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    border-radius: 2px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 2px solid rgba(255,255,255,.5);
    color: white;
    padding: 14px 30px;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    border-radius: 2px;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.btn-whatsapp:hover {
    border-color: white;
    background: rgba(255,255,255,.1);
    transform: translateY(-2px);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* footer a 2 colonne fino a 1024px solo in questa pagina (altrove 4 colonne da 960px) */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .page-hero { padding: 60px 20px 48px; }

    .gallery-section { padding: 40px 20px 80px; }

    .gallery-grid { grid-template-columns: 1fr; gap: 16px; }

    .filter-inner { padding: 0 20px; }

    .cta-section { padding: 60px 20px; }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    /* senza effetto visibile (.footer-bottom__inner ha gia' le sue regole): lasciata per prudenza */
    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
}

/* ===== TAB SWITCHER DUE SEZIONI ===== */
.gallery-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--beige-dark, #e8e0d6);
    margin: 0 auto 40px;
    max-width: 900px;
    padding: 0 32px;
}
.gallery-tab-btn {
    flex: 1;
    padding: 16px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font-sans, 'Lato', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #888;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.gallery-tab-btn.active {
    color: var(--bordeaux, #9B1B1B);
    border-bottom-color: var(--bordeaux, #9B1B1B);
}
.gallery-tab-btn:hover:not(.active) { color: #444; }
.gallery-tab-panel { display: none; }
.gallery-tab-panel.active { display: block; }
.gallery-novita-empty {
    text-align: center;
    padding: 80px 32px;
    color: #888;
    font-family: var(--font-sans, 'Lato', sans-serif);
}
.gallery-novita-empty__title {
    font-family: var(--font-serif, 'Playfair Display', serif);
    font-size: 1.5rem;
    color: #555;
    margin-bottom: 12px;
}
.gallery-novita-empty__text { font-size: 1rem; line-height: 1.7; }

/* CTA finale: pulsanti uno sotto l'altro su mobile stretto (spostato da responsive.css) */
@media (max-width: 599px) {
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-buttons .btn-white,
    .cta-buttons .btn-whatsapp {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}
