/*
Theme Name: Alès en Commun
Theme URI: https://raphaelbergere.art
Author: Raphaël Bergère
Author URI: https://www.raphaelbergere.art
Description: Vive Alès en Commun !
Version: 1
Requires at least: 5.0
Tested up to: 5.4
Requires PHP: 7.0
License: No
License URI:
*/

/* =============================================================================
   Variables & Base
   ============================================================================= */

:root {
  --background-color: #f5f5f5;
  --text-color: #393837;
  --header-bg-light: white;
  --header-bg-dark: #1e1c1ad9;
  --darkgreen: #5d8883;
  --lightgreen: #8ec3b1;
  --violet: #929ac0;
  --darkviolet: #525f9e;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--text-color);
  font-family: "Poppins", Tahoma, Verdana, sans-serif;
}

/* body.home {
  max-height: 100vh;
} */

p {
  margin: 0 0 15px 0;
  line-height: 1.2;
}

.pagecontent {
  min-height: 70vh;
  padding: 120px 100px 150px 50px;
  font-size: 1.1rem;
  background: #fff2ea;
}

.page-wrapper {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.content-wrapper {
  flex: 1;
  min-width: 0;
  max-width: 1000px;
  padding-left: 400px;
}

.pagecontent p,
.pagecontent li {
  max-width: 800px;
}

h1 {
  font-family: "Birmingham", Tahoma, Verdana, sans-serif;
  /* text-decoration: underline; */
  font-weight: 600;
  padding: 30px 0;
  margin: 20px 0 20px 0;
  font-size: 2em;
  color: var(--darkgreen);
  font-size: 3rem;
  line-height: 1;
}

h1::first-letter {
  font-family: "Birmingham Titling Bold", Tahoma, Verdana, sans-serif;
  font-size: 5rem;
}

h2 {
  font-family: "Poppins", Tahoma, Verdana, sans-serif;
  font-size: 1.5rem;
  line-height: 1;
  padding-top: 30px;
  font-weight: bold;
}

.article h2 {
  margin-top: 50px;
  margin-bottom: 20px;
}

a {
  font-family: "Poppins", Tahoma, Verdana, sans-serif;
}

strong {
  color: var(--darkviolet);
}

.home strong {
  color: var(--darkviolet);
}

.home.darkmode strong {
  color: var(--violet);
}

button {
  cursor: pointer;
  background: #393837;
  color: white;
  min-width: 70px;
  min-height: 30px;
  border: 1px solid black;
  border-radius: 5px;
}

/* =============================================================================
   Header & Menu
   ============================================================================= */

/* header {
  position: fixed;
  top: 0;
  left: 0;
  height: fit-content;
  min-width: 450px;
  display: flex;
  justify-content: left;
  background: var(--header-bg-color);
  z-index: 998;
} */

.logo {
  margin: 50px 50px 0 50px;
}

.logo img {
  max-width: 200px;
}

.headercontent {
  width: 320px;
  display: flex;
  flex-direction: column;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  height: fit-content;
  min-width: 100%;
  display: flex;
  justify-content: left;
  z-index: 998;
}

.home header {
  position: relative;
}

.home header nav {
  display: none;
}

.home .headercontent {
  flex-direction: column;
}

.headercontent {
  width: 100%;
  display: flex;
  flex-direction: row-reverse;
}

.page .headercontent,
.single .headercontent {
  justify-content: flex-end;
  align-items: center;
  gap: 80px;
}

.logo {
  margin: 10px 10px 10px 50px;
}

.home .logo {
  margin: 50px auto 0px auto;
}

.logo img {
  max-width: 150px;
}

.home .logo img {
  max-width: 350px;
}

.menu {
  max-width: 100%;
  font-size: 1rem;
  font-weight: 400;
  font-family: "Poppins", Tahoma, Verdana, sans-serif;
  margin: 0;
  padding-top: 0;
  line-height: 1;
}

.home .menu {
  padding-top: 50px;
  margin: auto;
}

.menu ul {
  display: flex;
  flex-direction: row;
  gap: 50px;
  list-style-type: none;
  text-transform: uppercase;
  margin: 0 0 0 10px;
  padding: 0;
}

.menu a {
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 1.2px;
  /* border: 2px solid var(--violet); */
  border-radius: 20px;
}

.menu ul li a {
  cursor: pointer;
  color: white !important;
  font-weight: 600;
  font-family: "Poppins", Tahoma, Verdana, sans-serif;
  transition: all 0.5s ease-in-out;
  position: relative;
}

.menu ul li a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.5s ease;
}

