/* ==========================================================================
   1. VARIABLES GLOBALES (Couleurs par catégorie)
   ========================================================================== */

:root {
    --color-evenements: #F5D372;   /* Jaune (Événements) */
    --color-balades: #A3C9A8;      /* Vert (Balades) */
    --color-manger: #E09F85;       /* Terre cuite (Manger) */
    --color-artisans: #8BB1C4;     /* Bleu (Artisans) */
    --color-culture: #B69EC9;      /* Violet (Culture) */
    --color-default: #C2D5A7;      /* Vert amande (Quartiers) */
}

/* Classes dynamiques JS pour les titres de la mosaïque */
.cat-evenements { color: var(--color-evenements) !important; }
.cat-balades { color: var(--color-balades) !important; }
.cat-manger { color: var(--color-manger) !important; }
.cat-artisans { color: var(--color-artisans) !important; }
.cat-culture { color: var(--color-culture) !important; }


/* ==========================================================================
   2. RESET GLOBAL & CONFIGURATION DE BASE
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #000;
    color: #000;
    overflow-x: hidden;
}


/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */

#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    z-index: 100;
    border-bottom: 1px solid #000;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.05em;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Typographie Titre Header */
#aigle-vibre-title {
    font-family: "Luckiest Guy", cursive;
    font-size: 22px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
    margin-top: 8px;
}
#aigle-vibre-title span { display: inline-block; }
.aigle-text { color: #000000; }
.vibre-text { color: #FFCC00; }

.word-aigle {
    font-family: "Luckiest Guy", cursive;
    font-size: 16px; 
    color: #000000;
    display: flex;
}
.word-vibre {
    font-family: "Luckiest Guy", cursive;
    font-size: 30px; 
    color: #FFCC00;
    display: flex;
    margin-top: -2px;
}

/* Navigation Catégories Desktop */
.categories {
    display: flex;
    align-items: center;
}
.categories button {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    margin: 0 10px;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}
.categories button:hover,
.categories button.active {
    opacity: 1;
}

/* Boutons Header Right */
#toggle-full-map {
    background: #000;
    color: #fff;
    border: none;
    font-family: inherit;
    font-size: 10px;
    font-weight: bold;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.2s;
}
#toggle-full-map:hover {
    background: #FFCC00 !important;
}
}

#burger-btn { display: none; }
#mobile-menu { display: none; }

/* Responsive Header & Menu Mobile */
@media (max-width: 600px) {
    .categories { display: none; }

    #burger-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px 6px;
    }
    #burger-btn span {
        display: block;
        width: 16px;
        height: 2px;
        background: #000;
        transition: opacity 0.2s;
    }

    #mobile-menu {
        position: fixed;
        top: 30px;
        left: 0;
        width: 100%;
        background: #fff;
        border-bottom: 2px solid #000;
        z-index: 99;
        flex-direction: column;
    }
    #mobile-menu.open {
        display: flex;
    }
    #mobile-menu .filter-btn {
        background: none;
        border: none;
        border-bottom: 1px solid #eee;
        font-family: inherit;
        font-size: 11px;
        font-weight: bold;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        padding: 14px 15px;
        text-align: left;
        cursor: pointer;
        opacity: 0.45;
        transition: opacity 0.15s, background 0.15s;
    }
    #mobile-menu .filter-btn:hover,
    #mobile-menu .filter-btn.active {
        opacity: 1;
        background: #f5f5f5;
    }
}


/* ==========================================================================
   4. GRILLE MOSAÏQUE
   ========================================================================== */

#mosaic-grid {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1px;
    background-color: #000;
}
#mosaic-grid:empty {
    display: none;
}

@media (max-width: 600px) {
    #mosaic-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .square-title { font-size: 18px; }
}

.square-item {
    background: #fff;
    aspect-ratio: 1 / 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.square-item.hidden {
    display: none;
}
.square-item:hover {
    background-color: #000;
    color: #fff;
}

/* Typographie des carrés */
.square-top {
    display: flex;
    flex-direction: column;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.05em;
    line-height: 1.3;
    margin-top: 5px;
}
.square-cat { margin-bottom: 2px; }
.square-quartier { opacity: 0.5; }
.square-item:hover .square-quartier { opacity: 0.7; }

.square-title {
    font-size: 26px;
    text-transform: uppercase;
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0em;
    word-wrap: break-word;
    hyphens: auto;
}

/* Background image pour mosaïque */
.square-item.has-bg {
    background-image: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0.9)), var(--bg-image);
    background-size: cover;
    background-position: center;
    color: #fff;
    border: 1px solid #333;
}
.square-item.has-bg:hover {
    background-image: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.7)), var(--bg-image);
}
.square-item.has-bg .square-quartier {
    opacity: 0.8;
}


