@font-face {
  font-display: swap;
  font-family: Gilroy;
  font-style: normal;
  font-weight: 700;
  src: url("../fonts/gilroy-bold.woff") format("woff");
}

@font-face {
  font-display: swap;
  font-family: Gilroy;
  font-style: normal;
  font-weight: 800;
  src: url("../fonts/gilroy-extrabold.woff") format("woff");
}

:root {
  --ink: #333d42;
  --muted: #778a93;
  --paper: #ffffff;
  --paper-2: #f6f4f8;
  --line: #d4d4d6;
  --orange: #f7941d;
  --orange-dark: #de7f0c;
  --teal: #029ba1;
  --teal-dark: #007f7f;
  --teal-light: #20bdc3;
  --red: #f84425;
  --navy: #00667f;
  --shadow: 0 12px 40px rgba(51, 61, 66, 0.08);
  --radius: 18px;
  --header-h: 4.6rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.5 Sen, "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a {
  color: var(--teal-dark);
  text-decoration: none;
}

a:hover { color: var(--orange); }

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.brand img {
  display: block;
  width: auto;
  height: 3.6rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem 1.5rem;
  font-size: 0.95rem;
}

.nav a {
  color: var(--ink);
  font-weight: 600;
}

.nav a.is-active,
.nav a:hover {
  color: var(--orange);
}

.brand-bar {
  height: 6px;
  background: linear-gradient(90deg, var(--navy) 0 25%, var(--orange) 25% 50%, var(--red) 50% 75%, var(--teal-light) 75% 100%);
}

.site-main {
  flex: 1;
  padding: 2.5rem 0 4rem;
}

.hero {
  padding: 1rem 0 2.5rem;
}

