/* ============================================================
   VALHALLA OTAKU — Styles globaux
   S'applique à toutes les pages du site
   ============================================================ */

/* IMPORTS */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=EB+Garamond:ital,wght@0,400;0,500;1,400&display=swap');

/* VARIABLES - THÈME SOMBRE (Default) */
:root {
  --ink:        #1a1410;
  --ash:        #252018;
  --stone:      #2e2820;
  --fade:       #6b5e55;
  --dust:       #9c8d83;
  --parchment:  #ede5d8;
  --cream:      #f7f2eb;
  --gold:       #c9a84c;
  --gold-dim:   #8a6f32;
  --ember:      #c85a2a;
  --rose:       #a8446a;
  --soul:       #5a6fa0;

  --hover-bg:   #2e2820; /* Subtilement plus clair que ash en sombre */

  --font-title: 'Cinzel', Georgia, serif;
  --font-body:  'EB Garamond', Georgia, serif;

  --radius-sm:  4px;
  --radius-md:  8px;

  --transition: 0.3s ease;
}

/* THÈME CLAIR */
html[data-theme="light"] {
  --ink:        #fdfaf5; /* Fond très clair */
  --ink-rgb:    253, 250, 245;
  --ash:        #f4ebd9; /* Fond secondaire (parchemin) */
  --stone:      #e8dec8; /* Éléments UI (un peu plus sombre) */
  --fade:       #8a7a6e; /* Texte discret -> contrasté brun */
  --dust:       #5c4b40; /* Texte secondaire -> contrasté brun sombre */
  --parchment:  #1a1410; /* Texte principal -> sombre (Encre) */
  --cream:      #0d0a08; /* Presque noir */
  
  --gold:       #7a5c2f; /* Texte Doré -> Bronze foncé pour lisibilité */
  --gold-dim:   #5c4523;
  --soul:       #304066;
  --hover-bg:   #e2d7c0; /* Subtilement plus sombre que ash en clair */
}

/* Corrections spécifiques mode clair */
html[data-theme="light"] {
  --hover-bg:   #e2d7c0;
  --bg-subtle:  rgba(0, 0, 0, 0.05);
  --border-light: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] body {
  background-color: var(--ash);
  color: var(--parchment);
}

html[data-theme="light"] .site-header,
html[data-theme="light"] .site-footer {
  background: var(--ink);
  border-color: var(--gold-dim);
}

html[data-theme="light"] .site-nav {
  background: var(--stone);
  border-color: rgba(122, 92, 47, 0.2);
}

html[data-theme="light"] .text-gold, 
html[data-theme="light"] .gold-text, 
html[data-theme="light"] .stele-name, 
html[data-theme="light"] .modal-name,
html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active {
  text-shadow: none !important;
}

html[data-theme="light"] .modal-overlay {
  background: rgba(253, 250, 245, 0.8) !important;
}

html[data-theme="light"] .block-text, 
html[data-theme="light"] .card-epitaph, 
html[data-theme="light"] .quote-text, 
html[data-theme="light"] .modal-story {
  color: var(--dust);
}

html[data-theme="light"] .header-stats {
  background: var(--ash);
  border-color: var(--gold-dim);
}


