/* Anaiz Duperret — feuille de style unique, sans framework. */

/* --- Design tokens ----------------------------------------------------- */
:root {
  --font-display: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Palette terreuse : beige, sable, terracotta/ocre, brun clair, brun foncé.
     --accent/--accent-contrast servent uniquement aux boutons et éléments
     "remplis" (fond coloré) : --accent a été assombri par rapport au
     terracotta d'origine (#b5602c) pour que le duo passe le contraste AA
     (4.08:1 -> 5.8:1 avec --accent-contrast, désormais clair plutôt que
     foncé). Pour de l'accent utilisé comme texte ou bordure directement
     sur le fond de page (prix, liens, message de formulaire...), voir
     --accent-text ci-dessous : une seule teinte ne peut pas à la fois
     rester lisible en texte sur fond clair ET sur fond sombre, donc cette
     variante-là dépend du thème. */
  --accent: #944e24;
  --accent-contrast: #fdf6ec;

  --radius: 2px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max-width: 1400px;

  --transition: 180ms ease;

  /* Thème clair par défaut ; :root[data-theme="dark"] ci-dessous prend le
     relais si le thème sombre est activé (bouton, ou choix déjà enregistré
     dans le navigateur). */
  color-scheme: light;
  --bg: #f3ead9;
  --bg-elevated: #faf5ec;
  --text: #2c241c;
  --text-muted: #6b5c48;
  --border: #e2d5bb;
  --overlay: rgba(44, 36, 28, 0.5);
  --accent-text: #944e24;
  --error: #a8333a;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #251d15;
  --bg-elevated: #2f2519;
  --text: #f1e6d4;
  --text-muted: #c7b79f;
  --border: #4a3c2a;
  --overlay: rgba(37, 29, 21, 0.6);
  --accent-text: #d37e4a;
  --error: #e78791;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

/* Empêche le menu mobile (position: fixed, décalé hors écran) d'ouvrir
   un défilement horizontal parasite de la page. */
html, body {
  overflow-x: hidden;
  touch-action: pan-y;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Thème clair (par défaut) : fond façon feuille de papier à peine
     froissée — un grain fin (bruit SVG) plus quelques zones d'ombre/
     lumière douces et asymétriques qui suggèrent des plis légers, sans
     image téléchargée. */
  background-image:
    linear-gradient(128deg, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0) 26%),
    linear-gradient(302deg, rgba(44, 36, 28, 0.09) 0%, rgba(44, 36, 28, 0) 34%),
    radial-gradient(150% 95% at 6% -12%, rgba(255, 255, 255, 0.65), transparent 58%),
    radial-gradient(130% 100% at 102% 118%, rgba(44, 36, 28, 0.12), transparent 58%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='720'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  /* Le SVG est généré en surrésolution (720px) puis réduit à 180px ici :
     sans ça, le bruit se rastérise à basse résolution native et ressort
     pixelisé (blocs visibles) sur les écrans haute densité (Retina). */
  background-size: auto, auto, auto, auto, 180px 180px;
}

/* Thème sombre : fond plat, sans texture papier. */
:root[data-theme="dark"] body {
  background-image: none;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus {
  left: var(--gutter);
  top: var(--gutter);
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}

/* --- En-tête / navigation ----------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: 1.3rem var(--gutter) 1rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  max-width: 100%;
  text-decoration: none;
}
.brand__logo {
  height: 54px;
  width: auto;
}
/* Deux exports du même monogramme (encre claire / encre foncée) : on
   affiche celui qui reste lisible sur le fond du thème actif plutôt que
   de plaquer un fond fixe derrière un monogramme à encre unique. */
.brand__logo--on-dark { display: none; }
.brand__logo--on-light { display: block; }
:root[data-theme="dark"] .brand__logo--on-dark { display: block; }
:root[data-theme="dark"] .brand__logo--on-light { display: none; }
.brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.brand__name {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4.6vw, 1.45rem);
  letter-spacing: 0.02em;
}
.brand__location {
  font-size: clamp(0.62rem, 2.2vw, 0.7rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: var(--gutter);
  top: 1.3rem;
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle svg { width: 1.15rem; height: 1.15rem; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
}

.nav-links {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
}
.nav-links a {
  text-decoration: none;
  white-space: nowrap;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  border-color: var(--accent-text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color var(--transition);
}
.theme-toggle:hover { border-color: var(--accent-text); }
.theme-toggle svg { width: 1rem; height: 1rem; }

/* Bascule aussi sur la hauteur : un téléphone en paysage peut dépasser
   ce seuil de largeur tout en gardant un écran bas, où la mise en page
   desktop ne conviendrait pas. */
@media (max-width: 1260px), (max-height: 500px) {
  .site-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(84vw, 340px);
    height: 100dvh;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 5.5rem var(--gutter) 2rem;
    gap: 2rem;
    transform: translateX(100%);
    transition: transform var(--transition);
    overflow-y: auto;
  }
  .site-nav.is-open { transform: translateX(0); }
  .nav-links {
    flex-direction: column;
    gap: 1.35rem;
    font-size: 1.1rem;
  }
  .nav-toggle { display: inline-flex; }
  /* Le bouton de menu est positionné en absolu au-dessus de l'en-tête et
     sort du flux : sans cette marge, le bloc de marque centré (qui ignore
     cet espace réservé) peut passer sous le bouton sur les petits écrans. */
  .site-header { padding-right: calc(var(--gutter) + 3rem); }
}

/* --- Hero ---------------------------------------------------------------- */
.hero {
  padding: clamp(3rem, 10vw, 7rem) var(--gutter) clamp(2rem, 6vw, 3.5rem);
  max-width: var(--max-width);
  margin: 0 auto;
}
.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  color: var(--accent-text);
  margin: 0 0 1.25rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 6vw, 4.2rem);
  line-height: 1.08;
  margin: 0 0 1.25rem;
  max-width: 20ch;
}
.hero p {
  color: var(--text-muted);
  max-width: 52ch;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  margin: 0 0 2rem;
}
.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero--compact {
  padding: clamp(2rem, 6vw, 3.5rem) var(--gutter) clamp(1.5rem, 4vw, 2rem);
  text-align: center;
}
.hero--compact h1 { max-width: none; margin-left: auto; margin-right: auto; }
.hero--compact p { margin-left: auto; margin-right: auto; }
.hero--compact .hero__actions { justify-content: center; }

/* --- Vitrine des prestations (accueil) ----------------------------------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.75rem, 2vw, 1.5rem);
  /* Volontairement plus large que le reste du site (--max-width) : des
     colonnes plus larges permettent des photos plus hautes tout en
     gardant des proportions portrait équilibrées. */
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(3rem, 7vw, 5rem);
}
.feature-grid__item {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  text-decoration: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}
.feature-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.feature-grid__item:hover img { transform: scale(1.04); }
.feature-grid__label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1rem 1.1rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
}
.feature-grid__empty {
  display: none;
  position: absolute;
  inset: 0.6rem;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px dashed var(--border);
  border-radius: 4px;
}
.feature-grid__item--empty .feature-grid__empty { display: flex; }
.feature-grid__item--empty img { display: none; }

