/* ===========================================================
   POLICE ET FOND
   =========================================================== */

/* Import de la police */
@font-face {
  font-family: "GreatVictorian";
  src: url("../fonts/GreatVictorian-Standard.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}


/* Fond global (pages normales) */
body {
  background: url("../images/background.png") center/cover no-repeat fixed;
  position: fixed;
  inset: 0;
  z-index: -1;
}

/* Fond alternatif pour les galeries */
body.fond-galerie {
  background: url("../images/mur2.png") center/cover no-repeat fixed;
  position: fixed;
  inset: 0;
  z-index: -1;
}



/* ===========================================================
   SPA - PAGES ET TRANSITIONS
   =========================================================== */
html, body {
  height: 100%;
  overflow: auto;
}

.spa-page {
  display: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.spa-page.active {
  display: block;
  opacity: 1;
}

/* Fumée multicouche */
.smoke-transition {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: url("../images/smoke.png") center/cover repeat;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  z-index: 9999;
}
.smoke-transition.active {
  opacity: 1;
}
.smoke-transition::before,
.smoke-transition::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: url("../images/smoke.png") center/cover repeat;
  opacity: 0.5;
  animation: smoke-move 6s linear infinite;
  filter: blur(8px);
}
.smoke-transition::after {
  opacity: 0.35;
  animation: smoke-move-alt 18s linear infinite;
  filter: blur(12px);
}
@keyframes smoke-move {
  from { transform: translateX(0) translateY(0) scale(1.1); }
  to   { transform: translateX(10%) translateY(-10%) scale(1.2); }
}
@keyframes smoke-move-alt {
  from { transform: translateX(0) translateY(0) scale(1); }
  to   { transform: translateX(-10%) translateY(10%) scale(1.15); }
}



/* ===========================================================
   PAGE TYPE JOURNAL
   =========================================================== */
.newspaper {
  max-width: 800px;
  max-height: 800px;
  margin: auto;
  background: url("../images/journal.png") center/cover no-repeat; 
  padding: 15px;
  box-shadow: 0 0 40px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  font-family: "GreatVictorian", serif;
  overflow-y: auto; 
}

/* Logo */
.logo {
  display: block;
  width: 100%;
}
.logo img {
  max-width: 100%;
  height: auto;
}
.logo:hover {
  animation: colorize 0.5s forwards;
  transition: transform 2s ease;
}

/* ===========================================================
   IMAGE D'INTRO
   =========================================================== */
.intro-image {
  position: relative;
  width: 100%;
  margin:auto;
}
.intro-image img.atelier {
  width: 100%;
  height: auto;
  display: block;
}
.intro-image:hover {
  animation: colorize 2s forwards;
  transform: scale(0.985);
}
@keyframes colorize {
  0%   { filter: grayscale(100%); }
  50%  { filter: sepia(70%); }
  100% { filter: none; }
}

/* Texte par-dessus l'image */
.intro-image #intro-text {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  font-size: clamp(0.9rem, 8vw, 5rem);
  font-weight: bold;
  color: gold;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.8);
  text-align: center;
  width: 90%;
  line-height: 1.2;
  transition: opacity 1s ease-in-out;
  opacity: 0;
}

/* ===========================================================
   ARTICLES ACCUEIL
   =========================================================== */
