/* Matiera - feuille de style unique
   Palette et typographie definies ici. Modifie ces variables pour changer tout le site. */

:root {
  /* Couleurs de marque Matiéra */
  --vert:   #223D26;   /* vert, texte principal et fonds pleins */
  --brun:   #9D9465;   /* brun, accent et pastille du logo */
  --beige:  #F1EDE1;   /* beige, fond du site */

  /* Tons dérivés des trois couleurs de marque */
  --vert-clair: #4A6B4E;
  --gris:       #78715C;
  --trait:      #DCD5C2;
  --beige-vif:  #FBF9F3;

  --mesure: 62ch;
  --marge: clamp(1.25rem, 5vw, 5rem);

  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --texte: Spectral, Georgia, "Times New Roman", serif;
  --ui: Spectral, Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--beige);
  color: var(--vert);
  font-family: var(--texte);
  font-size: 1.0625rem;
  line-height: 1.68;
  font-synthesis-weight: none;
}

/* ---------- bascule de langue ---------- */
html[data-lang="fr"] .en { display: none; }
html[data-lang="en"] .fr { display: none; }

/* ---------- liens ---------- */
a { color: inherit; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brun);
  outline-offset: 3px;
}

/* ---------- entete ---------- */
.tete {
  display: flex;
  align-items: baseline;
  gap: clamp(1rem, 4vw, 3rem);
  flex-wrap: wrap;
  padding: 1.75rem var(--marge) 1.25rem;
  border-bottom: 1px solid var(--trait);
}

.marque {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: auto;
}
.marque span { color: var(--brun); }

.menu { display: flex; gap: clamp(0.9rem, 2.5vw, 1.9rem); flex-wrap: wrap; }
.menu a {
  font-family: var(--ui);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.menu a:hover { border-bottom-color: var(--brun); }
.menu a[aria-current="page"] { border-bottom-color: var(--vert-clair); }

.bascule {
  font-family: var(--ui);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: none;
  border: 1px solid var(--trait);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  color: inherit;
}
.bascule:hover { border-color: var(--vert); }

/* ---------- structure ---------- */
.bande { padding: clamp(3rem, 8vw, 6rem) var(--marge); }
.bande + .bande { border-top: 1px solid var(--trait); }
.bande.sombre {
  background: var(--vert);
  color: var(--beige);
  border-top: none;
}
.bande.sombre a { color: var(--brun); }

.mesure { max-width: var(--mesure); }

/* ---------- typographie ---------- */
h1, h2, h3 {
  font-family: var(--ui);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0 0 1rem;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6.2vw, 4.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); margin-bottom: 1.25rem; }
h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  margin-bottom: 0.45rem;
}

p { margin: 0 0 1.15rem; max-width: var(--mesure); }
p:last-child { margin-bottom: 0; }

.chapeau {
  font-size: clamp(1.1rem, 1.9vw, 1.35rem);
  line-height: 1.5;
  color: var(--gris);
  max-width: 54ch;
}
.sombre .chapeau { color: #C3BFA5; }

.fin { font-size: 0.875rem; color: var(--gris); line-height: 1.55; }
.sombre .fin { color: #9A9378; }

/* ---------- heros ---------- */
.heros { padding: clamp(2.5rem, 6vw, 4.5rem) var(--marge) 0; }
.heros h1 { max-width: 17ch; }
.heros .chapeau { margin-top: 1.5rem; }

/* ---------- grilles ---------- */
.trio {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.25rem);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: 2.5rem;
}
.trio p { margin-bottom: 0; }

/* ---------- etapes numerotees (vraie sequence) ---------- */
.etapes { margin: 2.5rem 0 0; padding: 0; list-style: none; counter-reset: etape; }
.etapes li {
  counter-increment: etape;
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--trait);
}
.sombre .etapes li { border-top-color: rgba(241, 237, 225, 0.2); }
.etapes li::before {
  content: counter(etape);
  font-family: var(--ui);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brun);
  line-height: 1;
  padding-top: 0.1rem;
}
.etapes p { margin-bottom: 0; }

