/* Styles partagés pour toutes les pages (sauf home) */

/* Hero parallax pour pages (not home) */
body:not(.home) .hero {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  min-height: 60vh;
  z-index: 1;
  overflow: hidden;
  background: var(--color-white);
}

body:not(.home) .hero-photo .img,
body:not(.home) .hero-video .video,
body:not(.home) .hero-slideshow .slideshow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body:not(.home) .hero-photo .img img {
  display: block;
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover !important;
  /* object-position géré par le focal point de Kirby en inline */
}

body:not(.home) .hero-video video,
body:not(.home) .hero-video iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body:not(.home) .hero-slideshow .slideshow-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

body:not(.home) .hero-slideshow .slideshow-slide img {
  display: block;
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover !important;
}

/* Page hero - titre de page qui passe devant */
.page-hero {
  position: relative;
  z-index: 2;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem var(--padding);
}

.page-title {
  color: var(--color-white);
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.6);
  max-width: 15ch;
}

/* Container réutilisable */
.max-w-content {
  max-width: 70rem;
  margin: 0 auto;
  padding: 0 var(--padding);
}

/* Projects intro */
.projects-intro {
  position: relative;
  z-index: 2;
  background: var(--color-white);
  padding: 6rem 0 6rem;
}

.projects-intro .intro-content {
  max-width: 40rem;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.7;
}

/* Projects filters */
.projects-filters {
  position: relative;
  z-index: 2; /* Au-dessus du hero */
  background: var(--color-white);
  padding: 1rem 0 2rem;
  text-align: center;
}

.filters-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.filter-tag {
  background: none;
  border: 1px solid #000;
  color: #000;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 1.5rem;
  transition: all 0.2s ease;
}

.filter-tag:hover {
  background: #000;
  color: #fff;
  transform: scale(1.05);
}

.filter-tag.active {
  background: #000;
  color: #fff;
}

/* Projects list - réutilise le style home */
.projects-list {
  position: relative;
  z-index: 2; /* Au-dessus du hero */
  background: var(--color-white);
  padding: 2rem 0 4rem;
}

.project-row.hidden {
  display: none;
}

/* Mobile: cacher lieu et année pour plus de place */
@media (max-width: 768px) {
  .project-location,
  .project-year {
    display: none;
  }
}

/* Project detail */
.project-detail {
  padding-top: 0; /* PAS de padding-top: le hero doit coller au header */
  padding-bottom: 4rem;
}

.project-hero {
  position: relative;
  width: 100%;
  height: 60vh;
  overflow: hidden;
  background: var(--color-light-dark);
}

.project-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-info {
  padding: 4rem 0;
}

.project-header {
  margin-bottom: 3rem;
  text-align: center;
}

.project-detail .project-title {
  font-size: 2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.project-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.project-meta span:not(:last-child)::after {
  content: "•";
  margin-left: 2rem;
  color: var(--color-text-disabled);
}

.project-description {
  max-width: 50rem;
  margin: 0 auto;
  font-size: 1.2rem;
}

.project-gallery {
  padding: 4rem 0;
}

.project-gallery-item {
  margin-bottom: 3rem;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.project-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #000;
  border-radius: var(--border-radius);
}

.project-gallery-item figcaption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-align: center;
}

.project-nav {
  padding: 2rem 0;
  text-align: center;
}

.back-link {
  display: inline-block;
  color: #000;
  text-decoration: none;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  border-radius: 1.5rem;
  border: 1px solid #000; /* Déjà visible par défaut ✓ */
  transition: all 0.2s ease;
}

.back-link:hover {
  background: #000;
  color: #fff;
  transform: scale(1.05);
}

/* Contact page */
.contact-content {
  position: relative;
  z-index: 2;
  background: var(--color-white);
  padding: 4rem 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  max-width: 50rem;
  margin: 0 auto;
}

.contact-intro {
  font-size: 1.2rem;
  margin-bottom: 3rem;
}

.contact-item {
  margin-bottom: 2rem;
}

.contact-item strong {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: var(--color-text-secondary);
}

.contact-item a {
  color: #000;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.contact-item a:hover {
  opacity: 0.6;
}

/* About page specific styles */
.about-content,
.faq-content {
  position: relative;
  z-index: 2;
  background: var(--color-white);
  padding: 6rem 0;
}

.about-layouts,
.faq-layouts {
  margin: 0 auto;
  max-width: 70rem;
  padding: 0 var(--padding);
}

/* Gap entre colonnes du layout */
.about-layouts .grid,
.faq-layouts .grid {
  gap: 3rem;
}

/* Espacement des titres - About & FAQ layouts */
.about-layouts h2,
.faq-layouts h2 {
  margin-top: 5rem;
  /* margin-bottom défini globalement */
}

.about-layouts h2:first-child,
.about-layouts .layout:first-child h2,
.faq-layouts h2:first-child,
.faq-layouts .layout:first-child h2 {
  margin-top: 0;
}

