/*
 * Charte du site public, reprise de ressources/reference/web/src/app/globals.css (seules les polices changent de
 * mode de chargement : @font-face au lieu de next/font). L'administration charge aussi cette feuille (admin.css en plus).
 */
@font-face { font-family: 'Equateur'; src: url("../fonts/Equateur-Regular-d7YKcd1.otf") format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fengardo Neue'; src: url("../fonts/FengardoNeue_Regular-RPt69er.otf") format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fengardo Neue'; src: url("../fonts/FengardoNeue_Black-vdPB-m_.otf") format('opentype'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Teutonic'; src: url("../fonts/teutonic1-EhP8WSv.ttf") format('truetype'); font-weight: 400; font-display: swap; }

:root {
  --bg: #fcd296;
  --brown: #7a5230;
  --brown-dark: #4a2f17;
  --ink: #1d1409;
  --frame: #8a6a44;
  --radius: 14px;
  --font-titles: 'Equateur';
  --font-body: 'Fengardo Neue';
  --font-blackletter: 'Teutonic';
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body), system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.5;
}

h1, h2 { font-family: var(--font-titles), Georgia, serif; font-weight: 400; margin: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
a { color: var(--brown-dark); }
img { max-width: 100%; height: auto; }
/* <picture> ne sert qu'à choisir l'image (thème sombre) : la mise en page reste celle de l'<img>. */
picture { display: contents; }

.page {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

/* --- En-tête --- */
.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.site-header__shell { width: 110px; height: auto; flex: none; position: relative; z-index: 2; margin-right: -4.5rem; }
.site-header__fork { width: 56px; height: auto; flex: none; position: relative; z-index: 2; margin-left: -3rem; }

.main-nav { flex: 1; }
.main-nav ul {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.main-nav a, .phone-nav__list a {
  display: block;
  padding: 0.55rem 0.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-titles), Georgia, serif;
  font-size: clamp(1rem, 2vw, 1.35rem);
  border: 1px solid var(--frame);
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.main-nav a:hover, .phone-nav__list a:hover { background: rgba(122, 82, 48, 0.15); }
.main-nav a[aria-current='page'], .phone-nav__list a[aria-current='page'] {
  background: var(--brown);
  color: var(--bg);
}

.phone-nav { display: none; position: relative; }
.phone-nav__toggle { background: none; border: 0; padding: 0; cursor: pointer; list-style: none; }
.phone-nav__toggle::-webkit-details-marker { display: none; }
.phone-nav__toggle img { width: 64px; height: auto; display: block; }
.phone-nav__list {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 10;
  width: 15rem;
  margin: 0.25rem 0 0;
  padding: 0.75rem;
  list-style: none;
  display: grid;
  gap: 0.6rem;
  background: var(--brown);
  border-radius: 22px;
}
.phone-nav__list a {
  background: var(--bg);
  border: 0;
  border-radius: 999px;
  font-size: 1.05rem;
}
.phone-nav__list a[aria-current='page'] { background: var(--brown-dark); color: var(--bg); }

/* --- Blocs --- */
.page-title { text-align: center; }
.page-title img { width: min(70%, 420px); margin: 0 auto; display: block; }
.page-title--tortue img { width: min(70%, 380px); }
.page-title h1 {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 3rem;
  border-top: 1px solid var(--frame);
}
.page-title__sub { margin: 0.25rem 0 1.5rem; font-size: 0.95rem; }

.frame {
  border: 1px solid var(--frame);
  padding: 0.75rem 1rem;
  margin: 0;
  font-size: 0.95rem;
}
.frame--text {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
    hyphens: auto;
  padding: 1.25rem 1.5rem;
}
.frame--text p { margin: 0 0 1rem; }
.frame--text p:last-child { margin-bottom: 0; }
/* Prestations, Accompagnement. Sous-titre retiré par l'admin : le cadre garde la distance que le sous-titre lui donnait (les deux marges fusionnent quand il est là). */
.page-title--with-sub + .frame--text { margin-top: 1.5rem; }

.cta { text-align: center; margin: 1.75rem 0 0; }
.button {
  display: inline-block;
  padding: 0.6rem 2.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--brown);
  color: var(--bg);
  font-family: var(--font-titles), Georgia, serif;
  font-size: 1.3rem;
  text-decoration: none;
  cursor: pointer;
}
.button:hover:not(:disabled) { background: var(--brown-dark); }
.button:disabled { opacity: 0.6; cursor: progress; }

/* --- Accueil --- */
.home { display: grid; place-items: center; }
.home__hero { width: min(100%, 560px); }

/* --- Concept --- */
/* Un seul bloc de texte sous la vitrine ; les blocs .frame gardent leur cadre. */
/* Texte réparti en colonnes (3 sur ordinateur, 2 sur tablette, 1 sur téléphone) pour tenir sans défiler ;
   un paragraphe n'est jamais coupé entre deux colonnes. */
.concept { max-width: 1100px; margin: 1.25rem auto 0; columns: 3; column-gap: 2rem; text-align: justify; hyphens: auto; text-wrap: pretty; font-size: 0.95rem; }
.concept p { margin: 0 0 1rem; break-inside: avoid; }
/* Un cadre garde tous ses paragraphes ensemble, dans la même colonne. */
.concept .frame { margin: 0 0 1rem; break-inside: avoid; }
.concept .frame p:last-child { margin-bottom: 0; }
@media (max-width: 1000px) { .concept { columns: 2; } }
@media (max-width: 640px) { .concept { columns: 1; } }

/* Barre de bas de page : une phrase et des liens vers Prestations, Accompagnement et Contact (textes de l'admin). */
.next-steps {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--frame);
  border-bottom: 1px solid var(--frame);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.95rem;
}
/* Aperçu de l'admin : tout est vidé, la barre disparaît comme sur le site. */
.next-steps:not(:has(> :not([hidden]))) { display: none; }
.next-steps__text { margin: 0 0.5rem 0 0; }
.next-steps__link {
  padding: 0.25rem 1.1rem;
  border: 1px solid var(--brown);
  border-radius: 999px;
  color: var(--brown-dark);
  font-family: var(--font-titles), Georgia, serif;
  font-size: 1.05rem;
  text-decoration: none;
}
.next-steps__link:hover { background: var(--brown); color: var(--bg); }

/* Vitrine : l'image courante au centre, ses voisines plus petites et atténuées de chaque côté (3 visibles max). */
/* L'image courante a la même taille qu'une image seule (384 px, moins sur un écran peu haut). */
/* La colonne centrale a la largeur du logo du titre (.page-title img) : les voisines s'arrêtent à ses bords,
   l'image courante reste centrée entre elles (et passe devant si elle est plus large que le logo). */
.showcase { --showcase-current: min(384px, 75vh); --showcase-logo: 420px; position: relative; display: flex; align-items: center; gap: 0.5rem; margin: 1.25rem auto 0; touch-action: pan-y; }
.showcase__track { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--showcase-logo)) minmax(0, 1fr); align-items: center; min-width: 0; }
.showcase__track--1 { grid-template-columns: minmax(0, var(--showcase-current)); justify-content: center; }
/* Deux images : la courante au centre, la suivante à droite, une colonne vide à gauche pour garder le centrage. */
.showcase__track--2 .showcase__slide--current, .showcase__track--3 .showcase__slide--current { grid-column: 2; z-index: 1; margin-inline: calc((var(--showcase-logo) - var(--showcase-current)) / 2); }
.showcase__slide {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: none;
  box-shadow: 0 4px 16px rgba(74, 47, 23, 0.25);
  aspect-ratio: 1;
}
.showcase__slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.showcase__slide--prev, .showcase__slide--next { opacity: 0.7; transform: scale(0.68); cursor: pointer; transition: opacity 0.2s, transform 0.2s; }
/* Réduites vers le centre : leur bord intérieur reste sur le bord du logo. */
.showcase__slide--prev { transform-origin: right center; }
.showcase__slide--next { transform-origin: left center; }
.showcase__slide--prev:hover, .showcase__slide--next:hover { opacity: 0.9; }
/* Fond plein : une image transparente ne laisse pas voir les voisines qu'elle recouvre. */
.showcase__slide--current { background: var(--bg); animation: showcase-in 0.35s ease-out; }
@keyframes showcase-in { from { opacity: 0.6; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.showcase__caption {
  position: absolute;
  inset: auto 0 0;
  padding: 0.9rem 1rem;
  background: linear-gradient(transparent, rgba(29, 20, 9, 0.8));
  color: var(--bg);
  font-family: var(--font-titles), Georgia, serif;
  font-size: 1.2rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.showcase__slide--current:hover .showcase__caption, .showcase__slide--current:focus-visible .showcase__caption { opacity: 1; }
/* Sans survol possible (téléphone), le texte reste visible. */
@media (hover: none) { .showcase__caption { opacity: 1; } }
.showcase__arrow {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--brown);
  color: var(--bg);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.showcase__arrow:hover { background: var(--brown-dark); }
/* Bouton pause du défilement automatique (ajouté à la charte d'origine, accessibilité). */
.showcase__pause {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: var(--brown);
  color: var(--bg);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}
.showcase__pause:hover { background: var(--brown-dark); }
.showcase__pause[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .showcase__slide--current { animation: none; }
  .showcase__slide--prev, .showcase__slide--next { transition: none; }
}

/* --- Contact --- */
.blackletter { font-family: var(--font-blackletter), serif; font-size: 1.6rem; margin: 1.25rem 0 0.5rem; color: var(--frame); }
.contact-form { display: grid; gap: 0.75rem; text-align: left; max-width: 520px; margin: 0 auto; }
.field { display: grid; gap: 0.2rem; font-size: 0.95rem; border: 0; padding: 0; margin: 0; }
.field > label { display: grid; gap: 0.2rem; }
.field legend { padding: 0; margin-bottom: 0.2rem; }
.field--required > label > span::after, .field--required > legend::after { content: ' *'; }
.field input:not([type='checkbox']), .field textarea, .field select {
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--frame);
  border-radius: 6px;
  background: #fff8ec;
  color: var(--ink);
}
.field--checkbox > label { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 0.5rem; }
.field__option { display: flex; gap: 0.5rem; align-items: center; }
/* Corrige l'original : `.field > label` (plus précis) empilait la case au-dessus de son libellé. */
.field > .field__option { display: flex; }
.field__help { opacity: 0.75; }
.field__error { color: #8a1c1c; font-weight: 900; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .button { justify-self: center; }
.form-feedback { margin: 0; text-align: center; font-weight: 900; }
.form-feedback--error { color: #8a1c1c; }
/* Confirmation d'envoi. Sans script, la fenêtre n'est pas modale : elle se centre quand même et son ombre sert de voile. */
.form-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(26rem, calc(100vw - 2rem));
  padding: 1.75rem 1.5rem 1.5rem;
  border: 2px solid var(--frame);
  border-radius: var(--radius);
  outline: 1px solid var(--frame);
  outline-offset: -8px;
  background: var(--bg);
  color: var(--ink);
  text-align: center;
  z-index: 100;
  animation: form-modal-in 0.25s ease-out;
}
.form-modal:not(:modal) { box-shadow: 0 0 0 100vmax rgba(29, 20, 9, 0.6); }
.form-modal:modal { box-shadow: 0 12px 40px rgba(29, 20, 9, 0.45); }
.form-modal::backdrop { background: rgba(29, 20, 9, 0.6); backdrop-filter: blur(2px); }
.form-modal__mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: var(--brown);
  color: var(--bg);
  font-size: 1.6rem;
  line-height: 1;
}
.form-modal__title { margin: 0 0 0.5rem; font-family: var(--font-titles), Georgia, serif; font-size: 1.7rem; font-weight: normal; color: var(--brown-dark); }
.form-modal__text { margin: 0 0 1.25rem; }
@keyframes form-modal-in {
  from { opacity: 0; transform: translateY(0.75rem) scale(0.97); }
}
@media (prefers-reduced-motion: reduce) {
  .form-modal { animation: none; }
}
.contacts__mail { margin-top: 0.75rem; }
/* L'introduction est le dernier paragraphe de son bloc : la marge qui la séparait du titre « Mail » passe au bloc. */
.contacts__intro { margin-bottom: 1rem; }
/* Aperçu de l'admin : un bloc vide reste dans la page, masqué, même si sa classe fixe un `display`. */
[data-block][hidden] { display: none; }

/* --- Pied de page --- */
.site-footer {
  margin-top: auto;
  padding: 0.6rem 1rem;
  border: 1px solid var(--frame);
  text-align: center;
  font-size: 0.85rem;
}
.site-footer p { margin: 0; }

/* --- Pages légales (contenu rédigé dans l'admin) --- */
.legal { text-align: left; }
.legal h2 { font-family: var(--font-titles), Georgia, serif; font-size: 1.35rem; margin: 1.25rem 0 0.5rem; }
.legal h3 { font-size: 1.05rem; margin: 1rem 0 0.4rem; }
.legal > div > :first-child { margin-top: 0; }
.legal ul, .legal ol { margin: 0 0 1rem; padding-left: 1.5rem; }
.legal li p { margin: 0; }
.legal__updated { max-width: 760px; margin: 0.75rem auto 0; text-align: right; font-size: 0.85rem; }

/* --- Téléphone --- */
@media (max-width: 800px) {
  .main-nav, .site-header__fork { display: none; }
  .site-header { justify-content: space-between; }
  .site-header__shell { width: 90px; }
  .phone-nav { display: block; }
  /* Pas la place pour une image de 480 px et ses voisines : trois colonnes côte à côte, sans recouvrement. */
  .showcase__track { gap: 0.4rem; grid-template-columns: 0.6fr 1.8fr 0.6fr; }
  .showcase__track--2 .showcase__slide--current, .showcase__track--3 .showcase__slide--current { margin-inline: 0; }
  .showcase__slide--prev, .showcase__slide--next { transform: scale(0.85); transform-origin: center; }
  .showcase__arrow { width: 2rem; height: 2rem; font-size: 1.3rem; }
}

/* --- Thème sombre (site public seulement : l'administration, qui charge aussi cette feuille, reste claire) --- */
/* Les images à lettrage noir ont une variante claire, choisie par <picture> dans les gabarits. */
@media (prefers-color-scheme: dark) {
  :root.site {
    --bg: #1d1409;
    --brown: #d9a868;
    --brown-dark: #fcd296;
    --ink: #fcd296;
    --frame: #b08a5c;
  }
  .site .main-nav a:not([aria-current]):hover, .site .phone-nav__list a:not([aria-current]):hover { background: rgba(252, 210, 150, 0.15); }
  .site .showcase__slide { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); }
  .site .showcase__caption { color: #fcd296; }
  .site .field input:not([type='checkbox']), .site .field textarea, .site .field select { background: #2b1f12; }
  .site .field__error, .site .form-feedback--error { color: #ff9d8a; }
}
