:root {
  --ink: #14110D;
  --ink-2: #201B14;
  --paper: #EDE7DA;
  --paper-2: #E3DCCB;
  --curtain: #7A2331;
  --curtain-dark: #5E1B26;
  --gold: #C79A2E;
  --ink-soft: #55503F;
  --paper-soft: #C9BFA5;
  --focus: #C79A2E;
}
:root:not([data-theme="light"]) { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #14110D; --ink-2: #201B14; --paper: #EDE7DA; --paper-2: #E3DCCB;
    --curtain: #7A2331; --curtain-dark: #5E1B26; --gold: #C79A2E;
    --ink-soft: #55503F; --paper-soft: #C9BFA5;
  }
}
:root[data-theme="dark"] {
  --ink: #14110D; --ink-2: #201B14; --paper: #EDE7DA; --paper-2: #E3DCCB;
  --curtain: #7A2331; --curtain-dark: #5E1B26; --gold: #C79A2E;
  --ink-soft: #55503F; --paper-soft: #C9BFA5;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
a { color: var(--curtain); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
h1, h2, h3, .display {
  font-family: 'Gabarito', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

/* ---------- Header / rideau ---------- */
header.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
  border-bottom: 3px solid var(--curtain);
}
.head-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.head-inner::-webkit-scrollbar { display: none; }
@media (max-width: 640px) {
  .head-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: visible;
  }
  .wordmark { text-align: left; justify-content: flex-start; }
  nav.tabs {
    width: 100%;
    justify-content: space-between;
    gap: 2px;
  }
  nav.tabs a {
    flex: 1 1 0;
    text-align: center;
    padding: 6px 2px;
    font-size: 0.72rem;
    white-space: nowrap;
  }
}
@media (max-width: 640px) {
  .foot-line-social .foot-label { display: block; margin-bottom: 6px; }
}
.wordmark {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--paper);
  font-family: 'Gabarito', system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
}
nav.tabs {
  display: flex;
  gap: 2px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}
nav.tabs a {
  font-family: 'Gabarito', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  background: transparent;
  border: none;
  color: var(--paper-soft);
  padding: 8px 12px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  transition: color 0.15s ease, background 0.15s ease;
}
nav.tabs a:hover { color: var(--paper); background: rgba(255,255,255,0.06); }
nav.tabs a.current {
  color: var(--gold);
  background: rgba(199,154,46,0.12);
}

/* ---------- Plateau / contenu ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
section.page { padding: 64px 0 80px; }

.page-title { font-size: clamp(2.1rem, 5vw, 3.2rem); margin-bottom: 14px; }
.page-lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 100%; margin-bottom: 8px; text-align: justify; }

/* ---------- Empty state (rideau fermé) ---------- */
.empty-state {
  margin-top: 40px;
  border: 1px solid var(--paper-soft);
  background: var(--paper-2);
  padding: 46px 40px;
  max-width: 640px;
  position: relative;
}
.empty-state::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--curtain) 0 22px, var(--gold) 22px 44px);
}
.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}
.empty-state p {
  color: var(--ink-soft);
  margin: 0;
  max-width: 46ch;
}

/* ---------- Démos ---------- */
.demo-list {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}
@media (max-width: 640px) {
  .demo-list { grid-template-columns: 1fr; }
}
.demo-card {
  display: block;
}
.demo-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ink);
  border: none;
  padding: 0;
  cursor: pointer;
}
.demo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.demo-thumb:hover img { transform: scale(1.05); }
.demo-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 17, 13, 0) 45%, rgba(20, 17, 13, 0.88) 100%);
}
.demo-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.4rem;
  color: #FFFFFF;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.demo-thumb:hover .demo-play { opacity: 0.9; }
.demo-name {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0.01em;
  text-align: left;
}
.demo-email {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  background: #FFFFFF;
  border: 1px solid var(--paper-soft);
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.copy-icon-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 2px;
  color: var(--ink-soft);
  cursor: pointer;
}
.copy-icon-btn:hover { color: var(--curtain); }

