/* ==========================================================================
   Tizipedia — Composants réutilisables
   ========================================================================== */

/* --- Icônes (famille unique : tracé 1,75 px, hérite de currentColor) ----- */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Sur-titre ---------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  color: var(--color-blue);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  flex-shrink: 0;
  width: 1.75rem;
  height: 2px;
  border-radius: 2px;
  background: var(--color-green);
}

/* Titre de section introduit par le tiret vert de l'eyebrow (D-39 ; partagé depuis D-41) :
   mêmes dimensions (1,75 rem × 2 px) et même écart que .eyebrow::before. */
.section-title::before {
  content: "";
  display: inline-block;
  width: 1.75rem;
  height: 2px;
  margin-right: var(--space-3);
  border-radius: 2px;
  background: var(--color-green);
  vertical-align: middle;
}

.on-dark .eyebrow {
  color: var(--color-on-dark-soft);
}

/* --- Boutons ------------------------------------------------------------ */
.btn {
  --btn-bg: var(--color-blue);
  --btn-fg: var(--color-on-dark);
  --btn-border: var(--color-blue);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 48px;
  padding: 0.75rem 1.375rem;
  border: 1.5px solid var(--btn-border);
  border-radius: var(--radius-btn);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-heading);
  font-size: 0.96875rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-fast) ease,
              border-color var(--duration-fast) ease,
              color var(--duration-fast) ease,
              box-shadow var(--duration-base) var(--ease-out);
}

.btn .icon {
  width: 1.125rem;
  height: 1.125rem;
  transition: transform var(--duration-base) var(--ease-out);
}

.btn:hover {
  --btn-bg: var(--color-blue-strong);
  --btn-border: var(--color-blue-strong);
  color: var(--btn-fg);
  box-shadow: 0 10px 24px -12px rgb(1 74 125 / 0.55);
}

.btn:hover .icon-arrow {
  transform: translateX(3px);
}

.btn:active {
  box-shadow: none;
  transform: translateY(1px);
}

.btn:focus-visible {
  outline-offset: 3px;
}

.btn[aria-disabled="true"],
.btn:disabled {
  --btn-bg: var(--color-border);
  --btn-border: var(--color-border);
  --btn-fg: var(--color-text-soft);
  box-shadow: none;
  cursor: not-allowed;
}

/* Bouton vert (maquette) : vert de marque assombri pour un contraste AA avec le texte blanc. */
.btn--green {
  --btn-bg: var(--color-green-strong);
  --btn-border: var(--color-green-strong);
}

.btn--green:hover {
  --btn-bg: var(--color-green-stronger);
  --btn-border: var(--color-green-stronger);
  box-shadow: 0 10px 24px -12px rgb(6 107 27 / 0.55);
}

.btn--secondary {
  --btn-bg: transparent;
  --btn-fg: var(--color-blue);
  --btn-border: var(--color-blue);
}

.btn--secondary:hover {
  --btn-bg: var(--color-mist-blue);
  --btn-fg: var(--color-blue-strong);
  --btn-border: var(--color-blue-strong);
  box-shadow: none;
}

.on-dark .btn--secondary {
  --btn-fg: var(--color-on-dark);
  --btn-border: rgb(255 255 255 / 0.55);
}

.on-dark .btn--secondary:hover {
  --btn-bg: rgb(255 255 255 / 0.1);
  --btn-fg: var(--color-on-dark);
  --btn-border: var(--color-on-dark);
}

/* Lien tertiaire avec flèche */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  color: var(--color-blue);
  font-family: var(--font-heading);
  font-size: 0.96875rem;
  font-weight: 700;
  text-decoration: none;
}

.link-arrow .icon {
  width: 1.125rem;
  height: 1.125rem;
  transition: transform var(--duration-base) var(--ease-out);
}

.link-arrow span {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
  transition: background-size var(--duration-base) var(--ease-out);
}

