/*
 * Charte relevée sur les captures de www.opticourses.fr (dossier captures-ecrans/).
 * Les polices ont été identifiées à l'oeil, le site d'origine bloque la lecture de son code : à confirmer.
 * Polices hébergées ici (pas de CDN), licence SIL OFL.
 */
@font-face {
    font-family: "Catamaran";
    font-weight: 300 800;
    font-display: swap;
    src: url("../fonts/catamaran-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Fira Sans Extra Condensed";
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/fira-sans-extra-condensed-500-latin.woff2") format("woff2");
}

:root {
    --rouge: #e22326;
    --rouge-fonce: #b81c1f;
    --bs-body-font-family: "Catamaran", system-ui, sans-serif;
    --bs-body-font-size: 1.0625rem;
    --bs-body-color: #323335;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Fira Sans Extra Condensed", "Arial Narrow", sans-serif;
}

h1 {
    color: var(--rouge);
    font-size: clamp(2rem, 1.2rem + 3vw, 3rem);
    line-height: 1.1;
}

/* Blanc sur ce rouge : contraste de 4,7 pour 1. */
.site-entete,
.site-pied {
    background: var(--rouge);
    color: #fff;
}

.site-pied a {
    color: #fff;
}

.btn-primary {
    --bs-btn-bg: var(--rouge);
    --bs-btn-border-color: var(--rouge);
    --bs-btn-hover-bg: var(--rouge-fonce);
    --bs-btn-hover-border-color: var(--rouge-fonce);
    --bs-btn-active-bg: #a01a1c;
    --bs-btn-active-border-color: #a01a1c;
    --bs-btn-focus-shadow-rgb: 226, 35, 38;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #f0898b;
    box-shadow: 0 0 0 .25rem rgba(226, 35, 38, .25);
}

.form-check-input:checked {
    background-color: var(--rouge);
    border-color: var(--rouge);
}

/*
 * Photo de taille fixe (proportion de la largeur de la carte) : un long complément
 * allonge la carte au lieu de réduire la photo. Les cartes d'une ligne ont la même hauteur (h-100).
 */
.carte-photo {
    aspect-ratio: 4 / 3;
    /* Sans min-height: 0, la photo (carrée) impose sa hauteur et la proportion est ignorée. */
    min-height: 0;
    flex-shrink: 0;
    padding: .5rem .5rem 0;
    background: #fff;
}

.carte-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.carte-aliment h2 {
    font-size: 1.15rem;
    line-height: 1.2;
}

/* Texte noir : contraste suffisant sur toutes les couleurs de catégorie actuelles. */
.pastille {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 1rem;
    background: var(--couleur);
    color: #000;
    font-size: .75rem;
    line-height: 1.4;
}

/* Liste des catégories du filtre : défile au lieu de dépasser de l'écran. */
.menu-categories {
    max-height: 60vh;
}

/* Suggestions de la recherche (recherche.js) : remplace le <datalist> natif, non stylable. */
.suggestions-recherche {
    top: 100%;
    z-index: 1050;
    max-height: 60vh;
    overflow-y: auto;
    --bs-list-group-active-bg: var(--rouge);
    --bs-list-group-active-border-color: var(--rouge);
}

.suggestions-recherche .list-group-item {
    cursor: pointer;
}

.flocon {
    color: #1a6f8f;
    line-height: 1;
}

.flocon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (min-width: 768px) {
    .carte-aliment h2 {
        font-size: 1.25rem;
    }
}
