/* ==========================================================================
   HOME V2 — styles additionnels pour la nouvelle page d'accueil
   Chargé uniquement quand config/settings.json → home_v2_enabled = true
   (voir views/layouts/header.php). Vient compléter style.css : les
   composants communs (celebrity-card, celebrities-grid, section-header,
   btn/btn-primary, age-badge, category, celebrity-meta, years, flag) sont
   déjà définis dans style.css et réutilisés tels quels.
   ========================================================================== */

/* ---------- Demain + Décès récents : alignés sur grand écran, mêmes
   petites vignettes (aucun fond gris propre à ces encarts : on évite
   volontairement la classe historique .section-tomorrow de style.css qui
   porte un fond gris). Nombre de colonnes FIXE (pas d'auto-fill) pour que
   les 4 vignettes tiennent toujours sur une seule ligne, quelle que soit la
   largeur exacte — jamais de retour à la ligne asymétrique (3+1). ---------- */
.hv2-card .section-header { margin-top: 0; }
/* .section-header est display:flex dans style.css, avec l'eyebrow en
   flex-basis:100% pour forcer son passage au-dessus du titre. Imbriqué dans
   .hv2-card--align (flex-direction:column, pour coller les boutons en bas —
   voir plus bas), ce calcul en pourcentage devient instable selon les
   navigateurs : l'eyebrow ne prend plus toute la largeur et le h2 déborde au
   lieu de passer à la ligne. On repasse en empilement simple (display:block),
   fiable, uniquement dans ces cartes. */
.hv2-card--align .section-header { display: block; }
.hv2-card--align .section-header .section-eyebrow { margin-bottom: 2px; }
.hv2-mini .celebrities-grid { grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
.hv2-mini .celebrity-image { padding-top: 118%; }
.hv2-mini .celebrity-info { padding: 0.5rem; }
/* height:auto + line-clamp:unset : la règle de base (style.css) réserve
   2.8rem pour 2 lignes de titre (hauteur fixe), ce qui laisse un grand vide
   sous un nom tenant sur 1 ligne avant l'année. On laisse le nom prendre sa
   hauteur réelle (jamais tronqué) et on gère l'espacement avec un
   margin-bottom explicite à la place. */
.hv2-mini .celebrity-info h3 { font-size: 0.78rem; margin-bottom: 4px; height: auto; -webkit-line-clamp: unset; overflow: visible; }
.hv2-mini .celebrity-meta { font-size: 0.6rem; margin-bottom: 2px; }
.hv2-mini .category { font-size: 0.6rem; padding: 0.1rem 0.35rem; }
.hv2-mini .age-badge { font-size: 0.55rem; padding: 0.15rem 0.35rem; top: 0.3rem; right: 0.3rem; }
.hv2-mini .death-date-badge { font-size: 0.55rem; padding: 0.1rem 0.3rem; bottom: 0.3rem; left: 0.3rem; }
@media (max-width: 600px) { .hv2-card { padding: var(--spacing-lg) var(--spacing-md); } }
@media (max-width: 480px) { .hv2-mini .celebrities-grid { grid-template-columns: repeat(2, 1fr); } }

.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }

/* ---------- Tendances d'hier — carte maison (pas le composant standard) :
   les badges (raison, +N pts, âge) doivent rester SOUS la photo plutôt que
   la couvrir, ce que le composant standard (badges en overlay sur l'image)
   ne permet pas. Grille à 2 colonnes fixes = toujours 2x2, symétrique. ---------- */
