/* ============================================
   VARIABLES & RESET
   ============================================ */
:root {
  --olive: #606c38;
  --forest: #283618;
  --cream: #fefae0;
  --amber: #dda15e;
  /* --sienna: #bc6c25; */
  --sienna: #7b4719;

  --font-display: "Raleway", sans-serif;
  --font-body: "Lexend Deca", sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 1. Toujours définir la base */
::-webkit-scrollbar {
  width: 14px;
  background-color: var(--cream);
}

/* 2. La piste */
::-webkit-scrollbar-track {
  background-color: var(--cream);
}

/* 3. La barre (le thumb) */
::-webkit-scrollbar-thumb {
  background-color: var(--forest);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--olive) !important;
}

/* 4. RECRÉER LES FLÈCHES (Buttons) */
::-webkit-scrollbar-button:single-button {
  background-color: var(--cream);
  display: block;
  background-size: 10px;
  background-repeat: no-repeat;
  height: 14px;
}

/* Flèche du haut */
::-webkit-scrollbar-button:single-button:vertical:decrement {
  background-position: center bottom;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23283618'><polygon points='50,20 10,80 90,80'/></svg>");
}

/* Flèche du bas */
::-webkit-scrollbar-button:single-button:vertical:increment {
  background-position: center top;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23283618'><polygon points='50,80 10,20 90,20'/></svg>");
}

html {
  scroll-behavior: smooth;
  width: 100vw;
}

body {
  background: var(--cream);
  color: var(--forest);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 60;

  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--forest);
  color: var(--cream);
  border: solid 1px var(--olive);
  border-radius: 2px;
  cursor: pointer;

  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.3s var(--ease-out),
    transform 0.2s,
    visibility 0.3s,
    background 0.3s var(--ease-out);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--olive, #4b532d);
  transform: translateY(-2px);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .back-to-top {
    right: 1rem;
    bottom: 1rem;
    width: 42px;
    height: 42px;
  }
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}
nav ul li a {
  display: flex;
  align-items: center;
}
nav ul li a svg {
  transition: stroke 0.25s ease;
}
nav ul li a svg:hover {
  stroke: var(--amber);
}

/* ============================================
   TYPOGRAPHY HELPERS
   ============================================ */
.section-label {
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sienna);
  margin-bottom: 1rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  cursor: pointer;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--forest);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9rem 2.2rem;
  border-radius: 2px;
  transition:
    background 0.3s var(--ease-out),
    transform 0.2s;
}
.btn-primary:hover {
  background: #4b532d;
  transform: translateY(-2px);
}

.btn-secondary {
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #603815;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9rem 2.2rem;
  border: none;
  border-radius: 2px;
  transition:
    background 0.3s var(--ease-out),
    transform 0.2s;
}
.btn-secondary:hover {
  background: #7d491c;
  transform: translateY(-2px);
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  z-index: 999;
  background: var(--forest);
  border-bottom: 1px solid var(--olive);
  width: 100vw;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2.5rem;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header a img {
  width: 4.5rem;
  transition: transform 0.3s ease;
}

header a img:hover {
  transform: scale(1.1);
}

.main-nav ul {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}
.nav-link {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  position: relative;
  transition: color 0.25s;
}
.nav-link::after,
footer a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  /* left: 0px; */
  left: -1px;
  width: 0;
  height: 1.5px;
  background: var(--amber);
  transition: width 0.3s var(--ease-out);
}
.nav-link:hover::after,
.nav-link.active::after,
footer a.active::after,
footer a:hover::after {
  width: 100%;
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--cream);
  transition: all 0.3s;
  transform-origin: center;
}

/* ============================================
   BANNIÈRE
   ============================================ */
.banner {
  position: relative;
  width: 100%;
  /* height: calc(100vh - 72px); */
  height: 100vh;
  margin-top: -72px;
  overflow: hidden;
}

.banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(50%);
}

.banner-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: fadeUp 1.2s 0.4s var(--ease-out) both;
}

.banner-name {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: 4rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  line-height: 1;
  margin-top: 2rem;
}

.banner-sub {
  font-family: var(--font-body);
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--amber);
  margin-top: 1.2rem;
}

/* ============================================
   ABOUT
   ============================================ */
.about {
  padding: 120px 2.5rem;
  max-width: 1280px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
}
.about.revealed {
  opacity: 1;
  transform: none;
}

.about-inner {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 6rem;
  align-items: center;
}

/* Image column */
.about-image-col {
  position: relative;
}

