* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  /* magnetic scrolling */
  scroll-snap-type: y proximity;
}

html.detail-view-active {
  scroll-snap-type: none;
}

section {
  /* magnetic scrolling */
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

body {
  font-family: "Work Sans", sans-serif;
  line-height: 1.6;
  font-weight: 400;
  color: #222;
  background-color: #ffffff;
  scroll-behavior: smooth;
}

a {
  text-decoration: none;
  color: #cd2593;
  transition: opacity 0.3s ease;
}

/* Header & Nav */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  z-index: 1000;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

header.scrolled {
  background-color: white;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-logo {
  width: 40px;
  height: 40px;
}

header.in-hero .header-logo {
  opacity: 0;
  pointer-events: none;
}

header.in-hero .logo {
  opacity: 0;
}

header.scrolled .header-logo,
body.detail-view-active header .header-logo {
  opacity: 1;
  pointer-events: auto;
}

/* Force dark header on detail view */
body.detail-view-active header .logo,
body.detail-view-active header #main-menu li {
  color: #1a1a1a;
}

header .logo,
header #main-menu li {
  color: white;
  transition: color 0.3s ease;
}

header.scrolled .logo,
header.scrolled #main-menu li {
  color: #1a1a1a;
}

.logo {
  font-family: "Montserrat", sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  cursor: pointer;
}

#main-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  justify-content: center;
  flex: 1;
}

#main-menu li {
  font-family: "Work Sans", sans-serif;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  cursor: pointer;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 2px;
  background-color: #1a1a1a;
}

/* Hero Section */
.hero-section {
  height: 100vh;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: brightness(0.7);
}

/* 2 columns */
.hero-columns {
  display: flex;
  width: 100%;
}

/* partie gauche */
.hero-content {
  flex: 0 0 50%;
  display: flex;
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  position: relative;
  z-index: 0;
  padding: 5%;
}

