/*
Theme Name: Kozto
Description: Theme enfant Kozto
Author: Benoit Baraille & Nicolas Hoffmann
Author URI: https://www.benoit-baraille.fr
Template: twentytwentyfive
Version: 1.0.0
*/

@import url(./css/splash-screen.css);
@import url(./css/page-projets.css);
@import url(./css/page-projets-mobile-display.css);
@import url(./css/header-color-switch.css);

/* Supprimer toutes les bordures noires au focus sur tout le site */
*:focus,
*:focus-visible,
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
.kozto-project-item:focus .kozto-project-item img:focus {
  outline: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

/* gallery container */
.projet-gallery {
  gap: 12px;
}

/* GRID */
.projet-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* MASONRY (CSS columns) */
.projet-gallery-masonry {
  column-count: 3;
  column-gap: 12px;
}

.projet-gallery-masonry .projet-gallery-item {
  display: inline-block;
  width: 100%;
  margin: 0 0 12px;
  break-inside: avoid;
}

/* item common */
.projet-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.infos-projet {
  background-color: #f7f7f7;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.infos-projet p {
  margin: 0.3em 0;
}

.projet-gallery {
  display: grid;
  gap: 10px;
}

.projet-gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.projet-gallery-masonry {
  column-count: 3;
  column-gap: 10px;
}

.projet-gallery-masonry .projet-gallery-item {
  break-inside: avoid;
  margin-bottom: 10px;
}

.projet-gallery img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* Éditeur Gutenberg */
.projets-gallery-editor {
  padding: 20px;
  background: #f9f9f9;
  border-radius: 4px;
}

.projet-item-editor {
  transition: all 0.2s ease;
}

.projet-item-editor:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.projets-gallery-loading,
.projets-gallery-empty {
  padding: 60px 20px;
  text-align: center;
  background: #f9f9f9;
  border: 2px dashed #ddd;
  border-radius: 8px;
}

.projets-gallery-empty p {
  color: #666;
  font-size: 14px;
}

/* Front-end */
.projets-gallery {
  display: grid;
  gap: 30px;
  padding: 20px 0;
}

.projets-gallery[data-columns="1"] {
  grid-template-columns: 1fr;
}

.projets-gallery[data-columns="2"] {
  grid-template-columns: repeat(2, 1fr);
}

.projets-gallery[data-columns="3"] {
  grid-template-columns: repeat(3, 1fr);
}

.projets-gallery[data-columns="4"] {
  grid-template-columns: repeat(4, 1fr);
}

.projets-gallery[data-columns="5"] {
  grid-template-columns: repeat(5, 1fr);
}

.projets-gallery[data-columns="6"] {
  grid-template-columns: repeat(6, 1fr);
}

.projet-item {
  position: relative;
  overflow: hidden;
  border-radius: 0px;
  height: 500px;
}

.projet-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.projet-thumbnail {
  width: 100%;
  height: 300px;
  overflow: hidden;
  background: #f0f0f0;
  position: relative;
}

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

.projet-item:hover .projet-thumbnail img {
  transform: scale(1.08);
}

.projet-title {
  padding: 20px;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  background: #fff;
  transition: color 0.3s ease;
}

.projet-item:hover .projet-title {
  color: #0073aa;
}

/* Projet sans image */
.projet-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

.projet-no-image span {
  font-size: 48px;
  opacity: 0.3;
}

/* Messages d'état */
.projets-gallery-notice,
.projets-gallery-empty {
  margin: 20px 0;
}

/* Responsive */
@media (max-width: 1200px) {

  .projets-gallery[data-columns="5"],
  .projets-gallery[data-columns="6"] {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (max-width: 1024px) {

  .projets-gallery[data-columns="4"],
  .projets-gallery[data-columns="5"],
  .projets-gallery[data-columns="6"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 768px) {

  .projets-gallery[data-columns="3"],
  .projets-gallery[data-columns="4"],
  .projets-gallery[data-columns="5"],
  .projets-gallery[data-columns="6"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .projet-thumbnail {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .projets-gallery {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .projet-thumbnail {
    height: 250px;
  }
}

/* Grille des projets */
.wp-block-kozto-projets-gallery .projets-gallery {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  padding: 0;
  list-style: none;
  margin: 0;
}

/* Style de chaque projet */
.wp-block-kozto-projets-gallery .projet-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  height: 500px;
  width: 500px;
  object-fit: cover;
}

/* Image du projet */
.wp-block-kozto-projets-gallery .projet-item img {
  height: 500px;
  width: 500px;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  display: block;
}

/* Titre du projet (masqué par défaut) */
.wp-block-kozto-projets-gallery .projet-item h3 {
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  padding: 15px;
  margin: 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  font-size: 16px;
  text-align: center;
}

/* Effet au survol */
.wp-block-kozto-projets-gallery .projet-item:hover {
  transform: scale(1.02);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.wp-block-kozto-projets-gallery .projet-item:hover img {
  opacity: 0.7;
}

.wp-block-kozto-projets-gallery .projet-item:hover h3 {
  transform: translateY(0);
}

.kozto-projet-gallery p {
  display: none;
  margin: 0;
  padding: 0;
}

.featured-image-overlay-wrapper {
  position: relative;
  display: inline-block;
}

.featured-image-overlay-wrapper img {
  display: block;
  width: 100%;
  height: auto;
}

.featured-image-overlay-wrapper .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  text-align: center;
  transition: 0.3s ease;
}

.kozto-projet-gallery-media br {
  display: none;
}


/* HEADER fixé - ancien mode difference commenté pour utiliser le système automatique d'inversion */
.is-fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: transparent !important;
  /* mix-blend-mode: difference ; */
  isolation: isolate;
}

/* Logo - gestion automatique par JS
.is-fixed-header img {
  filter: invert(1) !important;
  mix-blend-mode: difference;
}
*/

/* Navigation WORDPRESS - gestion automatique par JS
.is-fixed-header .wp-block-navigation a {
  color: #fff !important;
  mix-blend-mode: difference;
}
*/

/* Contenu du responsive container - gestion automatique par JS */
/* .is-fixed-header .wp-block-navigation__responsive-container-content a {
  color: #fff !important;
} */

/* Navigation des filtres projets - gestion automatique par JS */
/* .is-fixed-header .kozto-filters-nav-shortcode a {
  color: #fff !important;
} */

/* Bouton burger - gestion automatique par JS */
/* .is-fixed-header .wp-block-navigation__responsive-container-open svg rect {
  fill: #fff !important;
} */

/* Icône de fermeture - gestion automatique par JS */
/* .is-fixed-header .wp-block-navigation__responsive-container-close svg path {
  stroke: #fff !important;
  fill: #fff !important;
}








/* Style général du figure */
.wp-block-post-featured-image {
  position: relative;
  overflow: hidden;
  /* Pour que l'overlay ne dépasse pas */
  cursor: pointer;
}

/* L'overlay : caché par défaut */
.featured-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  /* overlay blanc semi-transparent */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  /* caché */
  transition: opacity 0.3s ease;
}

/* Titre au centre de l'overlay */
.overlay-title {
  color: #000;
  /* couleur du texte */
  font-size: 24px;
  text-align: center;
  margin: 0;
}

/* Au hover sur la figure, afficher l'overlay */
.wp-block-post-featured-image:hover .featured-image-overlay {
  opacity: 1;
}




.projets-filters ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 10px;
}

.projets-filters li a {
  text-decoration: none;
  padding: 5px 10px;
}


.projets-list article {
  margin-bottom: 20px;
  padding: 10px;
  border-radius: 4px;
}


@media (max-width: 640px) {

  .entry-content {
    /* margin-top: 7vh !important; */
    /* margin-top: var(--wp--preset--spacing--70);
    margin-bottom: var(--wp--preset--spacing--70);
    margin-left: var(--wp--preset--spacing--70) !important;
    margin-right: var(--wp--preset--spacing--70) !important */
  }

}

.wp-block-navigation.is-layout-flex {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5rem !important;
  /* <-- espace entre les liens */
}




.kozto-filters-nav {
  /* position: sticky !important; */
  /* top: 13vh; */
  z-index: 100;
  /* background-color: #fff; */
  padding-bottom: 20px;
  transition: box-shadow 0.3s ease;
  /* Alignement avec le logo - compense la différence entre spacing-80 du conteneur et spacing-70 du header */
  margin-left: calc(var(--wp--preset--spacing--70) - var(--wp--preset--spacing--80));
}

.kozto-filters-nav-shortcode {
  margin-bottom: 20px;
}

.kozto-filters-nav-shortcode ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.kozto-filters-nav-shortcode li {
  margin: 0;
}

.kozto-filters-nav-shortcode a {
  display: inline-block;
  text-decoration: none;
  color: #000000ff;
  font-family: var(--wp--preset--font-family--ibm-plex-sans-condensed, sans-serif);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Override pour les filtres dans le header fixe - gestion automatique par JS */
/* .is-fixed-header .kozto-filters-nav-shortcode a {
  color: white !important;
} */

.kozto-filters-nav-shortcode a:hover {
  /* color: #000; */ /* Géré par JS pour adaptation au fond */
  text-decoration: underline;
}

.kozto-filters-nav-shortcode a.active {
  text-decoration: underline;
}

@media (max-width: 782px) {
  .kozto-filters-nav {
    z-index: 10;
  }
}


/* Supprimer la bordure au clic (état :active) sur les liens de navigation */
li.wp-social-link a:hover,
li.wp-social-link a:focus,
.wp-block-navigation-item__content:hover,
.wp-block-navigation-item__content:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  /* Ajoute d'autres propriétés si nécessaire pour réinitialiser le style */
  opacity: 1 !important;
  transform: none !important;
  background: transparent !important;
  color: inherit !important;
}


/* Correction affichage texte page Contact - supprime les styles flex de WordPress */
.has-small-font-size.is-layout-flex,
.has-small-font-size.wp-block-group-is-layout-flex {
  display: block !important;
  flex-direction: unset !important;
  gap: 0 !important;
}

/* Assure que les paragraphes avec nowrap n'utilisent pas flex */
p.is-nowrap {
  white-space: normal !important;
  display: block !important;
}

/* Harmoniser l'espacement entre le header et le contenu sur la page filtrée avec la page projets */
/* Cibler uniquement la page filtrée en utilisant la classe du wrapper du shortcode */
.wp-block-group.is-layout-flow:has(.kozto-filtered-grid-wrapper) {
  padding-top: var(--wp--preset--spacing--80) !important;
}

/* Supprimer le margin-block-start sur la page filtrée pour éviter l'espacement indésirable */
.wp-block-group.is-layout-flow:has(.kozto-filtered-grid-wrapper)>* {
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
}

@media screen and (max-width: 768px) {

  /* Page d'accueil */
  .home {
    /* margin-left: calc(var(--wp--preset--spacing--60) - var(--wp--preset--spacing--70)) !important;
    margin-right: calc(var(--wp--preset--spacing--60) - var(--wp--preset--spacing--70)) !important; */
  }

  /* Navigation des filtres */
  .kozto-filters-nav {
    margin-left: 0 !important;
  }

}