/* =====================================================================
   Le Grimoire Gourmand — feuille de style principale
   Contient les jetons de design de la charte graphique (utilisés sur
   tout le site, back-office inclus) ainsi que les pages d'authentification
   livrées dans ce lot. Les sections "Porche du Grimoire", "Chaudron",
   etc. du front public seront ajoutées à ce fichier au lot suivant.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Pirata+One&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,500;1,600&display=swap');

:root {
    /* Couleurs de la charte "Grimoire Gourmand" — version "sorcière de conte" */
    --color-parchment:      #F7EFDD;
    --color-parchment-deep: #EAD9A0;
    --color-sauge:      #8A9A86;
    --color-sauge-dark: #6d7c69;
    --color-prune:      #5B3F63;
    --color-prune-dark: #3E2A44;
    --color-prune-light:#8B6D91;
    --color-prune-wash: rgba(91, 63, 99, 0.08);
    --color-amber:      #E5A93C;
    --color-amber-dark: #c78d24;
    --color-postit:     #F4E2A8;
    --color-wood:       #5A3D2B;
    --color-wood-dark:  #3E2A1D;
    --color-moonlight:  #D9DCEA;
    --color-text:       #2D2A2E;
    --color-text-soft:  #5c5760;
    --color-border:     #ddcfa8;
    --color-white:      #fffdf7;
    --color-danger:     #b0453f;
    --color-success:    #4c7a5a;

    /* Typographie */
    --font-title: 'Pirata One', Georgia, serif;
    --font-body:  'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Rayons & ombres */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-soft: 0 4px 16px rgba(45, 42, 46, 0.12);
    --shadow-lift: 0 12px 28px rgba(91, 63, 99, 0.28);
    --shadow-glow: 0 0 0 1px var(--color-amber), 0 0 22px rgba(229,169,60,0.35);

    /* Texture "vieux papier" réutilisable (grain fin en SVG, aucune image externe) */
    --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* --- Diviseur "constellation" entre les sections --- */
.grimoire-divider {
    display: flex; align-items: center; gap: 1em; margin: 0.5em 0 2.2em; color: var(--color-prune-light);
}
.grimoire-divider::before, .grimoire-divider::after {
    content: ''; flex: 1; height: 1px; background: linear-gradient(to right, transparent, currentColor, transparent);
}
.grimoire-divider .glyph { font-size: 1.1em; flex: 0 0 auto; }

/* --- Ornements de coin façon reliure ancienne, réutilisables sur cartes/blocs --- */
.ornate-frame { position: relative; }
.ornate-frame::before, .ornate-frame::after {
    content: '✦'; position: absolute; font-size: 0.8em; color: var(--color-wood); opacity: 0.45; pointer-events: none;
}
.ornate-frame::before { top: 0.5em; left: 0.6em; }
.ornate-frame::after { bottom: 0.5em; right: 0.6em; }


* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-parchment);
    background-image:
        var(--paper-grain),
        radial-gradient(ellipse 900px 500px at 10% 0%, var(--color-prune-wash) 0%, transparent 55%),
        radial-gradient(ellipse 700px 500px at 95% 25%, rgba(229,169,60,0.07) 0%, transparent 50%),
        radial-gradient(ellipse 800px 600px at 50% 100%, rgba(91,63,99,0.06) 0%, transparent 60%),
        radial-gradient(ellipse 1400px 900px at 50% 50%, transparent 55%, rgba(91,63,99,0.09) 100%);
    background-attachment: fixed;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-title);
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.5em;
}

a {
    color: var(--color-prune);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* --- Boutons génériques (réutilisés par le back-office) --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.7em 1.4em;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
    background: var(--color-amber);
    color: var(--color-text);
}
.btn-primary:hover { background: var(--color-amber-dark); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.btn-secondary {
    background: transparent;
    border-color: var(--color-prune);
    color: var(--color-prune);
}
.btn-secondary:hover { background: var(--color-prune); color: var(--color-white); }
.btn-danger {
    background: transparent;
    border-color: var(--color-danger);
    color: var(--color-danger);
}
.btn-danger:hover { background: var(--color-danger); color: var(--color-white); }
.btn-sm { padding: 0.4em 0.9em; font-size: 0.85em; border-radius: var(--radius-sm); }

/* --- Messages flash --- */

.alert {
    padding: 0.9em 1.2em;
    border-radius: var(--radius-md);
    margin-bottom: 1.2em;
    font-size: 0.95em;
}
.alert-success { background: #e7f1ea; color: var(--color-success); border: 1px solid #c7ddcd; }
.alert-error   { background: #f6e6e5; color: var(--color-danger);  border: 1px solid #ecc9c6; }

/* --- Champs de formulaire --- */

.field { margin-bottom: 1.1em; }
.field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4em;
    font-size: 0.92em;
}
.field .hint { color: var(--color-text-soft); font-size: 0.82em; margin-top: 0.3em; }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="url"],
.field input[type="file"],
.field select,
.field textarea {
    width: 100%;
    padding: 0.65em 0.9em;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    color: var(--color-text);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid var(--color-amber);
    outline-offset: 1px;
}
.field textarea { resize: vertical; min-height: 6em; }

/* --- Cartes de section génériques (utilisées en admin ET sur le front, ex: fiche recette) --- */
.form-card {
    background-color: var(--color-white);
    background-image: var(--paper-grain);
    border: 1px solid var(--color-border);
    box-shadow: inset 0 0 0 1px rgba(91,63,99,0.06);
    border-radius: var(--radius-md);
    padding: 1.6em 1.8em;
    margin-bottom: 1.4em;
}
.form-card h2 {
    font-size: 1.1em; margin-bottom: 1em; padding-bottom: 0.6em;
    border-bottom: 2px solid var(--color-prune-wash); color: var(--color-prune-dark);
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1em 1.4em; }
.form-checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.6em; }
.form-checkbox-grid label { display: flex; align-items: center; gap: 0.5em; font-weight: 500; font-size: 0.92em; }

/* =====================================================================
   Pages d'authentification (connexion / inscription)
   ===================================================================== */

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #fffdf8 0%, var(--color-parchment) 60%);
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 2.5em 2.2em;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.auth-logo {
    display: block;
    text-align: center;
    font-family: var(--font-title);
    font-size: 1.5em;
    font-weight: 700;
    color: var(--color-prune);
    margin-bottom: 0.2em;
}
.auth-tagline {
    text-align: center;
    color: var(--color-text-soft);
    font-size: 0.9em;
    margin-bottom: 1.8em;
}

.auth-form .btn { width: 100%; margin-top: 0.5em; }
.auth-switch {
    text-align: center;
    margin-top: 1.4em;
    font-size: 0.9em;
    color: var(--color-text-soft);
}

/* =====================================================================
   Front public — mise en page générale
   ===================================================================== */

.container { max-width: 1180px; margin: 0 auto; padding: 0 1.5em; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 1.5em; }
.site-main { min-height: 60vh; }
.site-body { overflow-x: hidden; }

section.page-section { padding: 3.2em 0; }
.section-heading { text-align: center; max-width: 640px; margin: 0 auto 2em; }
.section-heading .eyebrow {
    display: inline-flex; align-items: center; gap: 0.6em; color: var(--color-prune); font-weight: 700;
    font-size: 0.82em; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.5em;
}
.section-heading .eyebrow::before, .section-heading .eyebrow::after {
    content: '✦'; color: var(--color-amber); font-size: 0.9em; font-weight: 400;
}
.section-heading h2 { font-family: var(--font-title); font-weight: 400; letter-spacing: 0.01em; font-size: 2.1em; color: var(--color-prune-dark); }
.section-heading p { color: var(--color-text-soft); }

/* --- Bandeau d'annonce --- */
/* --- En-tête "Le Porche du Grimoire" (violet enchanté, magique et scintillant) --- */
.site-header {
    background-color: var(--color-prune-dark);
    background-image:
        var(--paper-grain),
        radial-gradient(ellipse 600px 200px at 20% 0%, rgba(229,169,60,0.14) 0%, transparent 65%),
        radial-gradient(ellipse 500px 300px at 85% 100%, rgba(139,109,145,0.35) 0%, transparent 65%),
        linear-gradient(180deg, var(--color-prune) 0%, var(--color-prune-dark) 100%);
    border-bottom: 3px solid var(--color-amber);
    box-shadow: 0 4px 20px rgba(45,20,50,0.4), inset 0 -3px 6px rgba(0,0,0,0.15);
    position: sticky; top: 0; z-index: 50;
}
.site-header::before, .site-header::after {
    content: '✦'; position: absolute; color: var(--color-amber); font-size: 0.7em; pointer-events: none;
    animation: header-twinkle 3.2s ease-in-out infinite;
}
.site-header::before { top: 18%; left: 42%; animation-delay: 0.4s; }
.site-header::after { top: 60%; left: 68%; font-size: 0.5em; animation-delay: 1.6s; }
@keyframes header-twinkle {
    0%, 100% { opacity: 0.15; transform: scale(0.8); }
    50%      { opacity: 0.9; transform: scale(1.2); }
}
.site-header-inner {
    max-width: 1180px; margin: 0 auto; padding: 0.65em 1.5em;
    display: flex; align-items: center; gap: 1.4em; flex-wrap: wrap;
    position: relative; z-index: 1;
}
.site-logo {
    font-family: var(--font-title); font-weight: 400; font-size: 1.5em; letter-spacing: 0.01em; color: var(--color-amber);
    display: flex; align-items: center; gap: 0.4em; margin-right: auto;
    animation: logo-flicker 4s ease-in-out infinite;
}
@keyframes logo-flicker {
    0%, 100% { text-shadow: 0 1px 0 rgba(0,0,0,0.5), 0 0 12px rgba(229,169,60,0.4); }
    50%      { text-shadow: 0 1px 0 rgba(0,0,0,0.5), 0 0 22px rgba(229,169,60,0.75), 0 0 8px rgba(255,255,255,0.3); }
}
.site-logo:hover { text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
    .site-header::before, .site-header::after, .site-logo { animation: none; }
}
.site-logo-mark { font-size: 0.9em; }

