/* Drapeaux des pays (🇫🇷, 🇧🇪…) : Windows n'affiche pas les drapeaux émojis (seulement deux lettres « FR »). Cette police ne contient
   que les drapeaux (Twemoji, licence CC-BY 4.0, voir Fonts/LICENCE-TwemojiCountryFlags.md) ; grâce à unicode-range, le navigateur
   ne la télécharge que sur une page qui contient un drapeau, et ne l'utilise que pour eux. */
@font-face {
    font-family: "Twemoji Country Flags";
    src: url("../Fonts/TwemojiCountryFlags.woff2") format("woff2");
    unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
    font-display: swap;
}

/* Style de base */

/* Les marges intérieures (padding) sont comprises dans la largeur :
   un élément à width:100% ne dépasse plus de son conteneur. */
*, *::before, *::after {
    box-sizing: border-box;
}

img {
    max-width: 100%;
}

/* Filet de sécurité : rien ne peut élargir la page au-delà de l'écran
   (publicités, ombres, effets de survol restés actifs après un toucher...) */
html {
    overflow-x: hidden;
}
@supports (overflow-x: clip) {
    html, body {
        overflow-x: clip;
    }
}

body {
    font-family: "Twemoji Country Flags", Arial, sans-serif;
    box-sizing: border-box;
    background-color: #DDDDFF; /* Optionnel : définir une couleur de fond pour le corps */
	margin:0;

}

.page{
    max-width: 1000px;
    margin: 0 auto; /* Centre le contenu */
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); /* Ajoute une ombre légère */
	background-color: white;
	min-height:1evh;
}


/* Entête */
header {
    background-color: #f3f3f3;
    padding: 10px;
    text-align: center;
    display: flex;
    align-items: center;
}

#logo {
    height: 80px;
	margin-right: 20px;
}

/* Barre de recherche */
.recherche {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background-color: #f3f3f3;
    border-top: 1px solid #e1e1e1;
}

.recherche input[type="search"] {
    flex: 0 1 420px; /* 420 px au maximum sur ordinateur, toute la largeur sur mobile */
    min-width: 0;
    padding: 10px 14px;
    font-size: 16px; /* 16 px minimum : évite le zoom automatique sur iPhone */
    border: 2px solid #4682B4;
    border-radius: 25px;
    outline: none;
}

.recherche input[type="search"]:focus {
    box-shadow: 0 0 0 3px rgba(70, 130, 180, 0.25);
}

.recherche button {
    padding: 10px 18px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background-color: #4682B4;
    border: none;
    border-radius: 25px;
    cursor: pointer;
}

.recherche button:hover {
    background-color: #36648B;
}

/* Suggestions pendant la frappe (Coloriage/Suggestions.js) */
.recherche {
    position: relative;
}
.suggestions {
    display: none;
    position: absolute;
    top: calc(100% - 4px);
    left: 50%;
    transform: translateX(-50%);
    width: min(520px, calc(100% - 20px));
    z-index: 50;
    background: #fff;
    border: 1px solid #d5dde6;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    padding: 6px;
    text-align: left;
    box-sizing: border-box;
}
.suggestions.ouverte {
    display: block;
}
.suggestions-rubrique {
    padding: 6px 8px 2px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7c8f;
}
.suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px;
    border-radius: 10px;
    color: #1e293b;
    text-decoration: none;
    font-size: 15px;
    line-height: 1.25;
}
.suggestion:hover, .suggestion.active {
    background: #eaf2fa;
}
.suggestion img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    flex: none;
}
.suggestion.categorie img {
    object-fit: cover;
}
.suggestions .suggestions-tout {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 9px 8px;
    border: 0;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 10px 10px;
    background: none;
    color: #36648B;
    font-size: 14px;
    font-weight: normal;
    text-align: left;
    cursor: pointer;
}
.suggestions .suggestions-tout:hover {
    background: #eaf2fa;
}

.liste-categorie-recherche {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-around;
}

.recherche-message {
    padding: 10px;
    font-size: 17px;
    line-height: 1.4;
}

/* Fil d'Ariane */
#breadcrumb {
    list-style: none;
    padding: 10px;
    background-color: #e1e1e1;
	margin:0;
}

#breadcrumb li {
    display: inline;
    margin-right: 10px;
}

#breadcrumb li a{
	text-decoration:none;
	color:#333;
}

/* Module de filtre */
#filter {
 
    background-color: #d1d1d1;
}

/* Corps du site */
main {
    display: flex;
    flex-wrap: wrap;
}


article {
    flex: 3;
	min-width: 0; /* un contenu trop large (publicité...) ne peut plus élargir la colonne */
	/*display: flex;*/
	flex-wrap:wrap;
	padding : 10px;
}