/* RESET */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  /* font-size et line-height définis plus bas dans le bloc d'amélioration */
  background-color: var(--ash);
  color: var(--parchment);
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a   { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* HEADER */
.site-header {
  background: var(--ink);
  border-bottom: 1px solid var(--gold-dim);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}

.header-rune {
  font-family: var(--font-title);
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  color: var(--dust);
  margin-bottom: 0.75rem;
}

.header-title {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.06em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.header-quote {
  font-style: italic;
  font-size: 1rem;
  color: var(--dust);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.header-divider {
  width: 80px;
  height: 1px;
  background: var(--gold-dim);
  margin: 0 auto 1.5rem;
}

.header-stats {
  font-family: var(--font-title);
  /* taille, padding et layout définis dans le bloc d'amélioration ci-dessous */
  color: var(--dust);
  flex-wrap: wrap;
}

.header-stats strong {
  color: var(--gold);
  font-weight: 600;
}

.stat-sep { color: var(--gold-dim); }

/* NAVIGATION */
.site-nav {
  background: var(--stone);
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-link {
  font-family: var(--font-title);
  /* taille et padding définis dans le bloc d'amélioration ci-dessous */
  color: var(--dust);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
  letter-spacing: 0.12em;
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold);
  text-decoration: none;
  border-bottom-color: var(--gold);
}

/* BOUTONS */
.btn-primary {
  font-family: var(--font-title);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  padding: 0.65rem 1.5rem;
  background: none;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  display: inline-block;
}

/* BOUTON HAMBURGER (Caché par défaut) */
.nav-toggle {
  display: none;
  background: var(--stone);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  width: 45px;
  height: 45px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.5rem;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 10px;
  right: 15px;
  z-index: 1001;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.nav-toggle:hover {
  background: rgba(201, 168, 76, 0.2);
}

/* BOUTON THÈME */
.theme-toggle {
  position: fixed;
  top: 10px;
  right: 70px; /* À gauche du hamburger sur mobile */
  background: var(--stone);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  width: 45px;
  height: 45px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: rgba(201, 168, 76, 0.2);
  transform: translateY(-2px);
}



.btn-primary:hover {
  background: var(--gold-dim);
  color: var(--ink);
  text-decoration: none;
}

.btn-ghost {
  font-family: var(--font-title);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  padding: 0.65rem 1.5rem;
  background: none;
  border: 1px solid var(--fade);
  color: var(--dust);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
  display: inline-block;
}

.btn-ghost:hover {
  border-color: var(--dust);
  color: var(--parchment);
  text-decoration: none;
}

/* ÉTIQUETTES DE SECTION */
.section-label {
  font-family: var(--font-title);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: var(--dust);
  text-transform: uppercase;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 1.5rem;
}

/* BADGES DE TYPE */
.type-badge {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  padding: 3px 10px;
  border: 1px solid;
  border-radius: var(--radius-sm);
}

.type-badge.sacrifice { color: var(--ember);   border-color: var(--ember); }
.type-badge.souffrance { color: var(--rose);   border-color: var(--rose); }
.type-badge.legende   { color: var(--gold);    border-color: var(--gold-dim); }

/* BARRE DE SCORE */
.score-bar-wrap {
  background: rgba(var(--ink-rgb, 0, 0, 0), 0.1);
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  margin: 0.4rem 0;
}

.score-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.score-bar.sacrifice { background: var(--ember); }
.score-bar.suffering { background: var(--rose);  }

/* FOOTER */
.site-footer {
  background: var(--ink);
  border-top: 1px solid rgba(201, 168, 76, 0.15);
  text-align: center;
  padding: 2.5rem 1.5rem;
  margin-top: 4rem;
  /* font-size et color définis dans le bloc d'amélioration ci-dessous */
}

/* .footer-sub défini dans le bloc d'amélioration ci-dessous */

/* ÉTAT VIDE */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--fade);
}

.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.empty-text { font-style: italic; font-size: 1rem; }

/* UTILITAIRES */
.hidden { display: none !important; }

/* RESPONSIVE */
@media (max-width: 600px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: fixed;
    top: 0;
    right: -280px; /* Caché à droite */
    width: 280px;
    height: 100vh;
    background: var(--ink);
    flex-direction: column;
    justify-content: flex-start;
    padding: 80px 1rem 2rem;
    gap: 0.5rem;
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    border-left: 1px solid var(--gold-dim);
    border-bottom: none;
  }

  .site-nav.nav-open {
    right: 0; /* Affiché */
  }

  .nav-link {
    width: 100%;
    text-align: left;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
  }

  .nav-link:hover,
  .nav-link.active {
    background: rgba(201, 168, 76, 0.1);
    border-bottom-color: var(--gold);
  }

  .header-stats { font-size: 0.65rem; gap: 0.5rem; }
}

/* Bouton retour flottant */
.back-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: var(--ash);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  padding: 10px 16px;
  border-radius: 30px;
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 0.75rem;
  z-index: 1000;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: rgba(201,168,76,0.2);
  transform: translateX(-3px);
}
/* ============================================================
   AMÉLIORATION DE LA LISIBILITÉ (contraste et taille)
   ============================================================ */

/* Texte général plus lisible */
body {
  font-size: 18px;
  line-height: 1.8;
  color: var(--parchment);
}

/* Titres plus grands et lisibles */
h1, .header-title, .page-header-title, .stele-name {
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: 0.05em;
  text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

h2, .card-name, .modal-name, .month-title {
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  letter-spacing: 0.03em;
}

/* Descriptions plus contrastées */
.block-text, .card-epitaph, .quote-text, .modal-story {
  font-size: 1rem;
  line-height: 1.7;
  color: #e0d6c8;  /* Plus clair que var(--fade) */
  font-weight: 400;
}

/* Citations plus lisibles */
.citation-quote, .hero-quote .quote-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--parchment);
  font-style: italic;
}

/* Tags plus lisibles */
.tag, .card-tag, .type-badge {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 4px 10px;
}

/* Scores plus lisibles */
.card-score-item, .score-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.card-score-item span {
  font-size: 0.85rem;
  font-weight: 700;
}

/* Flammes plus visibles */
.card-flames, .stele-flames {
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.15); /* Plus léger pour le mode clair */
  padding: 2px 8px;
  border-radius: 20px;
}

/* Boutons plus lisibles */
.btn-primary, .btn-ghost, .flame-btn, .pagination-btn {
  font-size: 0.75rem;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

/* Navigation plus lisible */
.nav-link {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  padding: 0.9rem 1.3rem;
  font-weight: 500;
}

/* Footer plus lisible */
.site-footer {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--dust);
}

.footer-sub {
  font-size: 0.8rem;
  color: rgba(156, 141, 131, 0.7);
}

/* Header stats plus lisibles */
.header-stats {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  background: var(--ash);
  border: 1px solid var(--gold-dim);
  display: inline-flex;
  padding: 0.5rem 1.5rem;
  border-radius: 40px;
  margin-top: 0.5rem;
}

.header-stats strong {
  font-size: 1rem;
  color: var(--gold);
}

/* Amélioration du contraste pour les textes sur fond sombre */
.text-gold, .gold-text, .stele-name, .modal-name {
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Liens plus lisibles */
a, .nav-card, .mur-item {
  transition: all 0.2s ease;
}

a:hover, .nav-card:hover, .mur-item:hover {
  text-decoration: underline;
/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--stone);
  color: var(--parchment);
  padding: 12px 24px;
  border-radius: 30px;
  border: 1px solid var(--gold-dim);
  font-family: var(--font-title);
  font-size: 0.8rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* BOUTON "VOIR L'HISTOIRE COMPLÈTE" */
.story-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.5rem 1.2rem;
  background: none;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.story-toggle-btn:hover {
  background: rgba(201, 168, 76, 0.12);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.story-toggle-btn.expanded {
  border-color: var(--ember);
  color: var(--ember);
}

.story-toggle-btn.expanded:hover {
  background: rgba(200, 90, 42, 0.1);
  border-color: var(--ember);
}

.story-text {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--dust);
  margin: 0;
}