.mobile-menu-toggle {
    display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 0.4em;
}
.mobile-menu-toggle span { width: 22px; height: 2px; background: #ecdcef; display: block; }

.site-nav { display: flex; align-items: center; gap: 1.1em; flex-wrap: wrap; }
.site-nav a, .nav-link-button {
    font-weight: 500; font-size: 0.92em; color: #f0e4cf; background: none; border: none; cursor: pointer; padding: 0;
}
.site-nav a:hover, .nav-link-button:hover { color: var(--color-amber); text-decoration: none; }
.nav-inline-form { display: inline; }

.nav-dropdown { position: relative; }
.nav-dropdown-toggle { background: none; border: none; font: inherit; font-weight: 500; font-size: 0.92em; color: #f0e4cf; cursor: pointer; padding: 0; }
.nav-dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0; margin-top: 0.8em; z-index: 60;
    background: var(--color-white); background-image: var(--paper-grain); border: 1px solid var(--color-border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft); padding: 0.6em; min-width: 220px; flex-direction: column;
}
.nav-dropdown.is-open .nav-dropdown-menu { display: flex; }
.nav-dropdown-menu a { padding: 0.5em 0.7em; border-radius: var(--radius-sm); color: var(--color-text); }
.nav-dropdown-menu a:hover { background: var(--color-prune-wash); text-decoration: none; }


.site-search-row { display: flex; justify-content: center; padding: 0 1.5em 0.6em; }
.site-search {
    display: flex; width: 100%; max-width: 420px;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.28);
    border-radius: 999px; overflow: hidden; transition: background 0.15s ease, border-color 0.15s ease;
}
.site-search:focus-within { background: rgba(255,255,255,0.2); border-color: var(--color-amber); }
.site-search input {
    flex: 1; border: none; padding: 0.42em 1.1em; background: transparent; color: #fdf6ec; font-size: 0.92em;
}
.site-search input::placeholder { color: rgba(253,246,236,0.6); }
.site-search input:focus { outline: none; }
.site-search button { border: none; background: transparent; color: var(--color-amber); padding: 0 1.1em; cursor: pointer; font-size: 1.05em; }
.site-search button:hover { color: #fff; }

/* --- Hero "Bienvenue dans le Chaudron" --- */
.hero {
    position: relative;
    background-color: var(--color-parchment-deep);
    background-image:
        var(--paper-grain),
        radial-gradient(circle at 15% 20%, rgba(91,63,99,0.14) 0%, transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(229,169,60,0.14) 0%, transparent 40%),
        radial-gradient(circle at 50% 100%, rgba(91,63,99,0.10) 0%, transparent 55%);
    padding: 5em 0 4.5em;
    text-align: center;
    overflow: hidden;
    border-bottom: 1px solid var(--color-border);
}
.hero::before, .hero::after,
.hero-inner::before, .hero-inner::after {
    content: '✦'; position: absolute; color: var(--color-prune-light); opacity: 0.55; font-size: 1.4em;
}
.hero::before { top: 14%; left: 8%; }
.hero::after { bottom: 18%; right: 10%; color: var(--color-amber); font-size: 1em; }
.hero-inner { max-width: 700px; margin: 0 auto; padding: 0 1.5em; position: relative; z-index: 1; }
.hero-inner::before { content: '☾'; top: -2.2em; left: 50%; transform: translateX(-50%); font-size: 1.6em; opacity: 0.7; color: var(--color-prune); }
.hero-inner::after { content: none; }
.hero h1 {
    font-family: var(--font-title); font-weight: 400; letter-spacing: 0.01em;
    font-size: 2.9em; line-height: 1.2; margin-bottom: 0.5em; color: var(--color-prune-dark);
}
.hero p.lead { font-size: 1.1em; color: var(--color-text-soft); margin-bottom: 1.8em; }
.hero-actions { display: flex; gap: 1em; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn { font-size: 1em; padding: 0.85em 1.6em; }
.hero-actions .btn-primary { background: var(--color-sauge); color: #fff; }
.hero-actions .btn-primary:hover { background: #6f7d6c; box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.hero-actions .btn-secondary { border-color: var(--color-prune); color: var(--color-prune); }
.hero-actions .btn-secondary:hover { background: var(--color-prune); color: #fff; }

/* --- Filtre Alchimique --- */
.alchemy-filter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1em; }
.alchemy-filter a {
    display: flex; flex-direction: column; align-items: center; gap: 0.4em;
    background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
    padding: 1.6em 1em; text-align: center; transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative; overflow: hidden;
}
.alchemy-filter a:hover { transform: translateY(-5px) scale(1.03); box-shadow: var(--shadow-lift); text-decoration: none; border-color: var(--color-amber); }
.alchemy-filter .icon { font-size: 1.8em; display: inline-block; transition: transform 0.3s ease; }
.alchemy-filter a:hover .icon { animation: alchemy-wiggle 0.6s ease; }
.alchemy-filter .label { font-family: var(--font-title); font-weight: 600; color: var(--color-prune); }
.alchemy-filter .desc { font-size: 0.8em; color: var(--color-text-soft); }

@keyframes alchemy-wiggle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25%      { transform: scale(1.15) rotate(-8deg); }
    50%      { transform: scale(1.2) rotate(6deg); }
    75%      { transform: scale(1.1) rotate(-4deg); }
}
.alchemy-filter a[href*="element=feu"]:hover { box-shadow: 0 12px 28px rgba(229,169,60,0.35); }
.alchemy-filter a[href*="element=eau"]:hover { box-shadow: 0 12px 28px rgba(138,154,134,0.35); }
.alchemy-filter a[href*="element=terre"]:hover { box-shadow: 0 12px 28px rgba(91,63,99,0.25); }
@media (prefers-reduced-motion: reduce) {
    .alchemy-filter .icon, .alchemy-filter a:hover .icon { animation: none !important; }
}

/* --- Cartes recette (style "tarot") --- */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.6em; }
.recipe-card {
    background-color: var(--color-white);
    background-image: var(--paper-grain);
    border: 1px solid var(--color-prune-light);
    box-shadow: 0 0 0 4px var(--color-parchment), 0 0 0 5px var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease; height: 100%;
    display: flex; flex-direction: column;
    position: relative;
}
.recipe-card-heart {
    position: absolute; top: 0.5em; left: 0.5em; z-index: 5;
    width: 2.5em; height: 2.5em; border: none; background: none;
    display: flex; align-items: center; justify-content: center; font-size: 1.25em; cursor: pointer;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.35));
    transition: transform 0.15s ease;
    touch-action: manipulation; pointer-events: auto;
}
.recipe-card-heart:hover { transform: scale(1.15); }

