/*
  ep-establishment.css — Styles partagés pour toutes les pages établissement P003
  Version 1.0 — Sprint WEBAPP-03
  Ne pas modifier sans validation UX.
*/

/* ──────────────────────────────────────────
   DESIGN TOKENS
────────────────────────────────────────── */
:root {
  --navy:       #122C45;
  --sky:        #2A6AA8;
  --gold:       #F2990A;
  --gold-light: #FDE8CC;
  --sand:       #F7F1E6;
  --sand-dark:  #ECE4D4;
  --text:       #10202F;
  --text-muted: #6B7280;
  --white:      #FFFFFF;
  --card-bg:    #FFFFFF;
  --border:     rgba(27,58,92,0.12);
  --shadow-sm:  0 1px 4px rgba(27,58,92,0.08);
  --shadow-md:  0 4px 16px rgba(27,58,92,0.12);
  --shadow-lg:  0 12px 40px rgba(27,58,92,0.18);
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:   env(safe-area-inset-top, 0px);
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --navy:       #4A9CC7;
  --sand:       #0F1E2E;
  --sand-dark:  #162438;
  --text:       #F0EDE6;
  --text-muted: #9CA3AF;
  --card-bg:    #1A2D42;
  --border:     rgba(74,156,199,0.15);
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.45);
  --white:      #1A2D42;
}

/* ──────────────────────────────────────────
   RESET & BASE
────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; }
body {
  font-family: 'Nunito', sans-serif;
  background: var(--sand);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ──────────────────────────────────────────
   PAGE SHELL
────────────────────────────────────────── */
.ep-page {
  max-width: 480px;
  margin: 0 auto;
  background: var(--sand);
  min-height: 100dvh;
  position: relative;
}

@media (min-width: 640px) {
  .ep-page { max-width: 640px; box-shadow: var(--shadow-lg); }
  body { background: var(--sand-dark); }
}

/* ──────────────────────────────────────────
   BLOC A — HERO
────────────────────────────────────────── */
.ep-hero {
  position: relative;
  height: 55dvh;
  min-height: 300px;
  max-height: 420px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.ep-hero__photo {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #1a4a6e 0%, #2d7db5 40%, #1e5c8a 70%, #0d2e4a 100%);
}

.ep-hero__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,26,42,0.15) 0%,
    rgba(10,26,42,0.10) 30%,
    rgba(10,26,42,0.55) 65%,
    rgba(10,26,42,0.88) 100%
  );
}

.ep-hero__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  opacity: 0.18;
  pointer-events: none;
  user-select: none;
}

.ep-hero__nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 14px 12px;
  z-index: 2;
}

.ep-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10,26,42,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  cursor: pointer;
  transition: background var(--transition);
}
.ep-back:hover { background: rgba(10,26,42,0.75); }
.ep-back svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Repère SPIO (GO-01) — regroupe le lien retour et le repère d'accueil,
   pour que .ep-hero__nav garde son justify-content:space-between avec
   le bouton favori. */
.ep-nav-left { display: flex; align-items: center; gap: 8px; min-width: 0; }

.ep-home-link {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10,26,42,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
  overflow: hidden;
  transition: background var(--transition);
}
.ep-home-link:hover { background: rgba(10,26,42,0.75); }
.ep-home-link__icon { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; display: block; }
@media (max-width: 400px) {
  .ep-home-link__text { display: none; }
  .ep-home-link { padding: 7px; }
}

.ep-fav {
  width: 38px;
  height: 38px;
  background: rgba(10,26,42,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  transition: var(--transition);
}
.ep-fav:hover { background: rgba(10,26,42,0.75); }
.ep-fav.is-active { color: #ef4444; }
.ep-fav svg { width: 18px; height: 18px; }
@keyframes fav-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  70%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}
.ep-fav.pop { animation: fav-pop 0.35s cubic-bezier(0.36,0.07,0.19,0.97); }

.ep-hero__content {
  position: relative;
  z-index: 2;
  padding: 0 16px 20px;
}

.ep-zone-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.88);
  margin-bottom: 8px;
}
.ep-zone-chip svg { width: 11px; height: 11px; }

.ep-hero__title {
  font-family: 'Fraunces', serif;
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 700;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 5px;
}

.ep-hero__tag {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.78);
  margin-bottom: 10px;
}

