/* ================================================= */
/*          STILURI PENTRU PAGINA ARHIVĂ             */
/* ================================================= */

/* Antetul paginii */
.archive-header {
    /* Setări de bază pentru text și spațiere */
    color: var(--color-white);
    text-align: center; /* <-- CHEIA PENTRU CENTRARE */
    padding: 100px 20px;
    
    /* Poziționare pentru a permite suprapunerea overlay-ului */
    position: relative;
    z-index: 1;

    /* Imaginea de fundal, fără gradient direct aici */
    background-image: url('../images/custi-gaini.jpg'); /* Asigură-te că imaginea există */
    background-size: cover;
    background-position: center;
}

/* ================================================= */
/*      STILURI FINALE PENTRU ANTETUL PAGINII (AJUSTATE) */
/* ================================================= */

.archive-header {
    color: var(--color-white);
    text-align: center;
    
    /* MODIFICAT: Înălțime mai mică, mai compactă */
    padding: 70px 20px; 
    
    position: relative;
    z-index: 1;
    background-image: url('../images/custi-gaini.jpg');
    background-size: cover;
    background-position: center;
}

.archive-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 46, 53, 0.8); 
    z-index: -1;
}

.archive-header .container {
    position: relative;
}

/* MODIFICAT: Fonturi mult mai mari și mai de impact */
.archive-header h1 {
    font-size: clamp(2.8em, 6vw, 4em); /* Dimensiune considerabil mai mare */
    font-weight: 800; /* Mai bold */
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
    margin-bottom: 15px; /* Spațiu între titlu și paragraf */
}

.archive-header p {
    font-size: 1.3em; /* Paragraf mai mare și mai lizibil */
    font-weight: 400; /* Font normal, pentru contrast cu titlul */
    max-width: 700px; /* O lățime maximă pentru a nu se "lăbărța" */
    margin: 0 auto; /* Centrarea paragrafului */
    text-shadow: 1px 1px 8px rgba(0, 0, 0, 0.7);
}
/* Secțiunea principală a galeriei */
.gallery-section {
    padding: 80px 20px;
    background-color: var(--color-light-grey);
}

/* Navigatorul pentru Tab-uri */
.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
}
.tab-link {
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: 700;
    border: 2px solid #dee2e6;
    background-color: #fff;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.tab-link .fas {
    margin-right: 10px;
}
.tab-link.active, .tab-link:hover {
    background-color: var(--color-deep-teal);
    color: #fff;
    border-color: var(--color-deep-teal);
}

/* Conținutul Tab-urilor */
.tab-pane {
    display: none; /* Ascundem toate tab-urile implicit */
}
.tab-pane.active {
    display: block; /* Afișăm doar tab-ul activ */
}

/* Grila comună pentru foto și video */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Stil pentru elementele din grilă */
.media-item {
    background-color: #fff;
    border-radius: var(--border-radius-soft);
    box-shadow: var(--box-shadow-subtle);
    overflow: hidden;
    transition: all 0.3s ease;
}
.media-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Stil specific pentru imagini */
.media-item.gallery-item {
    position: relative;
    cursor: pointer;
}
.media-item.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}
.media-item .overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(26, 46, 53, 0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.media-item:hover .overlay {
    opacity: 1;
}

/* Stil specific pentru video-uri */
.video-item iframe {
    width: 100%;
    height: 200px; /* Înălțime standard pentru video */
    display: block;
    border: none;
}
.video-item h3 {
    font-size: 1.1em;
    font-weight: 600;
    padding: 15px;
    margin: 0;
    color: var(--color-deep-teal);
}

/* ================================================= */
/*          STILURI CORECTATE PENTRU ARHIVA          */
/* ================================================= */

/* 1. Centrează butoanele de filtrare pe ani */
.year-filter-nav {
    display: flex;
    justify-content: center; /* ALINIAZĂ PE MIJLOC */
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    
}
.year-filter-link {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s ease;
}
.year-filter-link:hover { background-color: #e9ecef; }
.year-filter-link.active {
    background-color: var(--color-coral-red);
    color: white;
    border-color: var(--color-coral-red);
}

/* 2. Logica de afișare pentru conținutul anilor */
.year-content-pane { display: none; }
.year-content-pane.active { display: block; }

/* 3. Setează grila de video la 3 coloane */
#video .media-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* ASIGURĂ MAX 3 COLOANE PE ECRANE MARI */
}

/* 4. Corectează aspectul video-urilor (cea mai importantă parte) */
.media-item.video-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 16 / 9; /* FORȚEAZĂ RAPORTUL DE ASPECT CORECT */
    background-color: #000; /* Fundal negru pentru un aspect curat */
}

/* Asigură că video-ul umple containerul FĂRĂ a se deforma */
.media-item.video-item video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Umple spațiul, decupând excesul dacă este necesar */
    pointer-events: none;
}

/* 5. Stilizarea iconiței de play */
.media-item.video-item::after {
    content: '\f04b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 15px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
    pointer-events: none;
}
.media-item.video-item:hover::after {
    transform: translate(-50%, -50%) scale(1.1);
    color: #fff;
}

/* 6. Stil pentru Lightbox-ul video */
.video-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
}
.video-lightbox-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
}
.video-lightbox-container video {
    width: 100%;
    height: 100%;
}
.video-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 36px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
}

/* ================================================= */
/*          STIL NOU PENTRU NAVIGAȚIE VIDEO          */
/* ================================================= */

/* Reutilizează stilul existent pentru butoanele de navigație */
.video-lightbox-overlay .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.3);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    z-index: 1002;
}

.video-lightbox-overlay .lightbox-nav:hover {
    background-color: rgba(0,0,0,0.6);
}

#video-lightbox-prev {
    left: 15px;
}

#video-lightbox-next {
    right: 15px;
}
/* Stiluri pentru Lightbox (se refolosesc din articol.css, dar le punem și aici pentru siguranță) */
.lightbox-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(26, 46, 53, 0.9); display: none; justify-content: center; align-items: center; z-index: 2000; padding: 20px; box-sizing: border-box; }
#lightbox-image { max-width: 90vw; max-height: 85vh; border-radius: 8px; box-shadow: 0 15px 40px rgba(0,0,0,0.4); }
.lightbox-close { position: absolute; top: 20px; right: 35px; color: white; font-size: 40px; font-weight: bold; cursor: pointer; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background-color: rgba(26, 46, 53, 0.5); color: white; border: 2px solid rgba(255, 255, 255, 0.3); border-radius: 50%; width: 50px; height: 50px; font-size: 1.5em; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: all 0.3s ease; }
.lightbox-nav:hover { background-color: var(--color-coral-red); }
#lightbox-prev { left: 20px; }
#lightbox-next { right: 20px; }

/* ================================================= */
/*          ADAPTARE NOUĂ PENTRU MOBIL               */
/* ================================================= */

@media (max-width: 768px) {
    /* Schimbăm layout-ul navigatorului de tab-uri */
    .tabs-nav {
        /* CHEIA SOLUȚIEI: Schimbăm direcția pe verticală */
        flex-direction: column;
        
        /* Aliniem butoanele pe toată lățimea pentru un aspect uniform */
        align-items: stretch; 
        
        /* Spațiul se va aplica acum pe verticală */
        gap: 10px; 
    }

    /* Asigurăm că textul din buton este centrat */
    .tabs-nav .tab-link {
        text-align: center;
    }

    /* Ajustăm grila media pentru a avea o singură coloană pe mobil */
    .media-grid {
        grid-template-columns: 1fr;
    }
}
