/* Header */
.center {
    display: block;
    margin: 0 auto 20px auto;
    width: 30%;
    max-width: 300px;
}



@font-face {
    font-family: 'Lino'; /*a name to be used later*/
    src: url('Linotype Feltpen Regular.otf'); /*URL to font*/
}

@font-face {
    font-family: 'main'; /*a name to be used later*/
    src: url('main-regular.otf'); /*URL to font*/
}

@font-face {
    font-family: 'courier';
    src: url('CourierPrime-Regular.ttf');
}


body{
    font-family: 'main';
}

.hero-container {
    position: relative;
    width: 100%;
    height: 90vh; /* 60% of viewport height */
    overflow: hidden;
    margin-bottom: 40px;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: -1;
}

.hero-overlay {
    position: absolute;
    font-family: 'courier';
    bottom: 8%;
    left: 5%;
    width: 30%;
    color: white;
    padding: 40px 20px;
    text-align: center;
}

.hero-overlay h1 {
    margin: 0;
    font-size: 3.5em;
    font-weight: 300;
    letter-spacing: 2px;
}

/* ─── Filter Toggle Button ────────────────────────────────────── */
.tabs-and-filter-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px;
}

#filter-toggle {
    font-family: 'courier';
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #547da6;
    background: #e8e5e1;
    border: 1px solid rgba(84, 125, 166, 0.25);
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0 0;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

#filter-toggle:hover {
    background: #dedad5;
    color: #6b1a15;
    border-color: rgba(107, 26, 21, 0.3);
}

#filter-toggle.active {
    background: #6b1a15;
    color: white;
    border-color: #6b1a15;
}

#filter-toggle .toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

#filter-toggle.active .toggle-icon {
    transform: rotate(45deg);
}

/* ─── Filters Layout ─────────────────────────────────────────── */
#filters-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    width: 100%;
    padding: 0 30px;
    box-sizing: border-box;
    background: #f5f3f0;
    border-bottom: 1px solid rgba(84, 125, 166, 0.15);
    /* Collapsed by default */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}

#filters-container.open {
    max-height: 300px;
    opacity: 1;
    padding: 20px 30px;
}

/* ─── Each filter group ───────────────────────────────────────── */
.filter-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Filter group label */
.filter-label {
    font-family: 'courier';
    font-size: 1.2em;
    color: #547da6;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-align: center;
}

/* ─── Segmented control wrapper ──────────────────────────────── */
#authors, #sides, #people {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    border: 1px solid rgba(84, 125, 166, 0.3);
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

/* ─── Filter buttons as segmented control ────────────────────── */
#authors .tab-btn,
#sides .tab-btn,
#people .tab-btn {
    font-family: 'courier';
    font-size: 0.72em;
    color: #7a96a8;
    background: transparent;
    border: none;
    border-right: 1px solid rgba(84, 125, 166, 0.2);
    border-radius: 0;
    cursor: pointer;
    margin: 0;
    text-transform: uppercase;
    line-height: 1.5;
}

#authors .tab-btn:last-child,
#sides .tab-btn:last-child,
#people .tab-btn:last-child {
    border-right: none;
}

#authors .tab-btn:hover,
#sides .tab-btn:hover,
#people .tab-btn:hover {
    color: #6b1a15;
    background: rgba(107, 26, 21, 0.05);
}

#authors .tab-btn.active,
#sides .tab-btn.active,
#people .tab-btn.active {
    color: white;
    background: #6b1a15;
}

#authors .tab-btn.active::after,
#sides .tab-btn.active::after,
#people .tab-btn.active::after {
    display: none;
}

/* The Grid Container */
#photo-grid {
    width: 100%;
    box-sizing: border-box;
}

.photo-page-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-auto-rows: minmax(0, calc(100%));
    width: 100%;
    box-sizing: border-box;
    background-image: url('leaf.jpeg');
    background-size: calc(100% / 10) auto;
    background-repeat: repeat;
    background-color: #f0f0f0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}

.photo-page-grid.loaded {
    opacity: 1;
    pointer-events: auto;
}

/* ─── Load more button ───────────────────────────────────────── */
.load-more-btn {
    display: block;
    margin: 24px auto;
    font-family: 'courier';
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #547da6;
    background: white;
    border: 1px solid rgba(84, 125, 166, 0.35);
    border-radius: 30px;
    padding: 10px 28px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.load-more-btn:hover {
    background: #6b1a15;
    color: white;
    border-color: #6b1a15;
}

/* ─── Download button on grid ────────────────────────────────── */
.photo-download-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 3;
    padding: 6px;
    box-sizing: border-box;
}

.photo-download-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 1 !important;
}