.articles {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 10px;
}
.articles article {
  background: transparent;
  border: 4px double #444;
  padding: 5px;
  text-align: center;
  color: #4e4e4e;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}
.articles article:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.articles article:active {
  transform: scale(0.95);
}
.articles article img.icon {
  width: 30px;
  height: auto;
  margin-bottom: -5px;
}
.articles h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* espace entre icône et texte */
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.articles article p {
  font-family: "Times New Roman", Times, serif; 
  font-size: 0.8rem;
  line-height: 1.2;
  text-align: justify;
  hyphens: auto;
  margin: 0;
}
.articles article p::first-letter {
  font-size: 2em;
  font-weight: bold;
  font-family: "GreatVictorian", serif;
  color: #a65353;
  line-height: 0;
}


/* ===========================================================
   DIAPORAMA PERMANENT ACCUEIL
   =========================================================== */
.image-wrapper {
  position: relative;
  width: 100%;
  margin: auto;
  height: auto; /* ou fixe si nécessaire */
}

.image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.image-wrapper::before {
  content: "";
  display: block;
  padding-top: 46%; /* ratio pour réserver la place (ici 16:9) */
}

/* Image 1 : fade in puis fade out */
.img1 {
  animation: fade1 8s infinite;
}

/* Image 2 : fade out puis fade in (décalée) */
.img2 {
  animation: fade2 8s infinite;
}


@keyframes fade1 {
  0%   { opacity: 1; }
  40%  { opacity: 0; }
  60%  { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes fade2 {
  0%   { opacity: 0; }
  40%  { opacity: 1; }
  60%  { opacity: 1; }
  100% { opacity: 0; }
}


/* ===========================================================
   AUTRES PAGES
   =========================================================== */
#intro {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 3%;
  font-family: 'GreatVictorian', serif;
  font-size: 1.5rem;
  font-weight: bold;
  /*color: #3f33ab;*/
  color: #a65353;
}

.articles2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 8px;
}
.articles2 article2 {
  background: transparent;
  padding: 5px;
  text-align: center;
  color: #544f4f;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}
.articles2 article2 h3 {
  font-size: 2rem;
  margin: 4px 0;
}
.articles2 article2 p {
  font-family: "Times New Roman", Times, serif; 
  font-size: 0.8rem;
  color: #544f4f;
  line-height: 1.2;
  text-align: justify;
  hyphens: auto;
  margin: 0;
}
.articles2 article2 p::first-letter {
  font-size: 2em;
  font-weight: bold;
  font-family: "GreatVictorian", serif;
  color: #a65353;
  line-height: 0;
}

/* Illustrations */
.box-illustration {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  padding: 10%;
  align-items: start;
  overflow: visible;
}
.illustration {
  position: relative;
  margin: 8%;
  width: 80%;
}
.illustration img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 26px;
}
.illustration::after {
  content: "";
  position: absolute;
  top: -15px;
  left: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 30px);
  background: url('../images/cadre4.png') center/100% 100% no-repeat;
  pointer-events: none;
  z-index: 1;
}

/* ===========================================================
   FOOTER
   =========================================================== */
#footer {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 1rem;
  /*margin-left: 5vh;*/
  margin-bottom: 1rem;
  font-size: 1.1rem;
  border-top: 1px solid rgba(0,0,0,0.2);
}
.footer-left,
.footer-center,
.footer-right {
  font-family: "GreatVictorian", serif;
  font-size: 0.6rem;
  font-weight: bold;
}
.footer-center {
  font-style: italic;
}


/* ===========================================================
   FORMULAIRE DE CONTACT
   =========================================================== */

/* ============================= */
/* Formulaire de contact */
/* ============================= */
/* Cadre rétro avec coins décoratifs */
.cadre-retro {
  position: relative;
  width: 90%;
  max-width: 400px;
  margin: auto;
  background: transparent;
  padding: 0 1rem;
  /*font-family: "GreatVictorian", serif;*/
  border: 3px double rgba(0,0,0,0.2);
  overflow: hidden;
}

/* Coins décoratifs */
.coin {
  position: absolute;
  width: 60px;   /* ajuste selon taille de coin.png */
  height: 60px;
  background: url("../images/coin.png") no-repeat center/contain;
}

.coin-haut-gauche { top: 0; left: 0; }
.coin-haut-droit  { top: 0; right: 0; transform: scaleX(-1); }
.coin-bas-gauche  { bottom: 0; left: 0; transform: scaleY(-1); }
.coin-bas-droit   { bottom: 0; right: 0; transform: scale(-1,-1); }

.cadre-contenu {
  position: relative;
  z-index: 1;
}

.form-preambule {
  position: center;
  font-size: 0.8rem;
  font-family: "Times New Roman", Times, serif;
  margin-bottom: 1.5rem;
}

.form-titre {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  font-family: "GreatVictorian", serif;
  color: #5a3e2b;
  font-weight: bold;
}

/* Champs avec cadre décoratif */
.champ-cadre {
  margin-bottom: 1rem;
  padding: 0.8rem;
  border: 4px double black;
  border-image: url("../images/cadre2.png") 30 round; 
  border-radius: 6px;
  background: transparent;
}

.champ-cadre label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: "GreatVictorian", serif;
  font-weight: bold;
  font-size: 1.5rem;
  color: #5a3e2b;
  background: transparent;
}

.champ-cadre input,
.champ-cadre textarea {
  width: 100%;
  border: none;
  font-size: 0.8rem;
  font-family: "Times New Roman", Times, serif; 
  padding: 0.6rem;
  background: transparent;
  outline: none;
}

