/* Affichage default d'une sélection thématique (node--selection-thematique.html.twig).
   Fond et pleine largeur repris de l'en-tête des médiathèques (default_theme :
   .title_section / .bib_title, couleur --title_section_color). */

/* Pleine largeur : max(0px, …) évite que l'écart devienne une marge positive
   sous 1110px de large (le fond reste étendu par .title_section::before). */
.node--type-selection-thematique .block-system-breadcrumb-block,
.node--type-selection-thematique nav.tabs {
  background-color: var(--title_section_color);
  margin: 0 calc(-1 * max(0px, (100vw - 1110px) / 2));
  padding: 0 max(0px, (100vw - 1110px) / 2) 1rem;
  margin-bottom: 0;
  /* Fond étendu à toute la largeur de l'écran, sans débordement horizontal. */
  box-shadow: 0 0 0 100vmax var(--title_section_color);
  clip-path: inset(0 -100vmax);
}

.node--type-selection-thematique .block-system-breadcrumb-block ol {
  margin-bottom: 0;
}

/* Flex en ligne : texte à gauche, centré verticalement ; image à droite
   (520px au plus, hauteur fixe, recadrée). */
.selection-thematique-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3rem;
  text-align: left;
  background-color: var(--title_section_color);
}

/* Corrige .title_section (default_theme) sous 1110px de large : ses marges
   deviennent positives et rétrécissent l'en-tête. !important : le padding de
   .title_section l'est aussi. */
.selection-thematique-header.title_section {
  margin-inline: calc(-1 * max(0px, (100vw - 1110px) / 2));
  padding-inline: max(0px, (100vw - 1110px) / 2) !important;
}

.selection-thematique-header-text {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.selection-thematique-header-title {
  margin-bottom: 0;
}

.selection-thematique-header-image {
  flex: 0 1 520px;
  min-width: 0;
}

.selection-thematique-header-image img {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 20px;
}

/* Même rupture que .responsive-flex-row-to-col (progilone_portail) : une
   colonne, dans l'ordre titre, image, description. */
@media (max-width: 800px) {
  .selection-thematique-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .selection-thematique-header-text {
    display: contents;
  }

  .selection-thematique-header-title {
    order: 1;
  }

  .selection-thematique-header-image {
    order: 2;
    flex-basis: auto;
  }

  .selection-thematique-header-description {
    order: 3;
  }
}

.selection-thematique-lists {
  padding-block: 2rem;
}