.link-arrow:hover span {
  background-size: 100% 1.5px;
}

.link-arrow:hover .icon {
  transform: translateX(3px);
}

.on-dark .link-arrow {
  color: var(--color-on-dark);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
}

/* --- Liste de données pratiques (date, lieu…) --------------------------- */
.facts {
  display: grid;
  border-top: 1px solid var(--color-border);
}

/* Structure : div.facts__item > dt (pictogramme + libellé) + dd */
.facts__item {
  position: relative;
  padding-block: var(--space-4);
  padding-left: calc(2.75rem + var(--space-4));
  border-bottom: 1px solid var(--color-border);
}

.facts__icon {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: var(--color-mist-blue);
  color: var(--color-blue);
}

.facts__icon .icon {
  width: 1.375rem;
  height: 1.375rem;
}

.facts dt {
  color: var(--color-text-soft);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.facts dd {
  margin-top: 0.125rem;
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* --- Encart d'information ---------------------------------------------- */
.notice {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--color-green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--color-mist-green);
  color: var(--color-navy);
  font-size: var(--fs-small);
  line-height: var(--lh-meta);
}

.notice strong {
  display: block;
  margin-bottom: 0.125rem;
  font-family: var(--font-heading);
  font-size: var(--fs-body);
}

/* ==========================================================================
   Fil d'Ariane
   ========================================================================== */

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  list-style: none;
  color: var(--color-text-soft);
  font-size: var(--fs-small);
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumbs li + li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 1.5px solid var(--color-border-strong);
  border-right: 1.5px solid var(--color-border-strong);
  transform: rotate(45deg);
}

.breadcrumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--color-text-soft);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--color-blue);
  text-decoration: underline;
}

.breadcrumbs [aria-current="page"] {
  color: var(--color-navy);
  font-weight: 600;
}

/* ==========================================================================
   Introduction de page (rubriques internes)
   ========================================================================== */

.page-intro {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-6) var(--section-space);
  border-bottom: 1px solid var(--color-border);
  background:
    radial-gradient(44rem 30rem at 100% 0%, rgb(239 248 240 / 0.9), transparent 70%),
    var(--color-mist-blue);
}

.page-intro__decor {
  position: absolute;
  top: 50%;
  right: -10rem;
  width: 34rem;
  height: auto;
  color: var(--color-blue);
  opacity: 0.1;
  transform: translateY(-50%);
  pointer-events: none;
}

.page-intro__inner {
  position: relative;
}

.page-intro .breadcrumbs {
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}

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

.page-intro__lead {
  margin-top: var(--space-5);
  font-size: var(--fs-lead);
}

.page-intro .btn-group {
  margin-top: var(--space-6);
}

@media (max-width: 47.9375em) {
  .page-intro__decor {
    display: none;
  }
}

/* ==========================================================================
   Badge (accueil, pied de page)
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: 0.3rem 0.75rem 0.3rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--color-mist-green);
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 750;
  letter-spacing: 0.02em;
}

.badge .icon {
  width: 1rem;
  height: 1rem;
  color: var(--color-green-strong);
}

/* ==========================================================================
   Actualités : grille de cartes et état vide (accueil, page Actualités, D-33)
   ========================================================================== */

.news__grid {
  display: grid;
  gap: var(--space-5);
  list-style: none;
}

.news-card__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}

.news-card:hover .news-card__inner {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

/* Couvertures 4:3 (illustrations de ~495 × 370 px, jamais agrandies au-delà de 480 px). */
.news-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-mist-blue);
}

.news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
}

.news-card__category {
  align-self: flex-start;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--color-mist-green);
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.news-card__title {
  flex: 1;
  font-size: 1.1875rem;
  line-height: 1.3;
}

.news-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-small);
}

.news-card__date {
  color: var(--color-text-soft);
}

.news-card__meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-soft);
}

.news-card__meta .icon {
  width: 1rem;
  height: 1rem;
}

