/* Feuille de style du site Ménard/St-Amand
   Les couleurs et polices sont regroupées ici pour être modifiées facilement. */
:root {
  --texte: #575757;
  --texte-pale: #8a8a8a;
  --fond: #ffffff;
  --fond-doux: #f3f3f3;
  --ligne: #dddddd;
  --accent: #333333;
  --largeur: 1200px;
  --police-titres: all-round-gothic, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --police-texte: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--texte); text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--police-titres); font-weight: 700; line-height: 1.2; color: var(--texte); }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: 0.08em; margin: 2rem 0 1.5rem; }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); margin: 2rem 0 1rem; }
h3 { font-size: 1.15rem; margin: 1.5rem 0 1rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.visuellement-cache {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.lien-evitement { position: absolute; left: -9999px; top: 0; background: #fff; padding: 0.5rem 1rem; z-index: 10; }
.lien-evitement:focus { left: 1rem; }

/* En-tête et navigation */
.entete {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.logo img { width: 220px; }
.navigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.navigation a {
  font-family: var(--police-titres);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.04em;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.navigation a:hover, .navigation a[aria-current="page"] { border-bottom-color: currentColor; }

main { max-width: var(--largeur); margin: 0 auto; padding: 0 1.25rem 3rem; }

.pied {
  border-top: 1px solid var(--ligne);
  max-width: var(--largeur);
  margin: 2rem auto 0;
  padding: 1.5rem 1.25rem 2.5rem;
  font-size: 0.9rem;
  color: var(--texte-pale);
}
.pied p { margin: 0.25rem 0; }

.texte { max-width: 48rem; }
.texte p { margin: 0 0 1rem; }
.intro { max-width: 48rem; }

/* Accueil */
.vedettes {
  display: grid;
  grid-template-columns: repeat(var(--colonnes, 2), minmax(0, 1fr));
  gap: var(--espace, 2.5rem);
  margin-top: 1.5rem;
}
.vedette { margin: 0; position: relative; background: var(--fond-doux); }
.vedette video, .vedette img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.vedette-image img { aspect-ratio: auto; height: 100%; object-fit: cover; background: none; }
/* Options de mise en page choisies dans le panneau admin */
.vedette.taille-large { grid-column: span 2; }
.vedette.taille-pleine { grid-column: 1 / -1; }
.vedette.hauteur-double { grid-row: span 2; display: flex; flex-direction: column; }
.vedette.hauteur-double img { flex: 1 1 0; min-height: 0; height: auto; aspect-ratio: auto; }
.vedette-image:not(.hauteur-double) img { aspect-ratio: 16 / 9; }
.vedette figcaption {
  padding: 0.8rem 1rem;
  font-family: var(--police-titres);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.vedette figcaption a { text-decoration: none; }
.vedette figcaption a:hover { text-decoration: underline; }
.bio { margin: calc(var(--espace, 2.5rem) * 1.6) auto 0; font-size: 1.125rem; }
.credits { margin: calc(var(--espace, 2.5rem) * 1.6) 0 0; }
.partenaires { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2.5rem; }
.partenaires img { height: 56px; width: auto; }

/* Réalisations */
.projet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem 3rem;
  padding: 1rem 0 3rem;
  border-bottom: 1px solid var(--ligne);
  scroll-margin-top: 1rem;
}
.projet:last-of-type { border-bottom: 0; }
.projet h2 { margin-top: 0.5rem; }
.projet .annee { font-family: var(--police-texte); font-weight: 400; font-size: 1rem; color: var(--texte-pale); margin-left: 0.5rem; }
.projet-principale { width: 100%; }
.projet-galerie { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.projet-galerie img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.projet-texte { padding-top: 3.2rem; }

/* En cours */
.en-cours { margin-bottom: 3rem; }
.video-externe { position: relative; aspect-ratio: 16 / 9; max-width: 960px; }
.video-externe iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.en-cours video { width: 100%; max-width: 960px; }

/* Presse */
.presse { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.presse a { display: block; text-decoration: none; border: 1px solid var(--ligne); height: 100%; }
.presse a:hover { border-color: var(--texte); }
.presse img { width: 100%; aspect-ratio: 1275 / 380; object-fit: cover; object-position: top; }
.presse span { display: block; padding: 0.75rem 1rem; font-weight: 700; }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem 3rem; align-items: center; }
.contact figure { margin: 0; }
.contact figcaption { font-size: 0.85rem; color: var(--texte-pale); margin-top: 0.4rem; }
.contact .courriel a { font-size: 1.4rem; font-weight: 700; }

/* Applications */
.cartes-applications { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.cartes-applications a { display: block; text-decoration: none; background: var(--fond-doux); }
.cartes-applications img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.cartes-applications span { display: block; padding: 0.75rem 1rem; font-family: var(--police-titres); font-weight: 700; letter-spacing: 0.06em; }

/* Pages des instruments */
.instrument-entete { text-align: center; }
.instrument-entete h1 { letter-spacing: 0.2em; margin-bottom: 0.5rem; }
.instrument-video { width: 100%; max-width: 960px; margin: 2rem auto; background: #000; }
.instrument-intro { margin: 0 auto 2rem; }
.instrument-intro h2 { text-align: center; letter-spacing: 0.15em; }
.module { margin: 3rem 0; }
.module h3 { text-align: center; }

.module-photo { position: relative; width: 100%; margin: 0 auto; user-select: none; -webkit-user-select: none; }
.module-photo > * { position: absolute; }
.module-photo > .module-fond { position: static; width: 100%; height: 100%; object-fit: fill; }
#telharmonium .module-photo { max-width: 1100px; }

.poussoir {
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  background: url("/assets/img/instruments/bouton-off.webp") center / 100% 100% no-repeat;
  z-index: 3;
}
.poussoir[aria-pressed="true"] { background-image: url("/assets/img/instruments/bouton-on.webp"); }

.rotatif { aspect-ratio: 1; z-index: 3; cursor: grab; touch-action: none; border-radius: 50%; }
.rotatif:active { cursor: grabbing; }
.rotatif img { width: 100%; height: 100%; pointer-events: none; transition: transform 40ms linear; }

.del { opacity: 0.4; z-index: 2; pointer-events: none; }
.del.allumee { opacity: 1; }
.del-drum { opacity: 0; z-index: 2; pointer-events: none; transform: translateY(-25%); }
.del-drum.allumee { opacity: 0.9; }
.moteur { z-index: 2; pointer-events: none; }
.baguette { z-index: 1; pointer-events: none; transform-origin: left center; transform: rotate(9deg); transition: transform 60ms ease-out; }
.baguette.levee { transform: rotate(0deg); }

#on-off { max-width: 1100px; margin: 0 auto; }
#on-off .ecran { width: 73.6%; }
.cable { z-index: 2; pointer-events: none; }
.cable[hidden] { display: none; }
.connecteur {
  border: 0; padding: 0; background: transparent; cursor: pointer; z-index: 3; border-radius: 50%;
}
.connecteur::after { content: ""; position: absolute; inset: -60%; border-radius: 50%; }
.connecteur:hover, .connecteur:focus-visible { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8); }
.interrupteur, .bascule {
  border: 0; padding: 0; cursor: pointer; z-index: 3;
  background: center / 100% 100% no-repeat;
}
.interrupteur { background-image: url("/assets/img/instruments/interrupteur-off.webp"); }
.interrupteur[aria-pressed="true"] { background-image: url("/assets/img/instruments/interrupteur-on.webp"); }
.bascule { background-image: url("/assets/img/instruments/bascule-off.webp"); }
.bascule[aria-pressed="true"] { background-image: url("/assets/img/instruments/bascule-on.webp"); }

/* Séquenceur */
.sequenceur-section { margin: 4rem 0 0; }
.sequenceur-section h2 { text-align: center; }
.sequenceur-section .texte { margin: 0 auto 1.5rem; }
.avis-mobile { display: none; text-align: center; font-style: italic; }

.seq { background: #cccccc; padding: 4px; color: #fdfdfd; max-width: 1100px; margin: 0 auto; }
.seq-controles { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding: 6px; }
.seq-principal { display: flex; align-items: center; gap: 1rem; }
.seq-lecture {
  width: 56px; height: 56px; border: 0; background: #b2b2b2; color: #fff; font-size: 1.6rem; cursor: pointer;
}
.seq-lecture:hover { background: #9a9a9a; }
.seq-duree { display: flex; align-items: stretch; height: 40px; }
.seq-duree button, .seq-duree input {
  font: inherit; font-size: 1.1rem; color: #666; background: #fff; border: 2px solid #666; margin: 0;
}
.seq-duree button { width: 40px; cursor: pointer; }
.seq-duree button:hover { background: #666; color: #fff; }
.seq-duree input { width: 70px; text-align: center; border-left: 0; border-right: 0; -moz-appearance: textfield; appearance: textfield; }
.seq-duree input::-webkit-inner-spin-button, .seq-duree input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.seq-duree input:disabled { background: #666; color: #fff; }
.seq-variations { display: flex; flex-wrap: wrap; gap: 6px; }
.seq-variations button {
  border: 0; padding: 0.6rem 1rem; font: inherit; font-size: 1rem; cursor: pointer; background: #cccccc; color: var(--c);
  box-shadow: inset 0 0 0 2px var(--c);
}
.seq-variations button[aria-pressed="true"] { background: var(--c); color: #cccccc; }
.seq-grille { display: flex; flex-direction: column; gap: 1px; }
.seq-rangee { display: grid; grid-template-columns: 120px repeat(var(--pas), minmax(0, 1fr)); gap: 1px; }
.seq-etiquette { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 0.9rem; padding: 0 4px; min-height: 64px; }
.seq-cellule {
  position: relative; min-height: 64px; background: #ededed; cursor: pointer; overflow: hidden; outline-offset: -2px;
}
.seq-cellule:hover { background: rgba(196, 196, 196, 0.5); }
.seq-cellule.active { background: rgba(196, 196, 196, 0.5); }
.seq-cellule .niveau { position: absolute; left: 0; right: 0; bottom: 0; background: var(--c); opacity: 0.85; pointer-events: none; }
.seq-cellule.pas-courant { box-shadow: inset 0 0 0 3px #ffffff; }
.seq.en-lecture .seq-cellule { cursor: not-allowed; }

/* Écrans moyens et petits */
@media (max-width: 900px) {
  .projet, .contact { grid-template-columns: 1fr; }
  .projet-texte { padding-top: 0; }
  .vedettes { grid-template-columns: 1fr; }
  .vedette { grid-column: auto !important; grid-row: auto !important; }
  .avis-mobile { display: block; }
  .seq-rangee { grid-template-columns: 72px repeat(var(--pas), minmax(0, 1fr)); }
  .seq-etiquette { font-size: 0.7rem; min-height: 48px; }
  .seq-cellule { min-height: 48px; }
}
@media (max-width: 600px) {
  .logo img { width: 170px; }
  #on-off .ecran { width: 100%; }
  .seq-controles { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .rotatif img, .baguette { transition: none; }
}