/* ---------- tableau de specifications ---------- */
.specs { width: 100%; max-width: 44rem; border-collapse: collapse; margin-top: 2rem; }
.specs th, .specs td {
  text-align: left;
  padding: 0.85rem 0.5rem 0.85rem 0;
  border-bottom: 1px solid var(--trait);
  vertical-align: top;
}
.specs th {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.9375rem;
  width: 14rem;
}
.specs td { font-variant-numeric: tabular-nums; }

/* ---------- bouton ---------- */
.bouton {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  background: var(--brun);
  color: var(--vert);
  padding: 0.8rem 1.6rem;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  margin-top: 1.75rem;
}
.bouton:hover { background: var(--vert); color: var(--brun); }
.bande.sombre a.bouton { background: var(--brun); color: var(--vert); }
.bande.sombre a.bouton:hover { background: var(--beige); color: var(--vert); }

/* ---------- formulaire ---------- */
.form { max-width: 34rem; margin-top: 2.25rem; }
.form label {
  display: block;
  font-family: var(--ui);
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 1.35rem 0 0.4rem;
}
.form input, .form select, .form textarea {
  width: 100%;
  font-family: var(--texte);
  font-size: 1rem;
  color: inherit;
  background: #FFF;
  border: 1px solid var(--trait);
  border-radius: 2px;
  padding: 0.65rem 0.75rem;
}
.form textarea { min-height: 8rem; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: 2px solid var(--brun);
  outline-offset: 0;
  border-color: var(--brun);
}

/* ---------- pied ---------- */
.pied {
  padding: 2.5rem var(--marge) 3rem;
  border-top: 1px solid var(--trait);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  align-items: baseline;
  font-size: 0.875rem;
  color: var(--gris);
}
.pied a { text-decoration: none; border-bottom: 1px solid var(--trait); }
.pied a:hover { border-bottom-color: var(--brun); }
.pied .droite { margin-left: auto; }


/* ---------- logo dans l'en-tete ---------- */
.marque { display: block; text-decoration: none; line-height: 0; }
.marque-img { height: 3.2rem; width: auto; display: block; }
@media (max-width: 30rem) { .marque-img { height: 2.6rem; } }
.tete { background: var(--beige-vif); }
.form input, .form select, .form textarea { background: var(--beige-vif); }

/* ---------- questions et reponses ---------- */
.qr { border-top: 1px solid var(--trait); padding: 0; }
.qr:last-of-type { border-bottom: 1px solid var(--trait); }
.qr summary {
  font-family: var(--display); font-size: clamp(1.05rem, 1.9vw, 1.28rem);
  font-weight: 500; line-height: 1.35; padding: 1.15rem 2.5rem 1.15rem 0;
  cursor: pointer; list-style: none; position: relative;
}
.qr summary::-webkit-details-marker { display: none; }
.qr summary::after {
  content: "+"; position: absolute; right: 0.35rem; top: 1rem;
  font-size: 1.5rem; line-height: 1; color: var(--brun); font-weight: 400;
}
.qr[open] summary::after { content: "\2013"; }
.qr summary:hover { color: var(--vert-clair); }
.qr .rep { padding: 0 2.5rem 1.4rem 0; color: var(--gris); }
.qr .rep p { margin-bottom: 0.9rem; max-width: var(--mesure); }
.qr .rep p:last-child { margin-bottom: 0; }
.qr .lieux { list-style: none; margin: 0 0 0.9rem; padding: 0; }
.qr .lieux li {
  padding: 0.35rem 0 0.35rem 1.1rem;
  border-left: 2px solid var(--brun);
  margin-bottom: 0.4rem;
}
.qr .lieux strong { color: var(--vert); font-weight: 500; }

/* ---------- adresse et carte ---------- */
.adresse { font-style: normal; line-height: 1.75; margin: 1.5rem 0 1.75rem; }


