/*
 Theme Name: Mariage Chloé & Édouard (Child)
 Theme URI: https://example.com
 Description: Thème enfant (classique) pour le site de mariage — nav/menu, styles unifiés.
 Author: Vous
 Template: twentytwentyfive
 Version: 1.0.5
*/

:root{
  --brand-ivory:#FFFDF8;
  --brand-coral:#F69A7B;
  --brand-navy:#1E2A5E;
  --radius:20px;
  --shadow:0 4px 25px rgba(0,0,0,.06);
}

/* Fond rayé global sauf footer */
html {
  background-color: var(--brand-ivory);
  background-image: repeating-linear-gradient(
    to right,
    var(--brand-coral) 0,
    var(--brand-coral) 20px,
    transparent 20px,
    transparent 40px
  );
  overflow-x: hidden;
}

body {
  background: transparent;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  color: var(--brand-navy);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main { flex: 1; background: transparent; }

/* Header / Navigation */
.site-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.7));
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.site-header .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Brand */
.brand { display:inline-flex; align-items:center; gap:.6rem; text-decoration:none; color: var(--brand-navy); }
.brand .monogram { width:44px; height:44px; border-radius:999px; background:var(--brand-navy); color:#FFFDF8; display:inline-flex; align-items:center; justify-content:center; font-weight:700; }
.brand .brand-text { font-weight:700; }

/* Nav list base */
.site-nav .nav-list { display:flex; gap:.75rem; list-style:none; margin:0; padding:0; }
.site-nav .nav-list li { margin:0; }
.site-nav .nav-list a { text-decoration:none; color:var(--brand-navy); padding:.45rem .9rem; border-radius:999px; border:2px solid transparent; font-weight:600; }

/* Active / hover */
.site-nav .nav-list a:hover,
.site-nav .nav-list a:focus { outline:none; transform:translateY(-1px); }
.site-nav .nav-list a.active { background:var(--brand-coral); color:#FFFDF8; border-color:var(--brand-coral); box-shadow:0 6px 18px rgba(246,154,123,0.12); }

/* Layout */
.container{ max-width:1100px; margin: 0 auto; padding: 2rem 1rem; box-sizing: border-box; }
.card{
  background: var(--brand-ivory); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 2rem; margin: 1rem 0; box-sizing: border-box; max-width: 100%;
}
.hero{ margin: 1.5rem 0 0; padding: 2rem; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }

/* Media */
img, svg, video { max-width: 100%; height: auto; display: block; }
iframe { max-width: 100% !important; width: 100% !important; display: block; border: 0; }
.mapouter, .gmap_canvas, .wp-block-embed__wrapper { width: 100% !important; max-width: 100% !important; overflow: hidden; box-sizing: border-box; }

/* Typo */
h1,h2,h3,h4{ font-family:"Cormorant Garamond", serif; color: var(--brand-navy); margin: 0 0 .5rem 0; }
h1{ font-size: 2rem; } h2{ font-size:1.6rem; } h3{ font-size:1.25rem; }

/* Buttons */
.btn{ display:inline-block; background: var(--brand-navy); color:#fff; border:none; cursor:pointer;
  padding:.8rem 1.2rem; border-radius:10px; font-weight:600; text-decoration:none;
  transition: transform .1s ease, background-color .25s ease, color .25s ease; }
.btn:hover{ background: var(--brand-coral); color: var(--brand-navy); transform: translateY(-2px); }

/* Tables */
.table{ width:100%; border-collapse: collapse; border-radius: 12px; overflow:hidden; background:#fff; box-shadow: var(--shadow); }
.table th{ background: var(--brand-coral); color: var(--brand-ivory); text-align:left; padding:.75rem; }
.table td{ border:1px solid #eee; padding:.75rem; }
.table tr:nth-child(even) td{ background: #FFF8F5; }

/* Footer */
.site-footer { background: var(--brand-ivory); border-top:1px solid rgba(0,0,0,.06); margin-top:2rem; box-shadow: inset 0 8px 10px -8px rgba(0,0,0,.05); }
.site-footer .inner { max-width:1100px; margin:0 auto; padding:1rem; color:#4b5678; font-size:.9rem; }

/* Grille logements */
.housing-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:1.5rem; box-sizing:border-box; }
.housing-card { background:#fff; border-radius:16px; overflow:hidden; text-align:center; transition:transform .3s ease, box-shadow .3s ease; }
.housing-card:hover { transform:translateY(-5px); box-shadow:0 6px 20px rgba(246,154,123,0.25); }
.housing-card img { width:100%; height:auto; border-bottom:4px solid var(--brand-coral); transition:transform .4s ease; }
.housing-card:hover img { transform:scale(1.05); }
.housing-card h3 { margin:1rem 0 .25rem; font-size:1.2rem; color:var(--brand-navy); }
.housing-card p.type { margin:0 0 1rem; color:var(--brand-coral); font-weight:600; }

/* Tabs */
.tabs-filter { display:flex; justify-content:center; gap:1rem; margin:2rem 0 2.5rem; flex-wrap:wrap; }
.tabs-filter a { padding:.6rem 1.2rem; border-radius:999px; background:#fff; border:1.5px solid var(--brand-coral); color:var(--brand-navy);
  font-weight:600; text-decoration:none; transition:all .3s ease; }
.tabs-filter a:hover, .tabs-filter a.active { background:var(--brand-coral); color:#fff; }

/* RSVP : affichage événement = titre sur une ligne + date plus petite en dessous */
.ev-event .ev-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-navy);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.ev-event .ev-date {
  font-family: "Inter", system-ui, Arial, sans-serif;
  font-size: 0.85rem;
  color: #4b5678;
  opacity: 0.95;
  line-height: 1.25;
}

/* Assure un rendu propre sur petits écrans */
@media (max-width: 480px) {
  .ev-event .ev-title {
    font-size: 0.97rem;
  }
  .ev-event .ev-date {
    font-size: 0.78rem;
  }
}

/* Optionnel : diminue l'opacité des cellules alternées si tu veux garder l'effet existant */
.table tr:nth-child(even) .ev-event .ev-title { /* nothing by default */ }

/* Mobile fix */
@media (max-width: 768px) {
  .container { padding-left:1rem; padding-right:1rem; width:100%; max-width:100%; }
  .card { margin-left:0; margin-right:0; }
  .housing-grid { grid-template-columns:1fr; }
}

/* Table fix for programme */
@media (max-width: 768px) {
  .table { display:block; width:100%; overflow-x:auto; border-radius:12px; box-sizing:border-box; }
  .table th, .table td { white-space:normal; word-break:break-word; padding:.75rem .5rem; }
  .table tr { display:table-row; }
}
@media (max-width: 768px) {
  .table {
    display: block;
    border: none;
  }
  .table thead {
    display: none; /* cache les en-têtes */
  }
  .table tr {
    display: block;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    padding: 1rem;
  }
  .table td {
    display: block;
    border: none;
    padding: .25rem 0;
  }
  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--brand-coral);
    display: block;
  }
}

/* MOBILE NAV : logo en ligne 1, nav en ligne 2 défilante (pills), empêche débordement horizontal */
@media (max-width: 900px) {
  .site-header .inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }

  /* Logo / brand en haut, centré à gauche */
  .brand {
    display:flex;
    align-items:center;
    gap:.6rem;
    margin: 0;
    padding-left: 4px;
  }

  /* Nav occupe toute la largeur, barre de pills défilante */
  .site-nav {
    width: 100%;
    display: block;
    box-sizing: border-box;
    padding: 0;
  }

  .site-nav .nav-list {
    display: flex;
    gap: .6rem;
    margin: 0;
    padding: .5rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    flex-wrap: nowrap; /* KEEP ONE ROW so it scrolls horizontally */
    justify-content: flex-start;
  }

  .site-nav .nav-list li {
    flex: 0 0 auto;
  }

  .site-nav .nav-list a {
    display: inline-block;
    padding: .5rem .9rem;
    border-radius: 999px;
    border: 2px solid var(--brand-coral);
    background: rgba(255,255,255,0.95);
    color: var(--brand-navy);
    white-space: nowrap;
  }

  .site-nav .nav-list a.active {
    background: var(--brand-coral);
    color: #FFFDF8;
  }

  /* Ne pas laisser la header causer un scroll horizontal global */
  .site-header { overflow-x: hidden; }

  /* Optionnel : cacher la barre de scroll visuelle sous iOS/Android si tu veux */
  .site-nav .nav-list::-webkit-scrollbar { height: 8px; }
  .site-nav .nav-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.07); border-radius: 8px; }
}

/* Bottom navigation (mobile) : icônes + label, logo coloré conservé */
@media (max-width: 900px) {
  .site-nav { display: none !important; }

  main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: .25rem;
    padding: .6rem calc(6% + env(safe-area-inset-left)) calc(.6rem + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.98));
    border-top: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 -6px 24px rgba(0,0,0,0.06);
    backdrop-filter: blur(6px);
  }

  .bottom-nav .bn-item,
  .bottom-nav .bn-center {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--brand-navy);
    text-decoration: none;
    min-width: 56px;
    padding: 6px;
    border-radius: 12px;
    background: transparent;
    transition: transform .12s ease, background-color .12s ease, color .12s ease;
  }

  .bottom-nav .bn-item svg,
  .bottom-nav .bn-center svg { color: var(--brand-navy); width:22px; height:22px; }

  .bottom-nav .bn-item .bn-label,
  .bottom-nav .bn-center .bn-label {
    display:block;
    font-size:11px;
    margin-top:6px;
    line-height:1;
    color:var(--brand-navy);
    font-weight:600;
  }

  .bottom-nav .bn-item.active,
  .bottom-nav .bn-item:focus,
  .bottom-nav .bn-item:hover {
    background: var(--brand-coral);
    color: #FFFDF8;
  }
  .bottom-nav .bn-item.active svg,
  .bottom-nav .bn-item:focus svg,
  .bottom-nav .bn-item:hover svg {
    color: #FFFDF8;
  }

  /* Center elevated logo (coloré comme sur desktop) */
  .bottom-nav .bn-center {
    width:64px;
    height:64px;
    margin-top: -26px;
    background: var(--brand-navy);
    color: #FFFDF8;
    border-radius: 999px;
    box-shadow: 0 8px 30px rgba(246,154,123,0.18);
    font-weight:700;
    font-size:13px;
    display:flex;
    align-items:center;
    justify-content:center;
    transform: translateY(-6px);
    flex-direction: column;
  }

  .sr-only { position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
  .bottom-nav .bn-item, .bottom-nav .bn-center { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
}

/* Desktop: hide bottom nav and keep colored header monogram */
@media (min-width: 901px) {
  .bottom-nav { display: none; }

  /* ensure header monogram keeps colored background on desktop */
  .brand .monogram { background: var(--brand-navy); color: #FFFDF8; }
}

/* Mobile : élargir les cards et réduire les paddings latéraux pour plus d'espace */
@media (max-width: 900px) {
  /* Réduit les paddings globaux pour gagner de la place horizontale */
  .site-header .inner { padding-left: 12px; padding-right: 12px; }
  main {
    padding-left: 12px;
    padding-right: 12px;
    /* conserve l'espace en bas pour la bottom-nav */
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  /* Permet aux cards d'occuper quasiment toute la largeur utile */
  .card {
    max-width: calc(100% - 24px) !important;
    width: auto;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    padding: 1.4rem 1.2rem; /* un peu plus d'espace intérieur */
    border-radius: 18px;
  }

  /* Si tu as des cards imbriquées (card > card), conserver un peu de marge */
  .card .card {
    margin-left: 0;
    margin-right: 0;
    padding: 1rem;
  }

  /* Ajuste les hero / titres pour qu'ils respirent */
  .hero { padding-left: 0.25rem; padding-right: 0.25rem; }
  .hero h1 { font-size: 1.6rem; line-height: 1.12; }

  /* Tableaux / contenus larges : permettre un défilement horizontal si nécessaire */
  .entry-content, .table, .responsive-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Rendre les cards plus larges sur les pages template (ex : page-informations) */
@media (max-width: 900px) {
  /* Réduit les gutters globaux pour les pages template afin de laisser respirer le contenu */
  body.page-template main {
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-top: 20px;
    padding-bottom: calc(110px + env(safe-area-inset-bottom)) !important; /* espace pour bottom-nav */
    box-sizing: border-box;
  }

  /* Permet à chaque card d'utiliser quasiment toute la largeur disponible */
  body.page-template .card {
    max-width: calc(100% - 24px) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 1.4rem 1.2rem !important;
    box-sizing: border-box;
    border-radius: 18px;
  }

  /* Si tu as des cards imbriquées (card > card), évite la réduction excessive de largeur */
  body.page-template .card .card,
  body.page-template .card > .card {
    max-width: 100% !important;
    padding: 1rem !important;
    margin: 0 !important;
  }

  /* Ajuste les hero / titres pour occuper plus d'espace */
  body.page-template .hero { padding-left: 0.25rem; padding-right: 0.25rem; }
  body.page-template .hero h1 { font-size: 1.6rem; line-height: 1.12; }

  /* Tables / contenus larges : permettent le scroll horizontal propre */
  body.page-template .entry-content,
  body.page-template .table,
  body.page-template .responsive-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Masque visuellement les labels de cases à cocher sur desktop
   (conserve le texte pour les lecteurs d'écran) */
@media (min-width: 901px) {
  /* cible les labels dans le tableau RSVP (adaptable si ta table a une autre classe) */
  .rsvp-table label,
  table.rsvp-table label,
  .entry-content table.rsvp-table label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
}

/* RSVP : wrapper scrollable + table responsive pour nombreuses colonnes */
.rsvp-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tableau RSVP : wrapper scrollable sans modifier le layout des colonnes */
.rsvp-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Laisse le tableau utiliser sa largeur habituelle ; navigateur gère le sizing comme avant */
.rsvp-table {
  width: 100%;
  table-layout: auto; /* conserve le comportement natif (ne pas forcer fixed) */
  border-collapse: collapse;
}

/* Permet au contenu de retourner à la ligne là où c'était prévu (évite l'expansion) */
.rsvp-table th,
.rsvp-table td {
  white-space: normal;
  vertical-align: middle;
}

/* Préserve une largeur raisonnable pour les colonnes de cases à cocher (évite qu'elles deviennent minuscules) */
.rsvp-table td.checkbox-col,
.rsvp-table th.checkbox-col {
  width: 72px;
  min-width: 56px;
  text-align: center;
}

/* Si tu veux forcer un petit gap interne sans changer l'apparence générale */
.rsvp-table th, .rsvp-table td { padding: 0.65rem 0.8rem; }

/* Monogram shared styles (header + bottom nav) */
.monogram {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:0.25rem;
  font-weight:700;
  border-radius:999px;
  width:44px;
  height:44px;
  background: var(--brand-navy);
  color: #fff;
  font-family: "Inter", Arial, sans-serif;
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
}
.monogram .m-letter { display:inline-block; line-height:1; font-size:16px; }
.monogram .m-amp {
  color: var(--brand-coral);
  font-weight:900;
  font-size:16px;
  display:inline-block;
  transform:translateY(-1px);
}

/* Footer center logo tweaks (bigger, elevated) */
.bottom-nav .bn-logo .monogram { width:56px; height:56px; font-size:16px; }
.bottom-nav .bn-center .monogram { width:64px; height:64px; font-size:17px; }

/* Ensure header brand spacing */
.brand .monogram { margin-right: .6rem; }
.brand .brand-text { font-weight:700; color:var(--brand-navy); }

/* Keep accessibility: hide decorative text within bn-center */
.bn-center[aria-hidden="true"] .bn-logo { display:inline-flex; align-items:center; justify-content:center; }

/* 1) Espacement global entre les cards (évite qu'elles soient collées) */
.card + .card {
  margin-top: 1.5rem;
}

/* 2) Hero / première card : plus de respiration autour du titre */
.card > .hero,
.hero {
  padding: 2rem 1.2rem;
  box-sizing: border-box;
}

/* 3) Page 'programme' / pages templates : s'assurer que les cards utilisent l'espace disponible */
body.page-template .card {
  width: 100%;
  max-width: 100%;
}

/* 4) Enlever les fonds alternés des tables/lists dans le contenu (utiliser le fond de page)
   → limité au tbody pour ne pas affecter le THEAD */
.entry-content .table tbody tr:nth-child(even) td,
.entry-content .table tbody tr:nth-child(odd) td {
  background: transparent !important;
}

/* Assure que les en-têtes gardent leur couleur sur desktop (fallback) */
.entry-content .table thead th,
.table thead th {
  background: var(--brand-coral) !important;
  color: var(--brand-ivory) !important;
}

/* 5) Si certains éléments internes doivent garder un fond blanc (ex : "mini-cards" dans une table),
   cible-les explicitement (exemple : .cell-inner). Ne pas appliquer globalement. */
.cell-inner {
  background: #fff;
  border-radius: 10px;
  padding: .75rem;
}

/* 6) Sécurité responsive : éviter que des cartes imbriquées deviennent trop étroites */
@media (max-width: 900px) {
  .card { padding-left: 1.1rem; padding-right: 1.1rem; }
  .card + .card { margin-top: 1.25rem; }
}

/* Améliorations spacing / background pour les pages template (mobile) */
@media (max-width: 900px) {

  /* Assure un fond uni derrière les cards (évite de voir les rayures entre elles) */
  body.page-template main,
  body.page-template .entry-content {
    background-color: #FFFDF8;
  }

  /* Espacement vertical entre cards (ne touche pas à la première) */
  .card + .card {
    margin-top: 1.25rem;
  }

  /* Si les cards sont imbriquées, laisse moins d'espace interne mais évite écrasement */
  .card .card {
    margin-top: 0.85rem;
  }

  /* Rendre les cards plus larges et aérer l'intérieur */
  .card {
    width: 100%;
    box-sizing: border-box;
    padding: 1.4rem 1.2rem;
    border-radius: 18px;
    background-color: #FFFDF8; /* assure uniformité */
  }

  /* Plus d'air pour le hero (titre principal) sur mobile */
  .card .hero {
    padding: 1.2rem 0.8rem;
  }
  /* Si tu veux un hero encore plus aéré pour la première card spécifique */
  body.page-template .card:first-of-type .hero {
    padding-top: 1.6rem;
    padding-bottom: 1.2rem;
  }

  /* Contenus larges restent scrollables (sécurité) */
  .entry-content, .rsvp-table-wrapper, .responsive-table {
    -webkit-overflow-scrolling: touch;
  }
}

/* Corrige le header des tableaux : s'assurer que les <thead> gardent le fond corail sur desktop */
@media (min-width: 901px) {
  /* Restitue le style d'origine pour les en-têtes */
  .entry-content .table thead th,
  .table thead th {
    background: var(--brand-coral) !important;
    color: var(--brand-ivory) !important;
  }

  /* Limite les règles "transparent" précédentes uniquement au tbody (évite d'affecter thead) */
  .entry-content .table tbody tr:nth-child(even) td,
  .entry-content .table tbody tr:nth-child(odd) td {
    background: transparent !important;
  }
}

/* Fix : assurer la visibilité du footer sur desktop */
@media (min-width: 901px) {
  .site-footer {
    display: block !important;
    position: relative;
    z-index: 60; /* au-dessus d'éventuels éléments */
    padding: 2rem 1rem;
    background: var(--brand-ivory);
    border-top: 1px solid rgba(0,0,0,0.06);
    box-shadow: inset 0 8px 10px -8px rgba(0,0,0,.05);
  }

  .site-footer .inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
    color: #4b5678;
  }

  /* S'assurer que le main ne recouvre pas le footer */
  main { margin-bottom: 0; }

  /* Si un élément fixé en bas posait problème, on s'assure qu'il ne masque pas le footer */
  .bottom-nav { display: none !important; }
}
