/**
 * Main CSS - Archivio Futuro Theme
 * Stile minimalista ispirato a Below the Surface
 * Versione 2.0 - Ottimizzato e Pulito
 */

/* ========================================
   RESET & BASE
======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    color: var(--color-primary);
    background: var(--color-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

html {
    scroll-behavior: smooth;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.7;
}

/* ========================================
   HEADER
======================================== */

.site-header {
    background: var(--color-secondary);
    border-bottom: 1px solid var(--color-primary);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.site-title {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: -0.5px;
}

.site-title a {
    color: var(--color-primary);
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: 40px;
}

.menu-buttons {
    display: flex;
    gap: 40px;
}

.main-navigation .nav-menu {
    display: flex;
    gap: 40px;
    list-style: none;
}

.main-navigation .nav-menu a {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Header Search */
.header-search-box {
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: all 0.3s ease;
}

.header-search-box.active {
    max-width: 300px;
}

.header-search-input {
    width: 0;
    padding: 0;
    border: none;
    font-size: 14px;
    background: transparent;
    transition: all 0.3s ease;
    opacity: 0;
}

.header-search-box.active .header-search-input {
    width: 240px;
    padding: 8px 12px;
    opacity: 1;
}

.header-search-input:focus {
    outline: none;
}

.header-search-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--color-primary);
}

.search-text-desktop {
    display: inline;
}

.search-icon-mobile {
    display: none;
}

/* Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--color-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Animazione Hamburger Ã¢â€ â€™ X */
body .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

body .menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

body .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ========================================
   HOMEPAGE
======================================== */

.hero-section {
    min-height: 70vh;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--color-primary);
}

.hero-container {
    width: 100%;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text {
    padding-right: 40px;
}

.hero-title {
    font-size: 32px;
    line-height: 1.4;
    margin-bottom: 30px;
    font-weight: normal;
}

.hero-cta p {
    font-size: 18px;
    margin-top: 20px;
}

.hero-pattern {
    display: flex;
    gap: 10px;
    height: 500px;
    overflow: hidden;
}

.pattern-column {
    flex: 1;
}

.pattern-column svg {
    width: 100%;
    height: 100%;
    color: var(--color-primary);
}

/* Eventi Section */
.eventi-section {
    padding: 80px 0;
    border-bottom: 1px solid var(--color-accent);
}

.section-title {
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 40px;
    font-weight: bold;
}

.eventi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.evento-card {
    border: 1px solid var(--color-accent);
}

.evento-image {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--color-accent);
}

.evento-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.evento-card:hover .evento-image img {
    transform: scale(1.05);
}

.evento-content {
    padding: 20px;
}