/* ==========================================================================
   5. MODALE DE CONTENU DE FICHE
   ========================================================================== */

#content-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    z-index: 10002;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 20px;
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
#content-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-inner {
    width: 100%;
    max-width: 850px;
    position: relative;
    display: flex;
    flex-direction: column;
    text-align: left;
}

#close-modal {
    position: absolute;
    top: 0;
    right: 0;
    background: #000;
    color: #fff;
    border: none;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
}
#close-modal:hover {
    background: #cc0000;
}

.modal-header {
    margin-top: 50px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.05em;
    margin-bottom: 25px;
    border-bottom: 1px solid #000;
    padding-bottom: 10px;
}

#modal-title {
    font-size: 7vw;
    text-transform: uppercase;
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.03em;
    margin-bottom: 35px;
}
@media (min-width: 850px) {
    #modal-title {
		font-family: "Luckiest Guy", cursive;
		color: #FFCC00;
		font-size: 60px;
	}
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.lead-text {
    font-size: 22px;
    line-height: 1.35;
    font-weight: 500;
    max-width: 750px;
}

/* Layouts dynamiques des blocs d'infos */
.modal-grid-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
    border-top: 2px solid #000;
    padding-top: 25px;
}
.info-block {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.info-block h3 {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: bold;
    color: #666;
    letter-spacing: 0.05em;
}
.info-block p {
    font-size: 15px;
    line-height: 1.4;
    font-weight: bold;
}

/* Mini-map modale */
#modal-map {
    width: 100%;
    height: 250px;
    margin-top: 20px;
    border: 1px solid #000;
    background-color: #f0f0f0;
}


/* ==========================================================================
   6. RÉSEAUX SOCIAUX & GALERIE (MODALE)
   ========================================================================== */

.modal-media-section {
    margin-top: 40px;
    border-top: 2px solid #000;
    padding-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Grille posts sociaux */
.media-social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.social-post {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border: 2px solid #000;
    background: #000;
    transition: transform 0.2s ease;
    overflow: hidden;
}
.social-post:hover {
    transform: translateY(-5px);
}
.social-label {
    background: #000;
    color: #fff;
    padding: 10px 15px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.social-post img,
.social-post video {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #fff;
    filter: grayscale(100%);
    transition: filter 0.4s ease;
}
.social-post:hover img,
.social-post:hover video {
    filter: grayscale(0%);
}

/* Grille galerie */
.media-gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.gallery-header {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.05em;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.gallery-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid #000;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: transform 0.3s ease, filter 0.3s ease;
}
.gallery-item:hover img {
    transform: scale(1.05);
    filter: grayscale(0%);
}


/* ==========================================================================
   7. PASTILLES (BADGES) DRAGGABLES & ANIMATIONS
   ========================================================================== */

#category-badge,
#quartier-badge {
    position: fixed;
    top: 80px;
    right: 40px; 
    width: 340px;
    height: 340px;
    border-radius: 43% 57% 38% 62% / 53% 44% 56% 47%;
    background: #fff;
    border: 3px solid #000;
    z-index: 150;
    box-shadow: 8px 8px 0px #000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    cursor: grab;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    touch-action: none;
}
#quartier-badge {
    top: 90px;
}
#category-badge:active,
#quartier-badge:active {
    cursor: grabbing;
}
#category-badge.hidden,
#quartier-badge.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.category-badge-content,
.quartier-badge-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

#badge-title,
#quartier-badge-title {
    font-family: "Luckiest Guy", cursive;
    font-size: 36px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.0;
}
#quartier-badge-title {
    color: #FFCC00;
}
#badge-text,
#quartier-badge-text {
    font-size: 16px;
    line-height: 1.3;
    font-weight: regular;
    color: #333;
}

#close-badge, 
#close-quartier-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #000;
    color: #000;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    z-index: 151;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}
#close-badge:hover,
#close-quartier-badge:hover {
    color: #cc0000;
}

@media (max-width: 600px) {
    #category-badge, #quartier-badge {
        width: 250px;
        height: 250px;
        top: auto !important;
        bottom: 80px !important;
        left: calc(50% - 125px) !important; 
    }
}

/* Animations de rebond */
@keyframes pastilleBounceIn {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes pastilleBounceOut {
    0% { transform: scale(1); opacity: 1; }
    30% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
}
#category-badge:not(.hidden), 
#quartier-badge:not(.hidden) {
    animation: pastilleBounceIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}


/* ==========================================================================
   8. UTILITAIRES : TEASING, TOOLTIP, LIGHTBOX, MAP, TICKER
   ========================================================================== */