.about-layouts h3,
.faq-layouts h3 {
  margin-top: 3rem;
  /* margin-bottom défini globalement */
}

.about-layouts p,
.faq-layouts p {
  margin-bottom: 1.618rem;
  color: var(--color-text);
}

.about-layouts ul,
.about-layouts ol,
.faq-layouts ul,
.faq-layouts ol {
  margin-bottom: 1.618rem;
  padding-left: 1.5rem;
  margin-top: 0;
}

.about-layouts li,
.faq-layouts li {
  margin-bottom: 0rem; /* Plus serré */
}

/* Espacement cohérent des layouts */
.about-layouts .layout,
.faq-layouts .layout {
  margin-bottom: 4rem;
}

.about-layouts .layout:last-child,
.faq-layouts .layout:last-child {
  margin-bottom: 0;
}

/* Alignement vertical des colonnes */
.about-layouts .grid,
.faq-layouts .grid {
  align-items: start; /* Alignement en haut */
}

/* Espacement des blocs dans les colonnes */
.about-layouts .column .text > *,
.faq-layouts .column .text > * {
  margin-bottom: 0; /* Reset pour gérer manuellement */
}

.about-layouts .column .text > p,
.about-layouts .column .text > ul,
.about-layouts .column .text > ol,
.faq-layouts .column .text > p,
.faq-layouts .column .text > ul,
.faq-layouts .column .text > ol {
  margin-bottom: 1.618rem; /* φ */
}

.about-layouts .column .text > p:last-child,
.about-layouts .column .text > ul:last-child,
.about-layouts .column .text > ol:last-child,
.faq-layouts .column .text > p:last-child,
.faq-layouts .column .text > ul:last-child,
.faq-layouts .column .text > ol:last-child {
  margin-bottom: 0;
}

/* H2 garde toujours son margin-bottom même en :last-child */
.about-layouts h2,
.faq-layouts h2 {
  margin-bottom: 1.5rem !important;
}

/* Images et galeries dans les layouts */
.about-layouts .img,
.about-layouts .block-type-image,
.about-layouts .block-type-gallery,
.faq-layouts .img,
.faq-layouts .block-type-image,
.faq-layouts .block-type-gallery {
  margin-bottom: 0;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.about-layouts img,
.faq-layouts img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--border-radius);
}

/* Galerie - grid responsive avec lightbox */
.gallery {
  margin: 0;
}

.gallery ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.gallery li {
  margin: 0;
  overflow: hidden;
  border-radius: var(--border-radius);
}

.gallery a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gallery a:hover {
  transform: scale(1.02);
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover !important; /* Force cover malgré inline style */
  display: block;
  line-height: 0; /* Évite filet noir */
}

.gallery figcaption {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-align: center;
}

/* About & FAQ layouts - override pour galeries */
.about-layouts .block-type-gallery,
.faq-layouts .block-type-gallery {
  margin-bottom: 0;
}

.about-layouts .gallery ul,
.faq-layouts .gallery ul {
  grid-template-columns: repeat(2, 1fr); /* 2 colonnes fixes */
  gap: 0.75rem;
}

.about-contact {
  margin-top: 6rem;
  padding-top: 4rem;
  border-top: 1px solid #e0e0e0;
}

.about-contact .section-label {
  text-align: center;
  margin-bottom: 3rem;
}

/* Section label réutilisable */
.section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 400;
  margin-bottom: 3rem;
  display: block;
}

/* Podcast archive page */
.podcast-archive {
  position: relative;
  z-index: 2;
  background: var(--color-white);
  padding: 4rem 0;
}

.podcast-archive-intro {
  max-width: 50rem;
  margin: 0 auto 4rem;
  font-size: 1.2rem;
  text-align: center;
}

.podcast-episodes-list {
  max-width: 50rem;
  margin: 0 auto;
}

.podcast-episode-card {
  margin-bottom: 4rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid #e0e0e0;
}

.podcast-episode-card:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.podcast-episode-inner {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 2rem;
  align-items: start;
}

.podcast-episode-cover {
  width: 120px;
  height: 120px;
  border-radius: var(--border-radius);
  overflow: hidden;
  flex-shrink: 0;
}

.podcast-episode-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.podcast-episode-content {
  min-width: 0;
}

.podcast-episode-title {
  margin-bottom: 0.75rem;
}

.episode-number {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}

.podcast-episode-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}

.podcast-episode-meta span:not(:last-child)::after {
  content: "•";
  margin-left: 1rem;
  color: var(--color-text-disabled);
}

