/* ==========================================================================
   Bella Tchag - presence du logo : en-tete, pied de page, filigrane
   Chargee apres pwa.css. Ecrite en mobile first.

   Le monogramme est pose en masque CSS et non en <img> : sa couleur suit
   alors le contexte (sombre dans l'en-tete, creme dans le pied de page,
   presque transparent en filigrane) a partir d'un seul fichier.
   ========================================================================== */

.logo-mark {
  display: block;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: url("../images/icons/monogramme.svg") center / contain no-repeat;
  mask: url("../images/icons/monogramme.svg") center / contain no-repeat;
}

/* --------------------------------------------------------------------------
   1. En-tete
   -------------------------------------------------------------------------- */

/* Grille et non flex : en flex, le nom et son sous-titre se retrouvaient
   cote a cote. Ici le monogramme occupe les deux lignes, le texte s'empile. */
.navbar .logo {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 0.6rem;
}

.navbar .logo-mark { grid-row: 1 / span 2; }
.navbar .logo h2,
.navbar .logo-subtitle { grid-column: 2; }

.navbar .logo-mark {
  width: 38px;
  height: 38px;
  color: var(--color-primary);
}

.navbar .logo h2 {
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.navbar .logo-subtitle {
  font-size: 0.55rem;
}

@media (min-width: 480px) {
  .navbar .logo-mark { width: 42px; height: 42px; }
  .navbar .logo h2 { font-size: 1.35rem; }
  .navbar .logo-subtitle { font-size: 0.62rem; }
}

@media (min-width: 769px) {
  .navbar .logo { column-gap: 0.85rem; }
  .navbar .logo-mark { width: 48px; height: 48px; }
  .navbar .logo h2 { font-size: 1.7rem; letter-spacing: 2px; }
  .navbar .logo-subtitle { font-size: 0.7rem; letter-spacing: 1px; }

  /* le menu venait coller au nom de la marque : il lui faut de l'air */
  .nav-wrapper { gap: 1.5rem; }
  .nav-menu { margin-left: 1rem; }
}

@media (min-width: 1200px) {
  .nav-wrapper { gap: 2.5rem; }
  .nav-menu { margin-left: 2rem; }
}

/* --------------------------------------------------------------------------
   2. Pied de page
   -------------------------------------------------------------------------- */

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  min-width: 0;
}

/* Le nom se met a la taille de la colonne au lieu de deborder sur le menu
   voisin : c'est ce debordement qui rendait le pied de page illisible. */
.footer-brand h3 {
  min-width: 0;
  font-size: clamp(1.1rem, 4.2vw, 1.5rem);
  line-height: 1.15;
  overflow-wrap: break-word;
}

.footer-brand .logo-mark {
  width: 52px;
  height: 52px;
  color: var(--color-fire-3);
}

.footer-brand h3 {
  margin: 0;
}

/* --------------------------------------------------------------------------
   3. Filigrane
   Un monogramme tres pale en fond de quelques sections. Volontairement
   discret : il doit se sentir, pas se lire, et ne jamais gener le texte.
   -------------------------------------------------------------------------- */

#concept,
#menu,
#franchise,
#formats {
  position: relative;
  overflow: hidden;
}

#concept::after,
#menu::after,
#franchise::after,
#formats::after {
  content: "";
  position: absolute;
  top: 50%;
  width: min(52vw, 460px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  background-color: var(--color-secondary);
  opacity: 0.035;
  -webkit-mask: url("../images/icons/monogramme.svg") center / contain no-repeat;
  mask: url("../images/icons/monogramme.svg") center / contain no-repeat;
  pointer-events: none;
  z-index: 0;
}

/* alterne d'un cote puis de l'autre */
#concept::after,
#franchise::after { right: -8%; }

#menu::after,
#formats::after { left: -8%; }

/* le contenu doit rester au-dessus du filigrane */
#concept > .container,
#menu > .container,
#franchise > .container,
#formats > .container {
  position: relative;
  z-index: 1;
}

/* sur fond sombre, le filigrane se pose en clair */
.section-dark::after,
#franchise::after {
  background-color: var(--color-light);
  opacity: 0.045;
}

/* Sur telephone le filigrane est plus discret encore : l'ecran est petit,
   le texte doit primer. */
@media (max-width: 640px) {
  #concept::after,
  #menu::after,
  #franchise::after,
  #formats::after { opacity: 0.025; width: 62vw; }
}

/* --------------------------------------------------------------------------
   4. Hymne : ecoute des pistes candidates et vote

   La section "Le Feu de Bois" est CLAIRE : ce bloc doit donc etre ecrit en
   encre sombre. Une premiere version le traitait comme un bloc sur fond
   sombre, texte blanc sur fond pale : illisible.
   -------------------------------------------------------------------------- */