.about-img-wrap {
  position: relative;
  max-width: 440px;
  border-radius: 4px;
  overflow: visible;
}
.about-img-wrap img {
  border-radius: 4px;
  box-shadow: 0 30px 60px rgba(40, 54, 24, 0.15);
}
.about-img-deco {
  position: absolute;
  inset: -16px -16px -16px 16px;
  border: 2px solid var(--olive);
  border-radius: 4px;
  z-index: -1;
  opacity: 0.35;
}

/* Text column */

.about-body {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--forest);
  margin-bottom: 1rem;
  line-height: 1.8;
  text-align: justify;
}

.about-text-col #cta {
  display: flex;
  gap: 1rem;
}

/* ============================================
   GALLERY PREVIEW
   ============================================ */
.gallery-preview {
  background: var(--forest);
  padding: 100px 2.5rem;
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.9s 0.1s var(--ease-out),
    transform 0.9s 0.1s var(--ease-out);
}
.gallery-preview.revealed {
  opacity: 1;
  transform: none;
}

.gallery-preview-header {
  max-width: 1280px;
  margin: 0 auto 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.gallery-preview-header .section-label {
  color: var(--amber);
}

.gallery-preview-header > div {
  flex: 1;
}

.link-arrow {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap 0.3s;
  white-space: nowrap;
}
.link-arrow:hover {
  gap: 0.9rem;
}
.link-arrow span {
  transition: transform 0.3s;
}
.link-arrow:hover span {
  transform: translateX(4px);
}

.gallery-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  grid-template-rows: 280px 280px;
  gap: 12px;
}

.g-item {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  cursor: pointer;
}
.g-item img {
  transition: transform 0.7s var(--ease-out);
}
.g-item:hover img {
  transform: scale(1.06);
}

.g-item--tall {
  grid-row: 1 / 3;
}
.g-item--wide {
  grid-column: 2 / 4;
}

.g-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(40, 54, 24, 0.7) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.4s;
  display: flex;
  align-items: flex-end;
  padding: 1.2rem;
}
.g-item:hover .g-overlay {
  opacity: 1;
}
.g-overlay span {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  background: var(--forest);
  padding: 3rem 2.5rem;
  border-top: 1px solid var(--olive);
  height: 125px;
  width: 100vw;
  margin: auto auto 0 auto;
}

.footer-inner {
  margin: 0 auto;
  max-width: 1280px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

footer a {
  position: relative;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream);
}

.footer-copy {
  font-size: 1rem;
  color: var(--cream);
  letter-spacing: 0.05em;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .about-inner {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
  .about-img-wrap {
    max-width: 340px;
    margin: 0 auto;
  }
  header {
    position: fixed;
    top: 0;
  }
  body {
    padding-top: 72px;
  }
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 220px 220px 220px;
  }
  .g-item--tall {
    grid-row: auto;
  }
  .g-item--wide {
    grid-column: 1 / 3;
  }
}

@media (max-width: 768px) {
  .banner-name {
    font-size: 2.4rem;
  }

  .banner-sub {
    font-size: 1.2rem;
  }

  .about-body {
    font-size: 1rem;
    font-weight: 400;
    color: var(--forest);
    margin-bottom: 1rem;
    line-height: 1.8;
  }

  .burger {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--forest);
    border-top: 1px solid var(--olive);
    padding: 2.5rem;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
  }
  .main-nav.open {
    opacity: 1;
    pointer-events: all;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-end;
  }
  .nav-link {
    font-size: 1rem;
  }

  .burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .burger.active span:nth-child(2) {
    opacity: 0;
  }
  .burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .about {
    padding: 80px 1.5rem;
  }
  .gallery-preview {
    padding: 80px 1.5rem;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 220px);
  }
  .g-item--wide {
    grid-column: auto;
  }
  footer {
    height: 200px;
    justify-content: center;
  }
  .footer-inner {
    gap: 1.5rem;
  }
  .footer-copy {
    font-size: 1rem;
    text-align: center;
  }
  footer a {
    margin: 0 auto;
    font-size: 0.8rem;
    text-align: center;
  }
}

/* ============================================
   CONTACT FORM
   ============================================ */

.contact-section {
  max-width: 800px;
  margin: 0 auto;
}

h1 {
  font-family: var(--font-display);
  color: var(--sienna);
  text-align: center;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.18rem;
  margin-top: 3rem;
  animation: fadeUp 0.8s var(--ease-out) both;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Deux colonnes pour Nom/Prénom */
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Les champs E-mail et Message prennent toute la largeur */
.full-width {
  grid-column: 1 / -1;
}

.contact-form label {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sienna);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 1rem;
  background: transparent;
  border: 1px solid var(--forest);
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--forest);
  transition: border-color 0.3s var(--ease-out);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--amber);
}

