/* =========================================
   SUMA NGUEM — Charte graphique
   ========================================= */

:root {
  --violet:     #5B2D8E;
  --violet-dark:#3D1A6E;
  --or:         #C9A84C;
  --terracotta: #C1440E;
  --ivoire:     #FAF6F0;
  --brun:       #2C1A0E;
  --gris:       #7A6A5A;
  --blanc:      #FFFFFF;

  /* Variables liturgiques (surchargées par liturgie.js) */
  --liturgie-primary:   #5B2D8E;
  --liturgie-dark:      #3D1A6E;
  --liturgie-accent:    #CE93D8;
  --liturgie-hero-from: #3D1A6E;
  --liturgie-hero-to:   #5B2D8E;
  --liturgie-hero-text: #FFFFFF;
  --liturgie-hero-sub:  rgba(255,255,255,0.8);
  --liturgie-header-bg: var(--liturgie-dark);   /* fond du header */
  --liturgie-header-text: #FFFFFF;              /* texte/icônes header */
  --liturgie-menu-bg: var(--liturgie-dark);     /* fond menu hamburger */
  --liturgie-menu-text: rgba(255,255,255,0.9);  /* texte menu hamburger */

  /* Mode sombre */
  --bg:         var(--ivoire);
  --surface:    var(--blanc);
  --texte:      var(--brun);
  --texte-doux: var(--gris);
  --bordure:    rgba(0,0,0,0.08);
}

/* ---- MODE SOMBRE ---- */
body.dark {
  --bg:         #12100E;
  --surface:    #1E1A16;
  --texte:      #F0E8DC;
  --texte-doux: #9A8A78;
  --bordure:    rgba(255,255,255,0.08);
  --ivoire:     #12100E;
  --brun:       #F0E8DC;
  --gris:       #9A8A78;
  --blanc:      #1E1A16;
}

body {
  background: var(--bg);
  color: var(--texte);
  transition: background 0.3s ease, color 0.3s ease;
}

/* Cards & surfaces en mode sombre */
body.dark .verset-card,
body.dark .module-card,
body.dark .progress-section,
body.dark .priere-card,
body.dark .popup-card,
body.dark .bottom-nav {
  background: var(--surface);
  border-color: var(--bordure);
}

body.dark .priere-card {
  background: #1E1A16;
  border-color: rgba(91,45,142,0.3);
}

body.dark .progress-bar {
  background: #2A2420;
}

