/*
 * Feuille de style du site de Nicole Ebert.
 *
 * Les couleurs et les polices sont réglées une seule fois, dans les
 * variables du bloc « :root » ci-dessous. Pour changer une couleur sur
 * tout le site, modifiez la variable correspondante : inutile de
 * chercher la couleur ailleurs dans ce fichier.
 *
 * Largeurs d'écran utilisées (points de rupture) : 576, 768, 992, 1200
 * et 1400 pixels.
 */

/* ===== Polices (fichiers dans le dossier fonts/) ===== */
@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/libre-franklin.woff2') format('woff2');
}

@font-face {
  font-family: 'Libre Franklin';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/libre-franklin-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Marcellus';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/marcellus.woff2') format('woff2');
}

/* ===== Variables : polices et couleurs ===== */
:root {
  /* Polices : texte courant et titres */
  --font-body: 'Libre Franklin', Arial, sans-serif;
  --font-title: 'Marcellus', Georgia, serif;

  /* Couleurs générales */
  --color-text: #000;          /* texte courant */
  --color-title: #010618;      /* titres sur fond clair */
  --color-title-dark: #fbfcfe; /* titres sur fond sombre */
  --color-dark: #010618;       /* fond des sections sombres */
  --color-light: #e0e5eb;      /* fond gris clair (Techniques, bandeau) */
  --color-quote: #f0f5f9;      /* fond de la citation */

  /* Bouton « Envoyer » */
  --color-button: #1b293e;
  --color-button-hover: #445268;
  --color-button-active: #748093;

  /* Formulaire et pied de page */
  --color-link-dark: #748093;    /* liens sur fond sombre */
  --color-input-border: #5c687c; /* bordure des champs */
  --color-label: #677077;        /* libellés des champs */
  --color-footer-line: #d0d5d9;  /* trait au-dessus du pied de page */
}

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

body {
  margin: 0;
  font: 16px/28px var(--font-body);
  color: var(--color-text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

h1,
h2,
h3 {
  font-family: var(--font-title);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  margin: 0;
  color: var(--color-title);
}

h1 {
  font-size: 64px;
}

h2 {
  font-size: 38.4px;
}

h3 {
  font-size: 28.8px;
}

@media (max-width: 576px) {
  h1 {
    font-size: 54.4px;
  }

  h2 {
    font-size: 32.64px;
  }

  h3 {
    font-size: 24.48px;
  }
}

p {
  margin: 0;
}

/* Bloque le défilement de la page quand la visionneuse est ouverte */
.no-scroll {
  overflow: hidden;
}

/* ===== Conteneur centré (largeur maximale selon l'écran) ===== */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
}

@media (min-width: 576px) {
  .container {
    max-width: 576px;
    padding: 64px 24px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 992px) {
  .container {
    max-width: 992px;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
  }
}

@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
  }
}

/* ===== Bouton ===== */
.btn {
  display: inline-block;
  padding: 9px 20px;
  font: 500 16px/22px var(--font-body);
  color: #fff;
  background-color: var(--color-button);
  border: 0;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
  cursor: pointer;
  transition: background-color .16s ease-out;
}

.btn:hover,
.btn:focus-visible {
  background-color: var(--color-button-hover);
}

.btn:active {
  background-color: var(--color-button-active);
}

/* ===== Thèmes de section (couleur de fond) ===== */
.section--white {
  background: #fff;
}

.section--light {
  background: var(--color-light);
}

.section--quote {
  background: var(--color-quote);
}

.section--dark {
  background: var(--color-dark);
  color: #fff;
}

.section--dark h1,
.section--dark h2,
.section--dark h3 {
  color: var(--color-title-dark);
}

.section--dark a {
  color: var(--color-link-dark);
}

/* Titres de section centrés */
.section-title {
  text-align: center;
}

.section-title--cards {
  margin-bottom: 38px;
}

.section-title--gallery {
  margin-bottom: 32px;
}

/* ===== En-tête ===== */
.site-header {
  position: relative;
  z-index: 100;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .2), 0 0 1px rgba(0, 0, 0, .2), inset 0 0 0 1px rgba(208, 213, 217, .4);
}

.site-header .container {
  padding: 12px 24px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo img {
  height: 96px;
  width: auto;
  margin: 4px 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  padding: 6.5px 13px;
  color: #000;
  text-decoration: none;
  font-size: 16px;
  line-height: 28px;
}

.site-logo:hover,
.site-nav a:hover {
  opacity: .7;
}

/* ===== Introduction (texte + image) ===== */
.intro {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 24px;
  align-items: center;
}

@media (min-width: 992px) {
  .intro {
    grid-template-columns: 1fr 1fr;
    column-gap: 39px;
  }
}

.intro-text p {
  font-size: 20px;
  line-height: 30px;
  margin-top: 32px;
}

.intro-image {
  aspect-ratio: 1;
}

.intro-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ===== Cartes (Techniques et Merci) ===== */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: center;
}

.card {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  row-gap: 24px;
}

@media (min-width: 992px) {
  .card {
    flex-basis: calc((100% - 80px) / 3);
  }
}