.news-card__date::before {
  content: "·";
  margin-inline: var(--space-2);
}

.news-card__more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  color: var(--color-blue);
  font-family: var(--font-heading);
  font-weight: 700;
  text-decoration: none;
}

/* Toute la carte est cliquable, le lien reste « Lire l'article ». */
.news-card__more::after {
  content: "";
  position: absolute;
  inset: 0;
}

.news-card__more .icon {
  width: 1rem;
  height: 1rem;
  transition: transform var(--duration-fast) ease;
}

.news-card:hover .news-card__more .icon {
  transform: translateX(3px);
}

.news-empty {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: clamp(2rem, 1.5rem + 3vw, 3.5rem) var(--space-5);
  border: 1px dashed var(--color-border-strong);
  border-radius: 24px;
  background: linear-gradient(160deg, #ffffff 0%, var(--color-mist-blue) 100%);
  text-align: center;
}

.news-empty__icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--color-mist-green);
  color: var(--color-blue);
}

.news-empty__icon .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.news-empty__title {
  max-width: 30rem;
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  font-weight: 700;
  line-height: 1.35;
}

.news-empty__text {
  max-width: 34rem;
}

@media (min-width: 48em) {
  .news__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 60em) {
  .news__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-card:hover .news-card__inner,
  .news-card:hover .news-card__more .icon {
    transform: none;
  }
}

/* ==========================================================================
   Accordéon (« Sources et ressources », D-35)
   Carte blanche, bordure discrète, bouton circulaire à chevron ; replié par
   défaut avec JavaScript (ouvert sans JavaScript).
   ========================================================================== */

.accordion {
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.accordion__heading {
  margin: 0;
  font-size: inherit;
}

.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  min-height: 4.5rem;
  padding: var(--space-4) var(--space-5);
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--color-navy);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.accordion__label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.accordion__lead-icon {
  width: 1.375rem;
  height: 1.375rem;
  color: var(--color-green-strong);
}

.accordion__title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 750;
}

.accordion__count {
  color: var(--color-text-soft);
  font-size: var(--fs-small);
}

.accordion__icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-mist-blue);
  color: var(--color-blue);
  transition: transform var(--duration-base) var(--ease-out), background-color var(--duration-fast) ease;
}

.accordion__icon .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.accordion__trigger:hover .accordion__icon {
  background: #e2f0f7;
}

.accordion__trigger[aria-expanded="true"] .accordion__icon {
  transform: rotate(180deg);
}

.accordion__panel {
  padding: 0 var(--space-5) var(--space-5);
}

.js .accordion__panel:not([hidden]) {
  animation: accordion-open var(--duration-base) var(--ease-out);
}

@keyframes accordion-open {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* Liste de références */
.source-list {
  display: grid;
  gap: 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
  list-style: none;
  counter-reset: source;
}

.source-list__item {
  position: relative;
  padding: var(--space-4) 0 var(--space-4) 2.25rem;
  counter-increment: source;
}

.source-list__item + .source-list__item {
  border-top: 1px dashed var(--color-border);
}

.source-list__item::before {
  content: counter(source);
  position: absolute;
  top: var(--space-4);
  left: 0;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--color-mist-green);
  color: var(--color-green-stronger);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 750;
}

.source-list__org {
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: var(--fs-small);
  font-weight: 750;
}