.photo:hover .photo-download-btn {
    opacity: 1;
}

/* ─── Download button in lightbox ────────────────────────────── */
.lightbox-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    margin-left: 14px;
    padding: 7px;
    box-sizing: border-box;
    vertical-align: middle;
    transition: background 0.2s;
}

.lightbox-download-btn:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-download-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: invert(1);
}

.grid-loading-text {
    text-align: center;
    font-family: 'courier';
    font-size: 0.85em;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #547da6;
    padding: 40px 0;
    opacity: 0.7;
}


/* The Grid Container */
#photo-grid2 {
    display: grid;
    /* 12 Equal Columns */
    grid-template-columns: repeat(7, 1fr); 
    
    /* CRITICAL FIX: Force rows to be square (1:1 ratio) based on column width */
    /* Formula: Column Width (100% / 12) */
    /* We use 'minmax' to ensure the row has height even if empty */
    grid-auto-rows: minmax(0, calc((100%))); 
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    
    /* Background Settings */
    background-image: url('leaf.jpeg');
    
    /* FIX: Corrected Calc Syntax */
    /* 1. (100% / 12) = Width of one column fraction */
    /* 2. + 5px = Add the gap size */
    /* 3. auto = Keep the image's natural height ratio (1:1) */
    background-size: calc((100% / 7)) auto;
    
    background-repeat: repeat;
    background-position: top left;
    background-color: #f0f0f0; /* Fallback color */
    padding-right: 0px;
    padding-left: 0px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

#photo-grid2.loaded {
    opacity: 1;
}

/* Class to show the grid */
#photo-grid.loaded {
    opacity: 1;
    pointer-events: auto;
}

/* The Photo Item */
.photo {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
    background-color: #fff;
    
    /* Default: 1x1 */
    grid-column: span 1;
    grid-row: span 1;
    
    /* Ensure it fills the grid cell completely */
    width: 100%;
    height: 100%;
    z-index: 1; /* Sit above background */
    cursor: pointer;
}

/* Hover effect */
.photo:hover {
    transform: scale(1.01);
    z-index: 2;
}

/* The Image */
.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 0;
    opacity: 0; /* Initially invisible */
}
.photo img.loaded{
    opacity: 1;
}

/* Wide: 3 cols x 2 rows */
.photo.tile-wide {
    grid-column: span 3;
    grid-row: span 2;
}

/* Tall: 2 cols x 3 rows */
.photo.tile-tall {
    grid-column: span 2;
    grid-row: span 3;
}

/* Wide: 3 cols x 2 rows */
.photo.tile-wide2 {
    grid-column: span 3;
    grid-row: span 2;
}

/* Tall: 2 cols x 3 rows */
.photo.tile-tall2 {
    grid-column: span 2;
    grid-row: span 3;
}

/* Big: 2 cols x 2 rows */
.photo.tile-big {
    grid-column: span 2;
    grid-row: span 2;
}

.photo.tile-wide-groupes {
    grid-column: span 5;
    grid-row: span 3;
}
.photo.tile-tall-groupes {
    grid-column: span 3;
    grid-row: span 5;
}


/* The Title Overlay - CENTERED */
.cat-title {
    position: absolute;
    font-family: 'courier';
    top:85%;
    left: 50%;
    transform: translate(-50%, -50%); /* Perfectly centers the element */
    
    width: 100%; /* Prevents text from touching edges on small tiles */
    
    padding: 15px 20px;
    
    background: rgba(0,0,0, 0.4); /* Solid brand color background */
    color: white;
    text-align: center;
    font-size: 1.3em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    
    z-index: 2; /* Sits on top of image and overlay */
    transition: all 0.3s ease;
}

.photo:hover .cat-title {
    background: rgba(0,0,0, 0.6);
}


/* Lightbox Styles */
#lightbox {
    position: fixed;
    z-index: 9999;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Dark background */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#lightbox.show {
    opacity: 1;
}

/* The Image */
.lightbox-content {
    max-width: 99%;
    max-height: 95vh;
    object-fit: contain;
}

/* Caption */
#lightbox-caption {
    color: #fff;
    margin-top: 15px;
    font-size: 1.2em;
    text-align: center;
}

/* Close Button (Top Right) */
.lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

/* Navigation Arrows */
.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    padding: 16px;
    user-select: none;
    transition: 0.3s;
    z-index: 10000;
}

.lightbox-prev:hover, .lightbox-next:hover {
    color: #ccc;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }


/* Tab Container */
.tab-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0 30px 0;
    padding: 0 0px;
}