.contact-form .btn-primary {
  grid-column: 1 / -1;
  justify-self: center;
  width: 40%;
  border: none;
  cursor: pointer;
  margin-top: 1rem;
}

/* Placeholder discret */
::placeholder {
  color: rgba(40, 54, 24, 0.5);
  font-style: italic;
}

/* ============================================
   RESPONSIVE CONTACT
   ============================================ */
@media (max-width: 768px) {
  .contact-form {
    grid-template-columns: 1fr; /* Passage en une seule colonne sur mobile */
  }
  .contact-form {
    padding-top: 0;
    margin-bottom: 3rem;
  }
}

/* ============================================
   GESTION DES ERREURS & MESSAGES (PHP)
   ============================================ */

/* Conteneur d'alertes (Succès et Erreurs globales) */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 2px;
  margin-bottom: 2rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  animation: fadeIn 0.4s ease-out;
}

.alert-success {
  color: var(--cream);
  background-color: var(--forest);
}

.alert-error {
  background-color: #9a2f23;
  color: var(--cream);
}

/* Style des champs en erreur */
.form-group.has-error input,
.form-group.has-error textarea {
  border-color: #9a2f23 !important; /* Rouge pour l'erreur */
}

/* Texte du message d'erreur sous le champ */
.error-message {
  display: block;
  color: #9a2f23;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.4rem;
  text-transform: none;
  letter-spacing: normal;
}

/* Animation douce pour l'apparition des erreurs */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Optionnel : Style pour les navigateurs supportant :invalid 
   mais seulement APRES soumission (grâce à .has-errors ajouté en PHP) */
.contact-form.has-errors input:invalid,
.contact-form.has-errors textarea:invalid {
  border-color: #e74c3c;
}

#admin-table-links {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  width: 200px;
  gap: 2rem;
  /* Important : permet de positionner le trait par rapport au lien */
  position: relative;
  padding-bottom: 3rem;
}

/* On cible le dernier lien pour lui ajouter un trait au-dessus */
#admin-table-links a:last-child {
  position: relative;
  padding-top: 1rem; /* Espace entre le trait et le texte du lien */
  margin-top: 2rem;
}

#admin-table-links a:last-child::before {
  content: ""; /* Indispensable pour que le pseudo-élément existe */
  position: absolute;
  top: -2rem; /* Positionne le trait au milieu du gap (gap de 2rem / 2) */
  left: 0;
  width: 100%; /* Le trait prend toute la largeur du conteneur */
  height: 1px;
  background-color: var(--amber);
  transition: transform 0.2s; /* Doit suivre la même vitesse que le bouton */
  pointer-events: none;
}

#admin-table-links a:last-child:hover::before {
  transform: translateY(2px);
}

/* ============================================
   Tableau
   ============================================ */

table {
  margin: 0 auto;
  border-collapse: collapse;
  border-radius: 2px;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--olive);
}

.table-container {
  width: 100%;
  margin: 0 auto;
  margin-bottom: 3rem;
  padding: 0 2.5rem;
}

thead {
  background: var(--forest);
  color: var(--cream);
}

th {
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1.2rem;
  text-align: left;
  font-size: 1.1rem;
}

td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--olive);
  color: var(--forest);
  font-size: 1rem;
  vertical-align: middle;
}

table td img {
  border-radius: 2px;
  width: 250px;
  height: 200px;
  object-fit: contain;
}

/* On retire le flex du td pour qu'il reste une cellule normale */
td:last-child {
  vertical-align: middle;
}

