/* Polices auto-hébergées : aucune requête vers Google, rien à déclarer côté RGPD */
@font-face {
  font-family: "Lalezar";
  src: url("fonts/lalezar-arabic.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: "Lalezar";
  src: url("fonts/lalezar-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Literata";
  src: url("fonts/literata.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("fonts/literata-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

/* Palette : définie ici une seule fois */
:root {
  --nuit: #1F2A44;
  --ambre: #D4A24C;
  --papier: #F5F2EC;
  --brume: #A9AEBC;
  --trait: rgba(212, 162, 76, 0.28);
  --carte: rgba(245, 242, 236, 0.05);
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --titre: "Lalezar", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Sinon un display: grid/flex de composant l'emporte sur l'attribut hidden (form.ts masque le formulaire). */
[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--nuit);
  color: var(--papier);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

a {
  color: var(--ambre);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 2px solid var(--ambre);
  outline-offset: 4px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Accueil ---------- */

.accueil {
  flex: 1;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.accueil.simple {
  justify-content: center;
}

.accueil .logo {
  width: min(11rem, 45vw);
  height: auto;
  margin-bottom: 1.5rem;
}

.accueil h1 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  margin: 0 0 2rem;
}

.bloc {
  width: 100%;
  margin-top: 3rem;
}

.bloc h2 {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.5rem;
  text-wrap: balance;
}

.bloc p {
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.intro {
  margin-top: 0;
}

.accroche {
  font-family: var(--titre);
  font-size: 1.5rem;
  line-height: 1.5;
  color: var(--ambre);
}

.note,
.episode-sous-titre,
.episode-date,
.facade-note {
  color: var(--brume);
}

/* ---------- Boutons ---------- */

.bouton {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--ambre);
  border-radius: 999px;
  background: var(--ambre);
  color: var(--nuit);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.bouton:hover {
  background: transparent;
  color: var(--ambre);
}

.bouton:disabled {
  opacity: 0.6;
  cursor: wait;
}

.bouton-secondaire {
  background: transparent;
  color: var(--ambre);
}

.bouton-secondaire:hover {
  background: var(--ambre);
  color: var(--nuit);
}

/* ---------- Épisode ---------- */

.episode-miniature,
.facade {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--carte);
  margin-bottom: 1rem;
}

.episode-miniature {
  height: auto;
  object-fit: cover;
}

.episode-sous-titre {
  font-size: 1rem;
}

.facade {
  position: relative;
}

.facade-miniature {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.facade-lecture {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(31, 42, 68, 0.35);
  color: var(--papier);
  font-weight: 600;
  text-decoration: none;
}

.facade-lecture:hover,
.facade-lecture:focus-visible {
  background: rgba(31, 42, 68, 0.6);
  outline-offset: -4px;
}

.facade-icone {
  display: inline-grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--ambre);
  color: var(--nuit);
  font-size: 1.5rem;
}

.facade-note {
  position: absolute;
  inset: auto 0 0;
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  line-height: 1.4;
  background: rgba(31, 42, 68, 0.85);
}

.facade-active iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Inscription ---------- */

.formulaire {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  text-align: left;
}

.formulaire label {
  font-weight: 600;
}

.formulaire input[type="email"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--brume);
  border-radius: 0.5rem;
  background: var(--carte);
  color: var(--papier);
  font: inherit;
}

.formulaire .bouton {
  width: 100%;
}

.formulaire .note {
  font-size: 0.95rem;
  margin: 0;
}

/* Honeypot : hors écran, jamais visible, jamais focusable */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Messages affichés par le hash (#message-ok…), sans JS comme avec */
.message {
  display: none;
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ambre);
  text-align: left;
}

.message:target {
  display: block;
}

.message-ok {
  background: var(--ambre);
  color: var(--nuit);
  font-weight: 600;
  text-align: center;
}

.telegram .bouton {
  margin-top: 0.5rem;
}

/* ---------- Mentions légales ---------- */

.legal {
  flex: 1;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.legal .retour {
  display: inline-block;
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

.legal h1 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 2.5rem;
}

.legal h2 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ambre);
  margin: 2.5rem 0 0.75rem;
}

.legal p,
.legal address {
  margin: 0 0 1rem;
  max-width: 65ch;
  font-style: normal;
}

/* ---------- Pied de page ---------- */

.pied {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--brume);
  border-top: 1px solid var(--trait);
}

.pied-liens {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
}

.pied p {
  margin: 0;
}

/* ---------- Page d'un épisode ---------- */

.page-episode .retour {
  align-self: flex-start;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.page-episode .episode {
  margin-top: 1.5rem;
}

.resume p {
  text-align: left;
  text-wrap: pretty;
}