.menu ul li a:hover::after {
  width: 100%;
}

.home .menu ul li a {
  color: var(--darkgreen) !important;
}

.home .menu ul li a.darkmode {
  color: var(--lightgreen) !important;
}

.home .menu ul li a:hover {
  color: var(--violet) !important;
  transition: all 0.2s ease-in-out;
}

.menu ul li.current-menu-item a::after {
  width: 100%;
}

/* =============================================================================
   Burger Menu
   ============================================================================= */

.nav-toggler {
  display: none;
  position: fixed;
  z-index: 999;
  top: 25px;
  right: 25px;
  height: 40px;
  width: 40px;
  border: none;
  outline: none;
  cursor: pointer;
  justify-content: center;
  align-items: center;
  border-radius: 2px;
  background: white;
}

.burgerline {
  position: absolute;
  display: block;
  width: 70%;
  height: 3px;
  background: var(--darkgreen);
  transition:
    transform 0.3s ease-out,
    opacity 0.1s ease-out;
}

.l1 {
  transform: translateY(-10px);
}

.l3 {
  transform: translateY(10px);
}

.nav-toggler.active .l1 {
  transform: translateY(0px) rotate(135deg);
}

.nav-toggler.active .l2 {
  opacity: 0;
}

.nav-toggler.active .l3 {
  transform: translateY(0px) rotate(-135deg);
}

/* =============================================================================
   Content Pages
   ============================================================================= */

/* Home page menu styles */

.homecontent {
  position: relative;
  padding: 50px 50px 250px 50px;
  overflow: hidden;
}

.homecontent .back {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  object-fit: cover !important;
  z-index: -1 !important;
  pointer-events: none !important;
  opacity: 0.2;
  transition: opacity 1.5s ease-in-out !important;
}

.homecontent .back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logos-partis .wp-block-group__inner-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
}

.logos-partis .wp-block-group__inner-container figure {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logos-partis .wp-block-group__inner-container img {
  height: 100%;
  max-height: 77px;
  object-fit: cover;
}

.homecontent p {
  text-align: center;
  color: var(--darkgreen);
  font-weight: 400;
  font-size: 1.3rem;
  margin-bottom: 30px;
}

.homecontent p.home.darkmode {
  color: var(--lightgreen);
}

.home-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  row-gap: 10px;
  column-gap: 20px;
  margin-top: 20px;
}

.home-cta a {
  font-weight: 600;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--darkviolet);
  background: rgba(255, 255, 255, 0.1);
  padding: 15px 25px;
  border: 2px solid var(--darkviolet);
  border-radius: 25px;
  transition: all 0.3s ease-in-out;
}

.home-cta a:hover {
  color: white;
  background: var(--darkviolet);
  border: 2px solid var(--darkviolet);
  transition: all 0.3s ease-in-out;
}

/* Vidéo d'arrière-plan */
.homecontent .wp-video-shortcode {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: -1 !important;
  display: block !important;
}

/* Classe pour cacher les vidéos inactives */
.homecontent video.video-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Vidéos complètement cachées (pas encore initialisées) */
.homecontent video.video-none {
  display: none !important;
}

/* Masquer uniquement les contrôles MediaElement.js */
.homecontent .mejs-container {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: -1 !important;
  display: block !important;
}

.homecontent .mejs-controls,
.homecontent .mejs-overlay,
.homecontent .mejs-overlay-play,
.homecontent .mejs-overlay-button {
  display: none !important;
  visibility: hidden !important;
}

/* Assurer que le contenu textuel soit visible au-dessus de la vidéo */
.homecontent
  > *:not(video):not(.wp-video):not(.wp-video-shortcode):not(.mejs-container) {
  position: relative;
  z-index: 1;
}

.oeuvrecontent {
  margin: 0;
  padding: 50px 50px 20px 300px;
  width: 100%;
  overflow-y: hidden;
  overflow-x: hidden;
  color: var(--text-color) !important;
  text-align: left;
}

.content-wrapper a {
  color: var(--darkviolet);
}

.mgl-gallery {
  margin: 30px 0 !important;
}

.mgl-gallery {
  margin: 30px 0 !important;
}

.wp-block-gallery {
  margin: 30px 0 !important;
}

/* =============================================================================
   Scroll Index (Menu de navigation dynamique)
   ============================================================================= */

