/* ==========================================================================
   Marcelle et le Vent — feuille de style
   0. Polices
   1. Variables (couleurs, typographie, espacements)
   2. Base
   3. Mise en page
   4. En-tête et pied de page
   5. Sections
   6. Composants
   7. Utilitaires temporaires
   ========================================================================== */


/* 0. Polices
   Hébergées dans le site (dossier fonts/, licence OFL) : aucune connexion
   à un service externe.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/barlow-condensed-400.woff2") format("woff2");
}

/* Police variable : un seul fichier pour toutes les graisses */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("../fonts/dm-sans-variable.woff2") format("woff2");
}


/* 1. Variables
   -------------------------------------------------------------------------- */
:root {
  /* Couleurs — papier, encre, et deux couleurs d'impression */
  --color-paper: #f4efe6;
  --color-paper-dark: #e8e0d2;
  --color-ink: #1a1a1a;
  --color-ink-soft: #5a554d;
  --color-blue: #2a4fa8;  /* survol des liens, focus clavier */
  --color-red: #b5442a;   /* rouge ocre : boutons et liens vers Etsy */

  /* Typographie
     --font-text : texte courant, header (DM Sans)
     --font-sans : titres, légendes, boutons (Barlow Condensed) */
  --font-text: "DM Sans", system-ui, sans-serif;
  --font-sans: "Barlow Condensed", "Arial Narrow", sans-serif;

  --text-base: 1.0625rem;
  --text-small: 1rem;
  --text-h2: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  --text-h1: clamp(3.75rem, 2rem + 6vw, 7.5rem);
  --line-height: 1.6;

  /* Espacements */
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 2rem;
  --space-l: 4rem;
  --space-xl: clamp(4rem, 3rem + 5vw, 8rem);

  /* Largeurs */
  --width-page: 72rem;
  --width-text: 38rem;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);

  /* Place disponible de chaque côté de la colonne de contenu (0 sur les
     écrans étroits) : sert à décaler le nom et le menu du header vers les bords. */
  --side-space: max(0px, (100vw - var(--width-page) - 2rem) / 2);
}


/* 2. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: only light; /* pas d'assombrissement automatique en mode sombre */
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0 0 var(--space-m);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.1;
}

h2 {
  font-size: var(--text-h2);
}

p {
  margin: 0 0 var(--space-s);
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-blue);
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}


/* 3. Mise en page
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--width-page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--space-xl);
}


/* 4. En-tête et pied de page
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-s);
  padding: var(--space-xs) var(--space-s);
  background: var(--color-ink);
  color: var(--color-paper);
}

.skip-link:focus {
  top: var(--space-s);
}

/* Fond : scan de papier coton, bord frangé en bas.
   L'image (1718 × 335 px) est affichée agrandie 1,5 fois et alignée en bas,
   pour que le bord frangé forme toujours la limite du header. */
.site-header {
  padding-bottom: 3.5rem; /* espace entre le contenu et le bord frangé */
  background: url("../images/display/papier-bord.webp") center bottom / 2577px auto repeat-x;
}

/* Nom à gauche, logo au centre, menu à droite */
.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-m);
  padding-block: var(--space-m);
}

/* Nom et menu décalés vers les bords de l'écran, au-delà de la colonne de
   contenu : jusqu'à 8rem sur grand écran, moins (voire rien) s'il manque de place. */
.site-header__brand {
  justify-self: start;
  margin-left: calc(-1 * min(var(--side-space), 8rem));
  font-size: 1.25rem;
  text-decoration: none;
}

.site-header__logo {
  width: 3.5rem;
}