.source-list__link {
  display: inline;
  color: var(--color-blue);
  font-weight: 550;
  line-height: 1.45;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.source-list__link .icon {
  display: inline-block;
  width: 0.95rem;
  height: 0.95rem;
  margin-left: 0.3rem;
  vertical-align: -0.1em;
  transform: rotate(-45deg);
}

.source-list__date {
  margin-top: var(--space-1);
  color: var(--color-text-soft);
  font-size: var(--fs-xs);
}

@media (prefers-reduced-motion: reduce) {
  .js .accordion__panel:not([hidden]) {
    animation: none;
  }
}

/* --- Apparition au défilement (désactivée sans JS ou en mouvement réduit) */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-reveal) var(--ease-out),
              transform var(--duration-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Bouton « Revenir en haut de la page » (D-43)
   Créé par main.js sur toutes les pages ; masqué en haut de page, près du
   formulaire Tally et du bandeau inférieur du pied de page, et menu ouvert.
   ========================================================================== */

.back-to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.96);
  color: var(--color-blue);
  box-shadow: 0 6px 18px -8px rgb(18 59 89 / 0.45);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out),
              visibility 0s linear var(--duration-base), background-color var(--duration-fast) ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.back-to-top:hover {
  border-color: var(--color-blue);
  background: var(--color-mist-blue);
}

.back-to-top:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.back-to-top .icon {
  width: 1.25rem;
  height: 1.25rem;
  transform: rotate(-90deg);
}

.nav-open .back-to-top {
  opacity: 0;
  visibility: hidden;
}

@media (min-width: 60em) {
  .back-to-top {
    right: max(1.5rem, env(safe-area-inset-right));
    bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   Hero d'ouverture et carte « Prochaine journée médicale » (D-39)
   Déplacés tels quels depuis pages/home.css : partagés par l'accueil et le
   catalogue des Journées médicales (jonction hero / carte à cheval).
   ========================================================================== */

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(2.5rem, 1.2rem + 5vw, 5rem) clamp(5.5rem, 3.5rem + 6vw, 8.5rem);
  background:
    radial-gradient(46rem 28rem at 0% 100%, rgb(239 248 240 / 0.95), transparent 62%),
    radial-gradient(60rem 40rem at 100% 0%, #e1f0f8, transparent 68%),
    linear-gradient(180deg, #f4fafd 0%, #edf6fb 100%);
}

.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(2.5rem, 1.5rem + 4vw, 4rem);
  align-items: center;
}

.hero__content {
  max-width: 36rem;
}

.hero__title {
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.032em;
}

.hero__tagline {
  margin-top: var(--space-3);
  color: var(--color-blue);
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.hero__tagline::after {
  content: "";
  display: block;
  width: 4rem;
  height: 3px;
  margin-top: var(--space-4);
  border-radius: 3px;
  background: linear-gradient(90deg, var(--color-green), rgb(10 182 46 / 0.25));
}

.hero__lead {
  max-width: 33rem;
  margin-top: var(--space-5);
  font-size: var(--fs-lead);
  line-height: 1.6;
}

.hero__actions {
  margin-top: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem);
}

/* --- Photographie (image générée par IA, en attente d'approbation : D-23) - */
.hero__media {
  position: relative;
  width: 100%;
  max-width: 38rem;
  margin-inline: auto;
}

/* Le cadre porte la forme décalée : la légende placée dessous n'en modifie pas
   les proportions. */
.hero__frame {
  position: relative;
  display: block;
}

.hero__frame::before {
  content: "";
  position: absolute;
  inset: 7% -3% -5% 9%;
  border-radius: 40px;
  background: linear-gradient(135deg, rgb(10 182 46 / 0.16), rgb(1 91 153 / 0.12));
  transform: rotate(2.5deg);
}

.hero__media img {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 36px 36px 36px 120px;
  box-shadow: var(--shadow-lift);
  background: var(--color-mist-blue);
  object-fit: cover;
}

.hero__wave {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: clamp(48px, 7vw, 110px);
}

/* Petits écrans : rayon d'angle réduit, proportions 4:3 conservées. */
@media (max-width: 39.9375em) {
  .hero__media img {
    border-radius: 28px 28px 28px 80px;
  }

}

@media (min-width: 60em) {
  .hero__grid {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: clamp(3rem, 0.5rem + 4.5vw, 5.5rem);
  }

  .hero__media {
    margin-right: 0;
  }
}

/* Mobile (D-40) : le visuel remonte juste après le titre (et sa signature),
   avant le texte descriptif et les boutons. Réorganisation CSS sans
   duplication : le bloc de texte se fond dans la grille du hero. Le DOM et
   les rendus à partir de 40 em sont inchangés. */
@media (max-width: 39.9375em) {
  .hero__grid {
    row-gap: 0;
  }

  .hero__content {
    display: contents;
  }

  .hero__lead,
  .hero__actions {
    order: 2;
  }

  .hero__media {
    order: 1;
    margin-top: var(--space-6);
  }
}

/* ==========================================================================
   Prochaine journée médicale — à cheval sur le bas du hero
   Mobile (D-33) : affiche en premier, sur toute la largeur de la carte, puis
   en-tête, texte, date/lieu et bouton.
   ≥ 40em : affiche à gauche, contenu à droite.
   ========================================================================== */

.event-teaser {
  position: relative;
  z-index: 2;
  margin-top: clamp(-4rem, -4vw, -1.5rem);
}

.event-teaser__panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "poster"
    "head"
    "text"
    "meta"
    "actions";
  gap: var(--space-5);
  align-items: start;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: linear-gradient(110deg, #ffffff 0%, #ffffff 55%, var(--color-mist-blue) 100%);
  box-shadow: var(--shadow-soft);
}

.event-teaser__poster {
  grid-area: poster;
}

.event-teaser__head {
  grid-area: head;
}

/* Mobile : les éléments du corps rejoignent la grille du panneau. */
.event-teaser__body {
  display: contents;
}

.event-teaser__text {
  grid-area: text;
}

.event-teaser__meta {
  grid-area: meta;
  align-self: center;
}

.event-teaser__actions {
  grid-area: actions;
}

/* --- Affiche : illustrative, non interactive sur l'accueil (D-31) -------- */
.event-teaser__poster-frame {
  display: block;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: var(--shadow-lift);
}

.event-teaser__poster img {
  width: 100%;
  height: auto;
  border-radius: 9px;
}

/* --- Contenu --------------------------------------------------------------- */
.event-teaser__title {
  font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.028em;
}

.event-teaser__theme {
  margin-top: var(--space-2);
  color: var(--color-blue);
  font-family: var(--font-heading);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.4375rem);
  font-weight: 650;
  line-height: 1.3;
}

.event-teaser__signature {
  margin-top: var(--space-2);
  color: var(--color-text-soft);
  font-size: var(--fs-small);
  font-style: italic;
}

.event-teaser__text {
  max-width: 38rem;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.65;
}

.event-teaser__meta {
  display: grid;
  gap: var(--space-4);
  list-style: none;
}

.event-teaser__meta li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
}