.scroll-index {
  position: fixed;
  top: 140px;
  max-width: 370px;
  flex-shrink: 0;
  border-radius: 10px;
  z-index: 900;
  align-self: flex-start;
}

.scroll-index h3 {
  margin: 0 0 15px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--darkgreen);
  text-transform: uppercase;
  border-bottom: 2px solid var(--lightgreen);
  padding-bottom: 10px;
}

.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.index-link {
  display: block;
  text-decoration: none;
  color: #686868;
  font-size: 1rem;
  padding: 8px 30px 8px 12px;
  border-radius: 5px;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  position: relative;
  text-transform: uppercase;
}

.index-link:hover {
  /* background: rgba(142, 195, 177, 0.1);
  border-left-color: var(--lightgreen); */
  /* padding-left: 15px; */
  color: var(--darkviolet);
}

.index-link.active {
  font-weight: 600;
  color: var(--darkgreen);
  font-weight: 800;
}

.index-link.active::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--darkgreen);
  border-radius: 50%;
}

.team {
  justify-content: space-evenly;
  font-size: 1rem !important;
}

.team h2 {
  font-family: "Birmingham Titling Bold", Tahoma, Verdana, sans-serif;
  font-size: 1.7rem;
  padding: 0;
  color: var(--darkviolet);
}

.team img {
  border: 2px solid var(--darkviolet);
}

.single .content-wrapper {
  max-width: none;
  display: flex;
  flex-direction: row;
  gap: 50px;
  align-items: flex-start;
}

.single .main-content {
  flex: 2;
  min-width: 0;
}

.single .side-panel {
  flex: 1;
  min-width: 0;
  max-width: 350px;
  position: sticky;
  top: 120px;
  background: var(--darkviolet);
  border-radius: 10px;
  padding: 20px;
  min-height: 200px;
  max-height: calc(100vh - 60px);
  align-self: flex-start;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  color: white;
}

.single .side-panel h3 {
  font-size: 2em;
  color: white;
  margin: 0 0 20px 0;
}

.single .side-panel strong {
  color: white;
}

.single .side-panel p {
  font-size: 1em;
  color: rgba(255, 255, 255, 0.9);
}

.single .side-panel a {
  color: var(--lightgreen);
}

.single h3 {
  margin-top: 40px;
}

.button-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  padding: 0;
  margin: 40px 0;
  list-style-type: none;
  gap: 10px;
}

.button-list a {
  padding: 10px 15px;
  background: transparent;
  border: 2px solid var(--darkgreen);
  color: var(--darkgreen);
  border-radius: 15px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease-in-out;
}
.button-list a:hover {
  background: var(--darkgreen);
  color: white;
}

.side-panel .button-list {
  justify-content: center;
}

.side-panel .button-list a {
  color: white;
  border: 2px solid white;
}

/* =============================================================================
   H1 bis - Version noire du H1
   ============================================================================= */

.h1-bis {
  font-family: "Birmingham", Tahoma, Verdana, sans-serif;
  /* text-decoration: underline; */
  font-weight: 600;
  padding: 30px 0;
  font-size: 2em;
  color: var(--darkgreen);
}

.h1-bis::first-letter {
  font-family: "Birmingham Titling Bold", Tahoma, Verdana, sans-serif;
  font-size: 4.5rem;
}

.page .ateliers h1 {
  font-family: "Poppins", Tahoma, Verdana, sans-serif !important;
  font-size: 2rem !important;
  color: var(--text-color);
}

.page .ateliers h1::first-letter {
  font-family: "Poppins", Tahoma, Verdana, sans-serif !important;
  font-size: 2rem !important;
}

/* =============================================================================
   Ateliers Grid
   ============================================================================= */

