/* Les couleurs complètent toujours une tranche d’âge lisible. */
[data-age-group='age-0-8'] { --age-bg:#c9f4f5; --age-border:#27818b; --age-ink:#155b67; }
[data-age-group='age-9-12'] { --age-bg:#d4eaff; --age-border:#397bb7; --age-ink:#235586; }
[data-age-group='age-13-17'] { --age-bg:#ffd8ee; --age-border:#bc488c; --age-ink:#86205c; }
[data-age-group='age-young-adults'] { --age-bg:#e5ddff; --age-border:#8661c2; --age-ink:#573598; }
.age-tag[data-age-group],.age-legend-item,.home-theme-card[data-age-group],.taxonomy-age-choice[data-age-group] {
  background:var(--age-bg,#f0edf4) !important; color:var(--age-ink,#514961) !important;
  border:1px solid var(--age-border,#b7aec4) !important;
}
.age-legend { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.age-legend-item { display:inline-flex; align-items:center; border-radius:999px; padding:6px 10px; font-size:.85rem; }
#home-theme-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
#home-theme-grid a.home-theme-card[data-age-group] { background:var(--age-bg) !important; color:var(--age-ink) !important; border:1px solid var(--age-border) !important; border-top-width:5px !important; padding:18px; gap:10px; }
#home-theme-grid .home-theme-card strong { font-size:1rem; line-height:1.4; }
#home-theme-grid .home-theme-card small { color:var(--age-ink); }
#home-theme-grid .home-theme-card:focus-visible { outline:3px solid var(--age-ink); outline-offset:3px; }
@media(max-width:900px) { #home-theme-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { #home-theme-grid { grid-template-columns:minmax(0,1fr); } }
.home-theme-grid > .age-legend { grid-column:1 / -1; }
/* Même taille pour les badges de disponibilité et de public d’une vignette. */
body:not(.admin-page) .book-card :is(.age-tag,.home-availability,.status-tag) { font-size:.68rem !important; line-height:1.2 !important; }
body:not(.admin-page) .book-card .age-tag { width:fit-content; max-width:100%; padding:5px 8px; }
.catalog-filters-panel .catalog-tag-filter-group { padding:14px 0; border-bottom:1px solid #e0dceb; }
.catalog-filters-panel .media-genre-filter-heading { margin-bottom:10px; }
.catalog-filters-panel details > summary { cursor:pointer; font-weight:800; min-height:44px; padding:10px 0; }
.catalog-filters-panel details[open] > summary { margin-bottom:8px; }
.catalog-filters-panel .book-taxonomy-options { gap:8px; margin-bottom:12px; }
.catalog-filters-panel .book-taxonomy-group details .book-taxonomy-options { display:grid; grid-template-columns:minmax(0,1fr); }
.catalog-filters-panel .book-taxonomy-group details .book-taxonomy-options > button { width:100%; min-width:0; box-sizing:border-box; white-space:normal; text-align:center; }
.catalog-filters-panel .taxonomy-age-choice { flex:1 1 125px; }
.catalog-filters-panel .taxonomy-age-choice:has(input:checked) { outline:2px solid var(--age-border,#6750a4); outline-offset:2px; }
body.pc-section-books #publisher-detail .publisher-detail-logo-wrap {
  height:clamp(190px,20vw,280px) !important; aspect-ratio:auto !important; box-sizing:border-box;
  display:flex !important; justify-content:center; align-items:center;
}
body.pc-section-books #publisher-detail .publisher-detail-logo-wrap > img {
  width:100% !important; height:100% !important; max-width:100% !important; max-height:100% !important;
  object-fit:contain !important; object-position:center !important; flex:0 1 auto;
}

/* Un badge par ligne, sur toute la largeur disponible. */
body:not(.admin-page) #books .book-fixed-tags,
body:not(.admin-page) #webtoon-grid .webtoon-card .book-fixed-tags {
  display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:6px !important; height:auto !important; min-height:0 !important;
}
body:not(.admin-page) #books .book-fixed-tags > .tag,
body:not(.admin-page) #webtoon-grid .book-fixed-tags > .tag,
body:not(.admin-page) .book-card .age-tag,
body:not(.admin-page) .book-card .home-availability {
  display:flex !important; align-items:center; justify-content:center;
  box-sizing:border-box; width:100% !important; min-width:0 !important;
  grid-column:auto !important; margin:0; padding:5px 8px;
}
.catalog-filters-panel .book-taxonomy-options[role='radiogroup'] {
  display:grid; grid-template-columns:minmax(0,1fr);
}
.catalog-filters-panel .taxonomy-age-choice {
  width:100%; box-sizing:border-box; flex:none; min-height:44px;
}
.taxonomy-filter-help { font-size:.9rem; line-height:1.5; margin:8px 0 14px; }

/* Tags colores : texte affirme et contour de la meme famille, plus sombre. */
body :is(.tag,.genre-tag,.status-pill,.age-legend-item,.genre-filter-tag,.lexicon-filter-tag,.media-category-tag) {
  font-weight:800 !important; border:1px solid currentColor !important;
}
body .genre-filter-tag.active { border-color:var(--age-border,#473368) !important; }
.taxonomy-age-choice span { font-weight:800; }
/* Les styles historiques de la médiathèque neutralisaient les contours et couleurs d’âge. */
body.pc-section-media :is(#media-grid,#media-category-grid) :is(.media-card,.media-list-card) :is(.tag,.genre-tag,.media-category-tag):not(:empty) {
  font-weight:800 !important; border:1px solid currentColor !important;
}
body.pc-section-media :is(#media-grid,#media-category-grid) :is(.media-card,.media-list-card) .media-card-age.age-tag[data-age-group] {
  background:var(--age-bg) !important; color:var(--age-ink) !important; border:1px solid var(--age-border) !important;
}
body.pc-section-books #books .book-card .book-fixed-tags .tag,
body.pc-section-books #webtoon-grid .book-card.webtoon-card .book-fixed-tags .tag,
body.pc-section-home :is(#new-carousel,#release-carousel,#upcoming-carousel) .book-card .book-body .tag {
  font-weight:800 !important; border:1px solid currentColor !important;
}