/* Statut ouvert/fermé */
.ep-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}
.ep-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ep-status--open .ep-status__dot {
  background: #22c55e;
  animation: open-pulse 2s ease infinite;
}
.ep-status--open .ep-status__text { color: #86efac; }
.ep-status--coupure .ep-status__dot { background: var(--gold); }
.ep-status--coupure .ep-status__text { color: var(--gold); }
.ep-status--closed .ep-status__dot { background: #ef4444; }
.ep-status--closed .ep-status__text { color: #fca5a5; }
@keyframes open-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ──────────────────────────────────────────
   CTA PRINCIPAL
────────────────────────────────────────── */
.ep-cta-primary-wrap {
  background: var(--card-bg);
  padding: 14px 16px 14px;
}

.ep-cta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: linear-gradient(135deg, #122C45 0%, #1e4876 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  width: 100%;
  box-shadow: 0 4px 14px rgba(18,44,69,0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ep-cta-primary:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(18,44,69,0.2); }
@media (hover: hover) {
  .ep-cta-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(18,44,69,0.35); }
}
.ep-cta-primary svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ──────────────────────────────────────────
   BLOC B — SIGNAL CONTEXTUEL
────────────────────────────────────────── */
.ep-signal {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  animation: signal-slide 0.3s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes signal-slide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ep-signal--midi {
  background: var(--gold-light);
  color: #7a4f00;
  border-bottom: 1px solid rgba(242,153,10,0.2);
}
.ep-signal--soir {
  background: rgba(42,106,168,0.1);
  color: var(--sky);
  border-bottom: 1px solid rgba(42,106,168,0.15);
}
.ep-signal--coupure {
  background: rgba(242,153,10,0.08);
  color: #7a4f00;
  border-bottom: 1px solid rgba(242,153,10,0.15);
}
.ep-signal__icon { font-size: 18px; flex-shrink: 0; }
.ep-signal__text { flex: 1; }
.ep-signal__label { font-size: 11px; font-weight: 600; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.06em; }
.ep-signal__value { font-size: 15px; font-weight: 800; margin-top: 1px; }

/* ──────────────────────────────────────────
   SECTIONS — structure commune
────────────────────────────────────────── */
.ep-section {
  background: var(--card-bg);
  margin-top: 10px;
  padding: 20px 16px;
}
.ep-section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ──────────────────────────────────────────
   BLOC C — DÉCISION SPIO
────────────────────────────────────────── */
.ep-decision {
  padding: 20px 16px;
  background: var(--card-bg);
  margin-top: 10px;
}
.ep-decision__header {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.ep-ideal { margin-bottom: 12px; }
.ep-ideal__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #16a34a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ep-ideal__label svg { width: 13px; height: 13px; }
.ep-ideal__items { display: flex; flex-direction: column; gap: 6px; }
.ep-ideal__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
}
.ep-ideal__item::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #16a34a;
  margin-top: 8px;
  flex-shrink: 0;
}

.ep-moins { margin-bottom: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.ep-moins__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #dc2626;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ep-moins__label svg { width: 13px; height: 13px; }
.ep-moins__items { display: flex; flex-direction: column; gap: 6px; }
.ep-moins__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
}
.ep-moins__item::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #dc2626;
  margin-top: 8px;
  flex-shrink: 0;
}

.ep-savoir {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(27,58,92,0.05);
  border: 1px solid var(--border);
  margin-top: 12px;
}
.ep-savoir__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 8px;
}
.ep-savoir__items { display: flex; flex-direction: column; gap: 6px; }
.ep-savoir__item {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
.ep-savoir__item::before {
  content: '→';
  color: var(--navy);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ──────────────────────────────────────────
   BLOC D — CTA SECONDAIRES
────────────────────────────────────────── */
.ep-ctas {
  display: flex;
  gap: 10px;
  padding: 14px 16px 0;
  background: var(--card-bg);
}
.ep-cta-secondary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--sand);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  transition: var(--transition);
  cursor: pointer;
}
.ep-cta-secondary:hover, .ep-cta-secondary:active {
  border-color: var(--sky);
  color: var(--sky);
  background: rgba(42,106,168,0.06);
}
.ep-cta-secondary svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ──────────────────────────────────────────
   BLOC E — BADGES
────────────────────────────────────────── */
.ep-badges {
  padding: 14px 16px 20px;
  background: var(--card-bg);
}
.ep-badges-group { margin-bottom: 12px; }
.ep-badges-group:last-child { margin-bottom: 0; }
.ep-badges-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.ep-badge-row { display: flex; flex-wrap: wrap; gap: 7px; }
.ep-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.ep-badge--decisional {
  background: var(--navy);
  color: #ffffff;
}
[data-theme="dark"] .ep-badge--decisional {
  background: rgba(74,156,199,0.2);
  color: var(--sky);
  border: 1px solid rgba(74,156,199,0.3);
}
.ep-badge--descriptive {
  background: var(--sand-dark);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.ep-badge svg { width: 13px; height: 13px; }

.ep-badge-tooltip {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--text);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  max-width: 260px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 200;
}
.ep-badge-tooltip.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ──────────────────────────────────────────
   BLOC F — INFORMATIONS PRATIQUES
────────────────────────────────────────── */
.ep-pratiques {
  background: var(--card-bg);
  margin-top: 10px;
  padding: 20px 16px;
}
.ep-info-rows { display: flex; flex-direction: column; gap: 0; }
.ep-info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.ep-info-row:last-child { border-bottom: none; }
.ep-info-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--sand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--sky);
}
.ep-info-icon svg { width: 16px; height: 16px; }
.ep-info-body { flex: 1; min-width: 0; }
.ep-info-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.ep-info-value { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; }
.ep-info-value a { color: var(--sky); }
.ep-info-value a:hover { text-decoration: underline; }
.ep-info-action {
  font-size: 12px;
  font-weight: 700;
  color: var(--sky);
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(42,106,168,0.08);
  cursor: pointer;
  transition: var(--transition);
}
.ep-info-action:hover { background: rgba(42,106,168,0.15); }