/* ---------- Formation : ateliers cliquables ---------- */
.workshop-list {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.workshop {
  display: block;
  background: #FFFFFF;
  border: 1px solid var(--paper-soft);
  border-left: 4px solid var(--curtain);
  padding: 18px 22px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.workshop:hover {
  background: var(--paper);
  border-left-color: var(--curtain-dark);
}
.workshop h4 {
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 6px;
}
.workshop .meta { color: var(--ink-soft); font-size: 0.92rem; }

.formation-note {
  margin-top: 40px;
  padding: 20px 22px;
  background: var(--ink);
  color: var(--paper);
  max-width: 640px;
}
.formation-note p { margin: 0; color: var(--paper-soft); font-size: 0.98rem; }

.btn-gold {
  font-family: 'Gabarito', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 14px 28px;
  border: none;
  border-radius: 999px;
  background: var(--gold);
  color: var(--paper);
  cursor: pointer;
  display: inline-block;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-gold:hover { background: #B68A24; }
.btn-gold:active { transform: scale(0.98); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 13, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: var(--paper);
  max-width: 420px;
  width: 100%;
  padding: 36px 32px 32px;
  position: relative;
  text-align: center;
  border-radius: 12px;
}
.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 8px;
}
.modal-close:hover { color: var(--ink); }
.modal-card h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}
.modal-email {
  background: var(--paper-2);
  border: 1px solid var(--paper-soft);
  padding: 14px 16px;
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 22px;
  border-radius: 8px;
}
.modal-copy { width: 100%; }

/* ---------- Actu : carte (accueil) ---------- */
.news-search {
  margin-top: 8px;
  display: flex;
  gap: 0;
}
.news-search-input {
  flex: 1 1 auto;
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 1rem;
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid var(--paper-soft);
  border-right: none;
  border-left: 4px solid var(--curtain);
  padding: 14px 18px;
  box-sizing: border-box;
}
.news-search-input::placeholder { color: var(--ink-soft); }
.news-search-input:focus {
  outline: none;
  border-left-color: var(--gold);
}
.news-search-btn {
  flex: 0 0 auto;
  font-family: 'Gabarito', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--paper-soft);
  padding: 0 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.news-search-btn:hover { background: var(--paper-soft); }
.news-search-empty {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 20px 0 0;
}
.news-list {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.news-card {
  display: flex;
  gap: 22px;
  background: #FFFFFF;
  border: 1px solid var(--paper-soft);
  border-left: 4px solid var(--curtain);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(20, 17, 13, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.news-card:hover { border-left-color: var(--curtain-dark); box-shadow: 0 4px 14px rgba(20, 17, 13, 0.1); }
.news-card-img {
  flex: 0 0 auto;
  width: 110px;
  height: auto;
  max-height: 150px;
  object-fit: contain;
  background: #FFFFFF;
}
.news-card-body h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}
.news-card-body p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 8px;
}
.news-card-cta {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--curtain);
}
@media (max-width: 768px) {
  .news-list { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .news-card { flex-direction: column; }
  .news-card-img { width: 100%; max-width: none; max-height: none; }
}

/* ---------- Article ---------- */
.article-hook {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--ink-soft);
  border-left: 3px solid var(--gold);
  padding-left: 18px;
  margin: 18px 0 0;
}
.article-text {
  margin-top: 30px;
}
.article-text p {
  text-align: justify;
  margin-bottom: 18px;
}
.article-text em { font-style: italic; }

.article-media-row {
  display: flex;
  gap: 24px;
  align-items: stretch;
  flex-wrap: wrap;
  margin-top: 10px;
}
.article-poster-frame {
  flex: 0 0 260px;
  max-width: 100%;
}
.article-poster {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--paper-soft);
  cursor: zoom-in;
}
.infos-pratiques {
  flex: 1 1 260px;
  background: var(--paper-2);
  border: 1px solid var(--paper-soft);
  border-left: 4px solid var(--curtain);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.infos-pratiques h4 {
  font-size: 1rem;
  margin-bottom: 12px;
}
.infos-pratiques p { margin: 0 0 6px; font-size: 0.95rem; color: var(--ink-soft); }
.infos-pratiques .venue { color: var(--ink); font-weight: 600; }
.article-back {
  margin-top: 36px;
}
.link-back {
  font-family: 'Gabarito', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--curtain);
  text-decoration: none;
}
.link-back:hover { color: var(--curtain-dark); }
@media (max-width: 640px) {
  .article-poster-frame { flex: 1 1 100%; }
  .infos-pratiques { flex: 1 1 100%; }
}
.btn-reserve {
  align-self: flex-start;
  margin-top: 16px;
  font-family: 'Gabarito', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 14px 28px;
  border: none;
  border-radius: 999px;
  background: var(--curtain);
  color: var(--paper);
  cursor: pointer;
  display: inline-block;
  transition: background 0.15s ease;
}
.btn-reserve:hover { background: var(--curtain-dark); }

/* ---------- Lightbox (affiche plein écran) ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 13, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 30px;
  cursor: zoom-out;
}
.lightbox-overlay[hidden] { display: none; }
.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  background: none;
  border: none;
  color: var(--paper);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.video-lightbox-frame {
  position: relative;
  width: min(90vw, 960px);
  aspect-ratio: 16 / 9;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
@media (max-width: 640px) {
  .lightbox-overlay { padding: 0; }
  .video-lightbox-frame { width: 100vw; box-shadow: none; }
}
.video-lightbox-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
footer.site-foot {
  background: linear-gradient(0deg, var(--ink) 0%, var(--ink-2) 100%);
  border-top: 3px solid var(--curtain);
  margin-top: 40px;
}
.foot-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.foot-line {
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 0.95rem;
  color: var(--paper-soft);
  line-height: 1.7;
}
.foot-line .foot-label {
  color: var(--gold);
  font-weight: 600;
  margin-right: 6px;
}
.foot-line a,
.foot-line button.contact-trigger {
  color: var(--paper-soft);
  text-decoration: none;
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.foot-line a:hover,
.foot-line button.contact-trigger:hover { color: var(--paper); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Pied de page mobile : placé APRÈS les règles de base pour qu'il les surcharge réellement.
   La taille suit la largeur d'écran pour que chaque ligne tienne sans coupure (3 lignes au total). */
@media (max-width: 640px) {
  .foot-inner { padding: 22px 16px 18px; gap: 8px; }
  .foot-line {
    font-size: clamp(0.62rem, 3.2vw, 0.78rem);
    line-height: 1.5;
  }
  .foot-line-social .foot-label { display: block; margin: 0 0 2px; }
}

/* Très petits écrans (320 px) : évite tout débordement horizontal sans modifier les écrans plus larges. */
.news-search-input { min-width: 0; }
@media (max-width: 340px) {
  nav.tabs a { padding: 8px 6px; font-size: 0.8rem; }
}

/* Infos pratiques d'une tournée : un bloc par date */
.infos-pratiques .tour-date { margin: 0 0 14px; overflow-wrap: anywhere; }
.infos-pratiques .tour-date p { margin: 0; }
.infos-pratiques .tour-date .when { color: var(--ink); font-weight: 600; }
.news-list[hidden] { display: none; }

/* ---------- Formation : ateliers HelloAsso (liste dynamique + réservation) ---------- */
.fm-section-title { font-family: 'Gabarito', system-ui, sans-serif; font-size: 1.15rem; font-weight: 700; margin: 36px 0 0; }
.fm-list { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.fm-card { display: grid; grid-template-columns: 120px 1fr; gap: 18px; background: #FFFFFF; border: 1px solid var(--paper-soft); border-left: 4px solid var(--curtain); padding: 16px 20px; }
.fm-card img { width: 120px; height: 120px; object-fit: cover; background: var(--paper-soft); }
.fm-card h4 { font-family: 'Gabarito', system-ui, sans-serif; font-size: 1.05rem; font-weight: 600; margin: 0 0 4px; }
.fm-card .meta { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 8px; }
.fm-card p { margin: 0 0 12px; font-size: 0.95rem; color: var(--ink-soft); white-space: pre-line; max-height: 5.2em; overflow: hidden; }
.fm-card .fm-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.fm-card .fm-link { font-size: 0.92rem; color: var(--curtain); }
.fm-past { opacity: 0.8; }
.fm-modal-frame { position: relative; width: min(94vw, 760px); height: min(90vh, 900px); background: #FFFFFF; cursor: default; }
.fm-modal-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.fm-modal-fallback { position: absolute; left: 0; right: 0; bottom: -34px; text-align: center; font-size: 0.9rem; }
.fm-modal-fallback a { color: var(--paper); }
@media (max-width: 640px) {
  .fm-card { grid-template-columns: 1fr; }
  .fm-card img { width: 100%; height: 160px; }
  .fm-modal-frame { width: 100vw; height: 92vh; }
}