/* ---------- cycle de recyclage ---------- */
.cycle {
  display: block;
  width: 100%;
  max-width: 47rem;
  height: auto;
  margin: clamp(2rem, 5vw, 3.25rem) auto 0;
  overflow: visible;
}
.cycle .arc { fill: none; stroke-width: 27; stroke-linecap: butt; }
.cycle .a1 .arc, .cycle .a1 .tete { stroke: var(--brun); fill: var(--brun); }
.cycle .a2 .arc, .cycle .a2 .tete { stroke: var(--vert-clair); fill: var(--vert-clair); }
.cycle .a3 .arc, .cycle .a3 .tete { stroke: var(--vert); fill: var(--vert); }
.cycle .arc { fill: none; }
.cycle .tete { stroke: none; }
/* Les regles de couleur ci-dessus donnent aussi un remplissage aux arcs :
   on le retire, sinon le navigateur remplit la corde et le bord interieur parait droit. */
.cycle .bras .arc { fill: none; }
.cycle .num {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: middle;
  fill: var(--gris);
}
.cycle .etq-titre {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 500;
  fill: var(--vert);
}
.cycle .etq-det {
  font-family: var(--texte);
  font-size: 18px;
  fill: var(--gris);
}

.cycle .bras { opacity: 0; animation: apparait 0.75s ease-out forwards; }
.cycle .a1 { animation-delay: 0.20s; }
.cycle .a2 { animation-delay: 0.75s; }
.cycle .a3 { animation-delay: 1.30s; }
@keyframes apparait { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .cycle .bras { animation: none; opacity: 1; }
}

/* Sous 46rem, le texte du schema deviendrait illisible : on le sort du SVG
   et on affiche la liste sous un symbole reduit. */

.etapes-cycle {
  display: none;                 /* visible uniquement sous 48rem */
  list-style: none;
  counter-reset: ec;
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding: 0;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.etapes-cycle li { counter-increment: ec; }
.etapes-cycle li::before {
  content: counter(ec);
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--brun);
  line-height: 1;
  margin-bottom: 0.55rem;
}
.etapes-cycle p { margin-bottom: 0; color: var(--gris); }

/* ---------- photo ---------- */
.photo { margin: clamp(2rem, 4vw, 3rem) 0 0; max-width: 46rem; }
.photo img {
  width: 100%; height: auto; display: block;
  border-radius: 2px; border: 1px solid var(--trait);
}
.photo figcaption {
  margin-top: 0.65rem; font-size: 0.875rem; color: var(--gris);
}

.cycle-compact { display: none; }

/* Sous 48rem, le texte du schema deviendrait illisible : on affiche le
   symbole seul et les trois etapes en liste sous celui-ci. */
@media (max-width: 48rem) {
  .cycle-large { display: none; }
  .cycle-compact { display: block; max-width: 12.5rem; }
  .etapes-cycle { display: grid; }
}

/* ---------- lien social ---------- */
.social {
  display: inline-flex;
  align-items: center;
  color: var(--gris);
  border-bottom: none;
  transition: color 0.15s ease;
}
.social svg { width: 1.55rem; height: 1.55rem; fill: currentColor; display: block; }
.social:hover, .social:focus-visible { color: var(--brun); }
.pied .social { border-bottom: none; }