.podcast-episode-description {
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

.podcast-episode-player audio {
  width: 100%;
  height: 40px;
}

/* FAQ page - Utilise maintenant le système de layouts comme About */

/* Mobile adaptations */
@media (max-width: 768px) {

  .filters-wrapper {
    padding: 0 1rem;
    gap: 0.75rem;
  }

  .filter-tag {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }

  .project-hero {
    height: 40vh;
  }

  .project-detail .project-title {
    font-size: 1.5rem;
  }

  .project-meta {
    gap: 1rem;
    font-size: 0.75rem;
  }

  .project-meta span:not(:last-child)::after {
    margin-left: 1rem;
  }

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

  .project-gallery-item {
    margin-bottom: 2rem;
  }

  .contact-intro,
  .about-intro {
    font-size: 1rem;
  }

  .about-content,
  .faq-content {
    padding: 3rem 0;
  }

  .about-layouts h2,
  .faq-layouts h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
  }

  .about-layouts h3,
  .faq-layouts h3 {
    margin-top: 2rem;
  }

  .about-layouts .layout,
  .faq-layouts .layout {
    margin-bottom: 3rem;
  }

  .about-layouts .grid,
  .faq-layouts .grid {
    gap: 2rem;
    align-items: start; /* Pas de centrage vertical sur mobile */
  }
  
  /* Centrer les textes sur mobile */
  .about-layouts,
  .faq-layouts {
    text-align: center;
  }
  
  .about-layouts h2,
  .about-layouts h3,
  .about-layouts p,
  .faq-layouts h2,
  .faq-layouts h3,
  .faq-layouts p {
    margin-left: auto;
    margin-right: auto;
  }

  .about-layouts .gallery ul,
  .faq-layouts .gallery ul {
    grid-template-columns: repeat(2, 1fr); /* 2 colonnes sur mobile au lieu d'1 */
  }

  .about-contact {
    margin-top: 4rem;
    padding-top: 3rem;
  }

  .podcast-archive-intro {
    font-size: 1rem;
  }

  .podcast-episode-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .podcast-episode-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .podcast-episode-card {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
  }

  /* Hero parallax mobile */
  body:not(.home) .hero {
    min-height: 50vh;
  }

  /* S'assurer que l'image remplit toute la zone sur mobile */
  body:not(.home) .hero-photo .img,
  body:not(.home) .hero-slideshow .slideshow,
  body:not(.home) .hero-slideshow .slideshow-slide {
    height: 100%;
    min-height: 100%;
  }
  
  body:not(.home) .hero-photo .img img,
  body:not(.home) .hero-slideshow .slideshow-slide img {
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
  }

  .page-hero {
    min-height: 50vh;
    padding: 2rem var(--padding);
  }

  /* .page-title garde la taille desktop (4rem) */
}

/* === PAGES (hors .home): HERO ~60vh + title glide + parallax === */
:where(body):not(.home) .hero,
:where(body):not(.home) .page-hero{
  position: relative;
  min-height: clamp(48vh, 56vh, 60vh);
  max-height: 60vh;
  overflow: hidden;
  z-index: 0;
}

:where(body):not(.home) .hero [data-parallax],
:where(body):not(.home) .page-hero [data-parallax]{
  will-change: transform;
}

/* Titre qui glisse doucement au-dessus */
:where(body):not(.home) .page-title,
:where(body):not(.home) h1.title,
:where(body):not(.home) h1{
  transform: translateY(16px);
  opacity: .8;
  transition: transform .25s ease, opacity .25s ease; /* garde un fallback si JS off */
}

/* === PATCH: PAGES HERO ~60vh + H1 visible === */
body:not(.home) .hero,
body:not(.home) .page-hero{
  position: relative;
  min-height: clamp(48vh, 56vh, 60vh);
  max-height: 60vh;
  overflow: hidden;
  z-index: 0;
}
/* Visible PAR DÉFAUT; le glide est ajouté par JS (titleGlide) */
body:not(.home) .page-title,
body:not(.home) h1.title,
body:not(.home) h1{
  opacity: 1;                  /* <- important: H1 reste visible même si JS absent */
  transform: none;             /* état par défaut */
  will-change: transform, opacity;
}
/* Optionnel: si tu veux un fallback discret quand JS présent, titleGlide gère via style inline */

/* === CORRECTIF PAGES MINIMAL === */

/* Hero: bandeau 60vh */
body:not(.home) .hero {
  min-height: 60vh;
  max-height: 60vh;
}

/* Image hero: léger agrandissement + cadrage uniforme */
body:not(.home) .hero img,
body:not(.home) .hero figure img {
  scale: 1.08; /* réduit de 1.15 à 1.08 */
  transform-origin: center;
  object-fit: cover;
  object-position: center center; /* centrage vertical uniforme */
  width: 100%;
  height: 100%;
}

/* Page-hero: position absolute pour overlay le titre sur hero */
body:not(.home) .page-hero {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

/* Titre: visible par défaut */
body:not(.home) .page-hero h1,
body:not(.home) .page-title {
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
  opacity: 1;
  pointer-events: auto;
}