body.dark .module-card.featured {
  background: linear-gradient(135deg, var(--liturgie-dark, #3D1A6E) 0%, var(--liturgie-primary, #2A0E50) 100%);
}

body.dark .bottom-nav {
  border-top-color: var(--bordure);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}

body.dark .popup-overlay {
  background: rgba(0,0,0,0.75);
}

body.dark .popup-benefits {
  background: #2A2420;
}

body.dark .popup-close {
  background: #2A2420;
}

/* Mode sombre - Méditation evangile.html */
body.dark .meditation-box {
  background: linear-gradient(135deg, #2A1A3E, #3D1A6E);
  border-left-color: #CE93D8;
}

body.dark .meditation-label {
  color: #CE93D8;
}

body.dark .meditation-text {
  color: #F0E8DC;
}

/* Mode sombre - Jour card */
body.dark .jour-card {
  background: var(--surface);
}

body.dark .jour-header:hover {
  background: rgba(91, 45, 142, 0.1);
}

body.dark .tabs-nav {
  background: #2A2420;
  border-bottom-color: rgba(255,255,255,0.1);
}

body.dark .tab-btn.active {
  background: var(--surface);
}

body.dark .lecture-titre {
  color: var(--texte);
}

body.dark .lecture-ref {
  background: rgba(201,168,76,0.2);
}

body.dark .lecture-text {
  color: var(--texte);
}

/* ---- TOGGLE MODE SOMBRE (bouton flottant gauche) ---- */
#theme-toggle {
  position: fixed;
  left: 16px;
  bottom: 90px;
  z-index: 9997;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(201,168,76,0.4);
  background: var(--surface);
  color: var(--texte);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

@media (min-width: 768px) {
  #theme-toggle {
    bottom: 24px;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  min-height: 100vh;
}

/* ---- HEADER / NAV ---- */
header {
  background: var(--liturgie-header-bg, var(--liturgie-dark, var(--violet)));
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: background 0.3s ease;
}

.logo-text {
  color: var(--liturgie-header-text, var(--or));
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
}

.logo {
  text-decoration: none;
}

.hamburger span {
  width: 24px;
  height: 3px;
  background: var(--liturgie-header-text, var(--or));
  border-radius: 2px;
  transition: all 0.3s;
}

.logo-sub {
  display: block;
  color: rgba(255,255,255,0.7);
  font-size: 0.6rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
}

nav {
  display: flex;
  gap: 0.5rem;
}

nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
  transition: all 0.2s;
  white-space: nowrap;
}

header nav a:hover, header nav a.active {
  background: var(--or);
  color: var(--brun);
}

nav .login-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
}

nav .login-btn:hover {
  background: var(--or);
  color: var(--brun);
  border-color: var(--or);
}

/* Menu hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

/* Menu mobile */
@media (max-width: 768px) {
  header {
    padding: 0.8rem 1rem;
  }
  
  .logo-text {
    font-size: 1.1rem;
  }
  
  .logo-sub {
    display: none;
  }
  
  .hamburger {
    display: flex;
  }
  
  /* L'overlay ne doit PAS couvrir la zone du menu */
  .mobile-menu-overlay.active {
    width: calc(100% - 280px);
  }
  
  header > nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--liturgie-menu-bg, var(--liturgie-dark, var(--violet)));
    flex-direction: column;
    padding: 4rem 1.5rem 1.5rem;
    gap: 0.25rem;
    z-index: 10000;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,0.3);
    pointer-events: auto;
    overflow-y: auto;
  }
  
  header > nav.active {
    right: 0;
  }
  
  header > nav a {
    font-size: 1rem;
    padding: 0.75rem 1rem;
    width: 100%;
    text-align: left;
    border-radius: 8px;
    position: relative;
    z-index: 10001;
    display: block;
    cursor: pointer;
    pointer-events: auto !important;
    text-decoration: none;
    color: var(--liturgie-menu-text, rgba(255,255,255,0.9));
  }
  
  header > nav a:active {
    opacity: 0.7;
  }
  header > nav a.active {
    background: var(--or);
    color: var(--brun);
    width: auto;
    display: inline-block;
  }
  
  header > nav .login-btn {
    margin-top: 1rem;
    background: var(--or);
    color: var(--brun);
    text-align: center;
    font-weight: 800;
    border-radius: 10px;
    padding: 1rem;
    display: block;
    width: 100%;
  }
  
  /* Cacher le bottom nav sur mobile quand menu ouvert */
  body:has(.mobile-menu-overlay.active) .bottom-nav {
    display: none;
  }
}

/* ---- HERO ---- */
.hero {
  background: linear-gradient(135deg, var(--liturgie-hero-from) 0%, var(--liturgie-hero-to) 60%, var(--liturgie-primary) 100%);
  padding: 3rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(201,168,76,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-date {
  display: inline-block;
  background: var(--or);
  color: var(--brun);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 1rem;
  border-radius: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  color: var(--liturgie-hero-text, var(--blanc));
  font-size: 2rem;
  line-height: 1.3;
  margin-bottom: 0.8rem;
}

.hero h1 span {
  color: var(--or);
}

.hero p {
  color: var(--liturgie-hero-sub, rgba(255,255,255,0.8));
  font-size: 0.95rem;
  max-width: 320px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero-cta {
  display: inline-block;
  background: var(--or);
  color: var(--brun);
  font-weight: 700;
  padding: 0.9rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(201,168,76,0.4);
  position: relative;
  z-index: 10;
  cursor: pointer;
  border: 2px solid transparent;
}

/* hero-light — désactivé, le Temps Pascal utilise le hero violet standard */
.hero.hero-light {
  /* neutralisé */
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201,168,76,0.5);
}

/* ---- VERSET DU JOUR ---- */
.verset-card {
  display: block;
  margin: -1.5rem 1.5rem 0;
  background: var(--blanc);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border-left: 4px solid var(--or);
  position: relative;
  z-index: 10;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.verset-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0,0,0,0.15);
}

.verset-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gris);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.verset-text {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--brun);
  line-height: 1.6;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.verset-ref {
  font-size: 0.8rem;
  color: var(--violet);
  font-weight: 700;
}

/* ---- MODULES ---- */
.section {
  padding: 2rem 1.5rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--brun);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.module-card {
  background: var(--blanc);
  border-radius: 16px;
  padding: 1.2rem 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--brun);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
}

.module-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  border-color: var(--or);
}