.hv2-trend-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.hv2-trend-card { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--color-border); border-radius: var(--border-radius-md); padding: 12px; transition: border-color .15s, box-shadow .15s; }
.hv2-trend-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.hv2-trend-avatar { width: 64px; height: 64px; border-radius: var(--border-radius-md); object-fit: cover; flex-shrink: 0; background: var(--color-background-alt); }
.hv2-trend-info { min-width: 0; }
.hv2-trend-name { font-weight: 600; font-size: 0.85rem; margin: 0 0 2px; color: var(--color-text); }
.hv2-trend-meta { font-size: 0.72rem; color: var(--color-text-light); margin: 0 0 6px; display: flex; align-items: center; gap: 4px; }
.hv2-trend-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hv2-trend-reason { font-size: 0.6rem; font-weight: 500; color: var(--color-text-light); background: var(--color-background-alt); padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.hv2-trend-reason--anniversaire { color: var(--color-primary); background: var(--color-primary-light); }
.hv2-trend-reason--deces { color: #4b5563; background: rgba(75,85,99,0.14); }
.hv2-trend-reason--commemoration { color: #8e44ad; background: rgba(142,68,173,0.14); }
.hv2-trend-reason--actualite { color: #17a2b8; background: rgba(23,162,184,0.14); }
.hv2-trend-points { font-size: 0.6rem; font-weight: 400; color: #1b7a40; background: rgba(34,197,94,0.15); padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
@media (max-width: 480px) { .hv2-trend-grid { grid-template-columns: 1fr; } }

/* Ligne d'actions groupées (ex: bouton "voir tout" + filtres), pour que tout
   reste sur une seule ligne sans décalage entre encarts alignés. Le bouton
   n'est pas dans un .view-all-button-container ici : on reprend donc
   explicitement le style pilule utilisé partout ailleurs sur la home. */
.hv2-action-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.home-page .hv2-action-row .btn-primary {
    background: #fff; color: #1a1a1a; border: 1px solid #d9d9d9; border-radius: 999px;
    padding: 0.55rem 1.25rem; font-size: 0.85rem; font-weight: 500; letter-spacing: 0.01em;
    box-shadow: none; gap: 0.4rem;
}
.home-page .hv2-action-row .btn-primary::after { content: "→"; font-size: 1rem; line-height: 1; transition: transform 0.15s ease; }
.home-page .hv2-action-row .btn-primary:hover { background: #f5f1ea; border-color: #5b5b5b; color: #1a1a1a; }
.home-page .hv2-action-row .btn-primary:hover::after { transform: translateX(2px); }

/* ---------- Anniversaires marquants — cartes avec photo ronde ---------- */
.hv2-marking-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.hv2-marking-card { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--color-border); border-radius: var(--border-radius-md); padding: 12px; transition: border-color .15s, box-shadow .15s; }
.hv2-marking-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.hv2-marking-avatar { width: 64px; height: 64px; border-radius: var(--border-radius-md); object-fit: cover; flex-shrink: 0; background: var(--color-background-alt); }
.hv2-marking-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hv2-marking-name { font-weight: 600; font-size: 0.88rem; color: var(--color-text); }
.hv2-marking-meta { font-size: 0.76rem; color: var(--color-text-light); }
@media (max-width: 480px) { .hv2-marking-grid { grid-template-columns: 1fr; } }

/* ---------- Catégories — même présentation que /categories (section 2
   "Explorer par thème") : fond gris, pas de ligne de séparation — le fond
   gris suffit à marquer la coupure avec la section précédente. ---------- */
.tce-section { padding: 2.5rem 0 3rem; background: #ededed; }
.tce-themes-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .55rem; }
.tce-theme-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0; padding: .85rem .5rem .75rem;
    border: 1.5px solid #e8e8e8; border-radius: 14px;
    background: #fff; cursor: pointer; text-align: center; text-decoration: none;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.tce-theme-card:hover { border-color: var(--tc, #aaa); box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.tce-theme-icon { font-size: 1.3rem; line-height: 1; color: var(--tc, #6c757d); margin-bottom: .45rem; }
.tce-theme-name { font-size: .8rem; font-weight: 700; color: #333; line-height: 1.3; margin-bottom: .4rem; padding: 0 .2rem; }
.tce-theme-count { display: flex; align-items: center; justify-content: center; gap: .2rem; font-size: .68rem; color: #bbb; line-height: 1; }
.tce-theme-arrow { font-size: .6rem; opacity: .6; }
@media (max-width: 991px) { .tce-themes-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .tce-themes-grid { grid-template-columns: repeat(2, 1fr); gap: .35rem; } }
@media (max-width: 480px) {
    .tce-theme-card { padding: .65rem .35rem .6rem; }
    .tce-theme-icon { font-size: 1.1rem; margin-bottom: .35rem; }
    .tce-theme-name { font-size: .7rem; }
    .tce-theme-count { font-size: .62rem; }
}

/* ---------- Sections génériques : outil même-année, géo, rues, prénom du jour ---------- */
.hv2-section { padding: 2.5rem 0; }
.hv2-section.is-tight { padding-top: 0; }
.hv2-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.hv2-head h2 { font-size: 1.25rem; }

.hv2-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .hv2-two-col { grid-template-columns: 1fr; } }

.hv2-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--border-radius-lg); padding: 12px; box-shadow: var(--shadow-sm); }
.hv2-card h3 { font-size: 1.15rem; margin-bottom: 14px; }

/* Symétrie parfaite des boutons entre deux encarts alignés (Demain/Décès,
   Tendances/Marquants) : les deux cartes sont étirées à la même hauteur et
   leur bouton de bas de carte ("voir tout") est toujours collé au bord
   inférieur, quelle que soit la longueur du texte au-dessus. */
.hv2-two-col--align { align-items: stretch; }
/* min-width:0 : sans ça, un item de grille flex-column ne descend jamais
   sous le min-content de son contenu. Avec un bouton nowrap au texte long
   (ex: "Tous les anniversaires marquants"), ce min-content força toute la
   colonne de la grille (donc les deux cartes alignées) à dépasser la largeur
   de l'écran sur mobile étroit (~340px et moins). */
.hv2-card--align { display: flex; flex-direction: column; min-width: 0; }
.hv2-card--align .hv2-action-row { margin-top: auto; padding-top: 14px; }
.hv2-action-row .btn-primary { white-space: normal; text-align: center; }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 14px; font-size: 0.75rem; font-weight: 600; border: 1px solid var(--color-border); background: var(--color-background-alt); color: var(--color-text); text-decoration: none; }
.pill:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pill-celeb { padding-left: 4px; }
.pill-celeb-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

/* Outil « né la même année » */
.hv2-year-tool { text-align: center; padding: 32px; }
.hv2-year-tool h3 { margin-bottom: 8px; }
.hv2-year-tool p { color: var(--color-text-light); font-size: 0.9rem; max-width: 520px; margin: 0 auto 20px; }
.hv2-year-form { display: flex; justify-content: center; gap: 10px; max-width: 420px; margin: 0 auto 18px; }
.hv2-year-form input { flex: 1; border: 1px solid var(--color-border); border-radius: 8px; padding: 0 14px; height: 46px; font-size: 1rem; font-family: inherit; text-align: center; }
.hv2-year-form input:focus { outline: none; border-color: var(--color-primary); }
.hv2-year-form button { background: #fff; color: #1a1a1a; border: 1px solid #d9d9d9; border-radius: 8px; padding: 0 22px; font-weight: 500; cursor: pointer; }
.hv2-year-form button:hover { background: #f5f1ea; border-color: #5b5b5b; }
.hv2-year-quick { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* Géo */
.hv2-geo-note { font-size: 0.78rem; color: var(--color-text-tertiary); margin-bottom: 14px; }
.hv2-geo-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.hv2-geo-subheading { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-light); margin: 16px 0 8px; }

/* Classement rues */
.hv2-rank-list { display: flex; flex-direction: column; gap: 14px; margin: 14px 0; }
.hv2-rank-row { display: flex; align-items: center; gap: 14px; }
.hv2-rank-num { font-family: var(--font-secondary); font-size: 1.2rem; font-weight: 800; color: var(--color-secondary); width: 20px; flex-shrink: 0; }
.hv2-rank-row .hv2-rank-name { flex: 1; font-size: 0.88rem; font-weight: 600; margin: 0; }
.hv2-rank-count { font-size: 0.8rem; color: var(--color-text-light); white-space: nowrap; }
.hv2-card-intro { font-size: 0.82rem; color: var(--color-text-light); margin-bottom: 4px; }

/* Prénom du jour */
.hv2-eyebrow { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; color: var(--color-primary); text-transform: uppercase; margin-bottom: 6px; }
.hv2-prenom-title { font-size: 1.3rem; margin-bottom: 6px; }
.hv2-prenom-count { font-size: 0.8rem; color: var(--color-text-light); margin-bottom: 0; }

/* ---------- Derniers ajouts (bandeau bas de page) ---------- */
.hv2-last-added-bar { background: #fff; border-top: 1px solid var(--color-border); padding: 24px 0; }
.hv2-last-added-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.hv2-last-added-label { font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.hv2-last-added-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.hv2-last-added-bar .btn-primary::after { content: "🎲"; }
@media (max-width: 767.98px) {
    .hv2-last-added-inner { flex-direction: column; align-items: stretch; }
    .hv2-last-added-label { text-align: center; }
    .hv2-last-added-chips { justify-content: center; }
    .hv2-last-added-bar .btn-primary { justify-content: center; width: 100%; }
}