@media (max-width: 1000px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid__item { aspect-ratio: 16 / 10; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  font-weight: 600;
}
.btn--primary:hover { opacity: 0.9; }
.btn--ghost:hover { border-color: var(--accent-text); color: var(--accent-text); }

/* --- Galerie panoramique (défilement horizontal) ------------------------- */
.panorama {
  padding: 0.5rem 0 clamp(2.5rem, 6vw, 4rem);
}
.panorama__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) 1.1rem;
}
.panorama__head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 0;
}
.panorama__head .see-all {
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid transparent;
}
.panorama__head .see-all:hover { color: var(--accent-text); border-color: var(--accent-text); }

.panorama__scroller {
  position: relative;
}

.panorama__track {
  display: flex;
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0 var(--gutter) 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  touch-action: pan-x pan-y;
}
.panorama__track:focus-visible { outline-offset: -2px; }

.panorama__arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), opacity var(--transition);
}
.panorama__arrow svg { width: 1.15rem; height: 1.15rem; }
.panorama__arrow:hover { border-color: var(--accent-text); color: var(--accent-text); }
.panorama__arrow:disabled { opacity: 0; pointer-events: none; }
.panorama__arrow--prev { left: calc(var(--gutter) - 1.375rem); }
.panorama__arrow--next { right: calc(var(--gutter) - 1.375rem); }

