/* ═══════════════════════════════════════════════════════
   JournalCuisine — main.css
   Variables, reset, utilitaires, typographie, boutons, cards
════════════════════════════════════════════════════════ */

/* ── Variables CSS ──────────────────────────────────── */
:root {
  /* Couleurs fidèles au mockup */
  --vert-logo:       #4A7C59;
  --vert-badge:      #5C8C6A;
  --vert-btn:        #5B8C5A;
  --vert-hover:      #3e6b3e;
  --orange-titre:    #E8632A;
  --rouge-cor:       #D94040;
  --jaune-vedette:   #F5E09A;
  --vert-vedette:    #7DB87A;
  --rouge-vedette:   #D94040;
  --beige-fond:      #FBF7F0;
  --blanc:           #FFFFFF;
  --gris-texte:      #3A3A3A;
  --gris-leger:      #F0EDEA;
  --gris-border:     #E2D9D0;
  --footer-bg:       #F5B5AA;   /* salmon du mockup */
  --footer-bottom:   #F0A898;

  --font-titre:      'Playfair Display', Georgia, serif;
  --font-corps:      'Inter', -apple-system, sans-serif;

  --radius-card:     16px;
  --radius-btn:      50px;
  --radius-badge:    50px;
  --radius-md:       12px;
  --radius-lg:       20px;

  --shadow-card:     0 2px 10px rgba(0,0,0,.08);
  --shadow-hover:    0 8px 28px rgba(0,0,0,.14);
  --shadow-btn:      0 4px 12px rgba(91,140,90,.35);

  --transition:      .2s ease;
  --container-max:   1220px;
  --container-pad:   clamp(1rem, 4vw, 2.5rem);
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-corps);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--gris-texte);
  background: var(--beige-fond);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--vert-logo); text-decoration: none; }
a:hover { color: var(--orange-titre); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Conteneur ──────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ── Typographie ─────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-titre);
  line-height: 1.22;
  color: #1A1A1A;
}
h1 { font-size: clamp(1.7rem, 4vw, 2.8rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 2.8vw, 1.9rem); font-weight: 700; }
h3 { font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 600; }
p  { margin-bottom: .6rem; }
p:last-child { margin-bottom: 0; }

.section-title {
  font-family: var(--font-titre);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 1.5rem;
}

/* ── Boutons — fidèles au mockup ────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .7rem 1.6rem;
  border-radius: var(--radius-btn);
  font-size: .9rem;
  font-weight: 600;
  font-family: var(--font-corps);
  line-height: 1;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  border: 2px solid transparent;
}
.btn:active { transform: scale(.97); }

.btn--primary {
  background: var(--vert-btn);
  color: var(--blanc);
  border-color: var(--vert-btn);
  box-shadow: var(--shadow-btn);
}
.btn--primary:hover {
  background: var(--vert-hover);
  border-color: var(--vert-hover);
  color: var(--blanc);
  box-shadow: 0 6px 18px rgba(62,107,62,.4);
}

.btn--outline {
  background: transparent;
  color: var(--vert-logo);
  border-color: var(--vert-logo);
}
.btn--outline:hover { background: var(--vert-logo); color: var(--blanc); }

.btn--ghost {
  background: transparent;
  color: var(--gris-texte);
  border-color: var(--gris-border);
}
.btn--ghost:hover { background: var(--gris-leger); }

.btn--connexion {
  background: var(--vert-btn);
  color: var(--blanc);
  border-color: var(--vert-btn);
  border-radius: var(--radius-btn);
  padding: .5rem 1.3rem;
  font-size: .87rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.btn--connexion:hover { background: var(--vert-hover); color: var(--blanc); }

.btn--lg  { padding: .85rem 2rem; font-size: .97rem; }
.btn--sm  { padding: .45rem 1rem; font-size: .82rem; border-radius: var(--radius-btn); }
.btn--full { width: 100%; justify-content: center; }

/* ── Badges — fidèles au mockup ─────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .7rem;
  border-radius: var(--radius-badge);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}
.badge--saison {
  background: var(--vert-badge);
  color: var(--blanc);
}
.badge--meta {
  background: transparent;
  color: #777;
  border: none;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  font-size: .8rem;
  padding: 0;
}

/* ── Grilles de cartes ───────────────────────────────── */
.cards-grid { display: grid; gap: 1.25rem; }
.cards-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cards-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ── Card Recette — fidèle au mockup ────────────────── */
.card-recette {
  background: var(--blanc);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
}
.card-recette:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.card-recette__image-link {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--gris-leger);
}
.card-recette__image-link img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.card-recette:hover .card-recette__image-link img { transform: scale(1.04); }
.card-recette__no-image { width: 100%; height: 100%; background: var(--gris-leger); }