.event-teaser__meta-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: var(--color-mist-blue);
  color: var(--color-blue);
}

.event-teaser__meta-icon .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.event-teaser__meta-label {
  display: block;
  margin-bottom: 2px;
  color: var(--color-text-soft);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.event-teaser__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
}

/* Mobile (D-41) : le badge « Prochaine journée médicale » ouvre la carte,
   avant l'affiche ; l'en-tête se fond dans la grille du panneau. */
@media (max-width: 39.9375em) {
  .event-teaser__panel {
    grid-template-areas: none;
    row-gap: 0;
  }

  .event-teaser__poster,
  .event-teaser__head,
  .event-teaser__text,
  .event-teaser__meta,
  .event-teaser__actions {
    grid-area: auto;
  }

  .event-teaser__head {
    display: contents;
  }

  .event-teaser__head .badge {
    order: -1;
    justify-self: start;
    margin-bottom: var(--space-4);
  }

  .event-teaser__poster {
    margin-bottom: var(--space-5);
  }

  .event-teaser__text,
  .event-teaser__meta,
  .event-teaser__actions {
    margin-top: var(--space-5);
  }
}

@media (min-width: 40em) {
  .event-teaser__panel {
    grid-template-columns: 14rem minmax(0, 1fr);
    grid-template-areas:
      "poster head"
      "poster body";
    gap: var(--space-5) clamp(2rem, 1rem + 3vw, 3rem);
    padding: var(--space-6);
  }

  .event-teaser__head {
    align-self: end;
  }

  .event-teaser__body {
    grid-area: body;
    display: grid;
    gap: var(--space-5);
    align-content: start;
  }

  .event-teaser__text,
  .event-teaser__meta,
  .event-teaser__actions {
    grid-area: auto;
  }

  .event-teaser__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-7);
    padding-block: var(--space-4);
    border-block: 1px solid var(--color-border);
  }

  .event-teaser__meta li {
    font-size: 1rem;
  }

  .event-teaser__meta-icon {
    display: grid;
  }
}