@media (min-width: 700px) {
  .panorama__arrow { display: inline-flex; }
}

.panorama__item {
  flex: 0 0 auto;
  height: clamp(220px, 40vw, 440px);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  cursor: zoom-in;
}
.panorama__item img {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  transition: transform 400ms ease;
}
.panorama__item:hover img { transform: scale(1.035); }
.panorama__item figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.75rem 0.9rem;
  font-size: 0.78rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.62), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.panorama__item:hover figcaption,
.panorama__item:focus-within figcaption { opacity: 1; }

/* Pages galerie dédiées : photos plus grandes que l'aperçu de l'accueil. */
.panorama--large .panorama__item {
  height: clamp(280px, 56vw, 620px);
}

.panorama__empty {
  margin: 0 var(--gutter);
  padding: 2.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: calc(var(--max-width) - 2 * var(--gutter));
}
.panorama__empty a {
  color: var(--accent-text);
  text-decoration: underline;
}

/* --- Sections texte génériques ------------------------------------------- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter);
}
.section--narrow { max-width: 74ch; }
.section h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  margin-top: 0;
}
.section p { color: var(--text-muted); }
.quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  line-height: 1.4;
  margin: 0;
  border-left: 2px solid var(--accent-text);
  padding-left: 1.4rem;
}
.quote cite {
  display: block;
  margin-top: 1rem;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.category-intro {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 4.5rem) var(--gutter) 1rem;
}
.category-intro__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.7rem;
  color: var(--accent-text);
  margin: 0 0 1rem;
}
.category-intro h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0 0 1rem;
}
.category-intro p {
  color: var(--text-muted);
  max-width: 60ch;
}

/* --- Grille de contact ---------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(3rem, 7vw, 5rem);
}
.contact-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--bg-elevated);
}
.contact-card h3 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
}
.contact-card p { margin: 0 0 1rem; color: var(--text-muted); font-size: 0.92rem; }
/* Pousse le bouton en bas de la carte, quelle que soit la longueur du
   texte au-dessus, pour que les boutons restent alignés entre cartes
   (grille étirant les cartes d'une même ligne à hauteur égale). */
.contact-card a.btn { width: 100%; justify-content: center; margin-top: auto; }
.price-card__price {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent-text);
  margin: 0 0 0.6rem;
}
.price-card__note {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Formulaire de contact -------------------------------------------- */
.contact-form {
  display: grid;
  gap: 1.1rem;
  margin: 1.5rem 0;
  max-width: 42rem;
}
.form-row { display: flex; flex-direction: column; gap: 0.4rem; }
.form-row label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.form-row input,
.form-row select,
.form-row textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  transition: border-color var(--transition);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent-text);
}
.form-row select { cursor: pointer; }
.form-row textarea { resize: vertical; min-height: 8rem; }
.contact-form .btn { justify-self: start; }
.form-note { color: var(--accent-text); font-size: 0.9rem; margin: 0.9rem 0 0; }
.form-note.form-note--error { color: var(--error); }

/* --- Pied de page ---------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem var(--gutter) 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent-text); }
.social-links, .legal-links { display: flex; gap: 1.1rem; list-style: none; margin: 0; padding: 0; }

/* En dessous de ce seuil, le copyright passe seul à la ligne : avec
   justify-content: space-between sur 3 groupes, Mentions légales et
   Instagram/Mariages.net se retrouvaient alors écartés aux deux bords,
   avec un grand vide au milieu. Empile plutôt les 3 groupes. */
@media (max-width: 700px) {
  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
  }
}

/* --- Lightbox --------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: clamp(1rem, 4vw, 3rem);
}
.lightbox.is-open { display: flex; }
.lightbox figure {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: var(--radius);
}
.lightbox figcaption {
  color: #eee;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
}
.lightbox__close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lightbox__close:hover { border-color: #fff; }

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