/* ===========================
   COMPÉTITION — HORAIRES
   (copied from pages-mobile/competition/horaires.html)
   =========================== */
.horaires{
  /* section layout (title → block → photo; JS measures gaps) */
  min-height: calc(100% - var(--localHeader, 40px));
  display:flex; flex-direction:column; gap:16px;
  padding:10px 12px 20px; /* top | sides | bottom */
  box-sizing:border-box;
  background:#f4f4f4; color:#333;

  /* type scale */
  --fz-title: clamp(26px, 5.2vw, 36px);
  --fz-label: 13px;
  --fz-years: 13px;
  --fz-row: 14.5px;         /* slightly smaller grid text as requested */
  --c-dark:#2b2b2b; --c-mid:#555; --c-years:#777;
}

.horaires .h-title{
  margin:0;                 /* keep 0 so section gap drives spacing */
  font-size:var(--fz-title);
  line-height:1.2;
  font-weight:800;
  color:var(--c-dark);
  letter-spacing:-.02em;
  text-wrap:balance;
}

/* White framed container for the whole schedule */
.horaires .block{
  background:#fff;
  border:1px solid #e5e5e5;
  border-radius:12px;
  box-shadow:0 1px 0 rgba(0,0,0,.04);
  padding:12px 14px;        /* inner padding around the grid */

  /* the grid itself lives inside this card */
  display:grid;
  grid-template-columns:minmax(88px,120px) 1fr; /* narrower first column */
  column-gap:16px;
  row-gap:24px;             /* spacing between age groups */
  align-items:start;
}

/* Left column (label + years) */
.horaires .group{ display:flex; flex-direction:column; }
.horaires .label{
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.03em;
  font-size:var(--fz-label);
  color:#333;
}
.horaires .years{
  margin-top:4px;
  font-weight:600;
  font-size:var(--fz-years);
  color:var(--c-years);
}