/* Teasing Placeholder */
#teasing-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 50px);
    margin-top: 50px;
    background-color: #fff;
    padding: 20px;
    text-align: center;
}
#teasing-placeholder .teasing-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#teasing-placeholder .word-aigle {
    font-size: 10vw;
    min-size: 40px;
    color: #000;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: bold;
}
#teasing-placeholder .word-vibre {
    font-size: 20vw;
    min-size: 80px;
    color: #FFCC00;
    margin-top: -2vw;
    text-transform: uppercase;
    font-weight: 900;
}
@media (max-width: 600px) {
    #teasing-placeholder {
        align-items: flex-start;
        padding-top: 200px;
    }
    #teasing-placeholder .word-aigle { font-size: 50px; }
    #teasing-placeholder .word-vibre { font-size: 100px; margin-top: -10px; }
}

@keyframes vibrer {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-1px, 1px) rotate(-1deg); }
    50% { transform: translate(1px, -1px) rotate(1deg); }
    75% { transform: translate(-1px, -1px) rotate(0deg); }
    100% { transform: translate(1px, 1px) rotate(-1deg); }
}

/* Tooltip Curseur */
#hover-tooltip {
    position: fixed;
    pointer-events: none;
    background: #000;
    color: #fff;
    padding: 6px 12px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.05em;
    z-index: 10001;
    display: none;
    white-space: nowrap;
    border: 1px solid #fff;
}

/* Carte Plein Écran */
#full-map-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #fff;
}
#full-map-container.hidden { display: none; }
#global-map { width: 100%; height: 100%; }

#close-full-map {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 160;
    background: #000;
    color: #fff;
    border: none;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
}
#close-full-map:hover { background: #333; }

/* Lightbox */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10005;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#lightbox.lightbox-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.lightbox-content {
    max-width: 80%;
    max-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
#lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border: 3px solid #fff;
}
#lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #fff;
    color: #000;
    border: none;
    padding: 10px 15px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10006;
}
.lightbox-arrow {
    background: #fff;
    color: #000;
    border: none;
    padding: 15px 20px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}
#lightbox-close:hover,
.lightbox-arrow:hover {
    background: #cc0000;
    color: #fff;
}
@media (max-width: 600px) {
    .lightbox-arrow { padding: 10px 12px; font-size: 16px; }
    .lightbox-content { max-width: 70%; }
}

/* Bandeau d'Annonce (News Ticker) */
.news-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35px;
    background: #fff;
    color: #000;
    display: flex;
    z-index: 250;
    transform: translateY(100%);
    animation: slideUpTicker 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.5s forwards;
    border-top: 2px solid #000;
}
@keyframes slideUpTicker {
    to { transform: translateY(0); }
}
.ticker-wrapper {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    position: relative;
}
.ticker-track {
    display: flex;
    white-space: nowrap;
    animation: scrollTicker 25s linear infinite;
}
.ticker-text {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-right: 15px;
}
@keyframes scrollTicker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

#close-ticker {
    background: #fff;
    color: #000;
    border: none;
    border-left: 2px solid #000;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
#close-ticker:hover {
    background: #cc0000;
    color: #fff;
}
.news-ticker.hide-ticker {
    animation: none !important;
    transform: translateY(100%) !important;
    opacity: 0 !important;
    transition: transform 0.4s ease, opacity 0.4s ease !important;
}

/* ==========================================================================
   9. LE POULS AIGLON
   ========================================================================== */

.pouls-btn {
    background: #000 !important;
    color: #fff !important;
    border: none;
    font-family: inherit;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    margin: 0 0 0 15px;
    padding: 6px 12px !important;
    opacity: 1 !important;
    transition: background 0.2s ease;
}

.pouls-btn:hover {
    background: #FFCC00 !important;
}

#pouls-aiglon-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    z-index: 10005; /* Au dessus du reste */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 20px;
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#pouls-aiglon-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#close-pouls-modal {
    position: absolute;
    top: 0;
    right: 0;
    background: #000;
    color: #fff;
    border: none;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
}

#close-pouls-modal:hover {
    background: #cc0000;
}

.pouls-body {
    border-top: 2px solid #000;
    padding-top: 30px;
    max-width: 750px;
}

.pouls-body h3 {
    font-size: 22px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 25px;
    letter-spacing: -0.02em;
}

.pouls-body p {
    font-size: 18px;
    line-height: 1.5;
    font-weight: 500;
    margin-bottom: 20px;
    color: #333;
}

.pouls-conclusion {
	font-family: "Luckiest Guy", cursive;
    font-size: 40px !important;
    font-weight: 100 !important;
    color: #FFCC00 !important;
    margin-top: 40px;
    text-transform: uppercase;
}

/* Ajustement mobile pour le bouton dans le menu déroulant */
@media (max-width: 600px) {
    #mobile-menu .pouls-btn {
        margin: 0;
        border-bottom: 1px solid #eee;
        background: transparent !important;
        color: #000 !important;
    }
    #mobile-menu .pouls-btn:hover { background: #f5f5f5 !important; }
}