/*
 Theme Name: News Magazine X Child
 Theme URI: https://festival7.fr/
 Description: Thème enfant pour News Magazine X
 Author: Festival7
 Author URI: https://festival7.fr/
Template: news-magazine-x
 Version:1.0.0
*/

/* ==============================================
   STYLES PERSONNALISÉS POUR FESTIVAL7.FR
   (Version finale et nettoyée)
   ============================================== */

/* --- BLOC FICHE FILM (utilisé dans les articles) --- */
.fiche-film-wrapper {
	background-color: #f7f7f7;
	padding: 15px !important;
	margin: 25px 0 !important;
	border-left: 3px solid #000;
	overflow: hidden;
}
.affiche-flottante {
	float: left !important;
	width: 150px !important;
	height: auto !important;
	margin-right: 20px !important;
	margin-bottom: 10px !important;
}

/* --- AGENDA DES FESTIVALS (Shortcode) --- */
.agenda-festivals {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 2em 0;
}
.mois-titre {
    border-bottom: 2px solid #0056b3;
    padding-bottom: 10px;
    margin-top: 40px;
    margin-bottom: 25px;
    font-size: 2em;
    color: #333;
}
.mois-titre:first-of-type {
    margin-top: 0;
}
.festivals-grille {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}
.festival-carte {
    display: flex;
    align-items: flex-start;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 20px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border-left: 5px solid #007bff;
}
.festival-carte:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.carte-badge-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f0f7ff;
    border-radius: 6px;
    padding: 10px;
    margin-right: 20px;
    text-align: center;
    min-width: 60px;
}
.carte-badge-date .jour {
    font-size: 2.2em;
    font-weight: bold;
    color: #007bff;
    line-height: 1;
}
.carte-badge-date .mois {
    font-size: 1em;
    font-weight: 500;
    text-transform: uppercase;
    color: #555;
    margin-top: 5px;
}
.carte-contenu {
    flex: 1;
}
.carte-contenu h3 {
    margin: 0 0 8px 0;
    font-size: 1.5em;
}
.carte-contenu h3 a {
    text-decoration: none;
    color: #222;
}
.carte-contenu h3 a:hover {
    color: #007bff;
}
.carte-infos {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
    color: #666;
    font-size: 0.95em;
}
.carte-infos .info-lieu {
    font-weight: 500;
}
.carte-specificites {
    background-color: #e9ecef;
    color: #495057;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    display: inline-block;
}
a.festival-carte, 
a.festival-carte:hover {
    text-decoration: none;
    color: inherit;
}
@media (min-width: 900px) {
    .festivals-grille {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- WIDGETS (Accueil & Latéral) --- */
.prochains-festivals-widget-wrapper {
	display: grid;
	grid-template-columns: 1fr;
	gap: 35px;
	align-items: flex-start;
	margin: 1.5em 0;
}
@media (min-width: 768px) {
	.prochains-festivals-widget-wrapper {
		grid-template-columns: 1fr 2fr;
	}
}
.prochains-festivals-widget-wrapper .widget-image img {
	width: 100%;
	height: auto;
	max-height: 280px;
	object-fit: cover;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.prochains-festivals-widget-wrapper .widget-list ul {
	list-style-type: none;
	margin: 0 0 20px 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px 25px;
}
.prochains-festivals-widget-wrapper .widget-list ul li {
	padding-bottom: 0;
	line-height: 1.4;
}
.prochains-festivals-widget-wrapper .widget-list ul li a {
	text-decoration: none;
	color: #333;
}
.prochains-festivals-widget-wrapper .widget-list ul li a:hover {
	color: #007bff;
}
.prochains-festivals-widget-wrapper .widget-list ul li a strong {
	font-size: 1.1em;
	font-weight: 700;
	color: #222;
}
.widget-festival-info {
	display: block;
	font-size: 0.9em;
	color: #555;
	margin-top: 4px;
}
.widget-voir-tout {
	text-align: right;
	margin-top: 15px;
}
.widget-bouton {
	display: inline-block;
	background-color: #0056b3;
	color: #ffffff !important;
	padding: 10px 18px;
	border-radius: 5px;
	text-decoration: none;
	font-weight: bold;
	transition: background-color 0.2s ease, transform 0.2s ease;
}
.widget-bouton:hover {
	background-color: #007bff;
	text-decoration: none;
	transform: translateY(-2px);
}
.sidebar-prochains-festivals {
    border-top: 0px solid #0056b3;
    padding-top: 0px;
}
.sidebar-festival-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.sidebar-festival-image a {
    display: block;
}
.sidebar-festival-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
}
.sidebar-festival-content {
    flex: 1;
}
.sidebar-festival-title {
    margin: 0 0 5px 0;
    font-size: 1em;
    line-height: 1.3;
}
.sidebar-festival-title a {
    font-weight: bold;
    color: #222;
    text-decoration: none;
}
.sidebar-festival-title a:hover {
    color: #007bff;
}
.sidebar-festival-info {
    display: block;
    font-size: 0.85em;
    color: #666;
    line-height: 1.4;
}
.sidebar-voir-tout {
    text-align: right;
    font-size: 0.9em;
    margin-top: 10px;
}

/* =======================================================
   --- MISE EN PAGE PRINCIPALE DU SITE ---
   ======================================================= */

/* --- Ajustement de la largeur des colonnes --- */
@media (min-width: 992px) {
    #primary.content-area {
        flex: 1 1 70%;
        max-width: 70%;
    }
    .newsx-general-sidebar {
        flex: 1 1 25%;
        max-width: 25%;
    }
}

/* =======================================================
   --- PAGE FICHE FESTIVAL INDIVIDUELLE (/festival/...) ---
   ======================================================= */

.festival-location-header {
	text-align: right;
	font-style: italic;
	color: #444444;
	font-size: 1.5rem;
	font-weight: 500;
	margin-bottom: 1.5em;
}
.articles-lies {
	margin: 2em 0;
	padding: 20px 25px;
}
.articles-lies h4 {
	margin-top: 0;
	margin-bottom: 15px;
	font-size: 1.3em;
}
.articles-lies ul {
	margin: 0;
	padding-left: 20px;
}
.festival-meta-box {
    background-color: #f8f9fa;
    border-left: 5px solid #037fff;
    padding: 20px;
    margin: 2em 0;
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    align-items: flex-start;
}
.festival-meta-box .meta-details {
    flex: 2;
    min-width: 250px;
}
.festival-meta-box #map {
    flex: 1;
    min-width: 220px;
    min-height: 250px;
    border-radius: 8px;
}
.festival-meta-box .meta-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.festival-meta-box .meta-icon {
    font-size: 1.5em;
    margin-right: 15px;
    color: #037fff;
    transition: transform 0.3s ease;
}
.festival-meta-box .meta-item:hover .meta-icon {
    transform: scale(1.2);
}
.festival-meta-box .meta-text {
    font-size: 1.1em;
}

