/* Composants de la charte : boutons, pastilles, cartes, formulaires, navigation secondaire. */

/* Logo : texte Outfit + boucle d'échange (templates/components/Logo.html.twig) */
.logo {
    display: inline-flex; align-items: baseline;
    font-family: var(--police-titres); font-weight: 800; letter-spacing: -0.035em; line-height: 1;
    white-space: nowrap; color: var(--anthracite); text-decoration: none;
}
.logo:hover { color: var(--anthracite); }
.logo__accent { color: var(--couleur-principale); }
.logo__boucle { width: 0.5em; height: 0.5em; margin-left: 0.035em; vertical-align: -0.01em; color: var(--couleur-principale); }
.logo__exclamation { display: inline-block; transform: rotate(8deg); margin-left: 0.03em; }
.logo--fonce, .logo--fonce:hover, .logo--fonce .logo__accent { color: #fff; }
.logo--fonce .logo__exclamation { color: var(--couleur-principale); }
.logo--principale, .logo--principale .logo__accent, .logo--principale .logo__boucle { color: #fff; }
.logo--mono .logo__accent, .logo--mono .logo__boucle { color: inherit; }

.pastille-site {
    display: inline-flex; align-items: center;
    font-size: 13px; font-weight: 700; line-height: 1; padding: 6px 10px;
    border-radius: 999px; background: var(--couleur-secondaire); color: #fff;
}

/* Boutons */
.bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 22px; border-radius: 999px; border: 2px solid transparent;
    font-family: var(--police-texte); font-size: 16px; font-weight: 700; line-height: 1.2;
    text-decoration: none; cursor: pointer; transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.bouton svg { flex: none; }
.bouton--principal { background: var(--couleur-principale); color: #fff; }
.bouton--principal:hover { background: var(--principale-fonce); color: #fff; }
.bouton--fonce { background: var(--couleur-secondaire); color: #fff; }
.bouton--fonce:hover { color: #fff; filter: brightness(1.15); }
.bouton--contour { background: #fff; color: var(--anthracite); border-color: var(--anthracite); }
.bouton--contour:hover { color: var(--anthracite); background: var(--fond-doux); }
.bouton--blanc { background: #fff; color: var(--anthracite); }
.bouton--blanc:hover { color: var(--anthracite); background: var(--fond-doux); }
.bouton--etiquette { border-color: var(--anthracite); box-shadow: var(--ombre-etiquette); }
.bouton--etiquette:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--anthracite); }
.bouton--grand { min-height: 56px; padding: 0 28px; font-size: 18px; }
.bouton--petit { min-height: 40px; padding: 0 16px; font-size: 15px; }
.bouton--bloc { width: 100%; }
.bouton-icone {
    width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center;
    border-radius: 999px; border: 0; background: transparent; color: inherit; text-decoration: none; cursor: pointer;
}
.bouton-icone:hover { background: var(--fond-doux); color: inherit; }
.lien-fleche { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; }

/* Pastilles, badges et statuts */
.pastille {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 999px; font-size: 15px; font-weight: 700;
    background: var(--principale-douce); color: var(--texte);
}
.pastille__coche {
    width: 22px; height: 22px; border-radius: 999px; display: inline-grid; place-items: center;
    background: var(--couleur-principale); color: #fff;
}
.puce {
    display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
    border: 1px solid var(--bordure-forte); font-size: 13px; font-weight: 700; line-height: 1.4;
}
.badge-pro {
    display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px;
    background: var(--couleur-secondaire); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
}
.statut {
    display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
    font-size: 13px; font-weight: 700; line-height: 1.3;
}
.statut--disponible { background: var(--dispo-fond); color: var(--dispo-texte); }
.statut--reserve { background: var(--reserve-fond); color: var(--reserve-texte); }
.statut--donne { background: var(--donne-fond); color: var(--donne-texte); }
.statut--attente { background: var(--attente-fond); color: var(--attente-texte); }
.etiquette-gratuit {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 8px;
    background: var(--couleur-principale); color: #fff; font-weight: 700; font-size: 14px;
    letter-spacing: 0.08em; text-transform: uppercase; box-shadow: var(--ombre-etiquette);
}
.etiquette-gratuit::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: #fff; }

/* Carte d'un don (templates/components/CarteDon.html.twig) */
.carte-don {
    position: relative; display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border: 1px solid var(--bordure); border-radius: 20px;
    transition: transform .18s ease, box-shadow .18s ease;
}
.carte-don:hover { transform: translateY(-4px); box-shadow: var(--ombre-carte); }
.carte-don__lien { display: flex; flex-direction: column; flex: 1 1 auto; color: var(--texte); text-decoration: none; }
.carte-don__lien:hover { color: var(--texte); }
.carte-don__visuel { position: relative; aspect-ratio: 4 / 3; background: var(--fond-doux); }
.carte-don__visuel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carte-don__sans-photo { position: absolute; inset: 0; display: grid; place-items: center; color: var(--texte-discret); font-size: 14px; }
.carte-don__statut { position: absolute; left: 12px; top: 12px; }
.carte-don__corps { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; }
.carte-don__categorie { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--principale-fonce); }
.carte-don__titre { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -0.01em; }
.carte-don__infos { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--texte-discret); }
.carte-don__infos span { display: inline-flex; align-items: center; gap: 5px; }
.carte-don__pied { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; }
.carte-don__favori { position: absolute; right: 12px; top: 12px; z-index: 1; }
.carte-don__favori .bouton-icone { background: rgba(255, 255, 255, 0.94); color: var(--anthracite); }
.carte-don__favori .bouton-icone[aria-pressed="true"] { color: var(--couleur-principale); }

/* Tuiles de catégories */
.tuile {
    display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 16px 18px;
    background: #fff; border: 2px solid var(--anthracite); border-radius: var(--rayon);
    color: var(--texte); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease;
}
.tuile:hover { color: var(--texte); transform: translateY(-3px); box-shadow: 0 5px 0 var(--anthracite); }
.tuile__icone {
    flex: none; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
    background: var(--principale-douce); color: var(--couleur-principale);
}
.tuile__texte { display: flex; flex-direction: column; line-height: 1.25; }
.tuile__titre { font-weight: 700; font-size: 17px; }
.tuile__nombre { font-size: 14px; color: var(--texte-discret); }

/* Barre de recherche « étiquette » */
.recherche-etiquette {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 8px;
    background: #fff; border: 2px solid var(--anthracite); border-radius: 22px; box-shadow: 0 6px 0 var(--anthracite);
}
.recherche-etiquette__champ {
    position: relative; flex: 2 1 220px; display: flex; align-items: center; gap: 10px;
    min-height: 56px; padding: 0 14px; color: var(--texte-discret); margin: 0;
}
.recherche-etiquette__champ + .recherche-etiquette__champ { flex: 1 1 170px; border-left: 1px solid var(--bordure); }
.recherche-etiquette__champ input, .recherche-etiquette__champ select {
    width: 100%; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 17px; color: var(--texte);
}
.recherche-etiquette__champ input:focus-visible, .recherche-etiquette__champ select:focus-visible { outline-offset: 6px; }
.recherche-etiquette .bouton { min-height: 56px; border-radius: 16px; }
@media (max-width: 600px) {
    .recherche-etiquette__champ + .recherche-etiquette__champ { border-left: 0; border-top: 1px solid var(--bordure); }
    .recherche-etiquette .bouton { width: 100%; }
}

/* Suggestions d'autocomplétion (recherche, commune) */
.suggestions, #suggestions, #suggestions-list {
    position: absolute; top: calc(100% + 6px); left: 0; width: 100%; z-index: 30;
    max-height: 260px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
    background: #fff; border: 1px solid var(--bordure-forte); border-radius: var(--rayon-petit); box-shadow: var(--ombre-carte);
}
.suggestions li, #suggestions li, #suggestions-list li { padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--texte); }
.suggestions li:hover, #suggestions li:hover, #suggestions-list li:hover { background: var(--fond-doux); }
.suggestions__code { color: var(--texte-discret); }
.suggestions[hidden] { display: none !important; }
.suggestions li[aria-selected="true"] { background: var(--fond-doux); outline: 2px solid var(--texte); outline-offset: -2px; }

/* Formulaires (classes Bootstrap conservées dans les gabarits de formulaire Symfony) */
.form-label, .form-check-label, legend.col-form-label { font-weight: 700; color: var(--texte); }
input.form-control, textarea.form-control, select.form-select, .form-control, .form-select {
    min-height: 50px; border: 1px solid #8A969D; border-radius: var(--rayon-petit);
    font-family: var(--police-texte); font-size: 17px; color: var(--texte); background-color: #fff;
}
textarea.form-control { min-height: 120px; }
input.form-control:focus, textarea.form-control:focus, select.form-select:focus, .form-control:focus, .form-select:focus { border-color: var(--anthracite); box-shadow: 0 0 0 4px var(--principale-douce); }
.form-text, .help-text { color: var(--texte-discret); font-size: 15px; }
.form-check-input { width: 1.2em; height: 1.2em; border-color: #8A969D; }
.form-check-input:checked { background-color: var(--anthracite); border-color: var(--anthracite); }
.invalid-feedback, .form-error-message { color: var(--alerte-accent); font-weight: 700; }
.champ { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }

/* Choix sous forme de pastilles (état d'un don, type de compte) */
.choix-pastilles { display: flex; flex-wrap: wrap; gap: 8px; }
.choix-pastilles input[type="radio"], .choix-pastilles input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choix-pastilles label {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; margin: 0;
    border: 1px solid var(--bordure-forte); border-radius: 999px; background: #fff; font-weight: 700; cursor: pointer;
}
.choix-pastilles input:checked + label { background: var(--couleur-secondaire); border-color: var(--couleur-secondaire); color: #fff; }
.choix-pastilles input:focus-visible + label { outline: 3px solid var(--anthracite); outline-offset: 3px; }

/* Alertes et messages */
.alert { border: 0; border-radius: var(--rayon); padding: 16px 20px; font-size: 16px; }
.alert-success { background: var(--dispo-fond); color: #0F4A2E; }
.alert-info { background: var(--attente-fond); color: #143361; }
.alert-warning { background: var(--reserve-fond); color: #5C3800; }
.alert-danger { background: var(--alerte-fond); color: var(--alerte-texte); }
.alert-secondary { background: var(--donne-fond); color: var(--texte-moyen); }

/* Fil d'Ariane */
.fil-ariane { font-size: 15px; color: var(--texte-discret); }
.fil-ariane ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fil-ariane li + li::before { content: "›"; margin-right: 6px; }
.fil-ariane a { color: var(--texte-discret); }

/* Pagination */
.pagination-charte { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 40px 0 0; padding: 0; }
.pagination-charte a, .pagination-charte span {
    display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px;
    border-radius: 999px; border: 1px solid var(--bordure-forte); text-decoration: none; font-weight: 700; color: var(--texte); background: #fff;
}
.pagination-charte [aria-current="page"] { background: var(--couleur-secondaire); border-color: var(--couleur-secondaire); color: #fff; }

/* Cartes génériques et panneaux */
.panneau { background: #fff; border-radius: var(--rayon-grand); padding: 28px; }
.panneau--contour { border: 2px solid var(--anthracite); }
.panneau--etiquette { border: 2px solid var(--anthracite); box-shadow: 0 6px 0 var(--anthracite); }
.panneau--doux { background: var(--fond-doux); }

/* Avatar à initiale */
.avatar-initiale {
    flex: none; width: 56px; height: 56px; border-radius: 999px; display: inline-grid; place-items: center;
    background: var(--couleur-principale); color: #fff; font-family: var(--police-titres); font-weight: 800; font-size: 26px;
}

/* Onglets et filtres en pastilles */
.filtres-pastilles { display: flex; flex-wrap: wrap; gap: 8px; }
.filtres-pastilles a, .filtres-pastilles button {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
    border: 2px solid var(--bordure-forte); background: #fff; color: var(--texte); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.filtres-pastilles [aria-current="page"], .filtres-pastilles [aria-pressed="true"] { background: var(--couleur-secondaire); border-color: var(--couleur-secondaire); color: #fff; }

/* Suggestions d'adresses (assets/controllers/adresse_controller.js) */
ul.adresse-suggestions { border: 1px solid var(--bordure); border-radius: var(--rayon-petit); box-shadow: var(--ombre-carte); max-height: 240px; top: calc(100% + 4px); padding: 6px; }
ul.adresse-suggestions:empty { display: none; }
ul.adresse-suggestions .suggestion-item { padding: 10px 12px; border-radius: 8px; }
ul.adresse-suggestions .suggestion-item:hover, ul.adresse-suggestions .suggestion-item[aria-selected="true"] { background: var(--fond-doux); }

.bouton--danger { background: #fff; color: var(--alerte-accent); border-color: var(--alerte-accent); }
.bouton--danger:hover { background: var(--alerte-fond); color: var(--alerte-texte); }
.bouton-icone--danger:hover { background: var(--alerte-fond); color: var(--alerte-accent); }

/* Tableaux */
.tableau-defilant { overflow-x: auto; padding: 8px 12px; }
.tableau-charte { width: 100%; border-collapse: collapse; font-size: 16px; }
.tableau-charte th { text-align: left; font-size: 14px; font-weight: 700; color: var(--texte-discret); padding: 12px 14px; border-bottom: 2px solid var(--bordure); white-space: nowrap; }
.tableau-charte td { padding: 14px; border-bottom: 1px solid var(--bordure); vertical-align: middle; }
.tableau-charte tr:last-child td { border-bottom: 0; }

/* Visuels d'ambiance : photo en fond, voile à la couleur secondaire du site pour garder le texte blanc lisible */
.fond-ambiance { position: relative; isolation: isolate; background-size: cover; background-position: center; background-repeat: no-repeat; background-color: var(--couleur-secondaire); }
.fond-ambiance::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--couleur-secondaire) 92%, transparent) 0%,
        color-mix(in srgb, var(--couleur-secondaire) 72%, transparent) 55%,
        color-mix(in srgb, var(--couleur-secondaire) 40%, transparent) 100%);
}
.fond-ambiance--uni::before { background: color-mix(in srgb, var(--couleur-secondaire) 86%, transparent); }
.fond-ambiance--bas::before {
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--couleur-secondaire) 10%, transparent) 0%,
        color-mix(in srgb, var(--couleur-secondaire) 55%, transparent) 45%,
        color-mix(in srgb, var(--couleur-secondaire) 94%, transparent) 100%);
}

/* Cartes de dons sur mobile : deux colonnes compactes (accueil, résultats, favoris) */
@media (max-width: 600px) {
    .grille-cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .carte-don { border-radius: 16px; }
    .carte-don__visuel { aspect-ratio: 1 / 1; }
    .carte-don__statut { left: 8px; top: 8px; padding: 3px 8px; font-size: 12px; }
    .carte-don__favori { right: 6px; top: 6px; }
    .carte-don__favori .bouton-icone { width: 36px; height: 36px; }
    .carte-don__corps { padding: 8px 10px 10px; gap: 2px; }
    .carte-don__categorie, .carte-don__pied { display: none; }
    .carte-don__titre { font-size: 15px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .carte-don__infos { flex-wrap: nowrap; gap: 0; font-size: 13px; white-space: nowrap; overflow: hidden; }
    .carte-don__infos svg { display: none; }
    .carte-don__infos span + span::before { content: "\00a0·\00a0"; }
}