.site-header nav {
  justify-self: end;
  margin-right: calc(-1 * min(var(--side-space), 10rem));
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.site-nav a {
  text-decoration: none;
}

.site-nav__shop {
  color: var(--color-red);
}

/* Sur petit écran : logo puis menu, centrés. Le nom est masqué car le grand
   titre « Marcelle et le Vent » apparaît juste en dessous. */
@media (max-width: 48rem) {
  .site-header__inner {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: var(--space-s);
  }

  .site-header__brand {
    display: none;
  }

  .site-header__logo {
    order: -1;
  }

  .site-header nav {
    justify-self: center;
  }

  .site-nav {
    justify-content: center;
    column-gap: 1.25rem;
  }
}

.site-footer {
  padding-block: var(--space-l);
  border-top: 1px solid var(--color-paper-dark);
  font-family: var(--font-sans);
  font-size: var(--text-small);
  color: var(--color-ink-soft);
}

/* Copyright à gauche, lien « Mentions légales » à droite */
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-m);
}

.site-footer p {
  margin: 0;
}


/* 5. Sections
   -------------------------------------------------------------------------- */

/* Accueil : texte à gauche, gravure à droite (empilés sur mobile).
   Peu d'espace en haut, et une gravure limitée en hauteur, pour que
   tout l'accueil tienne dans le premier écran. */
.hero {
  padding-block: var(--space-m) var(--space-l);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-l);
}

/* Titre sur deux lignes : « Marcelle » / « et le Vent » */
.hero__title {
  font-size: var(--text-h1);
  line-height: 0.95;
}

.hero__title-line {
  display: block;
}

.hero__lead {
  max-width: var(--width-text);
  margin-bottom: var(--space-m);
  font-size: 1.25rem;
  color: var(--color-ink-soft);
}

.hero__image {
  justify-self: center;
  width: auto;
  /* hauteur de l'écran moins header et marges, sans descendre sous 24rem */
  max-height: max(24rem, calc(100vh - 14rem));
  max-height: max(24rem, calc(100svh - 14rem));
}

@media (max-width: 48rem) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* À propos : photo à gauche, texte à droite (photo au-dessus sur mobile) */
.about {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  align-items: start;
  gap: var(--space-l);
}

.about__photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.about__text {
  max-width: var(--width-text);
  padding-left: var(--space-l); /* éloigne le texte de la photo */
}

.about__text strong {
  font-weight: 600;
}

@media (max-width: 48rem) {
  .about {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-m);
  }

  .about__text {
    padding-left: 0;
  }
}

/* Page Mentions légales : une colonne de texte */
.legal {
  max-width: calc(var(--width-text) + 2 * var(--gutter));
}

.legal h1 {
  font-size: var(--text-h2);
}

.legal h2 {
  margin: var(--space-l) 0 var(--space-s);
  font-size: 1.5rem;
}

/* Contact : phrase d'introduction, puis une colonne par lien (empilées sur mobile) */
.contact__intro {
  max-width: var(--width-text);
  margin-bottom: var(--space-l);
  color: var(--color-ink-soft);
}


/* 6. Composants
   -------------------------------------------------------------------------- */

/* Galerie */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-l) var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery__item {
  margin: 0;
}

.gallery__item figcaption {
  margin-top: var(--space-s);
  font-family: var(--font-sans);
  font-size: var(--text-small);
  color: var(--color-ink-soft);
}

.gallery__more {
  margin-top: var(--space-l);
  text-align: center;
}

/* Bouton (vers Etsy) */
.button {
  display: inline-block;
  padding: 0.75em 1.5em;
  border: 1px solid var(--color-red);
  color: var(--color-red);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.button:hover {
  background: var(--color-red);
  color: var(--color-paper);
}

/* Liste de contacts */
.contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  padding-top: var(--space-s);
  border-top: 1px solid var(--color-ink);
}

.contact-list__label {
  display: block;
  margin-bottom: var(--space-xs);
  font-family: var(--font-sans);
  font-size: var(--text-small);
  color: var(--color-ink-soft);
}

.contact-list a {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  text-decoration: none;
  overflow-wrap: anywhere; /* l'adresse e-mail ne déborde pas sur mobile */
}

.contact-list .contact-list__shop {
  border-color: var(--color-red);
}

.contact-list .contact-list__shop a {
  color: var(--color-red);
}


/* 7. Utilitaires temporaires (à supprimer quand le contenu réel est en place)
   -------------------------------------------------------------------------- */
.placeholder {
  aspect-ratio: 4 / 5;
  background: var(--color-paper-dark);
}