.module-card.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--liturgie-primary, var(--violet)) 0%, var(--liturgie-dark, var(--violet-dark)) 100%);
  color: var(--blanc);
}

/* body.pascal — supprimé : le Temps Pascal utilise désormais les couleurs violettes standard */

.module-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.module-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.module-desc {
  font-size: 0.75rem;
  color: var(--gris);
  line-height: 1.4;
}

.module-card.featured .module-desc {
  color: rgba(255,255,255,0.7);
}

/* ---- PROGRES CAREME ---- */
.progress-section {
  background: var(--blanc);
  margin: 0 1.5rem;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.progress-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.progress-day {
  font-size: 0.8rem;
  color: var(--liturgie-primary, var(--violet));
  font-weight: 700;
}

.progress-bar {
  background: #EDE8E0;
  border-radius: 10px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  background: linear-gradient(90deg, var(--liturgie-primary, var(--violet)), var(--or));
  height: 100%;
  border-radius: 10px;
  transition: width 1s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--gris);
  text-align: center;
}

/* ---- PRIERE DU JOUR ---- */
.priere-card {
  background: var(--liturgie-priere-bg, linear-gradient(135deg, #F5F0FF 0%, #EDE8FF 100%));
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--liturgie-priere-border, rgba(91,45,142,0.15));
}

.priere-moment {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.moment-btn {
  flex: 1;
  padding: 0.4rem;
  border: none;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  background: #F5F5F5;
  color: var(--gris);
  transition: all 0.2s;
}

.moment-btn.active {
  background: var(--liturgie-accent-btn, var(--liturgie-primary, var(--violet)));
  color: var(--blanc);
}

.priere-content {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--brun);
  font-style: italic;
}

/* ---- BOTTOM NAV ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--blanc);
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  padding: 0.5rem 0 0.8rem;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--gris);
  font-size: 0.65rem;
  font-weight: 600;
  transition: color 0.2s;
  padding-top: 0.3rem;
}

.nav-item.active {
  color: var(--liturgie-accent-btn, var(--liturgie-primary, var(--violet)));
}

.nav-icon {
  font-size: 1.3rem;
}

.nav-item.active .nav-icon {
  filter: none;
}

/* Espace pour bottom nav */
.page-content {
  padding-bottom: 5rem;
}

/* ---- POPUP INSCRIPTION ---- */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 26, 14, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.popup-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.popup-card {
  background: var(--blanc);
  border-radius: 24px;
  padding: 2rem 1.5rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  transform: translateY(30px) scale(0.96);
  transition: transform 0.4s ease;
  border-top: 5px solid var(--or);
}

.popup-overlay.active .popup-card {
  transform: translateY(0) scale(1);
}

.popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--ivoire);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--gris);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.popup-close:hover {
  background: #EDE8E0;
  color: var(--brun);
}

.popup-icon {
  font-size: 3rem;
  margin-bottom: 0.8rem;
}

.popup-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--violet);
  margin-bottom: 0.8rem;
  line-height: 1.3;
}

.popup-text {
  font-size: 0.875rem;
  color: var(--gris);
  line-height: 1.6;
  margin-bottom: 1.2rem;
}

.popup-benefits {
  background: #F5F0FF;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.popup-benefit {
  font-size: 0.82rem;
  color: var(--brun);
  font-weight: 600;
  text-align: left;
}

.popup-btn-primary {
  display: block;
  background: linear-gradient(135deg, var(--violet), var(--violet-dark));
  color: var(--blanc);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.9rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  margin-bottom: 0.8rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(91,45,142,0.35);
}

.popup-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(91,45,142,0.45);
}

.popup-btn-secondary {
  background: none;
  border: none;
  color: var(--gris);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.3rem;
  font-family: 'Nunito', sans-serif;
  transition: color 0.2s;
}

.popup-btn-secondary:hover {
  color: var(--brun);
}

/* ---- RESPONSIVE ---- */
@media (min-width: 480px) {
  .hero h1 { font-size: 2.4rem; }
  .modules-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
  header nav { display: flex; }
  header #mobile-nav { display: none; }
  .bottom-nav { display: none; }
  .page-content { padding-bottom: 2rem; }
  .hero { padding: 5rem 2rem 6rem; }
  .hero h1 { font-size: 3rem; }
  .modules-grid { grid-template-columns: repeat(3, 1fr); }
  .module-card.featured { grid-column: span 1; }
}