.hero h1,
.conseil-head h1 {
  margin: 0 0 0.5rem;
  font-family: Gilroy, Sen, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hero p,
.lede {
  margin: 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.conseil-list {
  display: grid;
  gap: 1.25rem;
}

.conseil-card {
  display: grid;
  grid-template-columns: 8.5rem 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.4rem 1.6rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.conseil-card:hover {
  transform: translateY(-2px);
  border-color: var(--orange);
  color: inherit;
}

.date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 6.2rem;
  padding: 0.7rem;
  background: #fff8ee;
  border-radius: 14px;
  text-align: center;
}

.date-badge .day {
  font-family: Gilroy, Sen, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
}

.date-badge .month {
  color: var(--orange);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.card-body h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.card-cta {
  color: var(--orange);
  font-weight: 700;
  white-space: nowrap;
}

.conseil-head {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.conseil-head .meta { margin-top: 0.4rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.55rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover { background: var(--orange-dark); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: transparent;
}

.player {
  position: sticky;
  top: calc(var(--header-h) + 6px);
  z-index: 15;
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1.75rem;
  padding: 1rem 1.2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.player-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.85rem 1rem;
}

.player-copy {
  min-width: 0;
}

.player-copy strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.3;
}

.player-copy span {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.timeline {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--muted);
}

.timeline input[type="range"] {
  width: 100%;
  accent-color: var(--orange);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

.panel {
  padding: 1.2rem 0 0;
}

.panel h2 {
  margin: 0 0 1rem;
  font-family: Gilroy, Sen, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
}

.hint {
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.chapitre-list {
  display: grid;
  gap: 0.45rem;
}

.chapitre-bloc.is-open .chapitre {
  border-radius: 12px 12px 0 0;
}

.chapitre {
  display: grid;
  grid-template-columns: 4.4rem 1fr auto;
  gap: 0.8rem;
  align-items: start;
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--paper-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.chapitre:hover,
.chapitre.is-active {
  border-color: var(--orange);
  background: #fff8ee;
}

.chapitre.is-active { box-shadow: inset 3px 0 0 var(--orange); }

.transcription {
  max-height: min(32rem, 52vh);
  overflow: auto;
  padding: 0.75rem 0.9rem 0.9rem;
  border: 1px solid var(--orange);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #fff;
  scroll-margin-top: calc(var(--header-h) + 9.5rem);
}

.transcription-vide {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.replique {
  display: grid;
  grid-template-columns: 7.2rem 1fr;
  gap: 0.7rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.4rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.replique time {
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.replique:hover,
.replique.is-current {
  background: var(--paper-2);
}

.replique.is-current {
  box-shadow: inset 3px 0 0 var(--teal);
}

.replique.is-hit {
  background: #fff3df;
  box-shadow: inset 3px 0 0 var(--orange);
}

.chapitre.is-retire {
  opacity: 0.72;
  cursor: pointer;
}

.chapitre.is-retire .chapitre-title {
  text-decoration: line-through;
}

.chapitre-num,
.chapitre-time {
  color: var(--orange);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chapitre-title { font-weight: 600; }

.chapitre-note {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
  text-decoration: none;
}

.badge {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #fde8e4;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.site-footer {
  padding: 2.5rem 0 1.4rem;
  background: var(--paper-2);
  color: var(--ink);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.footer-title {
  margin: 0 0 0.7rem;
  font-weight: 800;
}

.communes,
.footer-links {
  display: grid;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.communes {
  grid-template-columns: 1fr 1fr;
}

.footer-links {
  grid-template-columns: 1fr;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.empty, .error {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--paper-2);
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.search-form input[type="search"] {
  flex: 1 1 16rem;
  min-height: 2.6rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: inherit;
  font: inherit;
}

.prochain-card {
  margin: 1.75rem 0 0;
  padding: 1rem 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.prochain-label {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.prochain-card h2 {
  margin: 0 0 0.25rem;
  font-family: Gilroy, Sen, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.prochain-card .meta {
  font-size: 0.88rem;
}

.prochain-card .hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.resultats { margin: 0 0 2rem; }
.resultats h2 {
  margin: 0 0 0.8rem;
  font-family: Gilroy, Sen, sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
}

.resultat {
  display: block;
  margin-bottom: 0.6rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
}

.resultat:hover {
  border-color: var(--orange);
  color: inherit;
}

.resultat strong { display: block; }
.resultat p { margin: 0.4rem 0 0; color: var(--ink); }
.resultat mark {
  background: #fff1d6;
  color: inherit;
}

.reprise[hidden] {
  display: none;
}

.reprise {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.2rem 0.2rem;
  color: var(--teal-dark);
  font-size: 0.92rem;
  font-weight: 600;
}

.btn-lien {
  padding: 0;
  border: 0;
  background: none;
  color: var(--teal-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn-lien:hover { color: var(--orange); }

.badge-vote {
  margin-left: 0.35rem;
  background: #e7f6f6;
  color: var(--teal-dark);
}

.badge-vote.is-majorite,
.badge-vote.is-abstention {
  background: #fff4e0;
  color: #b56a00;
}

.badge-vote.is-defavorable {
  background: #fde8e4;
  color: var(--red);
}

.transcription-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  margin-bottom: 0.55rem;
}

.transcription-toolbar .btn-lien {
  align-self: flex-end;
}

.transcription-note {
  margin: 0;
  font-size: 0.82rem;
}

.page-texte {
  max-width: 42rem;
}

.page-texte h1 {
  margin: 0 0 1rem;
  font-family: Gilroy, Sen, sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
}

.page-texte h2 {
  margin: 1.8rem 0 0.5rem;
  font-family: Gilroy, Sen, sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
}

.page-texte p { margin: 0 0 0.8rem; }

@media (min-width: 720px) {
  .brand img { height: 4rem; }
  .footer-grid { grid-template-columns: 1.1fr 1.4fr 1fr; }
  .conseil-head {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

@media (max-width: 700px) {
  .conseil-card {
    grid-template-columns: 5.6rem 1fr;
  }
  .card-cta { display: none; }
  .chapitre {
    grid-template-columns: 2.4rem 1fr;
  }
  .chapitre-time {
    grid-column: 2;
  }
}