/* Badge DE SAISON en haut à gauche de la photo */
.card-recette__image-link .badge--saison {
  position: absolute;
  top: .6rem; left: .6rem;
  z-index: 2;
  font-size: .65rem;
  padding: .2rem .65rem;
}

/* Bouton cœur favori — dans la ligne méta, à droite (fidèle au mockup) */
.btn-favorite {
  margin-left: auto;
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #cfcfcf;
  background: none;
  border: none;
  border-radius: 50%;
  transition: transform var(--transition), color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.btn-favorite svg { width: 20px; height: 20px; transition: fill var(--transition); }
.btn-favorite:hover { color: var(--rouge-cor); transform: scale(1.12); }
.btn-favorite.is-favorite { color: var(--rouge-cor); }
.btn-favorite.is-favorite svg { fill: var(--rouge-cor); }
.btn-favorite.is-loading { opacity: .5; pointer-events: none; }

.card-recette__body { padding: .9rem 1rem 1rem; }
.card-recette__titre {
  font-family: var(--font-corps);
  font-size: .97rem;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: .45rem;
  line-height: 1.35;
}
.card-recette__titre a { color: inherit; }
.card-recette__titre a:hover { color: var(--vert-logo); }

/* Méta : clock + temps, feuille + difficulté */
.card-recette__meta {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .78rem;
  color: #888;
}
.meta-item svg { flex-shrink: 0; color: #aaa; }
/* Icônes de difficulté colorées comme le mockup */
.diff-icon--leaf  { color: var(--vert-vedette) !important; }
.diff-icon--flame { color: var(--orange-titre) !important; }

/* ── Breadcrumb ──────────────────────────────────────── */
.breadcrumb { padding-block: .85rem; }
.breadcrumb__list {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .3rem; font-size: .8rem; color: #999;
}
.breadcrumb__list li:not(:last-child)::after { content: '›'; margin-left: .3rem; }
.breadcrumb__list a { color: #999; }
.breadcrumb__list a:hover { color: var(--vert-logo); }
.breadcrumb__list li:last-child { color: var(--gris-texte); }

/* ── Pagination ──────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: .4rem; flex-wrap: wrap; margin-top: 2.5rem; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding-inline: .5rem;
  border-radius: 50%; border: 1px solid var(--gris-border);
  font-weight: 500; color: var(--gris-texte); transition: all var(--transition);
}
.pagination .page-numbers:hover,
.pagination .current { background: var(--vert-logo); color: var(--blanc); border-color: var(--vert-logo); }

/* ── Spinner ─────────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gris-border);
  border-top-color: var(--vert-logo);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.no-content, .no-results { padding: 2.5rem; text-align: center; color: #999; }

/* ── Bloc auteur (recettes & articles) ───────────────── */
.author-box {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  background: linear-gradient(135deg, var(--jaune-fond) 0%, var(--beige-carte) 100%);
  border: 1px solid var(--gris-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-top: 2.5rem;
}
.author-box__avatar img { width: 80px; height: 80px; border-radius: 50%; display: block; box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.author-box__body { flex: 1; min-width: 0; }
.author-box__label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--vert-logo);
}
.author-box__name { font-size: 1.25rem; margin: .15rem 0 .4rem; }
.author-box__bio { font-size: .9rem; color: #666; line-height: 1.55; margin-bottom: .6rem; }
.author-box__link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .83rem;
  font-weight: 600;
  color: var(--vert-logo);
}
.author-box__link svg { transition: transform var(--transition); }
.author-box__link:hover svg { transform: translateX(3px); }

/* ── Page auteur ─────────────────────────────────────── */
.author-page { padding-bottom: 4rem; }
.author-hero {
  text-align: center;
  background:
    radial-gradient(circle at 85% 15%, rgba(125,184,122,.18), transparent 45%),
    radial-gradient(circle at 12% 85%, rgba(232,99,42,.10), transparent 42%),
    linear-gradient(135deg, var(--beige-fond) 0%, var(--jaune-fond) 100%);
  padding-block: 2.5rem 2.75rem;
  margin-bottom: 2rem;
}
.author-hero__avatar img {
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: var(--shadow-md);
  margin-bottom: .85rem;
}
.author-hero__kicker {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--vert-logo);
  margin-bottom: .35rem;
}
.author-hero__name { font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: .5rem; }
.author-hero__bio { max-width: 600px; margin: 0 auto .85rem; color: #666; line-height: 1.6; }
.author-hero__stats { display: flex; justify-content: center; gap: .6rem; font-size: .9rem; color: #888; }
.author-hero__stats strong { color: var(--vert-logo); }
.author-hero__dot { color: #ccc; }
.author-section { margin-bottom: 3rem; }

/* Dates de publication */
.post-dates { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: #999; }
.post-dates svg { flex-shrink: 0; }
.post-dates em { font-style: italic; }

@media (max-width: 560px) {
  .author-box { flex-direction: column; text-align: center; }
}

/* ── Archive de taxonomie (catégories, saisons, occasions…) ── */
.tax-page { padding-bottom: 4rem; }
.tax-header {
  background:
    radial-gradient(circle at 85% 15%, rgba(125,184,122,.18), transparent 45%),
    radial-gradient(circle at 12% 85%, rgba(232,99,42,.10), transparent 42%),
    linear-gradient(135deg, var(--beige-fond) 0%, var(--jaune-fond) 100%);
  padding-block: 1.25rem 2.25rem;
  margin-bottom: 1.5rem;
}
.tax-header .breadcrumb { padding-top: 0; }
.tax-header__kicker {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--vert-logo);
  background: rgba(74,124,89,.1);
  padding: .3rem .85rem;
  border-radius: var(--radius-btn);
  margin-bottom: .75rem;
}
.tax-header__title { font-size: clamp(1.9rem, 4.5vw, 3rem); margin-bottom: .5rem; }
.tax-header__desc { color: #666; max-width: 640px; line-height: 1.6; margin-bottom: .5rem; }
.tax-header__count { font-size: .9rem; color: #999; }

/* En-tête avec image de fond */
.tax-header--has-image {
  position: relative;
  background-size: cover;
  background-position: center;
  padding-block: clamp(2.5rem, 7vw, 5rem);
}
.tax-header__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,.6) 0%, rgba(0,0,0,.3) 60%, rgba(0,0,0,.15) 100%);
}
.tax-header--has-image .tax-header__inner { position: relative; z-index: 2; }
.tax-header--has-image .tax-header__title { color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.tax-header--has-image .tax-header__desc,
.tax-header--has-image .tax-header__count { color: rgba(255,255,255,.92); }
.tax-header--has-image .breadcrumb__list,
.tax-header--has-image .breadcrumb__list a,
.tax-header--has-image .breadcrumb__list li:last-child { color: rgba(255,255,255,.85); }
.tax-header--has-image .tax-header__kicker { background: rgba(255,255,255,.2); color: #fff; }

/* Navigation entre catégories */
.tax-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.75rem; }
.tax-nav__chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border-radius: var(--radius-btn);
  background: var(--blanc);
  border: 1.5px solid var(--gris-border);
  font-size: .85rem;
  font-weight: 600;
  color: var(--gris-texte);
  transition: all var(--transition);
}
.tax-nav__chip:hover { border-color: var(--vert-logo); color: var(--vert-logo); }
.tax-nav__chip.is-active { background: var(--vert-logo); color: #fff; border-color: var(--vert-logo); }
.tax-nav__count {
  font-size: .72rem;
  background: rgba(0,0,0,.08);
  border-radius: 50px;
  padding: .05rem .45rem;
  font-weight: 700;
}
.tax-nav__chip.is-active .tax-nav__count { background: rgba(255,255,255,.25); }

/* ── Responsive cards ────────────────────────────────── */
@media (max-width: 900px) {
  .cards-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .cards-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .cards-grid--3,
  .cards-grid--4 { grid-template-columns: 1fr; }
}