/* Bloc du coloriage à la une : jamais plus large que la colonne */
article > center {
	display: block;
	width: 100%;
	max-width: 100%;
}

.filtre{
	display: flex;
	flex-wrap:wrap;
}

/* Description de la catégorie, au-dessus des filtres */
.description-categorie{
	flex: 0 0 100%;
	box-sizing: border-box;
	margin: 8px 0 0 0;
	padding: 0 max(12px, calc((100% - 760px) / 2));
	font-size: 16px;
	line-height: 1.5;
	color: #475569;
	text-align: center;
}

.bouton-filtre{
	border-radius:5px;
	padding:10px;
	margin:10px;
	max-width:100px;
	background-color:#4682B4;
	color:white;
	font-weight:bold;
	border: 4px solid transparent; /* Transparent border by default */
	transition: transform 0.3s ease;
}

.bouton-filtre:hover {
    transform: scale(1.1);
    
}

.bouton-filtre-actif{
	border-color: white; /* Light steel blue border when selected */ 
}

.nombre-coloriage{
	width:100%;
	padding:10px;
	margin-bottom:10px;
	font-size:20px;
}

.liste-coloriage {
    display: flex; /* Utilise Flexbox pour le layout */
    flex-wrap: wrap; /* Permet aux éléments enfants de passer à la ligne si nécessaire */
    gap: 10px; /* Espace entre les éléments enfants (modifiable selon les besoins) */
    justify-content: space-around; /* Espacement régulier entre les éléments sur l'axe horizontal */
	align-items: stretch; /* les coloriages d'une même ligne ont la même hauteur */
	
}


/* Style pour le conteneur parent des boutons */
.bouton-coloriage-lien {
    display: flex;
    justify-content: space-between;
	text-decoration:none;
	width:200px;
	min-height:250px;
	margin-bottom:20px;
	
}

/* Style pour chaque bouton : toute la hauteur de la ligne, titre centré dans l'espace restant ; ombre bleutée */
.bouton-coloriage {
	position: relative;
    flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	box-shadow: 0 4px 16px rgba(30, 110, 220, 0.35);
	border-radius:10px;
	transition: transform 0.3s ease, box-shadow 0.3s ease; /* Ajoute une transition douce pour transform et box-shadow */
	border:solid 1px #777;
}


/* Style pour le bouton au survol */
.bouton-coloriage:hover {
    transform: scale(1.05); /* Agrandit légèrement l'élément */
    box-shadow: 0 6px 22px rgba(30, 110, 220, 0.5); /* ombre bleutée plus marquée */
}

/* Style pour les images à l'intérieur des boutons */
.bouton-coloriage-image img {
    width: 100%;
    height: auto;
    border-radius: 10px 10px 0 0;
	border-bottom:solid 1px #333;
}

.bouton-emoji{
	top:-20px;
	left:-20px;
	position:absolute;
	text-align:center;
	margin:10px;
	border-radius:50%;
	border:solid 1px black;
	padding:3px;
	background-color:white;
	height:23px;
	width:23px;
}

.bouton-coloriage-emoji-libelle{
	flex: 1;
	display: flex;
	flex-direction: column;
}
.bouton-coloriage-libelle{
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align:center;
	color:#333;
	font-weight:bold;
	padding-top:3px;
	font-size:17px;
}


aside {
    flex: 1;
    background-color: #CECEDE;
    display: flex;
    flex-direction: column; /* empile les éléments verticalement */
    align-items: center; /* centre les éléments verticalement si vous en avez besoin */
	padding : 10px;
	border-left:solid 1px #ABABDD;
}

.categorie-titre{
	font-size:20px;
	padding:10px;
	text-align:center;
	width:100%;
	font-weight:bold;
}

/* Style pour le conteneur parent des boutons */
.bouton-categorie-lien {
    display: flex;
    justify-content: space-between;
	text-decoration:none;
	width:200px;
	flex-direction: column; /* Alignement vertical */
	margin-bottom: 20px;
}

/* Style pour chaque bouton */
.bouton-categorie {
    width: 200px;
    margin-bottom: 20px;
	box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.5);
	border-radius:10px;
	border:solid 1px #777;
	transition: transform 0.3s ease, box-shadow 0.3s ease; /* Ajoute une transition douce pour transform et box-shadow */
	background-color:#EEEEEE;
}


/* Style pour le bouton au survol */
.bouton-categorie:hover {
    transform: scale(1.05); /* Agrandit légèrement l'élément */
    box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.4); /* Optionnel: augmente l'ombre pour un meilleur effet visuel */
}