.evento-data {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.evento-title {
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: bold;
}

.evento-luogo {
    font-size: 14px;
    color: #666;
}

/* Archivio CTA */
.archivio-cta-section {
    padding: 100px 0;
    text-align: center;
}

.archivio-cta-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.archivio-cta-content p {
    font-size: 18px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   BUTTONS
======================================== */

.btn {
    display: inline-block;
    padding: 12px 30px;
    border: 2px solid var(--color-primary);
    background: transparent;
    color: var(--color-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-lg {
    width:100%;
    padding: 24px ;
}

.btn:hover {
    background: var(--color-primary);
    color: var(--color-secondary);
    opacity: 1;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-secondary);
}

.btn-primary:hover {
    background: transparent;
    color: var(--color-primary);
}

/* ========================================
   ARCHIVIO PAGE
======================================== */

.archivio-page {
    background: white;
}

.archivio-header {
    padding: 0;
    background: white;
    border-bottom: 1px solid #e8e8e8;
}

.archivio-header .container {
    max-width: 1400px;
}

.page-title {
    font-size: 42px;
    margin-bottom: 16px;
    font-weight: 300;
    letter-spacing: -0.5px;
}

.page-intro {
    font-size: 16px;
    max-width: 700px;
    margin-bottom: 20px;
    color: #666;
    line-height: 1.7;
}

/* Active Filters Badges */
.active-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-top: 1px solid #e8e8e8;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: #000;
    border: 1px solid #000;
    color: #fff;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.filter-badge .filter-label {
    color: #999;
    font-weight: 400;
}

.filter-badge .filter-value {
    color: #fff;
    font-weight: 500;
}

.filter-badge .remove-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.filter-badge .remove-filter svg {
    width: 12px;
    height: 12px;
}

.filter-badge:hover .remove-filter {
    color: #fff;
}

.clear-all-filters {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #ddd;
    transition: all 0.2s;
}

.clear-all-filters:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #000;
    opacity: 1;
}

/* Archivio Main Layout */
.archivio-main {
    padding: 0;
    background: white;
    position: relative;
}

.archivio-container {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 0;
    max-width: 100vw;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

.back-to-archive {
    position: absolute;
    top: 5px;
    left: 0;
}

.foto-single-content-bts {
    position: relative;
    padding-top: 20px;
}

.related-title {
    font-weight: 400;
    font-size: 16px !important;
    text-transform: uppercase;
}

/* ========================================
   TIMELINE - BELOW THE SURFACE STYLE
======================================== */

.archivio-timeline {
    position: sticky;
    top: 30px;
    right: 0;
    height: auto;
    z-index: 10;
    pointer-events: none;
    background: transparent;
}

.timeline-inner {
    position: fixed;
    text-align: right;
    padding-right: 10px;
}

.timeline-content {
    position: sticky;
    text-align: right;
}

.timeline-year {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.timeline-year.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.timeline-year-label {
    font-size: 96px;
    font-weight: 400;
    color: #000;
    letter-spacing: -11px;
    line-height: .9;
    white-space: nowrap;
}


.timeline-year-count {
    display: none;
}

.timeline-loading {
    text-align: center;
    padding: 40px 20px;
    color: #ccc;
    font-size: 12px;
}

.timeline-loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f0f0f0;
    border-top-color: #999;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Grid Foto - 3 Colonne Masonry */
.archivio-content {
    padding: 20px 0px 20px 200px;
    background: white;
    position: relative;
    min-height: 63vh;
}

.archivio-stats {
    position: absolute;
    bottom: 20px;
    right: 20px;
    margin: 0;
    padding: 0;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: transparent;
    text-align: right;
    font-size: 10px;
    color: #bbb;
    z-index: 5;
}

.stat-item {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item strong {
    font-size: 11px;
    display: inline;
    margin: 0;
    font-weight: 500;
}

.archivio-grid {
    width: 100%;
}

.foto-item {
    width: calc(33.333% - 27px);
    margin-bottom: 50px;
    background: white;
    transition: transform 0.3s ease;
}

.foto-item:hover {
    transform: translateY(-8px);
}

.foto-link {
    display: block;
    color: inherit;
}

.foto-image {
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
    margin-bottom: 12px;
}

.foto-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.foto-item:hover .foto-image img {
    transform: scale(1.08);
}

.foto-info,
.related-info {
    padding: 0;
    display: flex;
    justify-content: space-between;
    margin: 0 10px;
}

.foto-title {
    font-size: 13px;
    margin-bottom: 4px;
    font-weight: 400;
    line-height: 1.4;
    color: #333;
    text-transform: uppercase;
}

.foto-meta {
    display: block;
    margin-bottom: 0;
    font-size: 10px;
    color: #aaa;
    font-weight: 400;
}

.foto-meta span {
    display: inline;
    margin-bottom: 4px;
}

/* Animazioni */
.foto-item {
    animation: fadeInUp 0.6s ease backwards;
}

.foto-item:nth-child(1) {
    animation-delay: 0.05s;
}

.foto-item:nth-child(2) {
    animation-delay: 0.1s;
}

.foto-item:nth-child(3) {
    animation-delay: 0.15s;
}

.foto-item:nth-child(4) {
    animation-delay: 0.2s;
}

.foto-item:nth-child(5) {
    animation-delay: 0.25s;
}

.foto-item:nth-child(6) {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* No Results */
.no-photos {
    text-align: center;
    padding: 120px 40px;
    color: #999;
    grid-column: 1 / -1;
}

.no-photos::before {
    content: "";
    display: block;
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.no-photos p {
    font-size: 16px;
    font-weight: 300;
    margin: 0;
    color: #aaa;
}

/* ========================================
   FILTERS SIDEBAR
======================================== */

.filters-sidebar {
    position: fixed;
    top: 0;
    left: -25vw;
    width: 25vw;
    height: 100vh;
    background: #000;
    color: #fff;
    z-index: 9999;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
}

.filters-sidebar.active {
    left: 0;
}

.filters-header {
    padding: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filters-header h3 {
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
}

.filters-content {
    padding: 30px;
}

.filter-group {
    margin-bottom: 40px;
}

.filter-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #999;
    font-weight: 500;
}

.filter-years {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.year-item {
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #fff;
}

.year-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.year-item.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.filters-toggle {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: #000;
    border: none;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.filters-toggle:hover {
    background: #333;
    transform: scale(1.05);
}

.filters-toggle .icon-search,
.filters-toggle .icon-close {
    position: absolute;
    transition: all 0.3s ease;
    color: #fff;
}

.filters-toggle .icon-search {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.filters-toggle .icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.filters-sidebar.active~.filters-toggle .icon-search {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.filters-sidebar.active~.filters-toggle .icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* ========================================
   SINGLE FOTO - Below the Surface Style
======================================== */

.foto-single-bts {
    background: #fff;
}

.foto-single-content-bts {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    position: relative;
}

.foto-hero {
    position: relative;
    margin-bottom: 20px;
}

.foto-hero-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 90vh;
    object-fit: contain;
}

.foto-year-overlay {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 120px;
    font-weight: 200;
    color: rgba(0, 0, 0, 0.15);
    letter-spacing: -8px;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.foto-nav-arrows {
    display: flex;
    gap: 10px;
    margin-bottom: 40px;
    justify-content: space-between;
}

.foto-nav-arrow {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #000;
    cursor: pointer;
    transition: all 0.2s ease;
}

.foto-nav-disabled {
    visibility: hidden;

}

.foto-nav-arrow:hover {
    background: #000;
    color: #fff;
}

.foto-nav-arrow:hover svg {
    stroke: #fff;
}

.foto-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px 60px;
    padding: 40px 0;
    border-top: 1px solid #e8e8e8;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    font-weight: 500;
}

.detail-value {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

/* Details Grid */
.foto-details-bts {
    margin-bottom: 60px;
}

.foto-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px 60px;
    padding: 40px 0;
    border-top: 1px solid #e8e8e8;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item.detail-full {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    font-weight: 500;
}

.detail-value {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

.detail-value a {
    color: #000;
    text-decoration: underline;
}

.detail-value a:hover {
    opacity: 0.7;
}

.back-to-archive {
    position: absolute;
    top: 5px;
}

.back-link {
    display: inline-block;
    font-size: 14px;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 0.6;
}

/* Related Photos Slider */
.foto-related-bts {
    border-top: 1px solid #e8e8e8;
    padding-top: 60px;
}

.related-title {
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.related-slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}

.slider-arrow {
    width: 50px;
    height: 50px;
    background: #fff;
    border: 1px solid #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.slider-arrow:hover {
    background: #000;
}

.slider-arrow:hover svg {
    stroke: #fff;
}

.slider-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.related-slider {
    display: flex;
    gap: 20px;
    overflow: hidden;
    transition: transform 0.4s ease;
    flex: 1;
}

.related-item {
    flex: 0 0 calc(33.333% - 14px);
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.related-item:hover {
    transform: translateY(-5px);
}

.related-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f5f5f5;
    margin-bottom: 10px;
}

.related-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.related-title-text {
    font-size: 13px;
    text-transform: uppercase;
    color: #333;
}

.related-anno {
    font-size: 11px;
    color: #999;
}

.related-loading,
.no-related {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}


/* ========================================
   FOOTER
======================================== */

.site-footer {
    background: var(--color-primary);
    color: var(--color-secondary);
    padding: 60px 0 30px;
    margin-top: 100px;
}

.footer-info a {
    text-decoration:underline;
    color: var(--color-secondary);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.footer-menu {
    display: flex;
    gap: 30px;
    list-style: none;
    margin-bottom: 30px;
}

.footer-menu a {
    color: var(--color-secondary);
    font-size: 14px;
}

/* ========================================
   RESPONSIVE - TABLET
======================================== */

@media (max-width: 1200px) {
    .foto-item {
        width: calc(50% - 20px);
    }

    .timeline-year-label {
        font-size: 72px;
    }

    .archivio-container {
        grid-template-columns: 1fr 100px;
    }

    .filters-sidebar {
        width: 35vw;
        left: -35vw;
    }

    .filter-years {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   RESPONSIVE - MOBILE (max-width: 768px)
======================================== */

@media (max-width: 768px) {

    .container,
    .header-container,
    .footer-container {
        padding: 0 20px;
    }

    /* HEADER MOBILE */
    .header-container {
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
        /* padding: 20px; */
    }

    .site-branding {
        flex: 1;
        z-index: 1001;
    }

    /* Search Icon Mobile */
    .search-text-desktop {
        display: none;
    }

    .search-icon-mobile {
        display: block;
        width: 24px;
        height: 24px;
        stroke: #000;
    }

    .header-search-btn {
        padding: 0;
        width: 24px;
        height: 24px;
    }

    .header-search-box {
        order: 2;
        margin-right: 10px;
        z-index: 1001;
    }

    /* Menu Toggle VISIBILE */
    body .site-header .menu-toggle {
        display: flex !important;
        flex-direction: column !important;
        gap: 5px !important;
        z-index: 1002;
        order: 3;
    }

    /* Menu Mobile Full Screen */
    .main-navigation {
        position: fixed;
        top: 0; 
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--color-secondary);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-top: 1px solid var(--color-primary);
        z-index: 1000;
        overflow-y: auto;
        padding: 0;
    }

    .main-navigation.active {
        transform: translateX(0);
    }

    .main-navigation .nav-menu {
        flex-direction: column;
        padding: 40px 0px;
        gap: 20px;
    }

    .main-navigation .nav-menu a {
        font-size: 18px;
        display: block;
        padding: 12px 20px;
        border-bottom: 1px solid #f0f0f0;
        width:100vw;
    }

    .menu-buttons {
        gap: 0;
    }

    /* ARCHIVIO MOBILE */
    body .archivio-page .archivio-container {
        display: block !important;
        padding: 0;
        position: relative;
    }

    body .archivio-page .archivio-content {
        padding: 15px 10px 120px !important;
    }

    /* TIMELINE MOBILE STICKY */
    .archivio-timeline {
        position: sticky !important;
        top: 70px !important;
        /* sotto header */
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        z-index: 50;
        pointer-events: none;
    }

    .timeline-inner {
        position: fixed !important;
        right: 5px !important;
        /* spostata a destra */
        top: 130px !important;
        width: auto !important;
    }

    .timeline-year-label {
        font-size: 80px !important;
        font-weight: 300 !important;
        letter-spacing: -8px !important;
        line-height: 1 !important;
    }

    /* Stats rimangono fisse in basso, OK */
    .archivio-stats {
        position: fixed !important;
        bottom: 90px !important;
        right: 15px !important;
        z-index: 50;
    }

    body .archivio-page .stat-item {
        font-size: 11px !important;
        color: rgba(0, 0, 0, 0.25) !important;
    }

    /* GRID 2 COLONNE - SOLO FOTO */
    body .archivio-page .archivio-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
    }

    body .archivio-page .foto-item {
        width: 100% !important;
        margin-bottom: 0 !important;
        background: transparent !important;
    }

    body .archivio-page .foto-item:hover {
        transform: none !important;
    }

    body .archivio-page .foto-image {
        aspect-ratio: 1 !important;
        margin-bottom: 0 !important;
    }

    body .archivio-page .foto-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    /* NASCONDI INFO FOTO */
    body .archivio-page .foto-info,
    body .archivio-page .foto-title,
    body .archivio-page .foto-meta {
        display: none !important;
    }

    /* FILTRI MOBILE */
    .filters-sidebar {
        width: 80vw;
        left: -80vw;
    }

    .filters-toggle {
        width: 50px !important;
        height: 50px !important;
        bottom: 20px !important;
        left: 20px !important;
    }

    .filter-years {
        grid-template-columns: repeat(3, 1fr);
    }

    /* ALTRO */
    .hero-content {
        grid-template-columns: 1fr;
    }

    .hero-pattern {
        height: 300px;
    }

    .page-title {
        font-size: 32px;
    }

    .foto-details-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    /* Nasconde il testo "Cerca" nei bottoni */
    .search-text-desktop {
        display: none;
    }

    .search-icon-mobile {
        display: block;
    }

    /* Overlay */
    .header-search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(10, 10, 10, 0.8);
        backdrop-filter: blur(4px);
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
        z-index: 9999;
    }

    .header-search-overlay.active {
        display: flex;
    }

    /* Input fullscreen */
    .header-search-overlay input[type="search"] {
        width: 100%;
        padding: 16px 20px;
        font-size: 18px;
        border-radius: 12px;
        border: 1px solid var(--color-primary);
        background: var(--color-secondary);
        color: var(--color-white);
    }

    /* Icona chiusura */
    .header-search-close {
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 32px;
        cursor: pointer;
        color: var(--color-white);
    }

    .header-search-box {
        display: flex;
        flex: 1 1 auto;
        /* permette di adattarsi */
        max-width: 100%;
        /* non supera mai lo schermo */
        overflow: hidden;
        /* per sicurezza */
    }

    .header-search-box.active .header-search-input {
        width: 100% !important;
        /* prende tutta la larghezza disponibile */
        padding: 8px 12px;
        opacity: 1;
    }
}

/* ========================================
   RESPONSIVE - SMALL MOBILE (max-width: 480px)
======================================== */

@media (max-width: 480px) {
    .site-title {
        font-size: 18px;
    }

    body .archivio-page .archivio-grid {
        gap: 6px !important;
    }

    body .archivio-page .archivio-content {
        padding: 15px 8px 120px !important;
    }

    .timeline-year-label {
        font-size: 64px !important;
        letter-spacing: -6px !important;
    }

    .timeline-inner {
        right: 0px !important;
    }

    .archivio-stats {
        right: 10px !important;
    }

    .filters-sidebar {
        width: 90vw;
        left: -90vw;
    }

    .filter-years {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-title {
        font-size: 24px;
    }

    .foto-year-overlay {
        font-size: 48px;
        right: 15px;
    }
}


/* 2 colonne da mobile */
@media (max-width: 768px) {
    .archivio-grid {
        column-count: 2;
        column-gap: 30px;
    }

    .foto-item {
        break-inside: avoid;
        margin-bottom: 30px;
        width: 100% !important;
        /* importante per evitare collisioni col JS */
        position: static !important;
        /* evita posizionamenti rimasti da Masonry */
    }
}

/* 1 colonna su mobile piccolo */
@media (max-width: 480px) {
    .archivio-grid {
        column-count: 1;
    }
}