/* =========================================================
   🎨 directory.css — Styles globaux pour l'annuaire
   ========================================================= */

/* =========================================================
   🎨 VARIABLES GLOBALES (Design Tokens)
   ========================================================= */
:root {
    /* Couleurs principales */
    --color-primary: #278FE2;          /* Bleu principal utilisé pour titres/links */
    --color-primary-dark: #1e3d7b;     /* Bleu foncé au survol */
    --color-dark-blue: #092851;        /* Bleu foncé pour boutons non-actifs */
    --color-orange: #f28c00;           /* Orange accent / département */
    --color-accent: #f57c00;           /* autre orange (breadcrumbs) */

    /* Textes et fonds */
    --color-text-dark: #333;
    --color-text-medium: #444;
    --color-text-light: #999;
    --color-background-light: #e0e0e0;
    --color-background-off-white: #f1f1f1;
    --color-row-even: #ffffff;
    --color-row-odd: #eeeeee;
    --color-row-hover: #d7dff2;

    /* Espacement */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;

    /* Rayons */
    --radius-sm: 10px;
    --radius-lg: 25px;

    /* Typographie */
    --font-family: 'Raleway', sans-serif;
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 1.8rem;
}

/* =========================================================
   🧱 STRUCTURE GLOBALE
   ========================================================= */
* { box-sizing: border-box; }

body {
    margin: 0;
    padding-top: 0 !important;
    font-family: var(--font-family);
    color: var(--color-text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.brochures-layout {
    display: flex;
    flex-direction: column;
    width: min(90%, 1600px);
    box-sizing: border-box;
    margin: var(--spacing-lg) auto;
    padding: 0 var(--spacing-lg);
    box-sizing: border-box;
    background-color: #fff;
}

.content-align-logo {
    margin-top: var(--spacing-xl);
}


.bandeau-sites {
    background-color: rgba(40, 143, 226, 1);
    color: white;
    text-align: left;
    padding: 12px 0 12px 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    width: 100%;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bandeau-sites p {
    margin: 0;
}

.brochures-container {
    display: flex;
    flex-direction: row;  /* <- assure les 2 colonnes côte à côte */
    gap: 20px;
    margin-bottom: 60px;
}

.left-column {
    flex: 1;
}

.right-column {
    flex: 1;
}

.single-column {
    width: 100%;
    padding: 20px;
}

.single-column #main-layout {
    width: 900px !important;
    height: 600px !important;
}

.single-column #viewer-layout,
.single-column #viewer-inner-layout {
    width: 100% !important;
    height: 100% !important;
}

/* MODAL FULLSCREEN */
.flipbook-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

/* Conteneur du flipbook */
.flipbook-modal-content {
    width: 90%;
    max-width: 1200px;
    height: 90%;
    position: relative;
}

/* Bouton fermer */
.flipbook-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 32px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.flipbook-close:hover {
    color: #ff5555;
}

.flipbook-preview {
    display: flex;
    justify-content: center; /* Centre horizontalement */
    align-items: center;     /* Centre verticalement (si le div a une hauteur) */
    width: 100%;             /* S'assure que le div prend toute la largeur de la colonne */
    margin: 20px 0;          /* Ajoute un peu d'espace au-dessus et en-dessous */
}

.flipbook-preview img {
    width: 70%;
    cursor: pointer;
    transition: 0.2s;
}

.flipbook-preview img:hover {
    transform: scale(1.02);
}

.flip-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99999;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 22px;
    cursor: pointer;
    border-radius: 6px;
}

.flip-prev-btn {
    left: 15px;
}

.flip-next-btn {
    right: 15px;
}

.flip-nav-btn:hover {
    background: rgba(0,0,0,0.8);
}

.brochure-info {
    display: flex;
    flex-direction: row; /* Pour que le texte et les liens s'empilent */
    gap: 0px;
    margin: 20px auto 0 auto; /* "auto" à gauche et à droite centre le bloc */
    align-items: flex-start; /* Aligne le contenu interne à gauche du bloc de 80% */
    width: 80%;
}

.brochure-info-text {
    flex: 1;
}

.brochure-info-text h3 {
    text-transform: none;
}

/* Le nouveau wrapper qui contient le picto et le bloc bleu */
.brochure-global-wrapper {
    flex: 1; /* Prend la moitié de droite */
    display: flex;
    flex-direction: row; /* Met le picto à gauche du bloc bleu */
    align-items: center; /* Centre le picto verticalement par rapport au bloc bleu */
    gap: 15px; /* Espace entre le picto et la bordure bleue */
}

.brochure-picto img {
    width: 45px; /* Taille du picto */
    height: auto;
    display: block;
}

.brochure-info-links {
    flex: 1;
}

.brochure-info h3,
.brochure-info h4 {
    margin: 5px 0 10px 0;
    font-family: 'Raleway';
    color: #707070;
}

.brochure-info a {
    color: #092851;
    font-weight: 600;
    text-decoration: none;
}

.brochure-info a:hover {
    text-decoration: underline;
}

.bordered-block {
    border-top: 1px solid #092851;
    border-bottom: 1px solid #092851;
    padding: 10px 0;
}

.brochure-title {
    display: flex;         /* Aligne le H4 et l'Image sur la même ligne */
    justify-content: space-between;
    align-items: center;   /* Centre verticalement l'image par rapport au texte */
    gap: 10px;             /* Crée un espace entre le texte et le drapeau */
    margin-bottom: 15px;   /* Espace avec les liens en dessous */
}