/* Right column rows: Day | Time | Activity */
.horaires .grid{
  display:grid;
  grid-template-columns: max-content max-content minmax(0,1fr);
  column-gap:12px; row-gap:8px;
  font-size:var(--fz-row); line-height:1.35;
}
.horaires .day{  font-weight:600; color:var(--c-mid); white-space:nowrap; }
.horaires .time{ color:#333; white-space:nowrap; font-variant-numeric:tabular-nums; }
.horaires .act{  color:var(--c-mid); }

/* Bottom photo fills the remaining height measured by JS as --photoH */
.horaires .photo-fill{
  flex: 0 0 var(--photoH, auto);
  height: var(--photoH, auto);
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
}
.horaires .photo-fill img{
  display:block; width:100%; height:100%; object-fit:cover;
}

/* Small phones */
@media (max-width:420px){
  .horaires{ padding:8px 10px 16px; gap:8px; --fz-row:10px; }
  .horaires .block{ grid-template-columns:minmax(80px,110px) 1fr; column-gap:12px; row-gap:20px; }
  .horaires .grid{ column-gap:10px; }
}


/* ===========================
   COMPÉTITION — LICENCES
   (copied from pages-mobile/competition/licences.html)
   =========================== */
.horaires.licences{
  min-height: calc(100% - var(--localHeader, 40px));
  display:flex; flex-direction:column; gap:14px;
  padding:10px 12px 12px; /* top | sides | bottom */
  box-sizing:border-box;
  background:#f4f4f4; color:#333;

  /* type scale */
  --fz-title: clamp(26px, 5.2vw, 34px);
  --fz-text: 16px;
  --c-dark:#2b2b2b; --c-mid:#555; --c-muted:#777;
}

.horaires.licences .h-title{
  margin:0;
  font-size:var(--fz-title);
  line-height:1.2;
  font-weight:800;
  color:var(--c-dark);
  letter-spacing:-.02em;
  text-wrap:balance;
}

/* Main text block (measured by JS as ".block") */
.horaires.licences .block{
  font-size:var(--fz-text);
  line-height:1.6;
  color:#444;
  background:#fff;
  border:1px solid #e5e5e5;
  border-radius:12px;
  padding:12px 14px;
}
.horaires.licences .block a{
  color:#0b63c1; text-decoration:none;
}
.horaires.licences .block a:hover{ text-decoration:underline; }

/* Licences: ensure the text card is NOT a grid */
.horaires.licences .block{
  display: block;                /* cancel the grid from .horaires .block */
  grid-template-columns: initial;
  column-gap: initial;
  row-gap: initial;
}

/* (Optional) ensure any children would span full width if grid ever reappears */
.horaires.licences .block > *{
  grid-column: 1 / -1;
}

/* Photo takes exactly the measured leftover height */
.horaires.licences .photo-fill{
  flex: 0 0 var(--photoH, auto);
  height: var(--photoH, auto);
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
}
.horaires.licences .photo-fill img{
  display:block; width:100%; height:100%; object-fit:cover;
}

/* Optional on-screen debug badge (kept commented) */
/*
.horaires.licences[data-photo-space]::after{
  content: attr(data-photo-space);
  position:absolute; right:10px; bottom:10px;
  padding:2px 6px; font:600 11px/1 system-ui,-apple-system,Segoe UI,Roboto,Montserrat,Arial;
  color:#333; background:rgba(255,255,255,.8); border:1px solid #d4d4d4; border-radius:6px;
  pointer-events:none;
}
*/
.horaires.licences{ position:relative; }

/* Small phones */
@media (max-width:420px){
  .horaires.licences{ --fz-text: 15px; padding:8px 10px 16px; gap:12px; }
}

/* ===========================
   RECITS (used by competition & randonnée)
   =========================== */

.recits{
  background:#f4f4f4; color:#333;
  padding:0 12px 24px;                 /* top=0 to avoid “pocket” */
  box-sizing:border-box;
  display:flex; flex-direction:column; gap:10px;
}

/* Section itself shouldn’t snap; heading + cards will */
.snap-section.recits{
  scroll-snap-align: none !important;
  min-height: auto !important;
}

/* Title block (snaps); small gap under the sticky sub-menu */
.recits .heading-snap{
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding-top: 8px;
}
.recits .h-title{
  margin:0;
  font-size: clamp(26px, 5.2vw, 36px);
  line-height:1.2;
  font-weight:800;
  color:#2b2b2b;
  letter-spacing:-.02em;
  text-wrap:balance;
  text-align:left;
}

/* Cards list */
.recits .cards{ display:flex; flex-direction:column; gap:10px; }

/* Card visuals + snap */
.recits .card{
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display:block; text-decoration:none; color:inherit;
  background:#f7f7f7; border:1px solid #d9d9d9; border-radius:16px;
  box-shadow:0 1px 0 rgba(0,0,0,.04);
  padding:12px;
}

/* Media 16:9 */
.recits .card-media{ overflow:hidden; border-radius:12px; aspect-ratio:16/9; }
.recits .card-media img{ display:block; width:100%; height:100%; object-fit:cover; }

.recits .card-body{ padding:10px 6px 4px; }
.recits .card-title{
  margin:8px 0 2px;
  text-align:center;
  font-weight:800;
  font-size:clamp(20px,5vw,26px);
  letter-spacing:-.01em; color:#2b2b2b;
}
.recits .card-sub{
  text-align:center; color:#777;
  font-weight:600; font-size:15px;
  margin-bottom:8px;
}
.recits .card-summary{
  margin:0; padding:0 4px 6px;
  font-size:14px; line-height:1.55; color:#666;
}

.recits .cards-sentinel{ height:1px; }

/* 16:9 fallback */
@supports not (aspect-ratio: 16/9){
  .recits .card-media{ position:relative; padding-top:56.25%; }
  .recits .card-media img{ position:absolute; inset:0; }
}

/* Small phones */
@media (max-width:420px){
  .recits{ padding:0 10px 20px; gap:10px; }
  .recits .card-summary{ font-size:12.5px; }
}


/* PDF/link row styling (as before) */
.horaires.licences .block .doc-link a{
  display:inline-flex; align-items:center; gap:8px;
  color:#0b63c1; text-decoration:none;
}
.horaires.licences .block .doc-link a:hover{ text-decoration:underline; }
.horaires.licences .block .doc-link img{
  width:32px; height:auto; display:inline-block;   /* ← same size as before */
}


/* Randonnée — Horaires: keep the narrower first column */
.horaires.rando .block{
  grid-template-columns: minmax(44px, 60px) 1fr;
}
@media (max-width:420px){
  .horaires.rando .block{
    grid-template-columns: minmax(40px, 55px) 1fr;
  }
}

/* Note row styling (full-width) */
.horaires .note{ grid-column: 1 / -1; }
.horaires .note p{ margin:0; font-size:15px; line-height:1.5; color:#555; }
.horaires .note a{ color:#0b63c1; text-decoration:none; }
.horaires .note a:hover{ text-decoration:underline; }


/* ===========================
   Generic "text + photo" sections
   (Actualités, Info, Le club / Info, etc.)
   =========================== */

.horaires.licences.news{
  /* At least one viewport “page”, but can grow if text is long */
  min-height: calc(100% - var(--localHeader, 0px));

  display:grid;
  grid-template-rows: auto auto auto; /* title | text card | optional photo */
  row-gap:12px;

  padding-top:0.01px;   /* anti margin-collapse */
  padding-bottom:8px;   /* small bottom buffer */
  box-sizing:border-box;
}

/* Title */
.horaires.licences.news .h-title{
  margin:0;
}

/* Text card: NO inner scroll anymore */
.horaires.licences.news .block{
  margin:0;
  position:relative;
  overflow:visible;              /* <- was auto, now no inner scroll */
  border-radius:12px;
}

/* Photo is OFF by default */
.horaires.licences.news .photo-fill{
  display:none;
}

/* ===== Mode WITH-PHOTO (JS adds .with-photo) ===== */
.horaires.licences.news.with-photo{
  /* In short-text + photo mode, lock to one viewport pane */
  min-height: calc(100% - var(--localHeader, 0px));
  max-height: calc(100% - var(--localHeader, 0px));
  height:     calc(100% - var(--localHeader, 0px));

  grid-template-rows: auto auto 1fr;      /* title | card | photo fills rest */
}

.horaires.licences.news.with-photo .block{
  overflow:visible;                        /* normal card */
  mask-image:none;
}

.horaires.licences.news.with-photo .photo-fill{
  display:block;
  min-height:0;
  overflow:hidden;
  border-radius:12px;
}

.horaires.licences.news.with-photo .photo-fill img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}

/* Optional: show a tiny hint only when the card actually overflows
   (with this new layout, it should almost never be added) */
.horaires.licences.news .block.show-scroll-hint::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:8px;
  transform:translateX(-50%);
  width:26px;
  height:18px;
  border-radius:999px;
  background:rgba(255,255,255,.9);
  box-shadow:0 1px 2px rgba(0,0,0,0.25);
}

/* Fallback: if the last child is visually the "photo"
   (direct <img> or container), give it the 3rd grid row */
.horaires.licences.news > :last-child{
  grid-row:3;
  min-height:0;
  align-self:stretch;
  border-radius:12px;
  overflow:hidden;        /* clip to rounded corners */
  margin:0;               /* kill stray margins that steal height */
}

/* If the last child is an IMG directly, fill and cover */
.horaires.licences.news > img:last-child{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* If the last child is a container (e.g., .photo-fill), fill its IMG */
.horaires.licences.news > :last-child img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}


/* Album cards — photo count badge on single 16:9 image */
.recits .card-media{ position: relative; } /* so we can place the badge */
.recits .photo-count{
  position: absolute; right: 8px; bottom: 8px;
  padding: 4px 8px; border-radius: 10px;
  background: rgba(255,255,255,.95);
  color: #111;
  font: 600 13px/1 system-ui,-apple-system,Segoe UI,Roboto,Montserrat,Arial;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
@media (max-width:420px){
  .recits .photo-count{ font-size:12px; padding:3px 7px; }
}

/* A tiny sibling that gives the previous section a bottom snap point */
.snap-helper-end{
  height: 1px;              /* effectively invisible */
  scroll-snap-align: end;   /* snap to bottom of viewport */
  scroll-snap-stop: always; /* nicer feel when scrolling */
  align-self: end;          /* push it to the bottom of the section */
}

/* === Le Club → Organisation → Le Comité ===================== */
#comite .block{
  margin: 0;                      /* match other .block elements */
  padding: 12px 14px;             /* same inner padding as standard block */
  border-radius: 12px;
  border: 1px solid #e9e9e9;
  background: #fff;
  box-sizing: border-box;
}

/* Kill legacy floats that force single-column flows inside this section */
#comite .block img,
#comite .block *{
  float: none !important;
}