@media (min-width: 60em) {
  .event-teaser__panel {
    grid-template-columns: 21rem minmax(0, 1fr);
    column-gap: clamp(3rem, 0.5rem + 4vw, 5rem);
    padding: var(--space-7) clamp(2.5rem, 0.5rem + 3.5vw, 4.5rem) var(--space-7) var(--space-7);
  }

  .event-teaser__poster {
    margin-top: calc(-1 * var(--space-9));
  }

  .event-teaser__poster-frame {
    padding: 10px;
    border-radius: 16px;
  }
}

/* --- En-tête des sections de journée (D-39 ; partagé depuis D-52) --------- */

.event-section__head {
  max-width: 56rem;
  margin-bottom: clamp(1.75rem, 1.25rem + 1.5vw, 2.75rem);
}

/* --- Navigation entre journées : cartes (D-38 ; partagé depuis D-52) ------------------------------ */

.edition-nav {
  border-top: 1px solid var(--color-border);
}

.edition-nav__grid {
  display: grid;
  gap: var(--space-4);
  list-style: none;
}

@media (min-width: 48em) {
  .edition-nav__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edition-nav__item--next:only-child {
    grid-column: 2;
  }
}

.nav-card {
  position: relative;
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: var(--space-4);
  height: 100%;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out), border-color var(--duration-fast) ease;
}

.nav-card:hover {
  border-color: var(--color-blue);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.nav-card:has(:focus-visible) {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.nav-card__media {
  align-self: start;
  padding: 6px;
  border-radius: 10px;
  background: var(--color-mist-blue);
}

.nav-card__media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.nav-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  min-width: 0;
}

.nav-card__dir {
  color: var(--color-green-strong);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-2);
  color: var(--color-text-soft);
  font-size: var(--fs-small);
}

.nav-card__title {
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 750;
  line-height: 1.3;
}

.nav-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  margin-top: auto;
  color: var(--color-blue);
  font-family: var(--font-heading);
  font-weight: 700;
  text-decoration: none;
}

.nav-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.nav-card__link:focus-visible {
  outline: none;
}

.nav-card__link .icon {
  width: 1rem;
  height: 1rem;
  transition: transform var(--duration-fast) ease;
}

.nav-card:hover .nav-card__link .icon {
  transform: translateX(3px);
}

/* Mobile (D-40) : une colonne — direction, affiche centrée et entière,
   édition · date, titre, lien. */
@media (max-width: 39.9375em) {
  .nav-card {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-5);
  }

  .nav-card__body {
    display: contents;
  }

  .nav-card__dir {
    order: -1;
  }

  /* D-41 : l'affiche occupe toute la largeur intérieure de la carte. */
  .nav-card__media {
    justify-self: stretch;
    padding: 8px;
  }

  .nav-card__link {
    margin-top: 0;
  }
}

@media (min-width: 60em) {
  .nav-card {
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: var(--space-5);
    padding: var(--space-5);
  }
}

.edition-nav__back {
  margin-top: var(--space-6);
}

@media (prefers-reduced-motion: reduce) {
  .nav-card {
    transition: none;
  }

  .nav-card:hover {
    transform: none;
  }
}