/* partie droite */
.hero-pedagogie {
  flex: 0 0 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.hero-pedagogie a {
  display: block;
  width: 50%;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.hero-pedagogie a:hover {
  transform: scale(1.05) rotate(10deg);
}

.hero-pedagogie img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-center {
  flex: 1;
  text-align: center;
  padding: 0 2rem;
}

.hero-center img {
  animation: spin3D 3s ease-in-out normal;
}

@keyframes spin3D {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(360deg);
  }
}

.hero-title {
  font-family: "Playfair Display", sans-serif;
  font-size: 4rem;
  font-weight: 700;
  line-height: 5rem;
  letter-spacing: 3px;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeInUp 1s ease 0.5s forwards;
}

.hero-description {
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 1px;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeInUp 1s ease 0.8s forwards;
  z-index: 1;
}

.hero-button {
  font-family: "Work Sans", sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  display: inline-block;
  padding: 12px 30px;
  background: transparent;
  border: 2px solid white;
  color: white;
  text-decoration: none;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  opacity: 0;
  animation: fadeInUp 1s ease 1.2s forwards;
}

.hero-button:hover {
  background: white;
  color: #2c2c2c;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 2rem;
  animation: bounce 2s infinite;
  cursor: pointer;
  z-index: 1;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  40% {
    transform: translateX(-50%) translateY(-10px);
  }

  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Main Content */
main {
  padding: 0;
  min-height: calc(100vh - 60px);
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

.content-section {
  min-height: 100vh;
  padding: 4rem 10%;
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Sections */
.section-header {
  margin-bottom: 1rem;
  text-align: center;
}

.section-header h1 {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  line-height: 1.6;
  text-transform: uppercase;
  text-align: center;
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: 2px;
  margin-top: 1rem;
  margin-bottom: 1rem;
  color: #2c2c2c;
}

.section-description {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 400;
  color: #666;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.sub-sections-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.sub-section {
  position: relative;
  aspect-ratio: 3/2;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
  transition: filter 0 (4) s ease-in-out;
}

.section-preview {
  background-color: #a4009c;
  display: flex;
  flex: 1 1 100%;
  overflow: hidden;
  padding: 0px;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  cursor: pointer;
}

.section-preview img {
  filter: grayscale(100%) contrast(1) blur(0px);
  flex: 1 0 100%;
  max-width: 100%;
  mix-blend-mode: lighten;
  object-fit: cover;
  object-position: center;
  opacity: 1;
  position: relative;
  width: 100%;
  height: 100%;
  transition:
    filter 0.4s ease,
    mix-blend-mode 0.4s ease,
    transform 0.4s ease;
}

.section-preview:hover img {
  transform: scale(1.03);
  filter: none;
  mix-blend-mode: normal;
}

.section-preview::before {
  background-color: #63cfb7;
  bottom: 0;
  content: "";
  height: 100%;
  left: 0;
  mix-blend-mode: soft-light;
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  z-index: 1;
  transition: opacity 0.4s ease;
}

.section-preview:hover::before {
  opacity: 0;
}

.preview-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(62, 57, 79, 0.3); /* bandeau gris à 20 % */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.8rem 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.section-preview:hover .preview-overlay {
  opacity: 1;
}

.sub-section:hover .preview-overlay {
  opacity: 1;
}
.sub-section:hover .section-preview img {
  transform: scale(1.03);
  filter: none;
  mix-blend-mode: normal;
}
.sub-section:hover .section-preview::before {
  opacity: 0;
}

.preview-overlay h3 {
  font-family: "Work Sans", sans-serif;
  color: white;
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 0.2rem;
}

.preview-overlay p {
  font-family: "Work Sans", sans-serif;
  color: white;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.about-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4rem;
  align-items: center;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  border-radius: 15px;
  padding: 25px 15px 15px 40px;
  background: #f8f8f8;
}

.about-image {
  flex: 1;
  min-width: 300px;
  max-width: 500px;
}

.about-image img {
  width: 100%;
  height: auto;
}

.about-text {
  flex: 1;
  min-width: 300px;
  max-width: 600px;
  line-height: 1.8;
  font-size: 0.9rem;
  color: #555;
}

/* Contact Section */
footer {
  background-color: #f4f4f4;
}

#phone-complete {
  background: #d4b1a5;
  padding: 2px;
  cursor: pointer;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-form {
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.3rem;
  font-weight: 400;
  font-size: 1rem;
  color: #2c2c2c;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 7px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #8b4513;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.submit-btn {
  padding: 15px 30px;
  background: #8b4513;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.submit-btn:hover {
  background: #6d3410;
}

.contact-info h3 {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 1.2rem;
  color: #2c2c2c;
}

.contact-info p {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #444;
}

.gallery-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #161615;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.gallery-modal.active {
  opacity: 1;
  visibility: visible;
}

.gallery-content {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.gallery-header {
  background: rgba(22, 22, 21, 1);
  padding: 2rem;
  text-align: center;
  color: white;
}

.gallery-title {
  font-size: 2.5rem;
  font-weight: 100;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  font-family: "Montserrat", sans-serif;
}

.gallery-description {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  white-space: pre-line;
}

.gallery-viewer {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #161615;
}

.gallery-image {
  max-width: 100%;
  max-height: 80vh;
  height: auto;
  width: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 10px 50px rgba(255, 255, 255, 0.1);
}

#gallery-caption {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
  color: white;
  font-size: 0.9rem;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
  word-wrap: break-word;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: white;
  font-size: 3rem;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  user-select: none;
  z-index: 10;
  opacity: 0.7;
}

.gallery-nav:hover {
  background: transparent;
  transform: translateY(-50%) scale(1.2);
  opacity: 1;
}

.gallery-nav.prev {
  left: 2rem;
}

.gallery-nav.next {
  right: 2rem;
}

.gallery-counter {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

.gallery-controls {
  position: absolute;
  top: 2rem;
  right: 2rem;
  display: flex;
  gap: 1rem;
  z-index: 2001;
}

.control-btn {
  background: transparent;
  border: none;
  color: white;
  padding: 0;
  cursor: pointer;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  font-size: 3rem;
  line-height: 1;
  opacity: 0.7;
}

.control-btn:hover {
  background: transparent;
  transform: scale(1.2);
  opacity: 1;
}

/* Mobile responsiveness for gallery */
@media (max-width: 768px) {
  .gallery-nav {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .gallery-nav.prev {
    left: 1rem;
  }

  .gallery-nav.next {
    right: 1rem;
  }

  .gallery-title {
    font-size: 2rem;
  }

  .gallery-header {
    padding: 1.5rem;
  }

  .control-btn {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }
}

.lightbox-caption {
  position: absolute;
  bottom: -40px;
  left: 0;
  width: 100%;
  text-align: center;
  color: white;
  font-size: 1rem;
  font-weight: 300;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.8rem;
  color: #555555;
  border-top: 1px solid #eee;
  margin-top: auto;
  /* Push footer to bottom */
}

/* Responsive */
@media (max-width: 768px) {
  .hero-columns {
    flex-direction: column;
    height: auto;
  }

  .hero-content,
  .hero-pedagogie {
    flex: 0 0 100%;
    width: 100%;
    padding: 10px 0;
    align-items: start;
  }

  .hero-content {
    padding: 10px 10px;
    margin-bottom: 20px;
  }

  .hero-pedagogie a {
    width: 40%;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  #main-menu {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: white;
    flex-direction: column;
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid #eee;
  }

  #main-menu.active {
    display: flex;
  }

  .mobile-menu-toggle {
    display: flex;
  }
}

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

@media (max-width: 768px) {
  .hero-center img {
    width: 80px;
    height: 80px;
  }

  .hero-description {
    margin: 5px 80px 35px;
  }

  .in-hero #main-menu li {
    color: black;
  }

  .sub-sections-grid {
    grid-template-columns: 1fr;
  }

  .section-preview img {
    object-fit: cover;
  }

  .section-preview {
    height: auto;
  }

  .preview-overlay h3 {
    font-size: 1.5rem;
  }

  .preview-overlay p {
    font-size: 1rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* Detail View */
#detail-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  background-color: #ffffff;
  z-index: 900;
  /* Below header (1000) */
  padding-top: 100px;
  /* Space for header */
  padding-bottom: 4rem;
}

.detail-container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 5%;
}

.back-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 1rem;
  margin-top: 1rem;
  padding: 10px; /* click zone */
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1a1a1a;
  transition: opacity 0.3s ease;
}

.back-btn:hover {
  opacity: 0.6;
}

.detail-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  font-weight: 600;
  text-transform: uppercase;
}

.detail-text {
  max-width: 800px;
  margin-bottom: 4rem;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #1a1a1a;
}

.detail-text p {
  margin-bottom: 1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* exception for galleryPortrait: true */
.detail-grid-portrait {
  grid-template-columns: repeat(4, 1fr);
}

.detail-item {
  aspect-ratio: 3/2;
  overflow: hidden;
  cursor: pointer;
}

.detail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.detail-item-portrait {
  aspect-ratio: 3/4;
}

.detail-item:hover img {
  transform: scale(1.03);
}

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

@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-title {
    font-size: 2rem;
  }
}
