/* ============================================================
   KMG Méditerranée - Styles globaux
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  background: #13110C;
  overflow-x: hidden;
}
body {
  background: #13110C;
  color: #F4EFE3;
  font-family: 'Archivo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
::selection { background: #E27C1B; color: #13110C; }

/* ---- Animations ---- */
@keyframes kmgGlow { 0%, 100% { opacity: .5; } 50% { opacity: .85; } }
@keyframes kmgPop  { 0% { transform: scale(.8); opacity: 0; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }

/* ---- Cards ---- */
.kmg-card { transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .35s, box-shadow .35s; }
.kmg-card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(0,0,0,.45); }
.kmg-card:hover { border-color: rgba(226,124,27,.5) !important; }
.kmg-card:hover .kmg-photo { transform: scale(1.05); }
.kmg-photo { transition: transform .5s cubic-bezier(.2,.7,.2,1); }

/* ---- Choice buttons (contact rapide) ---- */
.kmg-choice { transition: transform .3s cubic-bezier(.2,.7,.2,1), border-color .3s; }
.kmg-choice:hover { transform: translateY(-4px); border-color: rgba(226,124,27,.5) !important; }

/* ---- Scroll reveal ---- */
.kmg-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.kmg-reveal.kmg-in { opacity: 1; transform: translateY(0); }

/* ---- Form fields ---- */
.kmg-field {
  width: 100%;
  background: #13110C;
  border: 1px solid rgba(239,205,142,.16);
  border-radius: 12px;
  color: #F4EFE3;
  font-family: 'Archivo', sans-serif;
  font-size: 15.5px;
  padding: 14px 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.kmg-field::placeholder { color: #6F6857; }
.kmg-field:focus { border-color: #E27C1B; box-shadow: 0 0 0 3px rgba(226,124,27,.16); }
textarea.kmg-field { resize: vertical; min-height: 120px; line-height: 1.5; }
select.kmg-field {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23E27C1B' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 42px;
  cursor: pointer;
}

/* ---- Hamburger ---- */
.kmg-burger {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  background: #0F0D09;
  border: 1px solid rgba(239,205,142,.22);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}
.kmg-burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #EFCD8E;
  border-radius: 2px;
  transition: all .3s;
}
.kmg-burger.kmg-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.kmg-burger.kmg-open span:nth-child(2) { opacity: 0; }
.kmg-burger.kmg-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Overlay mobile ---- */
.kmg-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,11,8,.72);
  z-index: 40;
  backdrop-filter: blur(3px);
}
.kmg-overlay.kmg-open { display: block; }

