/* =====================================================================
   Styles communs à toutes les pages
   ===================================================================== */

/* ---------- Couleurs (clair / sombre automatique) ---------- */
:root {
  --fond: #eceeed;
  --surface: #f6f7f6;
  --texte: #22262a;
  --discret: #6b7278;
  --trait: #d3d7d6;
  --accent: #34506f;
  --voile: rgba(18, 21, 24, 0.96);
  --h-rang: 260px;      /* hauteur de référence d'une rangée de photos */
  --marge: clamp(1rem, 3vw, 2rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #1b1e22;
    --surface: #23272c;
    --texte: #e4e6e5;
    --discret: #8d949a;
    --trait: #30353a;
    --accent: #8fb0d4;
    color-scheme: dark;
  }
}
@media (max-width: 640px) { :root { --h-rang: 150px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fond);
  color: var(--texte);
  font-family: "Spectral", Georgia, "Times New Roman", serif;
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.65;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
main { flex: 1; width: 100%; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.conteneur { max-width: 1600px; margin: 0 auto; padding: 0 var(--marge); }
.etroit { max-width: 46rem; }

/* ---------- En-tête et navigation ---------- */
.entete {
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  padding: 1.25rem var(--marge);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}
.marque {
  color: var(--texte);
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.entete nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.entete nav a {
  color: var(--discret);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
}
.entete nav a:hover { color: var(--texte); }
.entete nav a[aria-current="page"] { color: var(--texte); border-bottom-color: var(--texte); }

/* ---------- Titres de page ---------- */
.titre-page {
  padding-top: clamp(2rem, 6vw, 5rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}
h1 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
h2 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
}
.intro { margin: 0.75rem 0 0; max-width: 36em; color: var(--discret); font-style: italic; font-size: 1.15rem; }
.compteur { color: var(--discret); font-size: 0.95rem; white-space: nowrap; }

/* ---------- Bandeau de démonstration ---------- */
.demo { color: var(--discret); font-size: 0.95rem; margin-bottom: 1.25rem; }
.demo p { margin: 0; padding: 0.75rem 1rem; border-left: 2px solid var(--accent); }
.demo code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85em; color: var(--texte); }

/* ---------- Accueil ---------- */
.hero { margin: 0; padding: 0 var(--marge); max-width: 1600px; margin: 0 auto; width: 100%; }
.hero img {
  display: block;
  width: 100%;
  height: min(72vh, 820px);
  object-fit: cover;
  background: var(--trait);
}
.presentation {
  padding-top: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(2rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.5rem 4rem;
  align-items: end;
}
.presentation h1 { font-size: clamp(2.6rem, 8vw, 6rem); }
.presentation .intro { margin: 0 0 1rem; }
.lien-fort {
  display: inline-block;
  color: var(--texte);
  text-decoration: none;
  border-bottom: 1px solid var(--texte);
  padding-bottom: 0.1rem;
}
.lien-fort:hover { color: var(--accent); border-color: var(--accent); }
.entete-section {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 760px) {
  .presentation { grid-template-columns: 1fr; align-items: start; }
  .hero img { height: 55vh; }
}

/* ---------- Grille justifiée : chaque photo garde ses proportions ---------- */
.grille { display: flex; flex-wrap: wrap; gap: 6px; }
.grille::after { content: ""; flex-grow: 999999; } /* évite d'étirer la dernière rangée */
.photo {
  --r: 1.5; /* rapport largeur / hauteur, mis à jour au chargement */
  flex-grow: var(--r);
  width: calc(var(--r) * var(--h-rang));
  position: relative;
  margin: 0; padding: 0; border: 0;
  background: var(--trait);
  cursor: zoom-in;
  overflow: hidden;
}
.photo i { display: block; padding-bottom: calc(100% / var(--r)); }
.photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.photo img.charge { opacity: 1; }

/* ---------- À propos ---------- */
.apropos {
  padding-top: clamp(2rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 2rem clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.apropos figure { margin: 0; }
.apropos figure img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--trait); }
.apropos .texte { max-width: 36em; }
.apropos .texte p { margin: 0 0 1.1em; }
.apropos .texte h1 { margin-bottom: 1.5rem; }
.apropos .texte h2 { margin: 2.5rem 0 0.75rem; }
@media (max-width: 760px) {
  .apropos { grid-template-columns: 1fr; }
  .apropos figure { max-width: 22rem; }
}

/* ---------- Contact ---------- */
.formulaire { display: grid; gap: 1.25rem; margin-top: 2rem; }
.champ { display: grid; gap: 0.35rem; }
.champ label { font-weight: 500; font-size: 0.95rem; }
.champ input, .champ textarea {
  font: inherit;
  color: var(--texte);
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: 2px;
  padding: 0.7rem 0.8rem;
  width: 100%;
}
.champ textarea { min-height: 10rem; resize: vertical; }
.champ input:focus, .champ textarea:focus { border-color: var(--accent); }
.piege { position: absolute; left: -9999px; } /* champ anti-robots, invisible */
.mention { color: var(--discret); font-size: 0.9rem; margin: 0; }
.bouton {
  justify-self: start;
  font: inherit;
  font-weight: 500;
  color: var(--fond);
  background: var(--texte);
  border: 0;
  border-radius: 2px;
  padding: 0.75rem 1.6rem;
  cursor: pointer;
}
.bouton:hover { background: var(--accent); }
.liens-directs { list-style: none; padding: 0; margin: 1.5rem 0 0; color: var(--discret); }
.liens-directs li { margin-bottom: 0.3rem; }

/* ---------- Pied de page ---------- */
footer {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 4rem var(--marge) 2.5rem;
  color: var(--discret);
  font-size: 0.9rem;
}

/* ---------- Visionneuse plein écran ---------- */
dialog {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--voile);
  color: #e8eaea;
}
dialog::backdrop { background: var(--voile); }
.vue {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
.scene { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 3.5rem 4rem 0.5rem; }
.scene img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.bas { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.75rem 1.25rem 1.25rem; }
.legende { font-style: italic; }
.position { color: #9aa1a6; white-space: nowrap; }
.btn {
  position: absolute;
  background: none; border: 0; color: #e8eaea;
  font: inherit; font-size: 2.2rem; line-height: 1;
  padding: 0.6rem 0.9rem; cursor: pointer; opacity: 0.7;
}
.btn:hover, .btn:focus-visible { opacity: 1; }
.fermer { top: calc(env(safe-area-inset-top, 0px) + 0.4rem); right: 0.6rem; font-size: 1.1rem; }
.prec { left: 0.2rem; top: 50%; transform: translateY(-50%); }
.suiv { right: 0.2rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .scene { padding: 3rem 0 0.5rem; }
  .prec, .suiv { display: none; } /* sur mobile : balayage gauche / droite */
}
@media (prefers-reduced-motion: reduce) { .photo img { transition: none; } }

/* =====================================================================
   Ajouts Cathy Outen Ceramics
   ===================================================================== */
:root { --fond: #eef1ef; --surface: #f7f8f7; --accent: #3f6f6a; --celadon: #a9c9bf; }
@media (prefers-color-scheme: dark) { :root { --fond: #1a1f1e; --surface: #222827; --accent: #9cc8bd; } }

/* Logotype inspiré du logo : lettres espacées, filet, sous-titre */
.marque { display: inline-flex; flex-direction: column; align-items: center; font-family: "Jost", "Helvetica Neue", Arial, sans-serif; font-weight: 300; line-height: 1; }
.marque-nom { font-size: 1.25rem; letter-spacing: 0.32em; text-transform: uppercase; padding-bottom: 0.4rem; border-bottom: 1px solid currentColor; margin-right: -0.32em; }
.marque-sous { font-size: 0.68rem; letter-spacing: 0.42em; text-transform: uppercase; padding-top: 0.4rem; margin-right: -0.42em; }
.entete { align-items: center; }

.presentation h1 { font-size: clamp(2.2rem, 5.5vw, 4.2rem); }

/* Filtres de la galerie */
.filtres { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.filtres button {
  font: inherit; font-size: 0.95rem; color: var(--discret);
  background: transparent; border: 1px solid var(--trait); border-radius: 999px;
  padding: 0.3rem 0.95rem; cursor: pointer;
}
.filtres button:hover { color: var(--texte); border-color: var(--discret); }
.filtres button[aria-pressed="true"] { color: var(--fond); background: var(--texte); border-color: var(--texte); }
.filtres button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Photos de l'atelier sur la page À propos */
.atelier { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding-top: clamp(2rem, 5vw, 4rem); }
.atelier figure { margin: 0; }
.atelier img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--trait); }
.atelier figcaption { color: var(--discret); font-style: italic; margin-top: 0.5rem; }
@media (max-width: 640px) { .atelier { grid-template-columns: 1fr; } }

/* Mobile : logo et menu centrés */
@media (max-width: 640px) {
  .entete { flex-direction: column; align-items: center; gap: 1rem; padding-top: 1.5rem; }
  .entete nav { justify-content: center; }
}

/* ---------- Page News ---------- */
.prochain { margin: 0 0 1.25rem; padding: 0.7rem 1rem; border-left: 2px solid var(--accent); color: var(--discret); }
.prochain a { color: var(--texte); }
.evenements { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }
.evt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1.5rem clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.evt img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--trait); }
.evt-corps { min-width: 0; max-width: 36em; display: grid; gap: 0.9rem; justify-items: start; }
.evt-corps p { margin: 0; }
.evt-date { color: var(--accent); font-weight: 500; font-variant-numeric: tabular-nums; }
.evt h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); text-wrap: balance; }
.evt-prochain h2 { font-size: clamp(2rem, 5vw, 3.2rem); }
.evt dl, .tarifs { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; margin: 0; }
.evt dt, .tarifs dt { color: var(--discret); }
.evt dd, .tarifs dd { margin: 0; }
.bloc-prix { margin-top: clamp(3rem, 7vw, 5rem); padding-top: 2rem; border-top: 1px solid var(--trait); max-width: 40rem; }
.bloc-prix h2 { margin-bottom: 1.25rem; }
.tarifs dd { font-variant-numeric: tabular-nums; }
.bloc-prix .mention { margin-top: 1.25rem; }
@media (max-width: 700px) { .evt { grid-template-columns: 1fr; } .tarifs { grid-template-columns: 1fr auto; } }

/* ---------- Prix en vignettes ---------- */
.bloc-prix { max-width: none; }
.bloc-prix .intro { margin: -0.5rem 0 1.75rem; }
.tarifs-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 1.5rem 1.25rem; }
.tarif { display: grid; gap: 0.6rem; color: var(--texte); text-decoration: none; }
.tarif-img { aspect-ratio: 1; overflow: hidden; background: var(--celadon); display: grid; place-items: center; }
.tarif-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.tarif-img span { font-style: italic; color: #2f4a45; font-size: 1.2rem; }
a.tarif:hover .tarif-img img { transform: scale(1.04); }
a.tarif:hover .tarif-nom { text-decoration: underline; text-underline-offset: 0.15em; }
a.tarif:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.tarif-texte { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.tarif-nom { min-width: 0; }
.tarif-prix { font-size: 1.35rem; font-weight: 500; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tarif-prix small { font-size: 0.8rem; font-weight: 300; color: var(--discret); margin-right: 0.1em; }
@media (max-width: 640px) { .tarifs-grille { grid-template-columns: 1fr 1fr; gap: 1.25rem 0.75rem; } .tarif-texte { flex-direction: column; gap: 0.1rem; } }
@media (prefers-reduced-motion: reduce) { .tarif-img img { transition: none; } }
.tarifs-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 60rem; gap: 2rem 1.5rem; }
.tarif-texte { flex-direction: column; gap: 0.1rem; }
@media (max-width: 640px) { .tarifs-grille { grid-template-columns: 1fr 1fr; gap: 1.25rem 0.75rem; } }

/* ---------- Page About : récit en blocs texte + photo ---------- */
.recit { display: grid; gap: clamp(3rem, 7vw, 5.5rem); padding-top: clamp(3rem, 7vw, 5.5rem); }
.bloc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 2rem clamp(2rem, 6vw, 6rem); align-items: start; }
.bloc-inverse > figure { order: 2; }
.bloc figure { margin: 0; }
.bloc figure img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--trait); }
.bloc figcaption { color: var(--discret); font-style: italic; margin-top: 0.5rem; }
.bloc .texte { max-width: 36em; min-width: 0; }
.bloc .texte p { margin: 0 0 1.1em; }
.bloc h2 { margin-bottom: 1rem; text-wrap: balance; }
.bloc h3 { font-weight: 500; font-size: 1.1rem; margin: 2rem 0 0.75rem; }
.lieux { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.lieux li { padding-left: 1rem; border-left: 2px solid var(--celadon); }
.cours { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; margin: 0 0 1.1em; }
.cours dt { color: var(--discret); }
.cours dd { margin: 0; }
.apropos .texte h1 { margin-bottom: 1.5rem; }
.grille#apercu .photo { --h-rang: 300px; }
@media (max-width: 760px) { .bloc { grid-template-columns: 1fr; } .bloc-inverse > figure { order: 0; } .bloc figure { max-width: 26rem; } }

/* Accueil : 4 photos carrées sur une ligne (2 x 2 sur mobile) */
.grille#apercu { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.grille#apercu::after { content: none; }
.grille#apercu .photo { width: auto; }
.grille#apercu .photo i { padding-bottom: 100%; }
@media (max-width: 640px) { .grille#apercu { grid-template-columns: 1fr 1fr; } }

/* ---------- Accueil : photo plein écran avec texte par-dessus ---------- */
.hero-plein {
  position: relative; overflow: hidden;
  height: calc(100svh - var(--h-entete, 5.5rem)); min-height: 26rem;
  display: flex; align-items: flex-end;
  background: #1f2b29;
}
.hero-cadre { position: absolute; inset: -12% 0 0 0; will-change: transform; }
.hero-cadre img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 35%; display: block;
  transform: scale(1.14); transition: transform 2.6s cubic-bezier(.2,.7,.2,1);
}
.hero-plein.pret .hero-cadre img { transform: scale(1); }
.hero-plein::after {   /* voile sombre en bas pour la lisibilité du texte */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(12, 22, 20, 0.72) 0%, rgba(12, 22, 20, 0.35) 38%, rgba(12, 22, 20, 0) 65%);
}
.hero-texte {
  position: relative; z-index: 1; width: 100%; max-width: 1600px; margin: 0 auto;
  padding: 0 var(--marge) clamp(2rem, 6vh, 4.5rem);
  display: grid; justify-items: start; gap: 1rem; color: #f4f7f6;
  opacity: 0; translate: 0 1.5rem; transition: opacity 1.2s ease 0.6s, translate 1.2s ease 0.6s;
}
.hero-plein.pret .hero-texte { opacity: 1; translate: 0 0; }
.hero-texte h1 { color: #fff; max-width: 14em; font-size: clamp(2.4rem, 6.5vw, 5.5rem); text-wrap: balance; text-shadow: 0 1px 24px rgba(0,0,0,.25); }
.hero-texte .intro { color: #e3ebe8; margin: 0; max-width: 32em; }
.hero-texte .prochain { margin: 0; color: #d4dfdb; border-left-color: #cfe3dc; }
.hero-texte .prochain a, .hero-texte .lien-fort { color: #fff; border-color: #fff; }
.hero-texte .lien-fort:hover { color: #cfe3dc; border-color: #cfe3dc; }
.hero-texte a:focus-visible { outline-color: #fff; }
.apres-hero { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
@media (max-width: 640px) { .hero-plein { min-height: 32rem; } .hero-cadre img { object-position: center 40%; } }
@media (prefers-reduced-motion: reduce) {
  .hero-cadre img, .hero-texte { transition: none; transform: none; translate: none; opacity: 1; }
}

/* ---------- Prix : toute la largeur ---------- */
.bloc-prix, .tarifs-grille { max-width: none; }
.tarifs-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 1.5rem; }
.tarif-img { aspect-ratio: 4 / 3; }
@media (max-width: 640px) { .tarifs-grille { grid-template-columns: 1fr 1fr; gap: 1.25rem 0.75rem; } .tarif-img { aspect-ratio: 1; } }
/* Une fois l'apparition terminée, le texte suit le défilement sans délai */
.hero-plein.fini .hero-texte { transition: none; }
/* Voile renforcé : le titre reste lisible même sur un fond de photo clair */
.hero-plein::after {
  background:
    linear-gradient(to top, rgba(12, 22, 20, 0.78) 0%, rgba(12, 22, 20, 0.45) 40%, rgba(12, 22, 20, 0.08) 75%),
    linear-gradient(to right, rgba(12, 22, 20, 0.35) 0%, rgba(12, 22, 20, 0) 55%);
}
.hero-cadre img { object-position: 60% 35%; }
@media (max-width: 640px) { .hero-cadre img { object-position: 64% 40%; } }
