/*
 * ui-extras.css — Thème clair, boutons d'en-tête, modale Infos & Crédits
 * Audioguide « Die, mémoires vivantes » / Trajet Spectacle
 *
 * Ce fichier complète main.css et layout.css sans les modifier :
 *  1. Palette claire (activée par la classe .theme-light sur <body>)
 *  2. Boutons icône du header (ⓘ infos, ☀/☾ thème)
 *  3. Modale Infos / Générique / Mentions légales
 */

/* ═════════════════════════════════════════════
   1. THÈME CLAIR
   Le thème sombre reste le défaut (variables dans :root de main.css).
   La classe .theme-light redéfinit les mêmes variables : tout le
   reste du CSS s'adapte automatiquement.
   [CHOIX TECHNIQUE] : l'accent ocre est assombri en mode clair
   (#c77f28 au lieu de #e8a045) pour conserver un contraste WCAG AA
   sur fonds clairs, notamment pour le texte des boutons.
   ═════════════════════════════════════════════ */

body.theme-light {
  --color-bg-primary:     #f5f1ea;
  --color-bg-secondary:   #ffffff;
  --color-bg-tertiary:    #ede7dc;
  --color-bg-elevated:    #e3dccd;

  --color-accent:         #c77f28;
  --color-accent-muted:   rgba(199, 127, 40, 0.12);
  --color-accent-dim:     rgba(199, 127, 40, 0.45);

  --color-text-primary:   #221f1a;
  --color-text-secondary: #5c564b;
  --color-text-muted:     #8a8272;

  --color-success:        #3d8a58;
  --color-warning:        #b0741f;
  --color-error:          #bb4a3e;
  --color-info:           #4a6fa8;

  --color-border:         rgba(0, 0, 0, 0.08);
  --color-border-strong:  rgba(0, 0, 0, 0.16);

  --shadow-sm:     0 1px 3px rgba(60, 50, 30, 0.12);
  --shadow-md:     0 4px 16px rgba(60, 50, 30, 0.15);
  --shadow-lg:     0 8px 32px rgba(60, 50, 30, 0.18);
  --shadow-accent: 0 0 20px rgba(199, 127, 40, 0.15);
}

/* Fond du conteneur carte pendant le chargement des tuiles */
body.theme-light #map-container { background: #e8e4da; }

/* Overrides Leaflet en clair (map.css utilise des couleurs en dur) */
body.theme-light #map-container .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.85) !important;
  color: var(--color-text-muted) !important;
}
body.theme-light .poi-marker {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(60, 50, 30, 0.35);
}
body.theme-light .user-marker {
  border-color: #ffffff;
}

/* Backdrop des modales plus doux en clair */
body.theme-light dialog::backdrop {
  background: rgba(40, 34, 24, 0.45);
}

/* ═════════════════════════════════════════════
   2. HEADER — groupe d'outils et boutons icône
   ═════════════════════════════════════════════ */

.app-header__tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}
.icon-btn:active {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

/* Icônes soleil/lune : une seule visible selon le thème */
#icon-theme-sun  { display: none; }
#icon-theme-moon { display: block; }
body.theme-light #icon-theme-sun  { display: block; }
body.theme-light #icon-theme-moon { display: none; }

/* ═════════════════════════════════════════════
   3. MODALE INFOS / GÉNÉRIQUE / MENTIONS LÉGALES
   Même mécanique que la modale POI : <dialog> +
   affichage conditionné à l'attribut [open].
   ═════════════════════════════════════════════ */

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-4);
  /* Pas de display ici — la dialog reste display:none sans [open] */
}
.info-modal[open] { display: flex; }

.info-modal__content {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-bottom: none;
  padding-bottom: calc(var(--space-8) + var(--safe-area-bottom));
  animation: sheet-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.info-modal__header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-bg-secondary);
  padding: var(--space-4) var(--space-5) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
}
.info-modal__header h2 {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}
.info-modal__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  border-radius: 50%;
  transition: all var(--transition-fast);
}
.info-modal__close:active { background: var(--color-bg-elevated); }

.info-modal__body {
  padding: var(--space-5) var(--space-6);
  -webkit-user-select: text;
  user-select: text;
}

/* Titre de l'œuvre en ouverture */
.info-modal__work-title {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--color-text-primary);
  margin-bottom: var(--space-5);
}
.info-modal__work-title em {
  font-style: italic;
  color: var(--color-accent);
}

/* Sections */
.info-section { margin-bottom: var(--space-8); }
.info-section h3 {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}
.info-section p {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}
.info-section p:last-child { margin-bottom: 0; }
.info-section strong { color: var(--color-text-primary); font-weight: 600; }
.info-section a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid var(--color-accent-dim);
}

/* Avertissement : encadré distinctif */
.info-section--notice {
  background: var(--color-accent-muted);
  border: 1px solid var(--color-accent-dim);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.info-section--notice h3 { border-bottom: none; padding-bottom: 0; }

/* In memoriam : centré, discret */
.info-section--memoriam {
  text-align: center;
  font-style: italic;
}
.info-section--memoriam p { color: var(--color-text-muted); }

/* Copyright final */
.info-modal__copyright {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

/* Marqueur d'élément à compléter (visible en relecture, à retirer en prod) */
.todo-mark {
  background: rgba(217, 107, 95, 0.15);
  color: var(--color-error);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.85em;
}
/* ═════════════════════════════════════════════
   4. LOGO DU SPLASH SCREEN
   ═════════════════════════════════════════════ */
.splash-screen__logo img {
  width: 112px;
  height: 112px;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(253, 89, 15, 0.35);
}