/* Style pour les images à l'intérieur des boutons */
.bouton-categorie-image img {
    width: 100%; /* Adapte la largeur de l'image à celle du bouton */
    height: auto;
    border-radius: 10px 10px 0 0; /* Bord arrondi */
	border-bottom:solid 1px #777;	
}

.bouton-categorie-libelle{
	text-align:center;
	color:#333;
	font-weight:bold;
	padding:5px;
}

/* Footer */
footer {
    display: flex;
    flex-wrap: wrap; /* Les encadrés passent à la ligne sur petit écran */
    justify-content: center;
	background-color: #b1b1b1;
    padding: 10px;
    text-align: center;
	
}

.footer-widget{
	justify-content: flex-start;
	padding:10px;
	background-color:white;
	border-radius:10px;
	text-align:left;
	flex: 1 1 200px;
	min-width: 0;
	margin:10px;
}

.footer-widget-titre{
	margin:0;
	font-weight:bold;
}

.footer-widget ul{
	padding: 0;
}

.footer-widget li{
	list-style-type: none;
}

.footer-widget a{
	text-decoration:none;
}

.drapeau{
	padding:0 10px 0 0;
}

/* Bouton "Imprimer" et "Télécharger" */
.conteneur-boutons-action {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin: 15px 0 20px 0;
}

/* La publicité reste dans les limites de son bloc */
.conteneur-boutons-action ins,
.conteneur-boutons-action iframe {
    max-width: 100%;
}

.conteneur-boutons-action a {
    display: block;
    max-width: 100%;
}

.bouton-action {
    padding: 12px 50px;
    line-height: 1.2;
    max-width: 100%;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	min-height:60px; /* min-height et non height : le texte ne déborde plus s'il passe sur deux lignes */
}

.bouton-action:hover {
	transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Commutateur sous « Imprimer » : Format A4 ◯━ Letter ; le format servi par le gros bouton est en gras */
.format-commutateur {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: -6px;
    margin-bottom: 14px;   /* espace avant les boutons de partage */
    font-size: 13px;
    color: #555;
    white-space: nowrap;
    user-select: none;
}
.format-libelle {
    display: inline-flex;
    flex-direction: column;
    padding: 2px 9px;
    border: 1px solid #c4c4c4;   /* format inactif : bordure grise */
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: background-color .25s, border-color .25s, color .25s;
}
/* Largeur du libellé en gras réservée : le commutateur ne bouge pas quand le gras change de côté */
.format-libelle::after {
    content: attr(data-texte);
    font-weight: bold;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}
.format-libelle[data-format="a4"] {
    align-items: flex-end;
}
.format-libelle:not(.actif):hover {
    border-color: #16a34a;
}
/* Format choisi : fond vert, texte blanc */
.format-libelle.actif {
    font-weight: bold;
    color: #fff;
    background: #16a34a;
    border-color: #16a34a;
}
.format-interrupteur {
    position: relative;
    flex: none;
    width: 34px;
    height: 18px;
    padding: 0;
    border: 1px solid #16a34a;
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
}
.format-interrupteur span {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #16a34a;
    transition: left .25s;
}
.format-interrupteur[aria-checked="true"] span {
    left: 17px;
}
.format-interrupteur:focus-visible {
    outline: 2px solid #86efac;
    outline-offset: 2px;
}

/* Boutons de partage, sous le bouton Imprimer */
.bloc-imprimer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 100%;
}

.partage {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-family: Arial, sans-serif;
}

.partage-titre {
    font-size: 14px;
    color: #666;
    margin-right: 2px;
}

.conteneur-boutons-action a.partage-bouton,
.partage-bouton {
    display: inline-block;
    padding: 6px 12px;
    border: none;
    border-radius: 16px;
    font: bold 13px Arial, sans-serif;
    line-height: 1.2;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s;
}