.brochure-title h4 {
    display: flex;
    align-items: center;
    gap: 10px; /* espace entre texte et drapeau */
    color: #092851;
    margin: 0;
}

.flag-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.flag-btn.fr {
    background-image: url('https://upload.wikimedia.org/wikipedia/en/c/c3/Flag_of_France.svg');
}

.flag-btn.en {
    background-image: url('https://upload.wikimedia.org/wikipedia/en/a/ae/Flag_of_the_United_Kingdom.svg');
}

/* PEPITS */

/* Container principal des PEPITS */

.pepits-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.pepits-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;

    width: 100%;
    margin: 20px 0;
    align-items: stretch;
}

.pepits-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* équilibre vertical */
    align-items: center;

    height: 100%;
    text-align: center;
}

.pepits-preview {
    width: 100%;
    height: 560px; /* ajuste si besoin */
    display: flex;
    align-items: center;
    justify-content: center;
}

.pepits-card img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.pepits-card img:hover {
    transform: scale(1.02);
}

.pepits-year,
.autres-title {
    margin-top: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #0B2951;
}

.pepits-year {
    margin-top: 12px;
    min-height: 28px;
}

.pepits-download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    margin-top: auto;
    padding-top: 12px;

    color: #278FE2;
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
}

.pepits-download-link .download-icon img {
    width: 34px;
}

.pepits-text {
    text-align: center;
    color: #333;
    font-size: 1rem;
    margin: 15px 0 30px;
    line-height: 1.4;
}

.autres-title {
    margin-top: 10px;
    font-weight: 600;
    color: #0B2951;
}

/* Boutons < > */
.pepits-prev,
.pepits-next {
    background-color: #278ee1;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    height: fit-content;
}

@media (max-width: 768px) {

    .brochures-layout {
        width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .page-title {
        font-size: 22px !important;
        margin: 20px 0 !important;
        text-align: center;
    }

    .blue-banner h2 {
        font-size: 16px !important;
        line-height: 1.25;
        padding: 10px 15px;
        text-align: center;
    }

    .brochures-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 35px;
        width: 100%;
        padding: 0;
        box-sizing: border-box;
    }

    .left-column,
    .right-column,
    .single-column {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        box-sizing: border-box;
    }

    .flipbook-preview {
        width: 100%;
        max-width: 260px;
        margin: 15px auto;
    }

    .flipbook-preview img {
        width: 100% !important;
        height: auto !important;
        display: block;
        border-radius: 8px;
    }

    .brochure-info {
        width: 100%;
        box-sizing: border-box;
    }

    .brochure-info-text h3 {
        font-size: 16px !important;
        line-height: 1.25;
        text-align: center;
        margin: 10px 0;
    }

    .brochure-global-wrapper.bordered-block {
        display: flex !important;
        flex-direction: column !important;
        align-items: center;
        text-align: center;

        width: 100%;
        padding: 15px;
        gap: 12px;

        box-sizing: border-box;
    }

    .brochure-picto img {
        width: 36px !important;
    }

    .brochure-info-links {
        margin-left: 0 !important;
        width: 100%;
    }

    .brochure-title {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        margin-bottom: 8px;
    }

    .brochure-title h4 {
        font-size: 14px !important;
        line-height: 1.25;
        margin: 0;
    }

    .brochure-info-links a {
        font-size: 13px !important;
        line-height: 1.5;
    }

    .flag-btn,
    .flag-icon,
    .brochure-title img {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        flex-shrink: 0 !important;
        border-radius: 50% !important;
        object-fit: cover !important;
        display: inline-block !important;
    }

    .pepits-slider-wrapper {
        gap: 8px;
    }

    .pepits-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 30px !important;

        overflow: visible !important;
    }

    .pepits-card {
        width: 100% !important;
        max-width: 280px !important;
        flex: none !important;

        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .pepits-card img {
        width: 100% !important;
        height: auto !important;
        border-radius: 8px;
    }

    .autres-title,
    .pepits-year {
        font-size: 14px !important;
        margin-top: 10px;
        line-height: 1.3;
    }

    .pepits-download-link {
        margin-top: 6px !important;
        padding-top: 0 !important;
        font-size: 12px !important;

        display: flex;
        flex-direction: row !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .pepits-download-link .download-icon img {
        width: 24px !important;
    }

    .pepits-prev,
    .pepits-next {
        display: none !important;
    }

    .pepits-text {
        font-size: 13px;
        line-height: 1.35;
        margin: 10px 0 20px;
    }

    .pepits-preview {
        height: auto !important;
    }

    .pepits-year {
        margin-top: 8px !important;
        min-height: 0 !important;
    }

    .autres-title {
        font-size: 12px !important;
        line-height: 1.25;
        margin-top: 8px;
    }

    .flipbook-modal-content {
        width: 96vw !important;
        height: 82vh !important;
        max-width: 96vw !important;
        max-height: 82vh !important;
    }

    #flipbook-viewer,
    #pepits-viewer {
        width: 100% !important;
        height: 100% !important;
    }

    .flip-nav-btn {
        display: none !important;
    }

    .flipbook-close {
        top: 8px !important;
        right: 12px !important;
        font-size: 28px !important;
        z-index: 9999;
    }
}