/* Responsive grid of cards */
#comite .comite-grid{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* exactly 2 columns */
  gap: 14px;
}


/* Card visuals to match other blocks */
#comite .comite-card{
  background: #fff;
  border: 1px solid #e9e9e9;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.02), 0 1px 3px rgba(0,0,0,0.06);
}

/* Square photo */
#comite .comite-photo{
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f4f4f4;
}
#comite .comite-photo img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Text */
#comite .comite-role{ font-weight: 700; line-height: 1.2; }
#comite .comite-name{ line-height: 1.2; }
#comite .comite-name a{ color: inherit; text-decoration: underline dotted; }

/* A bit denser on wide screens */
@media (min-width: 900px){
  #comite .comite-grid{
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
  }
}

/* Do NOT reserve a photo area in this section */
#comite .photo-fill{ display: none !important; }



/* SOUTIENS: blocks first, photo fills the rest */
#soutiens-2025{
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: stretch;             /* children can take full width */
}

/* Blocks: use the site's global .block margins/width — no overrides */
#soutiens-2025 .block{
  flex: 0 0 auto;                   /* don't stretch vertically */
  align-self: stretch;              /* allow full width */
  width: auto !important;
  max-width: none !important;
  float: none !important;
  margin: unset;                     /* <-- remove our extra 16px margins */
}