/* ---- Sidebar nav active state ---- */
.kmg-nav-link.kmg-nav-active {
  background: rgba(239,205,142,.92) !important;
  color: #13110C !important;
  font-weight: 700 !important;
}
.kmg-nav-link.kmg-nav-active .kmg-nav-num { color: #C9610C !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .kmg-burger { display: flex; }

  .kmg-sidebar {
    transform: translateX(-100%);
    transition: transform .35s cubic-bezier(.2,.7,.2,1);
  }
  .kmg-sidebar.kmg-open {
    transform: translateX(0);
    box-shadow: 8px 0 48px rgba(0,0,0,.65);
  }

  .kmg-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

@media (max-width: 960px) {
  /* Paddings sections */
  .kmg-section { padding-left: 24px !important; padding-right: 24px !important; }

  /* Hero */
  .kmg-hero-h1-big  { font-size: 56px !important; }
  .kmg-hero-h1      { font-size: 48px !important; }

  /* Grids */
  .kmg-grid-4  { grid-template-columns: 1fr 1fr !important; }
  .kmg-grid-3  { grid-template-columns: 1fr !important; }
  .kmg-grid-2  { grid-template-columns: 1fr !important; }
  .kmg-grid-alt { grid-template-columns: 1fr !important; }

  /* Pour qui rows */
  .kmg-pourqui-row { grid-template-columns: 1fr !important; gap: 8px !important; }

  /* Formule rows */
  .kmg-formule-row { grid-template-columns: 1fr !important; gap: 10px !important; }
  .kmg-formule-row > div:last-child { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

  /* Stat bars (flex sur accueil, grid sur histoire) */
  .kmg-stat-bar { flex-direction: column !important; grid-template-columns: 1fr 1fr !important; }
  .kmg-stat-bar > div { border-left: none !important; border-right: none !important; border-bottom: 1px solid rgba(239,205,142,.14) !important; padding: 16px 20px !important; }
  .kmg-stat-bar > div:last-child { border-bottom: none !important; }

  /* Lieu grid */
  .kmg-lieu-grid { grid-template-columns: 1fr !important; }

  /* Contact grid */
  .kmg-contact-grid { grid-template-columns: 1fr !important; }

  /* President card */
  .kmg-president-card { grid-template-columns: 1fr !important; }
  .kmg-president-photo { min-height: 240px !important; }

  /* Kids horizontal cards */
  .kmg-kids-grid  { grid-template-columns: 1fr !important; }
  .kmg-card-horiz { grid-template-columns: 1fr !important; }
  .kmg-card-horiz-photo { min-height: 180px !important; }

  /* Histoire two cols */
  .kmg-histoire-cols { grid-template-columns: 1fr !important; }
  .kmg-histoire-philo { grid-template-columns: 1fr !important; }

  /* CTA grid */
  .kmg-cta-grid { grid-template-columns: 1fr !important; }

  /* Nav histoire */
  .kmg-top-nav { flex-direction: column; gap: 12px; padding: 14px 20px !important; }
  .kmg-top-nav-links { flex-wrap: wrap; gap: 16px !important; }

  /* Footer */
  .kmg-footer-inner { flex-direction: column; gap: 12px; }
}

@media (max-width: 600px) {
  .kmg-hero-h1-big  { font-size: 40px !important; }
  .kmg-hero-h1      { font-size: 36px !important; }
  .kmg-grid-4       { grid-template-columns: 1fr !important; }
  .kmg-grid-contact-quick { grid-template-columns: 1fr 1fr !important; }
  .kmg-form-row-2   { grid-template-columns: 1fr !important; }
  .kmg-section      { padding-left: 16px !important; padding-right: 16px !important; }
  .kmg-stat-bar     { grid-template-columns: 1fr !important; }
}

/* ============================================================
   RESPONSIVE - classes utilitaires pour grilles inline
   (les colonnes desktop restent définies en inline style PHP ;
    ces classes servent uniquement à overrider sur mobile)
   ============================================================ */

/* Padding latéral des sections dans .kmg-main (pages publiques) */
@media (max-width: 960px) {
  .kmg-main > section { padding-left: 24px !important; padding-right: 24px !important; }
}
@media (max-width: 600px) {
  .kmg-main > section { padding-left: 16px !important; padding-right: 16px !important; }
}

/* Articles avec image latérale fixe (evenements, calendrier) */
@media (max-width: 960px) {
  .kmg-article-side    { grid-template-columns: 1fr !important; }
  .kmg-article-side-sm { grid-template-columns: 1fr !important; }
}

/* Grilles de sections contenu (appel-urgence, legitime-defense…) */
@media (max-width: 960px) {
  .kmg-sec-grille { grid-template-columns: 1fr !important; }
  .kmg-sec-blocs  { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 600px) {
  .kmg-sec-blocs  { grid-template-columns: 1fr !important; }
}

/* Grilles deux colonnes génériques (temoignage, liens-utiles, principes) */
@media (max-width: 960px) {
  .kmg-2col { grid-template-columns: 1fr !important; }
}

/* Galerie photos mosaïque */
@media (max-width: 960px) {
  .kmg-photo-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 600px) {
  .kmg-photo-grid { grid-template-columns: 1fr 1fr !important; }
}

/* Calendrier hebdomadaire */
@media (max-width: 960px) {
  .kmg-week-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 600px) {
  .kmg-week-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Formulaires d'inscription */
@media (max-width: 960px) {
  .kmg-form-2col { grid-template-columns: 1fr !important; }
  .kmg-form-3col { grid-template-columns: 1fr 1fr !important; }
  .tarif-grid    { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 600px) {
  .kmg-form-3col { grid-template-columns: 1fr !important; }
  .tarif-grid    { grid-template-columns: 1fr 1fr !important; }
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.kmg-admin-body {
  background: #1B180F;
  min-height: 100vh;
  font-family: 'Archivo', sans-serif;
  color: #F4EFE3;
}
.kmg-admin-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 240px;
  height: 100vh;
  background: #0F0D09;
  border-right: 1px solid rgba(239,205,142,.12);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  z-index: 10;
}
.kmg-admin-main {
  margin-left: 240px;
  padding: 40px;
  min-height: 100vh;
}
.kmg-admin-nav a {
  display: block;
  text-decoration: none;
  color: #C9C2B2;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 2px;
  transition: background .2s, color .2s;
}
.kmg-admin-nav a:hover { background: rgba(239,205,142,.08); color: #F4EFE3; }
.kmg-admin-nav a.active { background: rgba(226,124,27,.18); color: #E27C1B; }
.kmg-admin-table { width: 100%; border-collapse: collapse; }
.kmg-admin-table th,
.kmg-admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(239,205,142,.08); font-size: 14px; vertical-align: middle; }
.kmg-admin-table th { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #9C9484; font-weight: 700; background: rgba(239,205,142,.04); }
.kmg-admin-table tr:hover td { background: rgba(239,205,142,.03); }
.kmg-admin-btn {
  display: inline-block;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: 'Archivo', sans-serif;
  transition: opacity .2s;
}
.kmg-admin-btn:hover { opacity: .85; }
.kmg-admin-btn-primary  { background: #E27C1B; color: #13110C; }
.kmg-admin-btn-danger   { background: rgba(220,60,60,.2); color: #ff8080; border: 1px solid rgba(220,60,60,.3); }
.kmg-admin-btn-secondary { background: rgba(239,205,142,.12); color: #EFCD8E; }
.kmg-admin-card {
  background: #13110C;
  border: 1px solid rgba(239,205,142,.10);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
}
.kmg-admin-input {
  width: 100%;
  background: #1B180F;
  border: 1px solid rgba(239,205,142,.18);
  border-radius: 10px;
  color: #F4EFE3;
  font-family: 'Archivo', sans-serif;
  font-size: 14.5px;
  padding: 11px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  margin-bottom: 16px;
}
.kmg-admin-input::placeholder { color: #6F6857; }
.kmg-admin-input:focus { border-color: #E27C1B; box-shadow: 0 0 0 3px rgba(226,124,27,.14); }
.kmg-admin-label {
  display: block;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #9C9484;
  font-weight: 700;
  margin-bottom: 6px;
}
.kmg-alert { padding: 12px 18px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; }
.kmg-alert-success { background: rgba(80,180,80,.14); border: 1px solid rgba(80,180,80,.3); color: #8de88d; }
.kmg-alert-error   { background: rgba(226,124,27,.12); border: 1px solid rgba(226,124,27,.4); color: #EFCD8E; }

/* ── Admin burger (masqué par défaut sur desktop) ── */
.kmg-admin-burger {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 200;
  width: 44px; height: 44px;
  background: #0F0D09;
  border: 1px solid rgba(239,205,142,.20);
  border-radius: 10px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}
.kmg-admin-burger span {
  display: block;
  width: 20px; height: 2px;
  background: #EFCD8E;
  border-radius: 2px;
  transition: all .25s;
}
.kmg-admin-burger.kmg-admin-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.kmg-admin-burger.kmg-admin-open span:nth-child(2) { opacity: 0; }
.kmg-admin-burger.kmg-admin-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Admin overlay ── */
.kmg-admin-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99;
  cursor: pointer;
}
.kmg-admin-overlay.kmg-admin-visible { display: block; }

/* ── Admin responsive ── */
@media (max-width: 900px) {
  .kmg-admin-burger { display: flex; }

  .kmg-admin-sidebar {
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.2,.7,.2,1);
    z-index: 100;
  }
  .kmg-admin-sidebar.kmg-admin-open {
    transform: translateX(0);
    box-shadow: 8px 0 48px rgba(0,0,0,.65);
  }

  .kmg-admin-main {
    margin-left: 0;
    padding: 72px 20px 40px;
  }

  /* Tables : scroll horizontal */
  .kmg-admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Grilles admin : 1 colonne */
  .kmg-admin-grid-3 { grid-template-columns: 1fr !important; }
  .kmg-admin-grid-2 { grid-template-columns: 1fr !important; }
}

@media (max-width: 760px) {
  .kmg-pie-grid   { grid-template-columns: 1fr !important; }
  .kmg-dash-cards { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 480px) {
  .kmg-dash-cards { grid-template-columns: 1fr !important; }
}

@media (max-width: 600px) {
  .kmg-admin-main  { padding: 68px 12px 28px; }
  .kmg-admin-card  { padding: 18px 14px; }
  .kmg-admin-input { font-size: 16px; } /* évite le zoom iOS */
}

/* Icône calendrier des champs date (inscription + admin) */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(.55);
  cursor: pointer;
}