.card-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.card-image--wide {
  aspect-ratio: 16 / 9;
}

.card-text {
  display: flex;
  flex-direction: column;
  row-gap: 12px;
}

/* Titre de carte : même taille sur mobile, comme sur le site d'origine */
.card-text h3 {
  font-size: 28.8px;
}

.card-technique {
  font-size: 20px;
  line-height: 30px;
}

.card-description {
  font-size: 16px;
  line-height: 28px;
  padding-right: 20px;
}

/* ===== Galeries d'images ===== */
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.gallery-item {
  display: block;
  position: relative;
  flex: 0 0 50%;
  max-width: 50%;
  padding: 4px;
}

@media (min-width: 992px) {
  .gallery-item {
    flex-basis: 33.3333%;
    max-width: 33.3333%;
  }

  /* Page d'accueil : rangées de 2 puis 3 images, comme sur le site d'origine */
  .gallery--alternate .gallery-item:nth-child(5n+1),
  .gallery--alternate .gallery-item:nth-child(5n+2) {
    flex-basis: 50%;
    max-width: 50%;
  }
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

/* Léger assombrissement au survol */
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  transition: background-color .2s;
}

.gallery-item:hover::after {
  background-color: rgba(0, 0, 0, .15);
}

/* ===== Citation ===== */
.quote {
  text-align: center;
}

@media (min-width: 768px) {
  .quote {
    max-width: 66.666%;
    margin: 0 auto;
  }
}

.quote-author {
  font-size: 16px;
  line-height: 24px;
  margin-top: 12px;
  margin-bottom: 16px;
}

/* ===== Bandeau image ===== */
.image-banner {
  position: relative;
  height: 320px;
  background: var(--color-light);
  overflow: hidden;
}

@media (max-width: 768px) {
  .image-banner {
    height: 160px;
  }
}

.image-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(224, 229, 235, .2);
}

/* ===== Contact (formulaire + carte) ===== */
.contact-grid {
  display: grid;
  gap: 39px;
  margin-top: 56px;
  padding-bottom: 40px;
}

@media (min-width: 992px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  position: relative;
  margin-bottom: 13px;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  height: 56px;
  margin: 0;
  padding: 26px 12px 8px;
  border: 1px solid var(--color-input-border);
  border-radius: 4px;
  background: #fff;
  color: #000;
  font: 16px/18px var(--font-body);
}

.field textarea {
  height: auto;
  min-height: 100px;
  padding-top: 28px;
  resize: none;
}

/* Libellé posé dans le champ, qui remonte quand on écrit */
.field label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 14px 12px;
  color: var(--color-label);
  font-size: 16px;
  line-height: 28px;
  pointer-events: none;
  transform-origin: 0 0;
  transition: transform .1s ease-in-out, opacity .1s;
}

.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label,
.field textarea:focus ~ label,
.field textarea:not(:placeholder-shown) ~ label {
  opacity: .7;
  transform: scale(.85) translateY(-8px) translateX(2px);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: #748093;
  box-shadow: 0 0 0 3px rgba(116, 128, 147, .45);
}

.contact-form .btn {
  margin-top: 6.5px;
}

.form-status {
  margin-top: 16px;
  color: #fff;
}

.contact-map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 358px;
  margin-top: 32px;
  border: 0;
  border-radius: 4px;
}

@media (min-width: 992px) {
  .contact-map {
    margin-top: 0;
  }
}

/* ===== Pied de page ===== */
.site-footer {
  background: #fff;
  box-shadow: inset 0 1px 0 var(--color-footer-line);
}

.footer-logo {
  display: inline-block;
  vertical-align: top; /* évite l'espace de ligne sous le logo */
  margin-bottom: 48px;
}

.footer-logo:hover {
  opacity: .7;
}

.footer-logo img {
  height: 32px;
  width: auto;
}

.copyright {
  font-size: 16px;
  line-height: 24px;
}

@media (max-width: 767.98px) {
  .site-footer {
    padding-block: 48px;
  }

  .footer-logo {
    margin-bottom: 24px;
  }
}

/* ===== Apparition au défilement (activée par js/main.js) ===== */
.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .6s ease-out, transform .6s ease-out;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.js .card.reveal {
  transition-duration: 1.2s;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== Visionneuse d'images (créée par js/main.js) ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__image {
  max-width: calc(100vw - 120px);
  max-height: calc(100vh - 94px);
  object-fit: contain;
}

@media (max-width: 767.98px) {
  .lightbox__image {
    max-width: 100vw;
  }
}

.lightbox button {
  background: none;
  border: 0;
  color: #999;
  cursor: pointer;
  font: 28px/1 var(--font-body);
}

.lightbox button:hover {
  color: #fff;
}

.lightbox__counter {
  position: absolute;
  top: 12px;
  left: 20px;
  color: #999;
  font-size: 16px;
}

.lightbox .lightbox__close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 32px;
}

.lightbox .lightbox__prev,
.lightbox .lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, .45);
}

.lightbox .lightbox__prev {
  left: 12px;
}

.lightbox .lightbox__next {
  right: 12px;
}

.lightbox button[hidden] {
  display: none;
}