.hymne {
  max-width: 640px;
  margin: 3rem auto 0;
  padding: 1.5rem;
  background: var(--color-white);
  border: 1px solid rgba(44, 32, 19, 0.12);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(44, 32, 19, 0.07);
}

.hymne[hidden] { display: none; }

.hymne-entete {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.hymne-titre {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--color-secondary);
  margin: 0;
}

.hymne-etat {
  font-size: 0.82rem;
  color: var(--color-gray-dark);
  font-variant-numeric: tabular-nums;
}

.hymne-intro {
  margin: 0 0 1.1rem;
  font-size: 0.92rem;
  color: var(--color-gray-dark);
}

.hymne-relance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 48px;
  margin-bottom: 1.1rem;
  padding: 0.75rem 1.2rem;
  border: none;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.hymne-relance:hover { background: var(--color-primary-dark); }
.hymne-relance:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 3px; }

/* Onglets de langue */
.hymne-langues {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.hymne-langue {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(44, 32, 19, 0.18);
  border-radius: 999px;
  background: none;
  color: var(--color-gray-dark);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hymne-langue:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.hymne-langue:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.hymne-langue.actif {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* Versions de travail, repliees */
.hymne-variantes {
  margin-top: 1rem;
  border-top: 1px solid rgba(44, 32, 19, 0.1);
  padding-top: 0.8rem;
}

.hymne-variantes summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-gray-dark);
  cursor: pointer;
}

.hymne-variantes summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.hymne-variantes[open] summary { margin-bottom: 0.4rem; }

.hymne-liste-variantes { list-style: none; margin: 0; padding: 0; }

.hymne-liste { list-style: none; margin: 0; padding: 0; }

/* --part est la part de votes : elle teinte le fond de la ligne */
.hymne-piste {
  --part: 0%;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.6rem;
  border-radius: 10px;
  overflow: hidden;
}

.hymne-piste + .hymne-piste { border-top: 1px solid rgba(44, 32, 19, 0.07); }

.hymne-piste::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--part);
  background: rgba(192, 57, 43, 0.07);
  transition: width 0.4s ease;
  pointer-events: none;
}

.hymne-piste > * { position: relative; }
.hymne-piste.active { background: rgba(192, 57, 43, 0.04); }

.hymne-play {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--color-bg-muted, #f0ece6);
  color: var(--color-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.hymne-play:hover,
.hymne-piste.joue .hymne-play { background: var(--color-primary); color: #fff; }
.hymne-play:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.hymne-play .fa-pause { display: none; }
.hymne-piste.joue .hymne-play .fa-play { display: none; }
.hymne-piste.joue .hymne-play .fa-pause { display: inline-block; }

.hymne-infos { flex: 1; min-width: 0; }

.hymne-nom {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: 0.35rem;
}

.hymne-nom em {
  font-style: normal;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--color-gray-dark);
}

.hymne-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(44, 32, 19, 0.12);
  cursor: pointer;
  overflow: hidden;
}

.hymne-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-fire-1), var(--color-fire-2));
}

.hymne-time {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--color-gray-dark);
  font-variant-numeric: tabular-nums;
}

.hymne-vote {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 0.95rem;
  border: 1px solid rgba(44, 32, 19, 0.22);
  border-radius: 999px;
  background: none;
  color: var(--color-gray-dark);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hymne-vote:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.hymne-vote:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.hymne-vote[disabled] { opacity: 0.6; cursor: wait; }

.hymne-vote.choisi {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.hymne-score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  margin-left: 0.2rem;
}

@media (max-width: 560px) {
  .hymne { padding: 1.1rem; }
  .hymne-piste { flex-wrap: wrap; }
  .hymne-vote { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .hymne-piste::before { transition: none; }
}

/* --------------------------------------------------------------------------
   5. Le logo complet dans les pages

   Les fichiers -rond ont un fond circulaire : le logo se pose sans boite
   carree. Le monogramme plat reste dans la barre de navigation et en
   filigrane, ou il est plus lisible en petit.
   -------------------------------------------------------------------------- */

/* Hero : sans accent, au-dessus du titre. Taille mesuree : il annonce la
   marque, il ne concurrence pas le titre juste en dessous. */
.hero-logo {
  display: block;
  width: 84px;
  height: 84px;
  margin: 0 auto 1.1rem;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.42));
  animation: hero-logo-entree 0.55s ease both;
}

@media (min-width: 640px) {
  .hero-logo { width: 100px; height: 100px; margin-bottom: 1.35rem; }
}

@media (min-width: 1024px) {
  .hero-logo { width: 112px; height: 112px; }
}

@keyframes hero-logo-entree {
  from { opacity: 0; transform: translateY(-12px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}

/* Pied de page : avec l'accent du g, aligne sur le nom de la marque. */
.footer-logo {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.3));
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo { animation: none; }
}