/* On crée un conteneur flex à l'intérieur du td pour aligner les boutons */
td:last-child .actions-admin-td {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

td:last-child a,
td:last-child button {
  padding: 1rem 1.6rem;
  height: 50px;
  max-width: 170px;
}

.admin-header {
  display: flex;
  width: 80%;
  margin: 0 auto;
  padding: 3rem 0 2rem 0;
  justify-content: space-between;
}

.admin-header .actions-admin {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.admin-header h1 {
  margin: 0;
}

.admin-header .actions-admin a {
  width: 200px;
}

@media (max-width: 768px) {
  .table-container {
    overflow-x: auto; /* Active le scroll horizontal sur mobile */
    -webkit-overflow-scrolling: touch;
  }
  .admin-header {
    flex-direction: column;
    gap: 1rem;
  }
  .admin-header .actions-admin a {
    font-size: 0.78rem;
  }
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40, 54, 24, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--cream);
  border-radius: 4px;
  padding: 2.5rem 3rem;
  max-width: 460px;
  width: 90%;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.3s var(--ease-out);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-icon {
  font-size: 2.4rem;
  margin-bottom: 1rem;
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sienna);
  margin-bottom: 0.6rem;
}

.modal p {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--forest);
  margin-bottom: 2rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.modal-actions a,
.modal-actions button {
  min-width: 140px;
}

.admin-succes,
.erreurs-custom {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: calc(100vh - 125px - 72px - 1px);
  gap: 2rem;
  font-size: 1.4rem;
}

.erreurs-custom h1 {
  margin-top: 0;
  margin-bottom: 0;
}

/* ============================================
   GALERIE
   ============================================ */

/* ── Barre de filtres ── */
.gallery-filters {
  max-width: 1280px;
  margin: 3rem auto 2rem;
  padding: 0 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.gallery-search,
.admin-search {
  flex: 1 1 240px;
  position: relative;
}

.admin-search {
  width: 80%;
  margin: 0 auto 2rem auto;
}

.gallery-search input,
.admin-search input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  line-height: 1.5;
  border: 1.5px solid var(--olive);
  border-radius: 2px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--forest);
  transition: border-color 0.3s var(--ease-out);
}

.gallery-search input:focus,
.admin-search input:focus {
  outline: none;
  border-color: var(--amber);
}

.gallery-search svg,
.admin-search svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.gallery-select {
  flex: 0 1 200px;
  padding: 0.85rem 1rem;
  line-height: 1.5;
  border: 1.5px solid var(--olive);
  border-radius: 2px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--forest);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23283618' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
  transition: border-color 0.3s var(--ease-out);
}

.gallery-select:focus {
  outline: none;
  border-color: var(--amber);
}

.filter-reset {
  cursor: pointer;
  border: none;
  opacity: 0;
  pointer-events: none;
  transition:
    background 0.3s var(--ease-out),
    transform 0.2s,
    opacity 0.25s;
  white-space: nowrap;
}

.filter-reset.visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Compteur ── */
.gallery-count,
.admin-count {
  max-width: 1280px;
  margin: 0 auto 1.5rem;
  padding: 0 2.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--forest);
}

/* ── Grille ── */
.gallery-full {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2.5rem;
  columns: 3;
  column-gap: 12px;
}

.gallery-card {
  break-inside: avoid;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  cursor: pointer;
  background: rgba(40, 54, 24, 0.06);
  /* placeholder avant chargement */
}

.gallery-card img {
  display: block;
  width: 100%;
  height: auto;
  transition:
    transform 0.7s var(--ease-out),
    opacity 0.6s;
  opacity: 0;
}

.gallery-card img.loaded {
  opacity: 1;
}

.gallery-card:hover img {
  transform: scale(1.05);
}

/* Overlay au survol */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(40, 54, 24, 0.75) 0%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.4s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem;
  gap: 0.3rem;
}

.gallery-card:hover .card-overlay {
  opacity: 1;
}

.card-overlay-desc {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--cream);
  line-height: 1.4;
}

.card-overlay-meta {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}

/* ── État vide ── */
.gallery-empty {
  display: none;
  text-align: center;
  padding-top: 2rem;
  max-width: 1280px;
  margin: 0 auto;
  color: var(--forest);
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.gallery-empty svg {
  margin: 0 auto 1.5rem;
}

.gallery-empty p {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

/* ── Lightbox ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 37, 16, 1);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-caption {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--cream);
}

.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  transform: scale(0.96);
  transition: transform 0.35s var(--ease-out);
}

.lightbox-overlay.active .lightbox-inner {
  transform: scale(1);
}

.lightbox-inner img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.8rem;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--cream);
  background: rgba(254, 250, 224, 0.1);
  transition: opacity 0.2s;
  line-height: 1;
  display: flex;
  align-items: center;
  padding: 0.5rem;
  transition: background 0.25s;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(254, 250, 224, 0.1);
  border: none;
  color: var(--cream);
  cursor: pointer;
  padding: 1rem 0.8rem;
  border-radius: 2px;
  transition: background 0.25s;
  line-height: 1;
}

.lightbox-nav:hover,
.lightbox-close:hover {
  background: rgba(254, 250, 224, 0.22);
}

.lightbox-prev {
  left: 1.5rem;
}

.lightbox-next {
  right: 1.5rem;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .gallery-full {
    columns: 2;
  }
}

@media (max-width: 768px) {
  .gallery-full {
    columns: 1;
  }

  /* Permet à l'image de s'étendre au maximum de l'écran tout en restant entière */
  .lightbox-inner img {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain; /* Garantit que l'image ne sera JAMAIS rognée */
  }

  /* Ajuste le conteneur sur mobile pour enlever les marges superflues */
  .lightbox-inner {
    max-width: 100vw;
    max-height: 100vh;
    gap: 0;
  }

  .gallery-filters {
    padding: 0 1.2rem;
  }

  .gallery-count {
    padding: 0 1.2rem;
  }

  .lightbox-nav {
    display: none;
  }
}

#cgu-text {
  width: 90%;
  max-width: 800px;
  padding-bottom: 3rem;
  margin: 0 auto;
  line-height: 1.6;
  text-align: justify;
}