.ep-hours-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.ep-hours-toggle-label { font-size: 14px; font-weight: 700; color: var(--sky); }
.ep-hours-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.ep-hours-toggle[aria-expanded="true"] .ep-hours-chevron { transform: rotate(180deg); }
.ep-hours-detail { display: none; margin-top: 10px; }
.ep-hours-detail.open { display: block; }
.ep-hours-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; }
.ep-hours-day { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.ep-hours-time { font-size: 12px; font-weight: 700; color: var(--text); }
.ep-hours-sep { grid-column: 1 / -1; height: 1px; background: var(--border); margin: 6px 0 3px; }
.ep-hours-note { margin-top: 8px; font-size: 11px; color: var(--text-muted); font-style: italic; }

/* ──────────────────────────────────────────
   TOAST
────────────────────────────────────────── */
.ep-toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 300;
  white-space: nowrap;
}
.ep-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ──────────────────────────────────────────
   BLOC H — ENTRE NOUS
────────────────────────────────────────── */
.ep-entre-nous {
  background: var(--card-bg);
  margin-top: 10px;
  padding: 20px 16px;
  border-left: 4px solid var(--gold);
}
.ep-entre-nous__eyebrow {
  font-family: 'Fraunces', serif;
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a06810;
  margin-bottom: 10px;
}
.ep-entre-nous__text { font-size: 15px; line-height: 1.7; color: var(--text); }
.ep-entre-nous__text strong { font-weight: 800; }

/* ──────────────────────────────────────────
   BLOC I — CONTINUEZ VOTRE JOURNÉE
────────────────────────────────────────── */
.ep-continuer {
  background: var(--card-bg);
  margin-top: 10px;
  padding: 20px 16px;
}
.ep-continuer__header {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}
.ep-suggestion-list { display: flex; flex-direction: column; gap: 10px; }
.ep-suggestion {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--sand);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.ep-suggestion:hover, .ep-suggestion:active {
  background: var(--sand-dark);
  border-color: var(--sky);
}
.ep-suggestion__thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(42,106,168,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.ep-suggestion__body { flex: 1; min-width: 0; }
.ep-suggestion__moment {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sky);
  margin-bottom: 2px;
}
.ep-suggestion__name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.ep-suggestion__tag {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep-suggestion__dist { font-size: 12px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.ep-suggestion::after {
  content: '›';
  font-size: 20px;
  font-weight: 300;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ──────────────────────────────────────────
   FOOTER
────────────────────────────────────────── */
.ep-footer {
  text-align: center;
  padding: 24px 16px 16px;
  font-size: 11px;
  color: var(--text-muted);
}
.ep-footer a { color: var(--sky); font-weight: 700; }
.ep-footer__home {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.ep-footer__home:hover { color: var(--sky); }

/* ──────────────────────────────────────────
   REDUCED MOTION
────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
