/* ===========================================================
   VARIABLES PRINCIPALES
=========================================================== */
:root {
  --bg: #f7f7f7;
  --text: #222;
  --accent: #6C5CE7;

  --card: #ffffff;
  --card-rgb: 255,255,255;
  --card-alpha: 0.9;

  --menu-rgb: 255,255,255;
  --menu-alpha: 1;

  --hero-bg-transparency: 1;
}

/* Reset */
body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
}



/* ===========================================================
   SIDEBAR (DESKTOP)
=========================================================== */
.sidebar {
  width: 260px;
  height: 100vh;
  left: 0;
  position: fixed;
  background: rgba(var(--menu-rgb), var(--menu-alpha));
  backdrop-filter: blur(12px);
  border-right: none !important;
  padding: 40px 20px;
  box-sizing: border-box;
  z-index: 1000;
  transition: transform .25s ease;
}

.sidebar .logo {
  text-align: center;
  margin-bottom: 40px;
}

.sidebar .logo img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 10px;
}

.sidebar nav a {
  display: block;
  padding: 12px 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.sidebar nav a:hover {
  color: var(--accent);
}

/* ===========================================================
   PAGE CONTENT
=========================================================== */
section {
  margin-left: 320px;
  padding: 60px 10vw;
  margin-bottom: 40px;
}

h1, h2, h3, h4 {
  margin-top: 0;
  color: var(--title);
  font-weight: 700;
}

.btn {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 28px;
  background: var(--accent);
  color: var(--text) !important;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: 0.25s ease;
}

.btn:hover {
  color: white !important;
  background: var(--accent);
  opacity: 0.85;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
}

/* ===============================
   GLASS CARD — BASE GLOBALE
================================ */
.cv-item,
.cv-exp-card,
.blog-card,
.hours-card,
.social-item,
.preview-card,
.card,
.hero-inner {
  background: rgba(var(--card-rgb), var(--card-alpha));
  backdrop-filter: blur(6px);
}

/* ===========================================================
   HERO SECTION (DESKTOP)
=========================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 80px 10vw;
  margin-left: 260px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  background-image: var(--hero-bg-image, none);
  background-size: cover;
  background-position: center;
  overflow-x: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255, calc(1 - var(--hero-bg-transparency)));
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-inner {
  max-width: 640px;
  margin: 0 auto;
  background: rgba(var(--card-rgb), var(--card-alpha));
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.10);
  backdrop-filter: blur(6px);
  text-align: center;
}

/* =======================================
   HERO – Ajustement hauteur DESKTOP
======================================= */
@media (min-width: 769px) {
    .hero-inner {
        transform: translateY(-40px); /* ajuste la valeur si besoin */
    }
}

.hero-inner h1 {
  font-size: 3rem;
  margin-bottom: 12px;
}

.hero-inner p {
  font-size: 1.15rem;
  margin-bottom: 20px;
}

/* Avatar mobile caché desktop */
.mobile-only {
  display: none;
}

/* ===========================================================
   HERO — VERSION MOBILE (OPTION B)
   FULLSCREEN + AVATAR
=========================================================== */
@media (max-width: 768px) {

  .hero {
      width: 100% !important;
      margin: 0 !important;
      padding: 0 !important;        /* IMPORTANT : plus de padding horizontal */
      height: 100svh !important;
      min-height: 100svh !important;


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

      overflow: hidden !important;  /* empêche tout décalage horizontal */
      text-align: center;
      box-sizing: border-box;
  }

  .mobile-only {
      width: 100%;                /* empêche dépassement */
      display: flex !important;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      margin-bottom: 16px;
  }

  .mobile-hero-avatar img {
      width: 120px;
      height: 120px;
      object-fit: cover;
      border-radius: 50%;
      display: block;
  }

  .hero-inner {
      width: 85% !important;        /* Jamais trop large */
      max-width: 320px !important;  /* Jamais trop large */
      padding: 18px 16px !important;
      border-radius: 14px !important;
      margin: 0 auto !important;    /* CENTRAGE HORIZONTAL CERTAIN */
      text-align: center;
      box-sizing: border-box;
  }

  .hero-inner h1 {
      font-size: 1.6rem !important;
      margin-bottom: 10px;
  }

  .hero-inner p {
      font-size: 0.95rem !important;
      line-height: 1.4;
  }


}

/* ===========================================================
   ABOUT
=========================================================== */
.about p {
  font-size: 1.15rem;
  line-height: 1.6;
  max-width: 820px;
}

/* ===========================================================
   CV
=========================================================== */
.cv-section { margin-bottom: 60px; }

.cv-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cv-item {
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.04);
}

.cv-item-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cv-item-role { font-weight: 600; }
.cv-item-dates { font-size: 0.85rem; text-align: right; }

/* ===========================================================
   SERVICES
=========================================================== */
.services .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

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

  .services .service {
    width: 100%;
    box-sizing: border-box;
  }
}

/* ===========================================================
   PORTFOLIO
=========================================================== */
.portfolio .grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.portfolio-img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  object-fit: contain; /* 👈 IMPORTANT */
  background: #f0f0f0; /* optionnel */
}