/* Tab Button Style */
.tab-btn {
    font-family: 'Lino';
    padding: 10px 20px;
    margin: 5px;
    font-size: 20px;
    font-weight: 600;
    color: #547da6;
    background-color: #d3d0cc;
    border: none;
    border-radius: 20px; /* Rounded pills */
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

a{
    color: #547da6;
    text-decoration: none;
    font-size: 20px;
}

.tab-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

/* Active Tab Style */
.tab-btn.active {
    background-color: #6b1a15; /* Your brand color */
    color: white;
    box-shadow: 0 1px 5px #511f1a;
    transform: translateY(-2px);
}

.intro-merci {
    font-size: 30px;
    text-align: center;
}

.remerciements h1 {
    text-align: center;
    font-size: 50px;
}

.remerciements p {
    font-size: 20px;
}

.liste-fleurs1 {
    width: 45%;
    float: left;
    padding: 10px;
    margin-top: -10px;
    text-align: center;
}
.liste-fleurs2 {
    width: 45%;
    overflow: hidden;
    padding: 10px;
    margin-top: -10px;
    margin-bottom: 30px;
    text-align: center;
}

.remerciements {
    width: 75%;
    margin-left: 12%;
}

.div-intern {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    height: auto;
    margin-bottom: 40px;
}

.liste-merci-outside {
    float: left;
    background-color: #fff;
}

.liste-merci-inside {
    text-align: center;
    padding-top: 20px;
}

.leaf-left, .leaf-right {
    float:left;
    display: flex;
    flex-direction: column; /* Ensures images stack vertically */
    align-items: center;     /* Centers items horizontally */
    /* Background Settings */
    background-image: url('leaf.jpeg');
    
    /* FIX: Corrected Calc Syntax */
    /* 1. (100% / 12) = Width of one column fraction */
    /* 2. + 5px = Add the gap size */
    /* 3. auto = Keep the image's natural height ratio (1:1) */
    background-size: 100% auto;
    
    background-repeat: repeat;
    background-position: top left;
}

.leaf {
    width: 75%;
    display: block;
}



@media (max-width: 768px) {
    .lightbox-prev, .lightbox-next { font-size: 30px; padding: 10px; }
    #photo-grid, .photo-page-grid {grid-template-columns: repeat(6, 1fr); background-size: calc((100% / 6)) auto;}    .photo {display: block; margin: 0 auto 20px auto;}
    .center { width: 50%; }
    .tab-btn { font-size: 12px; padding: 8px 12px; }
    /* 1. Ajuster la grille pour 2 colonnes (au lieu de 3) pour des images plus grandes */
    #photo-grid2 {
        grid-template-columns: repeat(6, 1fr); 
        /* Ajuster la hauteur des lignes pour qu'elles suivent la largeur de la colonne (environ 50%) */
        grid-auto-rows: minmax(0, calc(100%)); 
        background-size: calc((100% / 6)) auto;
    }
    .photo.tile-tall2, .photo.tile-tall, .photo.tile-tall-groupes {
        grid-column: span 6;
        grid-row: span 9;
    }

    .photo.tile-wide2, .photo.tile-wide, .photo.tile-wide-groupes{
        grid-column: span 6;
        grid-row: span 4;
    }

    /* 2. Réduire la taille du texte sur les cartes */
    .cat-title {
        font-size: 0.9em; /* Réduit la taille par rapport au desktop */
        padding: 8px 10px; /* Réduit le padding pour moins de texte */
        top: 75%; /* Déplace le texte légèrement plus haut pour éviter de couper l'image */
        font-size: 1.1em; /* Ajustement fin si nécessaire */
    }

    /* 4. Ajuster le header et les autres éléments pour le mobile */
    .center {
        width: 60%; /* Logo un peu plus grand */
        max-width: 200px;
    }
    
    .hero-overlay h1 {
        font-size: 2.5em; /* Réduire les noms sur mobile */
    }

    .remerciements {
        width: 90%;
        margin-left: 5%;
    }

    .div-intern {
        grid-template-columns: 1fr; /* Empiler les listes verticalement */
        padding: 0 10px;
    }
    
    .liste-fleurs1, .liste-fleurs2 {
        width: 100%;
        float: none;
        display: block;
        margin-top: 10px;
    }

    /* Filter buttons on mobile: allow wrapping horizontally */
    #filters-container {
        gap: 20px;
        padding: 8px 12px;
    }

    #authors .tab-btn,
    #sides .tab-btn,
    #people .tab-btn {
        font-size: 0.65em;
        padding: 2px 9px;
    }
    
}
@media (max-width: 1300px) {
#photo-grid, .photo-page-grid {grid-template-columns: repeat(6, 1fr); background-size: calc((100% / 6)) auto;}}