.btn-envoyer {
  position: relative;
  text-align: center;
  padding: 0.6rem 1.2rem;
  background: transparent;
  color: #fff;
  font-family: "GreatVictorian", serif;
  font-size: 2rem;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-envoyer:hover {
  color: #c59d5f;
  transform: scale(1.2);
}

/* ===============================
         POPUP VICTORIEN 
   =============================== */
.victorian-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;

  /* Taille et proportions */
  width: 80vw;
  max-width: 700px;
  max-height: 80vh;
  aspect-ratio: 3 / 2;

  /* Fond décoratif */
  background-image: url('images/cadre5.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;

  display: flex;
  justify-content: center;
  align-items: center;

  /* Padding interne */
  padding: 4vh 5vw;

  text-align: center;

  /* Style général */
  font-family: 'GreatVictorian', serif;
  color: #2c1f14;

  /* Ombre cadre */
  box-shadow: -10px 10px 20px rgba(0,0,0,0.9);

  opacity: 0;
  animation: fadeIn 0.5s forwards;
}

/* Contenu interne */
.victorian-popup-content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Titres dans le popup */
.victorian-popup-content h2 {
  font-size: clamp(8px, 2.5vw, 40px);
  margin: 10px 0;
  text-shadow: 1px 1px #d4c6b2;
}

/* Images dans le popup */
.victorian-popup-content img {
  display: inline-block;
  width: clamp(120px, 20vw, 200px);
  margin: 10px 20px;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.victorian-popup-content img:hover {
  transform: scale(1.15);
}

/* Bouton de fermeture */
.victorian-popup-close {
  position: absolute;
  top: 5px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #2c1f14;
}

/* En cas de succès / erreur (bordure autour du cadre si tu veux) */
.victorian-popup.success {
  filter: drop-shadow(0 0 10px rgba(50,120,40,0.7));
}

.victorian-popup.error {
  filter: drop-shadow(0 0 10px rgba(120,20,20,0.7));
}

/* Animation fade-in */
@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -55%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* Responsive mobile */
@media (max-width: 768px) {
  .victorian-popup {
    width: 95vw;
    padding: 2vh 4vw;
  }
  .victorian-popup-close {
    font-size: 1.5rem;
  }
}


/* ===========================================================
   GALERIE D’IMAGES
   ===========================================================
.mur {
  max-width: 100%;
  width: 100%;
  margin: auto;
  background: transparent; 
  padding: 15px;
  box-shadow: 0 0 40px rgba(0,0,0,0.7);
  border: 2px solid #222;
  font-family: "GreatVictorian", serif;
  overflow-y: auto; 
  display: block; 
}


/* === TEST GALLERY LAYOUT === */
.containerB2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  padding: 2rem;
  height: auto;           /* ← facultatif, mais explicite */
  align-items: start;     /* ← évite que les enfants s'étirent verticalement */
  overflow: visible;      /* ← garantit que rien ne soit masqué */
}

/* Chaque cadre : bordure noire + zone relative */
.gallery-item {
  position: relative; /* sert pour placer le pseudo-élément */
  display: block;
  background: transparent;
  height: auto; /* ← facultatif mais utile */
  padding: 10px;
  margin: 0;
  box-shadow: -15px 20px 25px rgba(0,0,0,1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: -20px 30px 15px rgba(0,0,0,1);
}


/* Image ajustée à l'intérieur du cadre */
.gallery-item img {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.4);
}


/* Cadre doré superposé exactement sur la zone du container */
.gallery-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
  background-image: url('../images/cadre3.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% 100%;
}


/* Overlay */
.overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

.overlay img {
  position: fixed;
  top: 50%;
  left: 50%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: -10px 10px 15px rgba(0,0,0,1);
  transition: transform 0.2s ease;
}

.close-btn {
  position: absolute;
  z-index: 1001;
  top: 1rem;
  left: 1rem;
  background: none;
  border: none;
  color: white;
  font-size: 6rem;
}



/* ============================= */
/* Ajustements ergonomie mobile */
/* ============================= */

@media (max-width: 800px) {
  .containerB2 {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    justify-items: center;
    padding: 1rem;
  }
  .gallery-item {
    width: 100%;
    max-width: 220px;
    padding: 0;
  }
}

/* Entête */
.entete-img {
  width: 100%;
  height: auto;
}

/* Image principale */
.img-principale {
  width: 100%;
  max-height: 32vh;
  object-fit: cover;
  filter: grayscale(70%);
  display: block;
}

/* Texte */
.article-mobile p,
.article-page p {
  font-size: 0.85rem;
  padding: 0.5em 1em;
  line-height: 1.4;
  text-align: justify;
  color: #333;
}

/* Navigation */
.nav-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /*padding: 0.8em 1em;*/
  font-size: 1.3rem;
}

.nav-mobile img {
  width: 150px; /* zone tactile adaptée */
  height: 30px;
  vertical-align: middle;
}
.nav-mobile span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-mobile img:hover {
  transform: scale(1.2);
}

/* Footer */
.footer-mobile {
  display: flex;
  flex-direction: column;
  /*align-items: center;*/
  /*text-align: center;*/
  gap: 4px;
  padding: 0.5em 0;
  font-size: 0.7rem;
  margin-top: 1rem;
}

.footer-mobile span {
  display: block;
}