.partage-bouton:hover { transform: translateY(-2px); }
.partage-pin { background-color: #e60023; }
.partage-wa { background-color: #1a9e4b; }
.partage-fb { background-color: #1877f2; }
.partage-autre { background-color: #6c757d; }

.bouton-imprimer {
    background-color: #007bff;
    color: white;
    font-size: 26px;
    min-width: 300px;   /* plus large que les deux petits boutons de format placés dessous */
}

.bouton-imprimer:hover {
    background-color: #0056b3;
}

.bouton-acheter {
    background-color: #FF9900;
    color: black;
}

.bouton-acheter:hover {
    background-color: #E68A00;
}

.video-container {
	position: relative;
	padding-bottom: 56.25%; /* Ratio 16:9 */
	height: 0;
	overflow: hidden;
	max-width: 100%;
	background: #000;
}

.video-container iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* Barre fixe du mobile (logo et nom du site) : cachée sur ordinateur */
.barre-mobile {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Logo et nom du site toujours visibles en haut de l'écran */
    .barre-mobile {
        display: block;
        position: sticky;
        top: 0;
        z-index: 20;
        height: 52px;
        background-color: #f3f3f3;
        border-bottom: 1px solid #e1e1e1;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }
    .barre-mobile a {
        display: flex;
        align-items: center;
        gap: 10px;
        height: 100%;
        padding: 0 12px;
        text-decoration: none;
        color: #222;
        font-size: 20px;
        font-weight: bold;
    }
    .barre-mobile img {
        height: 40px;
        width: auto;
    }
    header #logo {
        display: none; /* déjà dans la barre fixe */
    }

    /* Recherche toujours visible, collée sous la barre du haut */
    .recherche {
        position: sticky;
        top: 52px;
        z-index: 19;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }

    /* Vignettes de catégories centrées */
    .bouton-categorie-liste {
        justify-content: center;
    }
    aside .bouton-categorie-lien {
        margin-left: auto;
        margin-right: auto;
    }

    main {
        flex-direction: column;
        flex-wrap: nowrap; /* sinon la colonne prend la largeur de son élément le plus large */
    }

    aside {
        order: 1;
    }
	
	
	article {
		flex: 1;
		display: flex;
		flex-direction: column; /* empile les éléments verticalement */
		justify-content: center; /* centre les éléments horizontalement */
		align-items: center; /* centre les éléments verticalement si vous en avez besoin */
	}
	
	/* Liste des coloriages (page catégorie, page coloriage) : 2 colonnes sur téléphone, plus sur tablette */
	.liste-coloriage {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
		gap: 16px 14px;
		width: 100%;
		box-sizing: border-box;
		padding: 0 4px;
	}
	.bouton-coloriage-lien {
		display: flex;
		justify-content: space-between;
		text-decoration:none;
		width: auto;
		min-width: 0;
		min-height: 0;
		flex-direction: column; /* Alignement vertical */
		margin-bottom: 4px;
	}
	.bouton-coloriage-libelle {
		font-size: 15px;
		padding: 3px 4px 5px 4px;
	}
	.bouton-emoji {
		top: -14px;
		left: -14px;
	}
	
    .conteneur-boutons-action {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        overflow: hidden;
    }
}




/* Collections : pastille du numéro sur les vignettes, mention sous le coloriage, encart sur les catégories */
/* Numéro (et étoile / cœur) à cheval sur le coin haut gauche de la carte, comme l'étoile seule */
.badges-coloriage{
	position: absolute;
	top: -10px;
	left: -10px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 4px;
}
.badges-coloriage .bouton-emoji{
	position: static;
	margin: 0;
}
.numero-collection{
	padding: 2px 9px;
	border: 2px solid #1f2937;
	border-radius: 999px;
	background: #fff;
	color: #1f2937;
	font-size: 13px;
	font-weight: bold;
	line-height: 1.4;
}
.mention-collection{
	margin: 4px auto 8px auto;
	max-width: 400px;
	padding: 0 12px;
	font-size: 15px;
	line-height: 1.5;
	color: #475569;
}
.mention-collection a{ color: #1d4ed8; font-weight: bold; text-decoration: none; }
.mention-collection a:hover{ text-decoration: underline; }
.encart-collection-ligne{ flex: 0 0 100%; padding: 0 12px; box-sizing: border-box; }
.encart-collection{
	display: block;
	box-sizing: border-box;
	max-width: 760px;
	margin: 10px auto 2px auto;
	padding: 10px 16px;
	border: 1px solid #f5d77a;
	border-radius: 12px;
	background: #fff8e1;
	color: #1f2937;
	font-size: 15px;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
}
.encart-collection:hover{ background: #fff2c6; }

/* Plusieurs collections dans une catégorie (Animaux faciles → Les p'tits amis de la forêt, de la ferme…) */
.encart-collections{ display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.encart-collections:hover{ background: #fff8e1; }
.encart-collections .encart-titre{ flex: 0 0 100%; margin-bottom: 2px; }
.puce-collection{
	display: inline-block;
	padding: 5px 12px;
	border: 1px solid #e8c766;
	border-radius: 999px;
	background: #fff;
	color: #1f2937;
	font-size: 14px;
	font-weight: bold;
	text-decoration: none;
}
.puce-collection span{ margin-left: 4px; padding: 0 7px; border-radius: 999px; background: #fde68a; font-size: 12px; }
.puce-collection:hover{ background: #fff2c6; }