/* Photo: take the remaining height, match the same horizontal footprint */
#soutiens-2025 .photo-fill{
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  height: auto !important;
  max-height: none !important;
  /* use same side/bottom spacing as your global .block via padding *inside* */
  margin: 0;                        /* no extra outer margin */
  border-radius: 12px;
  overflow: hidden;
}

/* Put the familiar spacing inside the photo container so it aligns visually */
#soutiens-2025 .photo-fill::before{
  content: "";
  display: block;
  height: 0;                        /* no vertical space */
  margin: 0 16px;                   /* same side inset as .block cards */
}
#soutiens-2025 .photo-fill img{
  position: absolute; inset: 0;
  width: 100%; height: 100% !important;
  max-height: none !important;
  object-fit: cover; object-position: center;
  display: block;
  border-radius: 12px;              /* keep rounded corners visible */
}

/* Les commissions — card + 2-column layout */
#commissions .block{
  /* card look */
  background:#fff;
  border:1px solid #e9e9e9;
  border-radius:12px;
  padding:12px;
  margin: 0 16px 12px;

  /* two equal columns */
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
  font-size:.8em;
  align-items:start;
}

/* tidy inside */
#commissions .block > div{ margin:0; }
#commissions .block p{ margin:.35em 0; }
#commissions .block *{ float:none; max-width:100%; }

/* keep layout engine from reserving photo space */
#commissions .photo-fill{ display:none; }
 
/* --- Commissions section: same layout as other snap-sections --- */
#commissions.snap-section {
  background: #f6f6f6;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 0;
}

/* Title styling: match other section headers */
#commissions h2,
#commissions .h-title {
  font-size: 1.8em;
  font-weight: 800;
  margin: 0px 24px 12px;
  color: #2b2b2b;
}

/* Card block — width and alignment same as other sections */
#commissions .block {
  background: #fff;
  border: 1px solid #e9e9e9;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 0 16px 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
  font-size: 0.8em;
  align-items: start;
}

/* Normalize inner text */
#commissions .block > div { margin: 0; }
#commissions .block p { margin: 0.4em 0; }
#commissions .block strong { display: block; margin-bottom: 0.15em; }
#commissions .block a { color: #0056cc; text-decoration: none; }
#commissions .block a:hover { text-decoration: underline; }


/* Clickable block feedback */
#soutiens-2025 .block {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#soutiens-2025 .block:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
#soutiens-2025 .block:active {
  transform: scale(0.99);
}

/* Apprendre / general: make .block height match its visual height */
#apprendre-general .snap-section .block{
  /* Create a new formatting context so child margins don't escape */
  display: flow-root;                 /* or: overflow: auto; */
  padding: 12px 16px;                 /* put spacing inside the box */
}

/* Normalize vertical rhythm inside the card */
#apprendre-general .snap-section .block p{
  margin: 0 0 .6em;                   /* consistent inner spacing */
}
#apprendre-general .snap-section .block > :first-child{ margin-top: 0; }
#apprendre-general .snap-section .block > :last-child{ margin-bottom: 0; }