.ateliers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.atelier-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.atelier-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-image {
  width: 100%;
  height: 250px;
  overflow: hidden;
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.atelier-card:hover .card-image img {
  transform: scale(1.05);
}

.card-content {
  padding: 25px;
}

.card-title {
  font-family: "Birmingham Titling", Tahoma, Verdana, sans-serif;
  font-size: 1.5rem;
  color: var(--darkgreen);
  margin: 0 0 15px 0 !important;
  padding: 0 !important;
  line-height: 1.3;
}

.card-excerpt {
  color: var(--text-color);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 15px;
}

.card-excerpt p {
  margin: 0;
}

.card-more {
  color: var(--darkgreen);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-block;
  transition: color 0.3s ease;
}

.atelier-card:hover .card-more {
  color: var(--lightgreen);
}

@media (max-width: 900px) {
  .ateliers-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* =============================================================================
   Footer
   ============================================================================= */

footer {
  position: absolute;
  margin: 0;
  bottom: 0;
  left: 0;
  width: auto;
  width: 100vw;
  display: flex;
  flex-direction: row;
  align-items: end;
  justify-content: space-between;
  padding: 10px 40px 30px 40px;
  color: #63908b;
  z-index: 999;
  box-sizing: border-box;
}

.legal {
  text-align: left;
  font-size: 0.7rem;
}

.socialcontact {
  display: flex;
  gap: 10px;
  margin-bottom: 7px;
}

.socialcontact img {
  max-height: 30px;
  opacity: 1;
  scale: 1;
  transition: all 0.5s;
}

.socialcontact img:hover {
  opacity: 0.5;
  scale: 1;
  transition: all 0.5s;
}

.pagecontent .socialcontact img {
  max-height: 50px;
  opacity: 0.9;
  transition: all 0.5s;
}

.mentions {
  font-size: 0.7rem;
  margin-top: 10px;
}

.politique {
  font-size: 0.7rem;
}

.politique a {
  color: #63908b;
}

.mentions a {
  color: #63908b;
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 1700px) {
  .home {
    position: relative;
    max-height: none;
    overflow: scroll;
  }
  body.home {
    max-height: none;
    overflow: scroll;
  }
  /* .menu {
    min-width: 250px;
    max-width: 250px;
  } */
  .homecontent {
    height: auto;
  }
  .pagecontent {
    /* padding: 50px 50px 50px 350px; */
    font-size: 1rem;
  }
  h1 {
    font-size: 2rem;
  }
}

/* BURGURISATION*/

@media (max-width: 1500px) {
  header {
    position: absolute !important;
    height: fit-content !important;
    min-width: 0;
  }

  header {
    position: relative !important;
  }

  .menu ul {
    flex-direction: column;
    gap: 35px;
  }

  .menu ul li a {
    color: var(--darkgreen) !important;
    font-size: 1.1rem;
  }

  .headercontent {
    width: 100%;
  }

  .logo {
    margin: 10px 30px;
  }

  .headercontent img {
    max-height: 150px;
    margin: 0;
  }

  .home .headercontent img {
    max-height: 300px;
    margin: 0;
  }

  .home .logo {
    display: block;
    margin: 80px auto 70px auto;
    text-align: center;
  }

  /* Cache le burger menu uniquement sur la page d'accueil en version desktop */
  /* Retiré: .home .nav-toggler { display: none !important; } */

  /* Affiche le burger menu sur toutes les pages en mobile */
  .nav-toggler {
    display: flex;
  }

  .pagecontent {
    padding: 30px;
    font-size: 0.9rem;
  }

  .scroll-index {
    top: 50px;
  }

  /* Menu burger pour toutes les pages (y compris front-page) */
  .menu {
    position: fixed;
    flex-direction: column;
    margin: 0;
    display: flex;
    top: 0;
    right: 0;
    min-width: 350px;
    height: 100vh;
    background: white;
    border-left: 1px solid #353535;
    z-index: 10;
    transition: transform 0.5s ease-in-out;
    transform: translateX(100%);
    padding: 70px 0 20px 30px;
  }

  .menu.active {
    transform: translate(0);
  }

  .single .content-wrapper {
    flex-direction: column;
    gap: 0;
  }

  .single .side-panel {
    max-width: none;
  }
}

@media (max-width: 1200px) {
  /* Masquer l'index de navigation en dessous de 1200px */
  .scroll-index {
    display: none;
  }

  .content-wrapper {
    padding-left: 0;
  }

  .home footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
  }

  footer {
    position: relative;
    flex-direction: column;
    padding: 30px 30px 70px 30px !important;
    align-items: center !important;
    max-width: none;
    box-sizing: border-box;
  }

  footer .legal {
    font-size: 0.7rem;
    text-align: center;
  }
}

@media (max-width: 650px) {
  h1 {
    font-size: 2rem;
  }
  h1::first-letter {
    font-size: 3rem;
  }
  .home .logo {
    margin: 80px auto 30px auto;
    text-align: center;
  }

  .home .logo img {
    max-width: 270px;
  }

  .homecontent p {
    font-size: 1.2rem;
  }

  .home-cta {
    flex-direction: column;
    max-width: fit-content;
    align-items: center;
    margin: auto;
  }

  .pagecontent {
    font-size: 0.9rem;
  }
}