.recipe-card:hover {
    transform: translateY(-6px) rotate(-0.6deg);
    box-shadow: 0 0 0 4px var(--color-parchment), 0 0 0 5px var(--color-amber), var(--shadow-lift);
}
.recipe-card-link { display: flex; flex-direction: column; flex: 1; color: inherit; }
.recipe-card-link:hover { text-decoration: none; }
.recipe-card-photo { position: relative; aspect-ratio: 4 / 3; background: var(--color-prune-light); flex-shrink: 0; }
.recipe-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.recipe-card-level {
    position: absolute; bottom: 0.7em; left: 0.7em; background: rgba(247, 239, 221, 0.95); 
    border: 1px solid var(--color-amber); color: #2D2A2E;
    font-size: 1.05em; padding: 0.3em 0.55em; border-radius: 999px; line-height: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.recipe-card-badge {
    position: absolute; top: 0.7em; right: 0.7em; background: var(--color-amber); color: var(--color-text);
    font-size: 0.72em; font-weight: 700; padding: 0.3em 0.7em; border-radius: 999px;
}
.recipe-card-body { padding: 1.1em 1.2em 1.3em; display: flex; flex-direction: column; flex: 1; }
.recipe-card-category { font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-prune); font-weight: 700; }
.recipe-card-body h3 { font-size: 1.15em; margin: 0.3em 0 0.4em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recipe-card-excerpt { font-size: 0.88em; color: var(--color-text-soft); margin: 0 0 0.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recipe-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 0.7em; font-size: 0.85em; color: var(--color-text-soft); }

/* --- Étoiles --- */
.rating-stars { display: inline-flex; align-items: center; gap: 0.2em; font-size: 0.9em; }
.rating-stars-lg { font-size: 1.3em; }
.star { color: #d8d2c2; }
.star-full, .star-half { color: var(--color-amber); }
.rating-count { font-size: 0.65em; color: var(--color-text-soft); margin-left: 0.3em; }
.rating-stars-lg .rating-count { font-size: 0.55em; }

/* --- Icônes régimes/allergies --- */
.dietary-icons { list-style: none; display: flex; gap: 0.4em; padding: 0; margin: 0.5em 0; flex-wrap: wrap; }
.dietary-icon {
    background: #f1ece0; border-radius: 999px; width: 1.9em; height: 1.9em; display: flex;
    align-items: center; justify-content: center; font-size: 0.9em; cursor: default;
}
.dietary-icon-img { width: 1.1em; height: 1.1em; object-fit: contain; }
.sr-only-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* --- Bloc autrice "Qui touille le chaudron" --- */
.author-block {
    display: flex; align-items: center; gap: 2.2em; background: var(--color-white);
    border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 2em; flex-wrap: wrap;
}
.author-block img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; border: 4px solid var(--color-parchment); box-shadow: var(--shadow-soft); overflow: hidden; }
.author-block-text { flex: 1; min-width: 240px; }
.author-block-text h3 { color: var(--color-prune); }

/* --- Carrousel "Laboratoire des Saisons" --- */
.seasonal-carousel { display: flex; align-items: stretch; gap: 1.2em; overflow-x: auto; padding: 0.5em 0.2em 1.2em; scroll-snap-type: x mandatory; }
.seasonal-carousel .recipe-card { min-width: 230px; max-width: 230px; height: 460px; scroll-snap-align: start; }
.seasonal-carousel .recipe-card-photo { flex-shrink: 0; }

/* --- Gazette Magique (section pleine largeur home) --- */
.newsletter-section {
    background-color: var(--color-prune);
    background-image: var(--paper-grain), linear-gradient(135deg, var(--color-prune) 0%, var(--color-prune-dark) 100%);
    color: #f6eef7; border-radius: var(--radius-lg);
    padding: 2.6em 2em; text-align: center;
    position: relative; overflow: hidden;
    border: 1px solid var(--color-prune-dark);
}
.newsletter-section h2 { color: var(--color-amber); }
.newsletter-section h2::before { content: '✦ '; }
.newsletter-section h2::after { content: ' ✦'; }
.newsletter-section p { color: #e4d4e6; margin-bottom: 1.4em; }
.newsletter-section-form { display: flex; gap: 0.7em; justify-content: center; max-width: 420px; margin: 0 auto; flex-wrap: wrap; }
.newsletter-section-form input { flex: 1; min-width: 200px; padding: 0.7em 1em; border-radius: var(--radius-md); border: none; }

/* --- Pied de page "Le Fond du Chaudron" --- */
.site-footer {
    background-color: var(--color-wood-dark);
    background-image: var(--paper-grain), linear-gradient(160deg, var(--color-wood) 0%, var(--color-wood-dark) 55%, var(--color-prune-dark) 100%);
    color: #ded2c4; margin-top: 3em; border-top: 3px solid var(--color-amber);
}
.site-footer-inner {
    max-width: 1180px; margin: 0 auto; padding: 3em 1.5em 2em;
    display: grid; grid-template-columns: 2fr 1fr 1.4fr 1fr; gap: 2em;
}
.footer-logo { color: var(--color-amber); margin-bottom: 0.6em; }
.footer-tagline { font-size: 0.88em; color: #b8b1ad; }
.footer-quote { font-size: 0.92em; font-weight: 700; color: #ded2c4; line-height: 1.5; margin: 0 0 0.3em; }
.footer-quote-author { font-size: 0.85em; font-style: italic; font-weight: 400; color: #b8b1ad; margin: 0; }

/* --- Bouton afficher/masquer le mot de passe --- */
.password-field-wrap { position: relative; }
.password-field-wrap input[type="password"], .password-field-wrap input[type="text"] { padding-right: 2.6em; width: 100%; }
.password-toggle-btn {
    position: absolute; top: 50%; right: 0.6em; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 1.1em; opacity: 0.6; padding: 0.3em;
}
.password-toggle-btn:hover { opacity: 1; }
.site-footer h4 { color: #fff; font-size: 0.95em; margin-bottom: 0.8em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5em; }
.site-footer a { color: #cfc8c3; font-size: 0.9em; }
.site-footer a:hover { color: var(--color-amber); }
.footer-newsletter-form { display: flex; gap: 0.5em; margin-top: 0.8em; flex-wrap: wrap; }
.footer-newsletter-form input { flex: 1; min-width: 140px; padding: 0.5em 0.8em; border-radius: var(--radius-sm); border: none; }
.site-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1); padding: 1.2em 1.5em; display: flex;
    justify-content: space-between; flex-wrap: wrap; gap: 0.6em; font-size: 0.78em; color: #9d968f; max-width: 1180px; margin: 0 auto;
}
.site-footer-bottom a { color: #9d968f; text-decoration: underline; text-underline-offset: 2px; }
.site-footer-bottom a:hover { color: var(--color-amber); }
.pwa-install-zone { position: relative; display: flex; gap: 0.5em; }
.pwa-btn {
    background: var(--color-amber); border: 1px solid var(--color-amber); color: #2D2A2E; font-weight: 700;
}
.pwa-btn:hover { background: var(--color-amber-dark); border-color: var(--color-amber-dark); color: #fff; }
.pwa-help-panel {
    position: absolute; bottom: 100%; left: 0; margin-bottom: 0.6em; z-index: 20;
    background: var(--color-white); color: var(--color-text); border: 1px solid var(--color-border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lift); padding: 1em 1.2em; width: 300px; font-size: 1.05em;
}
.pwa-help-panel p { margin: 0 0 0.6em; }
.pwa-help-panel p:last-child { margin-bottom: 0; }

/* --- Sidebar (listes "dernières / mieux notées / populaires") --- */
.sidebar-block { background-color: var(--color-white); background-image: var(--paper-grain); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1.4em; margin-bottom: 1.4em; }
.sidebar-block h4 { font-size: 1em; border-bottom: 2px solid var(--color-prune-wash); padding-bottom: 0.5em; margin-bottom: 0.8em; color: var(--color-prune-dark); }
.sidebar-recipe-item { display: flex; gap: 0.8em; align-items: center; margin-bottom: 0.8em; }
.sidebar-recipe-item img { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.sidebar-recipe-item .title { font-size: 0.88em; font-weight: 600; line-height: 1.3; }

/* --- Colonnes "En ce moment au grimoire" (version féerique) --- */
.grimoire-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.8em; }
.grimoire-column {
    background-color: var(--color-prune-dark);
    background-image:
        radial-gradient(1px 1px at 15% 20%, rgba(255,255,255,0.65) 50%, transparent 51%),
        radial-gradient(1px 1px at 75% 15%, rgba(255,255,255,0.5) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 40% 65%, rgba(255,255,255,0.55) 50%, transparent 51%),
        radial-gradient(1px 1px at 90% 55%, rgba(255,255,255,0.4) 50%, transparent 51%),
        radial-gradient(1px 1px at 60% 85%, rgba(255,255,255,0.5) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 25% 90%, rgba(255,255,255,0.4) 50%, transparent 51%),
        linear-gradient(160deg, var(--color-prune) 0%, var(--color-prune-dark) 65%, var(--color-wood-dark) 100%);
    border: 1px solid var(--color-amber);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 0 4px var(--color-parchment), 0 0 0 5px var(--color-amber), var(--shadow-lift);
    padding: 1.6em 1.5em 1.3em; position: relative; overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
}
.grimoire-column:hover { transform: translateY(-5px) scale(1.015); }
.grimoire-column-head { display: flex; align-items: center; gap: 0.8em; margin-bottom: 1.2em; padding-bottom: 0.9em; border-bottom: 1px dashed rgba(229,169,60,0.4); }
.grimoire-column-badge {
    width: 2.6em; height: 2.6em; border-radius: 50%; flex-shrink: 0;
    background: radial-gradient(circle, var(--color-amber) 0%, var(--color-amber-dark) 100%);
    display: flex; align-items: center; justify-content: center; font-size: 1.15em;
    box-shadow: 0 0 0 3px rgba(247,239,221,0.15), 0 0 18px rgba(229,169,60,0.55);
}
.grimoire-column-head h4 { margin: 0; font-family: var(--font-title); font-weight: 400; letter-spacing: 0.01em; font-size: 1.25em; color: var(--color-amber); }
.grimoire-column .sidebar-recipe-item { position: relative; z-index: 1; }
.grimoire-column .sidebar-recipe-item .title { color: #f7efdd; }
.grimoire-column .sidebar-recipe-item .sub { color: #cbb8d1; }
.grimoire-column .sidebar-recipe-item:last-child { margin-bottom: 0; }
.grimoire-column .sub { color: #cbb8d1 !important; }
.sidebar-recipe-item .sub { font-size: 0.76em; color: var(--color-text-soft); }

/* --- Page catégories / recherche --- */
.page-header { padding: 2.6em 0 1.6em; text-align: center; }
.page-header h1 { font-size: 2.1em; }
.category-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2em; }
.category-card {
    background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
    padding: 1.6em; text-align: center; transition: transform 0.15s ease;
}
.category-card:hover { transform: translateY(-3px); text-decoration: none; box-shadow: var(--shadow-soft); }
.category-card h3 { color: var(--color-prune); margin-bottom: 0.3em; }
.category-card p { font-size: 0.85em; color: var(--color-text-soft); }
.subcategory-chips { display: flex; gap: 0.5em; flex-wrap: wrap; margin: 1em 0 2em; justify-content: center; }
.subcategory-chips a {
    background: var(--color-white); border: 1px solid var(--color-border); border-radius: 999px;
    padding: 0.4em 1em; font-size: 0.85em;
}
.subcategory-chips a.active, .subcategory-chips a:hover { background: var(--color-prune); color: #fff; text-decoration: none; }

.search-form-block { background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.6em; margin-bottom: 2em; }
.search-form-block .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1em; align-items: end; }

/* --- Barre de recherche épurée et centrée --- */
.search-hero { text-align: center; padding: 1.6em 0 0.5em; }
.search-hero-bar {
    display: flex; max-width: 480px; margin: 1.2em auto 1em;
    border: 1px solid var(--color-border); border-radius: 999px; overflow: hidden;
    box-shadow: var(--shadow-soft); background: var(--color-white);
}
.search-hero-bar input {
    flex: 1; border: none; padding: 0.9em 1.4em; font-size: 1.05em; background: transparent;
}
.search-hero-bar input:focus { outline: none; }
.search-hero-bar button {
    border: none; background: var(--color-amber); padding: 0 1.4em; cursor: pointer; font-size: 1.1em;
}
.search-hero-actions { display: flex; justify-content: center; gap: 0.6em; }
.filters-count-badge {
    background: var(--color-amber); color: var(--color-wood-dark); font-size: 0.72em; font-weight: 700;
    padding: 0.1em 0.5em; border-radius: 999px; margin-left: 0.3em;
}

/* --- Modal des filtres, façon grimoire qui s'ouvre --- */
.grimoire-modal {
    position: fixed; inset: 0; z-index: 1500;
    display: none; align-items: center; justify-content: center; padding: 1.2em;
}
.grimoire-modal.is-open { display: flex; }
.grimoire-modal-backdrop {
    position: absolute; inset: 0; background: rgba(45,42,46,0.55); backdrop-filter: blur(2px);
    opacity: 0; transition: opacity 0.25s ease;
}
.grimoire-modal.is-open .grimoire-modal-backdrop { opacity: 1; }
.grimoire-modal-panel {
    position: relative; z-index: 1;
    background-color: var(--color-parchment);
    background-image: var(--paper-grain);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.35), 0 0 0 6px var(--color-white) inset;
    max-width: 640px; width: 100%; max-height: 85vh; overflow-y: auto;
    padding: 2em 2.2em;
    transform: scale(0.85) rotateX(8deg); opacity: 0;
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}
.grimoire-modal.is-open .grimoire-modal-panel { transform: scale(1) rotateX(0); opacity: 1; }
.grimoire-modal-close {
    position: absolute; top: 1em; right: 1em; background: none; border: 1px solid var(--color-border);
    width: 2.2em; height: 2.2em; border-radius: 50%; cursor: pointer; font-size: 1em; color: var(--color-text-soft);
}
.grimoire-modal-actions {
    display: flex; justify-content: center; gap: 0.8em; margin-top: 1.8em; padding-top: 1.2em;
    border-top: 1px dashed var(--color-border);
}
@media (prefers-reduced-motion: reduce) {
    .grimoire-modal-panel { transition: opacity 0.15s ease; transform: none !important; }
}
@media (max-width: 600px) {
    .grimoire-modal-panel { padding: 1.6em; max-height: 92vh; }
}

.search-section { margin-top: 1.4em; }
.search-section-label { display: block; font-weight: 700; font-size: 0.9em; color: var(--color-prune); margin-bottom: 0.6em; }
.search-section-label .hint { font-weight: 400; font-size: 0.85em; }
.search-chip-grid { display: flex; flex-wrap: wrap; gap: 0.5em; }
.search-text-input {
    width: 100%; max-width: 320px; padding: 0.6em 1em; border: 1px solid var(--color-border);
    border-radius: 999px; background: #faf7f0; font-size: 0.92em;
}
.search-text-input:focus { outline: 2px solid var(--color-amber); outline-offset: 1px; }

.search-drawer {
    border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 0.5em;
    background: #faf7f0; overflow: hidden;
}
.search-drawer summary {
    cursor: pointer; padding: 0.6em 0.9em; font-weight: 600; font-size: 0.86em; color: var(--color-prune);
    list-style: none; display: flex; align-items: center; gap: 0.5em; justify-content: flex-start;
}
.search-drawer-emoji {
    width: 1.7em; height: 1.7em; display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-white); border-radius: 50%; font-size: 0.9em; flex-shrink: 0;
}
.search-drawer summary .hint { margin-left: auto; font-weight: 400; }
.search-drawer summary::-webkit-details-marker { display: none; }
.search-drawer summary::after { content: '▾'; color: var(--color-text-soft); transition: transform 0.2s ease; margin-left: 0.4em; }
.search-drawer[open] summary::after { transform: rotate(180deg); }
.search-drawer .search-chip-grid { padding: 0 0.9em 0.9em; gap: 0.4em; }
.search-chip {
    display: inline-flex; align-items: center; gap: 0.4em;
    background: var(--color-white); border: 1px solid var(--color-border); border-radius: 999px;
    padding: 0.38em 0.85em; font-size: 0.82em; cursor: pointer; user-select: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.search-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.search-chip:hover { background: var(--color-prune-wash); transform: translateY(-1px); }
.search-chip:has(input:checked) {
    background: var(--color-prune); border-color: var(--color-prune); color: #fff; font-weight: 600;
}
.search-chip.is-active-link {
    background: var(--color-prune); border-color: var(--color-prune); color: #fff; font-weight: 600;
}
.search-chip-more {
    background: none; border: 1px dashed var(--color-prune-light); color: var(--color-prune);
    font-weight: 600; font-size: 0.8em;
}
.search-chip-more:hover { background: var(--color-prune-wash); transform: none; }

/* --- Champ ingrédients à étiquettes, avec suggestions en direct --- */
.ingredient-tag-box, .ebook-tag-box {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em;
    border: 1px solid var(--color-border); border-radius: var(--radius-md);
    background: var(--color-white); padding: 0.5em 0.7em; min-height: 2.6em;
}
.ingredient-tag-box:focus-within, .ebook-tag-box:focus-within { border-color: var(--color-amber); box-shadow: 0 0 0 2px rgba(229,169,60,0.2); }
.ingredient-tags, .ebook-tags { display: flex; flex-wrap: wrap; gap: 0.4em; }
.ingredient-tag {
    display: inline-flex; align-items: center; gap: 0.4em;
    background: var(--color-prune); color: #fff; font-size: 0.85em; font-weight: 600;
    padding: 0.3em 0.5em 0.3em 0.8em; border-radius: 999px;
}
.ingredient-tag-remove { background: none; border: none; color: rgba(255,255,255,0.8); cursor: pointer; font-size: 0.85em; padding: 0.1em 0.3em; }
.ingredient-tag-remove:hover { color: #fff; }
#ingredient-search-input, .ebook-tag-box input[type="text"] { flex: 1; min-width: 140px; border: none; outline: none; font-size: 0.92em; padding: 0.3em; }
.ingredient-suggestions, .ebook-suggestions {
    margin-top: 0.4em; background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft); max-height: 220px; overflow-y: auto;
}
.ingredient-suggestion-item {
    display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
    padding: 0.6em 0.9em; font-size: 0.9em; border-bottom: 1px solid #f1ece0;
}
.ingredient-suggestion-item:last-child { border-bottom: none; }
.ingredient-suggestion-item:hover { background: var(--color-prune-wash); }

.empty-state { text-align: center; padding: 4em 1em; color: var(--color-text-soft); }
.empty-state .icon { font-size: 2.4em; margin-bottom: 0.4em; display: block; }

/* --- Fiche recette --- */
.recipe-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.4em; align-items: center; padding: 2.4em 0; }
.recipe-hero-photo img { width: 100%; border-radius: var(--radius-lg); aspect-ratio: 4/3; object-fit: cover; box-shadow: var(--shadow-soft); }
.recipe-hero-content .recipe-card-category { display: block; margin-bottom: 0.4em; }
.recipe-hero-content h1 { font-size: 2.2em; margin-bottom: 0.5em; }
.recipe-hero-meta { display: flex; gap: 1em; align-items: center; flex-wrap: wrap; margin: 0.8em 0 1.2em; }
.recipe-actions { display: flex; gap: 0.7em; flex-wrap: wrap; margin-top: 1em; }

.recipe-tags { display: flex; gap: 0.6em; flex-wrap: wrap; margin: 1em 0; }
.recipe-tag {
    background: #f1ece0; border-radius: 999px; padding: 0.4em 0.9em; font-size: 0.82em; font-weight: 600; color: var(--color-text-soft);
}

.time-table { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; margin: 1.6em 0; }
.time-table div { padding: 1em; text-align: center; border-right: 1px solid var(--color-border); }
.time-table div:last-child { border-right: none; }
.time-table .value { font-family: var(--font-title); font-weight: 700; font-size: 1.2em; color: var(--color-prune); display: block; }
.time-table .label { font-size: 0.78em; color: var(--color-text-soft); text-transform: uppercase; letter-spacing: 0.04em; }

.recipe-body { display: grid; grid-template-columns: 1fr 1.6fr; gap: 3em; padding: 2em 0 3em; align-items: start; }
.recipe-aside {
    position: sticky; top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 0.4em;
    scrollbar-width: thin;
}
.recipe-aside .form-card, .recipe-aside .sidebar-block { margin-bottom: 1.2em; }

.servings-control { display: flex; align-items: center; gap: 0.8em; margin-bottom: 1em; }
.servings-control button { width: 2.2em; height: 2.2em; border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-white); cursor: pointer; font-size: 1em; }
.servings-control input { width: 60px; text-align: center; padding: 0.4em; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.unit-toggle { display: inline-flex; border: 1px solid var(--color-border); border-radius: 999px; overflow: hidden; margin-bottom: 1em; }
.unit-toggle button { border: none; background: var(--color-white); padding: 0.4em 1em; font-size: 0.82em; cursor: pointer; }
.unit-toggle button.active { background: var(--color-prune); color: #fff; }

.ingredient-group-title { font-family: var(--font-title); color: var(--color-prune); margin: 1.2em 0 0.5em; font-size: 1.05em; }
.ingredient-list { list-style: none; padding: 0; margin: 0; }
.ingredient-list li { display: flex; gap: 0.6em; padding: 0.5em 0; border-bottom: 1px dashed var(--color-border); font-size: 0.94em; }
.ingredient-list li .qty { font-weight: 700; color: var(--color-prune); min-width: 70px; }
.ingredient-list .note { color: var(--color-text-soft); font-size: 0.85em; }

.equipment-list { list-style: none; padding: 0; margin: 0; }
.equipment-list li { padding: 0.4em 0; font-size: 0.92em; }

.step-block { display: flex; gap: 1em; padding: 1.4em 0; border-bottom: 1px solid var(--color-border); }
.step-block:last-child { border-bottom: none; }
.step-checkbox { flex-shrink: 0; }
.step-checkbox input { width: 1.3em; height: 1.3em; accent-color: var(--color-amber); cursor: pointer; }
.step-content { flex: 1; }
.step-content.step-done .step-text { text-decoration: line-through; color: var(--color-text-soft); }
.step-number { font-family: var(--font-title); color: var(--color-amber-dark); font-weight: 700; margin-right: 0.4em; }
.step-photos { display: flex; gap: 0.6em; margin: 0.8em 0; flex-wrap: wrap; }
.step-photos img { width: 130px; border-radius: var(--radius-sm); }
.step-tip {
    background: var(--color-postit);
    border: none;
    box-shadow: 2px 4px 10px rgba(45,42,46,0.18);
    padding: 0.9em 1.1em 0.7em;
    border-radius: 2px;
    margin: 1.1em 0.4em 0.5em 0.2em;
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 600;
    font-size: 1.15em;
    line-height: 1.35;
    color: #4a3f1f;
    transform: rotate(-1.5deg);
    position: relative;
    max-width: 92%;
}
.step-tip strong { font-style: italic; font-weight: 600; font-size: 1.05em; }
.step-tip::before {
    content: '';
    position: absolute;
    top: -10px; left: 24px;
    width: 46px; height: 18px;
    background: rgba(229, 169, 60, 0.55);
    border: 1px solid rgba(229, 169, 60, 0.3);
    transform: rotate(-4deg);
}
.step-timer { display: inline-flex; align-items: center; gap: 0.4em; background: var(--color-prune-wash); color: var(--color-prune-dark); border-radius: 999px; padding: 0.3em 0.8em; font-size: 0.82em; margin-top: 0.6em; cursor: pointer; border: 1px solid transparent; font-weight: 600; }
.step-timer.running { background: var(--color-amber); color: var(--color-text); }

.nutrition-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8em; }
.nutrition-grid div { background: #faf7f0; border-radius: var(--radius-sm); padding: 0.7em; text-align: center; }
.nutrition-grid .value { font-weight: 700; color: var(--color-prune); display: block; }
.nutrition-grid .label { font-size: 0.72em; color: var(--color-text-soft); }

.author-notes { background: #faf7f0; border-radius: var(--radius-md); padding: 1.2em 1.4em; font-style: italic; color: var(--color-text-soft); }

.comments-list { list-style: none; padding: 0; margin: 1.4em 0; }
.comment-item { border-bottom: 1px solid var(--color-border); padding: 1em 0; }
.comment-item .comment-head { display: flex; justify-content: space-between; font-size: 0.85em; color: var(--color-text-soft); margin-bottom: 0.4em; }
.comment-item .comment-author { font-weight: 700; color: var(--color-text); }

.recipe-nav { display: flex; justify-content: space-between; padding: 2em 0; border-top: 1px solid var(--color-border); margin-top: 2em; gap: 1em; }
.recipe-nav a { max-width: 45%; font-size: 0.9em; }
.recipe-nav .direction { display: block; font-size: 0.75em; color: var(--color-text-soft); }

/* --- Pages À propos / Profil / Favoris --- */
.about-hero { text-align: center; padding: 3em 0; }
.about-hero img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; margin: 0 auto 1.4em; box-shadow: var(--shadow-soft); overflow: hidden; }
.profile-card { display: flex; gap: 1.4em; align-items: center; background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.6em; margin-bottom: 1.6em; }
.profile-card img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .recipe-hero { grid-template-columns: 1fr; }
    .recipe-body { grid-template-columns: 1fr; }
    .recipe-aside { position: static; }
    .site-footer-inner { grid-template-columns: 1fr 1fr; }
    .alchemy-filter { grid-template-columns: repeat(2, 1fr); }
    .time-table { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .mobile-menu-toggle { display: flex; }

    .nav-drawer-backdrop {
        display: none; position: fixed; inset: 0; background: rgba(20,10,25,0.55); z-index: 89;
        opacity: 0; transition: opacity 0.25s ease;
    }
    .nav-drawer-backdrop.is-open { display: block; opacity: 1; }

    .site-nav {
        display: flex; flex-direction: column; align-items: stretch; gap: 0;
        position: fixed; top: 0; right: 0; bottom: 0; width: min(82vw, 320px);
        background-color: var(--color-prune-dark);
        background-image: var(--paper-grain), linear-gradient(160deg, var(--color-prune) 0%, var(--color-prune-dark) 100%);
        border-left: 3px solid var(--color-amber);
        box-shadow: -8px 0 30px rgba(0,0,0,0.4);
        padding: 0 0 2em; z-index: 90; overflow-y: auto;
        transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .site-nav.is-open { transform: translateX(0); }

    .site-nav-drawer-header {
        display: flex; align-items: center; justify-content: flex-end;
        padding: 1em 1.2em 0.6em; border-bottom: 1px solid rgba(229,169,60,0.3); margin-bottom: 0.6em;
    }
    .site-nav-drawer-close {
        background: rgba(255,255,255,0.1); border: none; color: #f0e4cf; width: 2.2em; height: 2.2em;
        border-radius: 50%; font-size: 1.1em; cursor: pointer;
    }

    .site-nav a, .nav-link-button {
        display: block; padding: 0.85em 1.2em; font-size: 1em; color: #f0e4cf !important;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .site-nav a:active, .nav-link-button:active { background: rgba(255,255,255,0.08); }
    .site-nav .btn-primary { margin: 0.8em 1.2em; display: inline-block; width: calc(100% - 2.4em); text-align: center; border-bottom: none; }

    .nav-dropdown { width: 100%; }
    .nav-dropdown-toggle {
        display: block; width: 100%; text-align: left; padding: 0.85em 1.2em; color: #f0e4cf; font-size: 1em;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .nav-dropdown-menu {
        position: static; display: none; margin: 0; box-shadow: none; border: none; border-radius: 0;
        background: rgba(0,0,0,0.15); padding: 0.3em 0;
    }
    .nav-dropdown.is-open .nav-dropdown-menu { display: flex; }
    .nav-dropdown-menu a { padding-left: 2.2em; font-size: 0.94em; color: #e6d9ea !important; }

    .site-search-row { padding: 0 1em 0.9em; }
    .hero h1 { font-size: 2em; }
    .nutrition-grid { grid-template-columns: repeat(2, 1fr); }
    .site-footer-inner { grid-template-columns: 1fr; }
}
@media (min-width: 721px) {
    .nav-drawer-backdrop, .site-nav-drawer-header { display: none !important; }
}

/* =====================================================================
   Transition "sort magique" entre les pages
   ===================================================================== */
.spell-transition {
    position: fixed; inset: 0; z-index: 9999;
    background:
        var(--paper-grain),
        radial-gradient(circle at center, var(--color-prune) 0%, var(--color-prune-dark) 75%);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.32s ease;
}
.spell-transition.is-active { opacity: 1; pointer-events: all; }
.spell-transition-glyph {
    font-size: 2.6em; color: var(--color-amber);
    text-shadow: 0 0 18px rgba(229,169,60,0.7);
}
.spell-transition.is-active .spell-transition-glyph { animation: spell-spin 0.6s ease; }
@keyframes spell-spin {
    0%   { opacity: 0; transform: scale(0.4) rotate(-25deg); }
    55%  { opacity: 1; transform: scale(1.25) rotate(12deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
    .spell-transition { display: none !important; }
}

/* --- Sélection de recettes (page favoris -> liste de courses) --- */
.recipe-card-selectable { position: relative; }
.recipe-card-checkbox {
    position: absolute; top: 0.7em; right: 0.7em; z-index: 5;
    background: var(--color-white); border-radius: 50%; padding: 0.4em; box-shadow: var(--shadow-soft);
    display: flex; cursor: pointer;
}
.recipe-card-checkbox input { width: 1.2em; height: 1.2em; accent-color: var(--color-amber); cursor: pointer; }

/* --- Partage social --- */
.recipe-share { margin-top: 1.2em; padding-top: 1em; border-top: 1px dashed var(--color-border); display: flex; align-items: center; gap: 0.6em; flex-wrap: wrap; }
.recipe-share-label { font-size: 0.82em; font-weight: 700; color: var(--color-prune); margin-right: 0.3em; }
.recipe-share-btn {
    background: var(--color-white); border: 1px solid var(--color-border); color: var(--color-text);
    font-size: 0.82em; font-weight: 600; padding: 0.4em 0.9em; border-radius: 999px; cursor: pointer;
}
.recipe-share-btn:hover { background: var(--color-prune); color: #fff; text-decoration: none; border-color: var(--color-prune); }

/* --- Suggestion météo --- */
.weather-suggestion { margin-top: 1.4em; font-size: 0.9em; }
.weather-suggestion-ask {
    background: none; border: 1px dashed var(--color-prune-light); color: var(--color-prune);
    padding: 0.5em 1em; border-radius: 999px; cursor: pointer; font-size: 0.95em;
}
.weather-suggestion-ask:hover { background: var(--color-prune-wash); }
.weather-suggestion-result { color: var(--color-text-soft); }

/* --- Mode Cuisine guidée (plein écran) --- */
.cooking-mode {
    position: fixed; inset: 0;
    height: 100vh; height: 100dvh; /* 100dvh = hauteur réelle sur mobile, sans la barre d'adresse */
    z-index: 2000;
    background-color: var(--color-wood-dark);
    background-image: var(--paper-grain), radial-gradient(circle at 50% 20%, var(--color-prune) 0%, var(--color-wood-dark) 75%);
    color: #f3ecec;
    display: none; flex-direction: column;
    padding: 1.4em;
    padding-top: max(1.4em, env(safe-area-inset-top));
    padding-bottom: max(1.4em, env(safe-area-inset-bottom));
    box-sizing: border-box;
}
.cooking-mode.is-open { display: flex; }
.cooking-mode-header { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; }
.cooking-mode-progress { font-size: 0.9em; letter-spacing: 0.05em; color: var(--color-amber); font-weight: 700; }
.cooking-mode-close {
    background: none; border: 1px solid rgba(255,255,255,0.3); color: #fff; width: 2.6em; height: 2.6em;
    border-radius: 50%; font-size: 1.1em; cursor: pointer; flex-shrink: 0;
}
.cooking-mode-body {
    flex: 1 1 auto;
    min-height: 0;              /* indispensable : sans ça, le contenu peut déborder sans scroll sur mobile */
    overflow-y: auto;           /* si le contenu est trop grand pour l'écran, on peut faire défiler au lieu de le couper */
    -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; max-width: 720px; width: 100%; margin: 0 auto; gap: 1em; padding: 1em 0.5em;
}
.cooking-mode-step-number {
    font-family: var(--font-title); font-size: 4em; color: var(--color-amber); line-height: 1; opacity: 0.9;
}
.cooking-mode-step-text { font-size: 1.6em; line-height: 1.4; font-weight: 500; }
.cooking-mode-timer {
    background: rgba(229,169,60,0.18); border: 1px solid var(--color-amber); color: var(--color-amber);
    padding: 0.6em 1.4em; border-radius: 999px; font-size: 1.1em; cursor: pointer;
}
.cooking-mode-timer.running { background: var(--color-amber); color: var(--color-wood-dark); }
.cooking-mode-step-tip {
    background: var(--color-postit); color: var(--color-wood-dark); font-family: var(--font-body); font-style: italic; font-weight: 600;
    font-size: 1.3em; padding: 0.8em 1.4em; border-radius: 4px; transform: rotate(-1.5deg);
    box-shadow: 3px 4px 10px rgba(0,0,0,0.3); max-width: 480px;
}
.cooking-mode-nav {
    flex: 0 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 0.8em; max-width: 720px; margin: 0 auto; width: 100%;
}
.cooking-mode-done { display: flex; align-items: center; gap: 0.5em; font-size: 0.92em; cursor: pointer; white-space: nowrap; }
.cooking-mode-done input { width: 1.3em; height: 1.3em; accent-color: var(--color-amber); flex-shrink: 0; }
.cooking-mode-nav .btn { font-size: 1em; padding: 0.75em 1.3em; white-space: nowrap; }
.cooking-mode-nav .btn:disabled { opacity: 0.35; cursor: not-allowed; }

@media (max-width: 600px) {
    .cooking-mode { padding: 1em; }
    .cooking-mode-step-number { font-size: 2.4em; }
    .cooking-mode-step-text { font-size: 1.15em; }
    .cooking-mode-step-tip { font-size: 1.1em; padding: 0.7em 1em; }
    .cooking-mode-nav {
        flex-wrap: wrap; justify-content: center; gap: 0.6em;
    }
    .cooking-mode-nav .btn { flex: 1 1 auto; min-width: 40%; }
    .cooking-mode-done { order: 3; flex: 1 1 100%; justify-content: center; padding-top: 0.4em; }
}

/* Empêche le fond de défiler derrière le mode Cuisine, y compris sur iOS Safari */
body.cooking-mode-lock {
    position: fixed;
    width: 100%;
    overflow: hidden;
}

/* --- Étincelles du bouton favoris --- */
.favorite-sparkle {
    position: fixed; z-index: 500; pointer-events: none; color: var(--color-amber);
    text-shadow: 0 0 6px rgba(229,169,60,0.7);
    animation: favorite-sparkle-fly 0.7s ease-out forwards;
}
@keyframes favorite-sparkle-fly {
    0%   { opacity: 1; transform: translate(0, 0) scale(0.6); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.2); }
}
@media (prefers-reduced-motion: reduce) {
    .favorite-sparkle { display: none; }
}

/* --- Badge de progression --- */
.badge-card { background-color: var(--color-white); background-image: var(--paper-grain); }
.badge-display { display: flex; align-items: center; gap: 1em; }
.badge-icon {
    font-size: 2.4em; width: 1.6em; height: 1.6em; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle, var(--color-amber) 0%, var(--color-amber-dark) 100%);
    border-radius: 50%; box-shadow: var(--shadow-glow); flex-shrink: 0;
}
.badge-title { font-family: var(--font-title); font-size: 1.25em; color: var(--color-prune); }
.badge-progress-bar { height: 10px; background: #f1ece0; border-radius: 999px; overflow: hidden; margin-top: 1em; }
.badge-progress-fill { height: 100%; background: linear-gradient(to right, var(--color-amber), var(--color-prune)); border-radius: 999px; transition: width 0.6s ease; }

/* --- Galerie d'avatars prédéfinis --- */
.avatar-preset-grid { display: flex; gap: 0.7em; flex-wrap: wrap; margin-top: 0.6em; }
.avatar-preset-choice {
    width: 3.2em; height: 3.2em; border-radius: 50%; padding: 0; overflow: hidden;
    border: 3px solid transparent; cursor: pointer; background: none; transition: border-color 0.15s ease, transform 0.15s ease;
}
.avatar-preset-choice img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-preset-choice:hover { transform: scale(1.08); }
.avatar-preset-choice.is-selected { border-color: var(--color-amber); box-shadow: 0 0 0 2px var(--color-white), 0 0 0 4px var(--color-amber); }

/* --- Carrousel Recette du Moment --- */
.moment-carousel { position: relative; display: flex; align-items: center; gap: 1em; }
.moment-carousel-track { flex: 1; position: relative; overflow: hidden; }
.moment-card {
    display: none; grid-template-columns: 1fr 1fr; gap: 2em; align-items: center;
    background: var(--color-white); background-image: var(--paper-grain);
    border: 1px solid var(--color-border); border-radius: var(--radius-lg);
    padding: 1.6em; box-shadow: var(--shadow-soft);
    animation: moment-fade-in 0.4s ease;
}
.moment-card.is-active { display: grid; }
@keyframes moment-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.moment-carousel-arrow {
    flex-shrink: 0; width: 2.6em; height: 2.6em; border-radius: 50%; border: 1px solid var(--color-border);
    background: var(--color-white); color: var(--color-prune); font-size: 1.4em; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background 0.15s ease;
}
.moment-carousel-arrow:hover { background: var(--color-prune); color: #fff; }
.moment-carousel-dots { display: flex; justify-content: center; gap: 0.5em; margin-top: 1em; }
.moment-carousel-dot { width: 0.6em; height: 0.6em; border-radius: 50%; border: none; background: var(--color-border); cursor: pointer; padding: 0; }
.moment-carousel-dot.is-active { background: var(--color-prune); }
.moment-favorite-heart {
    background: none; border: 1px solid var(--color-border); border-radius: 50%; width: 2.6em; height: 2.6em;
    font-size: 1.2em; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s ease;
}
.moment-favorite-heart:hover { transform: scale(1.1); }
.moment-favorite-heart.is-favorite { border-color: var(--color-amber); }

.moment-card-photo img { width: 100%; height: 260px; object-fit: cover; border-radius: var(--radius-md); }
.moment-card-badge {
    display: inline-block; background: var(--color-amber); color: var(--color-wood-dark);
    font-size: 0.78em; font-weight: 700; padding: 0.3em 0.9em; border-radius: 999px; margin-bottom: 0.6em;
}
.moment-card-body h2 { font-size: 1.7em; margin-bottom: 0.4em; }
@media (max-width: 720px) {
    .moment-card { grid-template-columns: 1fr; }
    .moment-card-photo img { height: 200px; }
    .moment-carousel-arrow { width: 2.2em; height: 2.2em; font-size: 1.2em; }
}

/* --- Recettes liées / variantes --- */
.recipe-variants { margin-top: 1.2em; padding-top: 1em; border-top: 1px dashed var(--color-border); }
.recipe-variants-label { display: block; font-size: 0.82em; font-weight: 700; color: var(--color-prune); margin-bottom: 0.6em; }
.recipe-variants-list { display: flex; gap: 0.6em; flex-wrap: wrap; }
.recipe-variant-chip {
    background: var(--color-postit); color: var(--color-wood-dark); font-size: 0.85em; font-weight: 600;
    padding: 0.45em 1em; border-radius: 999px; box-shadow: 0 2px 6px rgba(45,42,46,0.15);
    transition: transform 0.15s ease;
}
.recipe-variant-chip:hover { transform: translateY(-2px) rotate(-1deg); text-decoration: none; }

/* =====================================================================
   Animations
   ===================================================================== */

/* --- Révélation douce au défilement --- */
.reveal-on-scroll { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

/* --- Lune flottante (décor du hero) --- */
@keyframes moon-float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(-8px); }
}
.hero-inner::before { animation: moon-float 5s ease-in-out infinite; }

/* --- Étincelles discrètes du hero (déjà positionnées via ::before/::after) --- */
@keyframes sparkle-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%      { opacity: 0.9; transform: scale(1.15); }
}
.hero::before, .hero::after { animation: sparkle-pulse 3.4s ease-in-out infinite; }
.hero::after { animation-delay: 1.2s; }

/* --- Étoiles au survol des cartes de recette (déjà transform sur hover, on ajoute une transition plus douce) --- */
.recipe-card { transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease; }

/* --- Boutons : petit "pop" au clic --- */
.btn { transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
.btn:active { transform: scale(0.96); }

@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll { opacity: 1; transform: none; transition: none; }
    .hero-inner::before, .hero::before, .hero::after { animation: none; }
}

/* --- Impression (fiche recette) --- */
@media print {
    .site-header, .site-footer, .recipe-actions, .recipe-aside .btn,
    .comments-list, #comment-form, .recipe-nav, .newsletter-section, .mobile-menu-toggle,
    .spell-transition { display: none !important; }
    body { background: #fff; }
    .recipe-body { grid-template-columns: 1fr; }
}

/* =====================================================================
   Le Vrai Grimoire des Herbes
   ===================================================================== */
.herbarium-cover {
    background-color: var(--color-wood-dark);
    background-image: var(--paper-grain), radial-gradient(circle at 50% 0%, var(--color-prune) 0%, var(--color-wood-dark) 70%);
    color: #f3ecec; text-align: center; padding: 4em 1.5em 3.5em;
}
.herbarium-cover .eyebrow { color: var(--color-amber); }
.herbarium-cover h1 { font-size: 2.4em; margin: 0.3em 0 0.4em; color: #f3ecec; }
.herbarium-cover .lead { max-width: 560px; margin: 0 auto; opacity: 0.9; color: #f3ecec; }

/* --- Table des matières façon livre ouvert (double page) --- */
.herb-book-open {
    display: grid; grid-template-columns: 1fr 1.4fr; gap: 0;
    background: #efe4c8;
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lift), 0 0 0 4px var(--color-parchment), 0 0 0 5px var(--color-border);
    overflow: hidden; margin: 2em 0;
}
.herb-book-page { padding: 2.4em 2em; }
.herb-book-page-left {
    display: flex; align-items: center; justify-content: center; text-align: center;
    border-right: 3px solid #d8c9a0;
    box-shadow: inset -8px 0 14px -10px rgba(0,0,0,0.25);
    background-image: var(--paper-grain);
}
.herb-book-glyph { color: var(--color-amber); font-size: 1.1em; letter-spacing: 0.3em; display: block; margin-bottom: 0.6em; }
.herb-book-page-left-content h2 { font-family: var(--font-title); font-weight: 400; color: var(--color-prune); font-size: 1.8em; line-height: 1.3; margin: 0 0 0.5em; }
.herb-book-count { color: var(--color-text-soft); font-size: 0.85em; }
.herb-book-page-right { background-image: var(--paper-grain); max-height: 620px; overflow-y: auto; }
.herb-book-page-right .herbarium-toc { margin: 0; }

/* --- Flèches gauche/droite façon livre --- */
.herb-book-wrapper { display: flex; align-items: center; gap: 1em; }
.herb-book-wrapper .herb-book { flex: 1; min-width: 0; }
.herb-arrow {
    flex-shrink: 0; width: 3em; height: 3em; border-radius: 50%; border: 2px solid var(--color-amber);
    background: var(--color-white); color: var(--color-prune); font-size: 1.5em; line-height: 1;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: var(--shadow-soft); transition: transform 0.15s ease, background 0.15s ease;
}
.herb-arrow:hover:not(:disabled) { background: var(--color-prune); color: #fff; transform: scale(1.1); }
.herb-arrow:disabled { cursor: default; }

.herbarium-toc { display: flex; flex-direction: column; gap: 1em; margin: 0; }

.herbarium-toc-item {
    display: flex; gap: 1.2em; align-items: center;
    background: var(--color-white); background-image: var(--paper-grain);
    border: 1px solid var(--color-border); border-radius: var(--radius-lg);
    padding: 1em 1.4em; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.herbarium-toc-item:hover { transform: translateX(4px); box-shadow: var(--shadow-soft); text-decoration: none; }
.herbarium-toc-thumb { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #f1ece0; }
.herbarium-toc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.herbarium-toc-text strong { font-family: var(--font-title); font-size: 1.2em; color: var(--color-prune); }
.herbarium-toc-text p { margin: 0.2em 0 0.3em; color: var(--color-text-soft); font-size: 0.92em; }
.herbarium-toc-season { font-size: 0.8em; color: var(--color-text-soft); }

/* --- Page individuelle : effet "page qui s'ouvre" (chargement) + "page qui tourne" (navigation) --- */
.herb-book { perspective: 1800px; }
.herb-page { perspective: 1600px; margin: 1.4em 0 2em; }
.herb-page-inner {
    background-color: var(--color-parchment); background-image: var(--paper-grain);
    border: 1px solid var(--color-border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lift), 8px 0 0 -2px var(--color-white), 10px 0 0 -2px var(--color-border);
    padding: 2.4em 2.6em;
    transform-origin: left center;
    animation: herb-page-turn 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    backface-visibility: hidden;
}
@keyframes herb-page-turn {
    0%   { transform: rotateY(-100deg); opacity: 0; }
    60%  { opacity: 1; }
    100% { transform: rotateY(0deg); opacity: 1; }
}
/* Navigation en direct (précédent/suivant), sans rechargement de page */
.herb-page-inner.is-turning-out {
    animation: herb-page-turn-out 0.38s cubic-bezier(0.55, 0, 0.85, 0.35) forwards;
}
.herb-page-inner.is-turning-in {
    animation: herb-page-turn-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes herb-page-turn-out {
    0%   { transform: rotateY(0deg) scale(1); box-shadow: var(--shadow-lift), 8px 0 0 -2px var(--color-white), 10px 0 0 -2px var(--color-border); }
    100% { transform: rotateY(-115deg) scale(0.96); opacity: 0.4; }
}
@keyframes herb-page-turn-in {
    0%   { transform: rotateY(100deg) scale(0.96); opacity: 0.3; }
    100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}
.herb-page-inner { will-change: transform; }
.herb-page-image { text-align: center; margin-bottom: 1em; }
.herb-page-image img { width: 160px; height: 160px; object-fit: cover; border-radius: 50%; box-shadow: var(--shadow-soft); }
.herb-page-content { font-size: 1.05em; line-height: 1.85; margin: 1.4em 0; }
.herb-properties { border-top: 1px dashed var(--color-border); padding-top: 1.2em; margin-top: 1.4em; }
.herb-properties h2 { font-size: 1.15em; margin-bottom: 0.6em; }
.herb-properties ul { padding-left: 1.4em; }
.herb-properties li { margin-bottom: 0.4em; }

.herb-nav {
    display: flex; justify-content: space-between; gap: 1em; margin-bottom: 3em;
}
.herb-nav a {
    flex: 1; background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-md);
    padding: 1em 1.2em; font-family: var(--font-title); color: var(--color-prune); font-weight: 600;
}
.herb-nav a:last-child { text-align: right; }
.herb-nav .direction { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.78em; color: var(--color-text-soft); margin-bottom: 0.2em; }

@media (prefers-reduced-motion: reduce) {
    .herb-page-inner { animation: none; }
}
@media (max-width: 600px) {
    .herb-page-inner { padding: 1.6em 1.4em; }
    .herbarium-toc-item { flex-direction: column; text-align: center; }
}

/* =====================================================================
   Passe responsive globale (tablette puis téléphone) — composants
   ajoutés après le premier passage responsive : modal de filtres,
   colonnes "En ce moment", carrousels, e-book, catégories, header sombre.
   ===================================================================== */

/* --- Tablette (jusqu'à 900px) --- */
@media (max-width: 900px) {
    .grimoire-columns { grid-template-columns: 1fr; }
    .moment-card { grid-template-columns: 1fr; }
    .herbarium-cover h1 { font-size: 2em; }
    .quiz-modal-panel, .grimoire-modal-panel { max-width: 92vw; }
}

/* --- Téléphone (jusqu'à 720px), en complément du bloc existant --- */
@media (max-width: 720px) {
    /* En-tête : logo plus compact, pas de retour à la ligne intempestif */
    .site-logo { font-size: 1.25em; }
    .site-header-inner { padding: 0.5em 1em; gap: 0.8em; }
    .nav-dropdown-menu { left: auto; right: 0; }

    /* Modal "Affiner ta recherche" : plein écran plutôt qu'une boîte flottante trop petite */
    .grimoire-modal-panel { padding: 1.3em 1.1em; max-width: 100vw; width: 100%; max-height: 100vh; border-radius: 0; margin: 0; }
    .grimoire-modal { padding: 0; align-items: stretch; }
    .search-chip { font-size: 0.8em; padding: 0.4em 0.8em; }
    .ingredient-tag-box { flex-direction: row; flex-wrap: wrap; }
    #ingredient-search-input { min-width: 100px; }

    /* Carrousels : cartes un peu plus étroites pour en laisser deviner la suivante */
    .seasonal-carousel .recipe-card { min-width: 200px; max-width: 200px; height: 380px; }
    .moment-carousel-arrow { width: 2em; height: 2em; font-size: 1.05em; }
    .moment-card-photo img { height: 180px; }

    /* Colonnes "En ce moment au grimoire" */
    .grimoire-column { padding: 1.3em 1.1em 1em; }

    /* Aide PWA : largeur adaptée au petit écran */
    .pwa-help-panel { width: calc(100vw - 2.4em); left: 0.2em; }
    .site-footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.8em; }

    /* Mode Cuisine, filtres modal, herbier : déjà gérés plus haut */

    /* Grille des cartes de recettes : une seule colonne bien lisible */
    .recipe-grid { grid-template-columns: 1fr; }
    .recipe-card-photo { aspect-ratio: 16 / 10; }

    /* Formulaires admin : les champs occupent toute la largeur, plus de colonnes forcées */
    .form-grid { grid-template-columns: 1fr !important; }
    .admin-header { flex-direction: column; align-items: flex-start; gap: 0.8em; }
    .bulk-actions-bar { flex-wrap: wrap; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    /* E-book : sélecteurs multiples moins hauts pour ne pas noyer l'écran */
    #recipe_ids, #herb_ids { size: 5; }

    /* Herbier utilisateur */
    .herb-page-inner { padding: 1.2em 1em; }
    .herb-book-open { grid-template-columns: 1fr; }
    .herb-book-page-left { padding: 1.6em 1.2em; }
    .herb-book-page-right { max-height: none; }
    .herb-book-wrapper { gap: 0.4em; }
    .herb-arrow { width: 2.2em; height: 2.2em; font-size: 1.2em; }
    .herb-nav { flex-direction: column; }
    .herb-nav a:last-child { text-align: left; }

    /* Section héro et titres, un peu plus compacts */
    .hero-inner { padding: 0 1em; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; text-align: center; }
}

/* --- Très petit écran (téléphones étroits) --- */
@media (max-width: 380px) {
    .site-logo { font-size: 1.1em; }
    .stats-grid { grid-template-columns: 1fr; }
    .search-chip-grid { gap: 0.35em; }
    .cooking-mode-step-number { font-size: 2em; }
}

/* --- Mon carnet de cuisine (note personnelle sur une recette) --- */
.cooking-note-card {
    background-color: #FBF3DD; background-image: var(--paper-grain);
    border: 1px solid #e6d5a0; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft); padding: 1.4em 1.5em; margin: 1.6em 0;
    position: relative; overflow: hidden;
}
.cooking-note-card::before {
    content: ''; position: absolute; top: 0; right: 0; width: 0; height: 0;
    border-style: solid; border-width: 0 26px 26px 0; border-color: transparent #e6d5a0 transparent transparent;
}
.cooking-note-header { display: flex; align-items: flex-start; gap: 0.9em; margin-bottom: 0.9em; }
.cooking-note-icon {
    width: 2.6em; height: 2.6em; border-radius: 50%; flex-shrink: 0;
    background: radial-gradient(circle, var(--color-amber) 0%, var(--color-amber-dark) 100%);
    display: flex; align-items: center; justify-content: center; font-size: 1.15em; box-shadow: var(--shadow-soft);
}
.cooking-note-header h2 { font-size: 1.15em; margin: 0 0 0.2em; color: var(--color-prune-dark); }
.cooking-note-header p { margin: 0; font-size: 0.86em; color: var(--color-text-soft); }
.cooking-note-card textarea {
    width: 100%; border: 1px dashed #d9c589; border-radius: var(--radius-md); background: rgba(255,255,255,0.5);
    padding: 0.8em 1em; font-family: var(--font-body); font-style: italic; font-size: 0.98em; color: var(--color-wood-dark);
    resize: vertical;
}
.cooking-note-card textarea:focus { outline: none; border-color: var(--color-amber); background: rgba(255,255,255,0.8); }
.cooking-note-footer { display: flex; align-items: center; gap: 0.9em; margin-top: 0.7em; }
.cooking-note-footer span { font-size: 0.85em; color: var(--color-amber-dark); font-weight: 600; }

/* --- Répartition des notes (histogramme 1-5 étoiles) --- */
.rating-breakdown { margin-bottom: 1.6em; padding-bottom: 1.4em; border-bottom: 1px dashed var(--color-border); }
.rating-breakdown-row { display: flex; align-items: center; gap: 0.7em; margin-bottom: 0.4em; }
.rating-breakdown-label { width: 3.4em; font-size: 0.85em; color: var(--color-text-soft); flex-shrink: 0; }
.rating-breakdown-bar { flex: 1; height: 0.6em; background: #f1ece0; border-radius: 999px; overflow: hidden; }
.rating-breakdown-bar span { display: block; height: 100%; background: var(--color-amber); border-radius: 999px; transition: width 0.4s ease; }
.rating-breakdown-count { width: 2em; text-align: right; font-size: 0.82em; color: var(--color-text-soft); flex-shrink: 0; }

/* =====================================================================
   Collections de recettes
   ===================================================================== */
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.6em; margin: 1.6em 0; }
.collection-card {
    display: block; background: var(--color-white); background-image: var(--paper-grain);
    border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: 0 0 0 4px var(--color-parchment), 0 0 0 5px var(--color-border);
    transition: transform 0.25s ease, box-shadow 0.25s ease; color: inherit;
}
.collection-card:hover { transform: translateY(-4px); text-decoration: none; }
.collection-card-cover { aspect-ratio: 16 / 9; background: var(--color-prune-light); }
.collection-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.collection-card-body { padding: 1.2em 1.3em; }
.collection-card-body h3 { font-family: var(--font-title); color: var(--color-prune); margin: 0 0 0.4em; }
.collection-card-body p { font-size: 0.88em; color: var(--color-text-soft); margin: 0 0 0.6em; }
.collection-card-count { font-size: 0.78em; font-weight: 700; color: var(--color-amber-dark); }

.collection-hero {
    background-color: var(--color-wood-dark); background-image: var(--paper-grain);
    background-size: cover; background-position: center;
    text-align: center; padding: 4em 1.5em 3.5em; color: #f7efdd;
}
.collection-hero-inner { max-width: 640px; margin: 0 auto; }
.collection-hero .eyebrow { color: var(--color-amber); }
.collection-hero h1 { font-family: var(--font-title); font-weight: 400; font-size: 2.2em; margin: 0.3em 0 0.4em; color: #f7efdd; }
.collection-hero .lead { opacity: 0.9; }

/* --- Champ piège anti-bot (invisible pour un humain, souvent rempli par un robot) --- */
.hp-field {
    position: absolute !important; left: -9999px !important; top: -9999px !important;
    width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none;
}

/* --- Pages légales --- */
.legal-page { padding-bottom: 3em; }
.legal-page h2 { font-size: 1.2em; margin-top: 1.8em; color: var(--color-prune-dark); }
.legal-page p, .legal-page ul { line-height: 1.75; }
.legal-table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.9em; }
.legal-table th, .legal-table td { border: 1px solid var(--color-border); padding: 0.6em 0.8em; text-align: left; vertical-align: top; }
.legal-table th { background: var(--color-prune-wash); }

/* --- Page contact --- */
.contact-info-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1em; margin-bottom: 1.6em; }
.contact-info-card {
    background: var(--color-white); background-image: var(--paper-grain); border: 1px solid var(--color-border);
    border-radius: var(--radius-md); padding: 1.2em; text-align: center;
}
.contact-info-card .icon { font-size: 1.6em; display: block; margin-bottom: 0.4em; }
.contact-info-card strong { display: block; color: var(--color-prune); margin-bottom: 0.3em; font-size: 0.92em; }
.contact-info-card p { font-size: 0.85em; color: var(--color-text-soft); margin: 0; }

.contact-faq { margin-top: 2em; }
.contact-faq details {
    background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-md);
    padding: 0.9em 1.1em; margin-bottom: 0.7em;
}
.contact-faq summary { cursor: pointer; font-weight: 600; color: var(--color-prune); }
.contact-faq p { margin: 0.7em 0 0; color: var(--color-text-soft); font-size: 0.92em; }