/* FULLSCREEN modal */
.portfolio-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.close-modal {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 42px;
  background: rgba(0,0,0,0.4);
  color: white;
  width: 48px; height: 48px;
  border-radius: 50%;
  display:flex;align-items:center;justify-content:center;
}

/* ===========================================================
   MENU MOBILE — TON ANCIEN BOUTON
=========================================================== */

/* Bouton hamburger */
.menu-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 2000 !important;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(var(--menu-rgb), var(--menu-alpha));
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.menu-toggle .icon,
.menu-toggle .icon::before,
.menu-toggle .icon::after {
  background: var(--text);
}

.menu-toggle .icon {
  position: relative;
  width: 22px;
  height: 2px;
  transition: background 0.2s ease;
}

.menu-toggle .icon::before,
.menu-toggle .icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  transition: transform 0.25s, top 0.25s;
}

.menu-toggle .icon::before { top: -6px; }
.menu-toggle .icon::after  { top: 6px; }

.menu-toggle.is-open .icon {
  background: transparent;
}

.menu-toggle.is-open .icon::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle.is-open .icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 900;
}

.sidebar-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar mobile state */
@media (max-width: 768px) {

  .menu-toggle {
    display: flex !important;
  }

  .sidebar {
    transform: translateX(-100%) !important;
    max-width: 260px;
        width: 260px !important;
  }

  .sidebar.sidebar--open {
    transform: translateX(0) !important;
  }

  section {
    margin-left: 0 !important;
    padding: 40px 16px !important;
  }
}

/* ===========================================================
   Alert
=========================================================== */
.alert-success {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #2ecc71;
  color: white;
  padding: 14px 22px;
  border-radius: 8px;
  animation: fadeInOut 4s ease forwards;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* Desktop → reste dans la sidebar */
.sidebar-adherents-btn {
    position: absolute;
    bottom: 12px;
    left: 12px;

    width: 22px;
    height: 22px;

    display: block;
    padding: 0;
    margin: 0;

    transition: transform 0.25s ease, opacity 0.25s ease;
}

.sidebar-adherents-btn img {
    width: 100%;
    height: 100%;
    opacity: 0.8;
    transition: opacity 0.25s ease;
}

.sidebar-adherents-btn:hover {
    transform: translateY(-2px) scale(1.08);
}

.sidebar-adherents-btn:hover img {
    opacity: 1;
}

/* 🔥 MOBILE : bouton totalement indépendant du menu */
@media (max-width: 768px) {
    .sidebar-adherents-btn {
        position: fixed !important;
        bottom: 20px !important;
        left: 20px !important;

        /* au-dessus de la sidebar mobile fermée OU ouverte */
        z-index: 6000 !important;

        /* empêcher qu'il soit limité à la zone scrollable */
        transform: none !important;
    }

    /* S'assurer que la sidebar ne recouvre pas le bouton */
    .sidebar.sidebar--open ~ .sidebar-adherents-btn {
        left: 280px !important; /* on décale un peu pour qu’il reste visible quand le menu est ouvert */
    }
  }  


/* ===========================================================
   SOCIAL ICONS (TAILLE FIXE)
=========================================================== */
.social-item img {
  width: 18px !important;
  height: 18px !important;
  object-fit: contain;
}

.social-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.social-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: transform .2s ease, box-shadow .2s ease;
}

.social-item img {
  width: 18px;
  height: 18px;
}

.social-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

.socials {
  margin-top: 60px;
}

.socials h2 {
  margin-bottom: 12px;
}

/* ===========================================================
   HORAIRES
=========================================================== */

.hours {
  max-width: 820px;
}

.hours-card {
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.06);
}

.hours-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.hours-row:last-child {
  border-bottom: none;
}

.hours-day {
  font-weight: 600;
}

.hours-time {
  font-weight: 500;
}

.hours-closed {
  color: var(--muted);
  font-style: italic;
}

/* IMAGE DANS LE MODAL */
#portfolioModalImg {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: zoomIn 0.25s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.portfolio-img {
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.portfolio-img:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

/* ===============================
   BLOG SECTION
================================ */
.blog-section {
  padding: 60px 20px;
}

.blog-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(4, 1fr);
}

.blog-card {
  border-radius: 14px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.blog-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.blog-card h3 {
  font-size: 16px;
  margin: 12px;
}

.blog-date {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 12px 12px;
}

.blog-excerpt {
  font-size: 14px;
  color: var(--muted);
  margin: 8px 12px 12px;
  line-height: 1.5;
}

.blog-card a {
  text-decoration: none;
  color: inherit;
}

.blog-card h3,
.blog-card p,
.blog-card span {
  color: var(--text);
}

.blog-image-link {
  display: block;
}

/* ===============================
   MOBILE → 2 ARTICLES
================================ */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-card:nth-child(n+3) {
    display: none;
  }
}


/* ===============================
   SERVICES / COMPÉTENCES — CASCADE
================================ */
.services .service {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
  transition-delay: var(--delay, 0s);
}

.services .service.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
  .services .service {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}