/* ==============================================
   RENDRE LE TABLEAU RESPONSIVE SUR MOBILE
   ============================================== */
@media screen and (max-width: 768px) {

    /* On cache les en-têtes du tableau */
    #festivalstable thead {
        display: none;
    }

    /* On transforme chaque ligne en une "carte" */
    #festivalstable tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 5px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    /* On transforme chaque cellule en une ligne */
    #festivalstable td {
        display: block;
        text-align: right; /* Aligne le contenu à droite */
        border-bottom: 1px solid #eee;
        padding-left: 50%; /* Crée de l'espace pour le titre */
        position: relative;
    }

    /* On enlève la bordure de la dernière cellule */
    #festivalstable td:last-child {
        border-bottom: none;
    }
    
    /* On utilise le "data-label" pour recréer un titre à gauche */
    #festivalstable td:before {
        content: attr(data-label); /* Affiche le contenu de l'attribut data-label */
        position: absolute;
        left: 15px;
        font-weight: bold;
        text-align: left;
    }
    
    /* Cas particulier pour l'icône de lien */
    #festivalstable td[data-label="Lien"] a {
        display: inline-block;
        padding: 5px 0;
    }
}

/* ==============================================
   CORRECTION MOBILE : CACHER LE SÉLECTEUR DE RÉSULTATS
   ============================================== */