.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- points de collecte ---------- */
.carte-qc {
  display: block;
  width: 100%;
  max-width: 52rem;
  height: auto;
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  border: 1px solid var(--trait);
  border-radius: 2px;
}
.carte-qc .eau      { fill: #E7E5D9; }
.carte-qc .voisins  { fill: #EFECE2; stroke: #D3CDB9; stroke-width: 1.5; }
.carte-qc .quebec   { fill: #DCD4BB; stroke: #B9B199; stroke-width: 1.8; }
.carte-qc .lacs     { fill: #E7E5D9; stroke: #CFC9B4; stroke-width: 1; }

.carte-qc .ville-pt  { fill: #A39B7E; }
.carte-qc .ville-nom { font-family: var(--texte); font-size: 20px; fill: #7C7560; }

.carte-qc .halo   { fill: var(--brun); opacity: 0.22; }
.carte-qc .coeur  { fill: var(--vert); }
.carte-qc .num    { font-family: var(--ui); font-size: 13px; font-weight: 600;
                    fill: #F1EDE1; text-anchor: middle; dominant-baseline: middle; }
.carte-qc .pt-nom { font-family: var(--display); font-size: 26px; font-weight: 500;
                    fill: var(--vert); }

@media (max-width: 48rem) {
  .carte-qc .ville-pt, .carte-qc .ville-nom { display: none; }
  .carte-qc .pt-nom { font-size: 42px; }
  .carte-qc .halo { r: 26; }
  .carte-qc .coeur { r: 13; }
  .carte-qc .num { font-size: 18px; }
}

.lieu h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.9rem; }
.lieu .pastille {
  flex: none;
  align-self: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--vert);
  color: var(--beige);
  font-family: var(--ui);
  font-size: 1rem;
  font-weight: 600;
  line-height: 2rem;
  text-align: center;
  letter-spacing: 0;
}
.lieu .ville {
  font-family: var(--display);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  color: var(--gris);
}
.fiche {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.75rem);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: 1.75rem;
}
.fiche h3 { color: var(--vert); margin-bottom: 0.5rem; }
.fiche address { font-style: normal; line-height: 1.7; color: var(--gris); }
.fiche .lien-carte { margin: 0.5rem 0 0; }
.fiche .lien-carte a {
  font-family: var(--ui);
  font-size: 0.9375rem;
  color: var(--vert);
  text-decoration: none;
  border-bottom: 1px solid var(--brun);
  padding-bottom: 1px;
}
.fiche .lien-carte a:hover { border-bottom-color: var(--vert); }
.fiche p { margin-bottom: 0.85rem; color: var(--gris); }
.fiche p:last-child { margin-bottom: 0; }
.fiche .restriction {
  font-size: 0.875rem;
  line-height: 1.55;
  padding-left: 0.85rem;
  border-left: 2px solid var(--brun);
}
.fiche a { color: var(--vert); }

/* ---------- galerie d'un point de collecte ---------- */
.photos {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
  max-width: 46rem;
}
.photos figure { margin: 0; }
.photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  border: 1px solid var(--trait);
}
.photos figcaption { margin-top: 0.6rem; font-size: 0.875rem; color: var(--gris); }

/* ---------- grille de quatre services ----------
   4 colonnes sur grand ecran, 2 x 2 sur tablette, 1 colonne sur cellulaire,
   pour eviter une ligne de 3 suivie d'un bloc seul. */
.trio.quatre { grid-template-columns: 1fr; }
@media (min-width: 40rem) { .trio.quatre { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 68rem) { .trio.quatre { grid-template-columns: repeat(4, 1fr); } }

/* ---------- intro avec photo (page A propos) ---------- */
.heros-duo { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; margin-top: 1.5rem; }
.heros-duo .chapeau { margin-top: 0; }
.portrait { margin: 0; }
.portrait img { width: 100%; height: auto; display: block; border-radius: 2px; border: 1px solid var(--trait); }
@media (min-width: 48rem) { .heros-duo { grid-template-columns: 1fr 1fr; } }

/* ---------- clin d'oeil a cote de la photo de l'atelier ---------- */
.photos.garage { align-items: center; max-width: none; grid-template-columns: 1fr; }
@media (min-width: 56rem) {
  .photos.garage { grid-template-columns: minmax(0, 46rem) 1fr; gap: clamp(1.5rem, 3vw, 3rem); }
  .photos.garage .clin { justify-self: center; text-align: center; max-width: 22rem; }
}
.clin {
  margin: 0; font-family: var(--display); font-style: italic;
  font-size: clamp(1.1rem, 1.8vw, 1.3rem); line-height: 1.45; color: var(--vert);
}