/* ============================================
   STYLISATION DES FORMULAIRES ADMIN
   ============================================ */

/* Conteneur principal du formulaire */
main form {
  width: 100%;
  max-width: 600px; /* Plus adapté pour un formulaire vertical */
  margin: 0 auto 4rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0 2.5rem;
  border-radius: 4px;
}

/* Alignement des groupes de champs */
main form > div {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Labels */
main form label,
main form p {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sienna);
}

main form select,
main form select option {
  cursor: pointer;
}

main form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23283618' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
}

main form textarea,
main form select,
main form input[type="text"],
main form input[type="password"],
main form input[type="date"],
main form input[type="number"],
main form input[type="url"] {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--olive);
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 1rem;
  background-color: var(--cream);
  color: var(--forest);
  transition: border-color 0.3s var(--ease-out);
}

/* Cible l'icône du calendrier spécifiquement */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

main form textarea {
  min-height: 120px;
  resize: vertical;
}

main form input:focus,
main form select:focus,
main form textarea:focus {
  outline: none;
  border-color: var(--amber);
}

/* Groupe de checkboxes pour les catégories */
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 2px;
  border: 1px solid var(--olive);
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--forest);
  text-transform: none;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--olive);
}

main form button[type="submit"] {
  cursor: pointer;
  border: none;
  background: var(--forest);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 1rem;
  border-radius: 2px;
  transition:
    background 0.3s var(--ease-out),
    transform 0.2s;
}

main form button[type="submit"]:hover {
  background: var(--olive);
  transform: translateY(-2px);
}

.back-or-submit {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-top: 1rem;
}

.back-or-submit a,
.back-or-submit button {
  width: 45%;
}

.old-photo {
  display: grid;
  grid-template-columns: 20% 40% 35%;
  gap: 2.5%;
  align-items: center;
}

.old-photo img {
  margin: 0 auto;
  border-radius: 2px;
}

main form p.old-photo-name {
  color: var(--forest);
  text-transform: none;
  overflow-wrap: break-word;
}

/* ============================================
   INPUT DRAG AND DROP
   ============================================ */

.custum-file-upload {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: space-between;
  gap: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--olive);
  padding: 1.5rem;
  border-radius: 2px;
}

.custum-file-upload:hover {
  border: 1px solid var(--sienna);
}

.custum-file-upload .icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.custum-file-upload .icon svg {
  height: 80px;
  fill: var(--forest);
}

.custum-file-upload .text {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.custum-file-upload .text span {
  font-weight: 600;
  color: var(--sienna);
}

.custum-file-upload input {
  display: none;
}

/* Adaptation Mobile */
@media (max-width: 768px) {
  main form {
    width: 90%;
    padding: 0 1.5rem;
  }
}

/* ============================================
   BOOKS PAGE
   ============================================ */

.books-section {
  max-width: 1000px;
  margin: 0 auto 5rem auto;
  padding: 0 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 4rem; /* Espace entre les livres si tu en ajoutes d'autres */
}

.book-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 3rem;
  align-items: center;
  padding: 1rem;
  border-radius: 4px;
  text-align: justify;
}

/* Couverture du livre */
.book-cover {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 4px;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Infos du livre */
.book-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.book-info h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--forest);
  line-height: 1.2;
  margin: 0;
}

.book-meta {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sienna);
}

.book-description {
  font-size: 1.05rem;
  color: var(--forest);
  line-height: 1.6;
  text-align: justify;
}

/* Actions et Prix */
.book-actions {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid var(--amber);
  padding-top: 1.5rem;
}

.book-price {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--forest);
}

/* Ajustement du bouton pour la carte */
.book-actions .btn-primary {
  padding: 0.8rem 1.5rem;
}

/* ============================================
   RESPONSIVE BOOKS
   ============================================ */

@media (max-width: 850px) {
  .book-card {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem;
  }

  .book-cover {
    max-width: 250px;
    margin: 0 auto;
  }

  .book-actions {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .book-info h2 {
    font-size: 1.4rem;
  }

  .books-section {
    padding: 0 1.5rem;
  }
}