/* Ne s'applique que sur les écrans de moins de 768px de large */
@media screen and (max-width: 768px) {
    
    /* On cible le conteneur de "Afficher X résultats" et on le cache */
    .dataTables_length {
        display: none !important;
    }
}


/* ==============================================
   STYLES POUR L'AGENDA INTERACTIF
   ============================================== */

#agenda-filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px; /* J'augmente un peu l'écart */
    margin-bottom: 40px;
}

#map-container {
    flex: 1 1 65%; /* La carte prendra environ 65% */
    min-width: 300px;
    min-height: 480px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
}

#month-selector {
    flex: 1 1 30%; /* Le sélecteur prendra environ 30% de la largeur */
    min-width: 250px; /* On réduit sa largeur minimale */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

#month-selector p {
    background-color: #f0f0f0;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    margin: 0;
    font-weight: 500;
}

#month-selector p:hover {
    background-color: #e0e0e0;
}

#month-selector p.active {
    background-color: #007bff; /* On utilise le bleu déjà présent dans vos styles */
    color: #ffffff;
}

#festival-results-container {
    transition: opacity 0.3s ease;
}

#festival-results-container.loading {
    opacity: 0.5;
    pointer-events: none; /* Empêche les clics pendant le chargement */
}

/* Style pour les départements sur la carte (sera utilisé par Leaflet) */
.leaflet-interactive {
    transition: fill-opacity 0.2s;
}
.department-shape {
    stroke: white;
    stroke-width: 1px;
    fill-opacity: 0.7;
    fill: #ccc;
}
.department-shape:hover {
    fill-opacity: 1;
}
.department-shape.selected {
    fill: #007bff;
}
/* ==============================================
   AMÉLIORATIONS UI/UX AGENDA
   ============================================== */

/* Fond de carte épuré */
#map-container {
    background-color: #f5f9ff; /* Un fond bleu très clair */
}

/* Statut de la recherche */
#search-status-container {
    padding: 15px;
    background-color: #e9ecef;
    border-radius: 8px;
    margin-bottom: 25px;
    display: none; /* Caché par défaut, affiché par JS */
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
}

#search-status-text {
    font-weight: 500;
}

#reset-filters-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-weight: bold;
    font-size: 16px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

#reset-filters-btn:hover {
    background-color: #c82333;
}

/* Style pour les boutons de mois (remplace les <p>) */
#month-selector button {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-weight: 500;
    font-size: 1em;
}

#month-selector button:hover {
    background-color: #e0e0e0;
}

#month-selector button.active {
    background-color: #007bff;
    color: #ffffff;
    border-color: #007bff;
}


/* ==============================================
   STRATÉGIE MOBILE
   ============================================== */
@media screen and (max-width: 800px) {
    #agenda-filters-container {
        flex-direction: column; /* Les éléments s'empilent */
    }

    #month-selector {
        grid-template-columns: repeat(4, 1fr); /* 4 mois par ligne */
    }
}

@media screen and (max-width: 480px) {
    #month-selector {
        grid-template-columns: repeat(3, 1fr); /* 3 mois par ligne sur très petits écrans */
    }

    #search-status-container {
        flex-direction: column;
        gap: 10px;
    }
}

/* Correction pour forcer la couleur des icônes sociales */
.td-header-sp-top-widget .td-social-icon-wrap a svg {
    fill: #000 !important; /* Ou la couleur que vous souhaitez */
}

/* Style pour les onglets de la carte */
.map-tabs {
    overflow: hidden;
    border-bottom: 1px solid #ccc;
    margin-bottom: 10px;
}

.map-tabs button {
    background-color: inherit;
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 16px;
    transition: 0.3s;
    font-size: 1em;
    border-radius: 5px 5px 0 0;
}

.map-tabs button:hover {
    background-color: #ddd;
}

.map-tabs button.active {
    background-color: #007bff;
    color: white;
}