/* ---------- Book page ---------- */
.crumbs { font-size: var(--step--1); color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-block: 4px 20px; }
.crumbs a { color: var(--text-secondary); text-decoration: none; }
.crumbs > a:hover, .crumb-menu > a:hover { color: var(--text-primary); }
.crumbs span[aria-hidden] { opacity: .6; }
/* breadcrumb menus: hover or keyboard focus shows the sibling rubriques */
.crumb-menu { position: relative; display: inline-flex; }
.crumb-list { display: none; position: absolute; top: 100%; left: -12px; z-index: 20; margin: 0; padding: 8px; list-style: none;
  min-width: 260px; background: var(--surface); border-radius: var(--radius-s); box-shadow: 0 2px 4px rgba(43,43,43,.08), 0 12px 28px -10px rgba(43,43,43,.3); }
.crumb-menu::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; } /* hover bridge */
.crumb-menu:hover .crumb-list, .crumb-menu:focus-within .crumb-list { display: grid; margin-top: 6px; }
.crumb-list a { display: block; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--text-primary); font-size: 0.875rem; white-space: nowrap; }
.crumb-list a:hover { background: var(--background); }
.crumb-list a[aria-current="page"] { font-weight: 700; background: var(--card-positive); }
@media (max-width: 620px) { .crumbs { position: relative; } .crumb-menu { position: static; } .crumb-list { left: 0; right: 0; min-width: 0; } .crumb-list a { white-space: normal; } }
@media (hover: none) { .crumb-menu:hover .crumb-list { display: none; } .crumb-menu:focus-within .crumb-list { display: grid; } }


/* Variant: three columns on top (cover | head + why | access + warning), the rest in two columns */
.book-top {
  display: grid; gap: clamp(18px, 2.5vw, 32px); align-items: start;
  /* fluid columns so the three-column layout holds down to iPad portrait (768px) */
  grid-template-columns: clamp(130px, 17vw, 220px) minmax(0, 1fr) clamp(230px, 27vw, 320px);
  grid-template-areas: "cover head side" "cover why side";
  grid-template-rows: auto 1fr;
}
.book-cover { grid-area: cover; display: flex; flex-direction: column; gap: 8px; }
.cover-credit { font-size: 0.6875rem; line-height: 1.4; color: var(--text-secondary); }
.cover-credit a { color: inherit; text-underline-offset: 2px; }
.cover-credit a:hover { color: var(--text-primary); }
.book-cover img { display: block; width: 100%; height: auto; border-radius: 0; }
.book-head { grid-area: head; }
.book-why { grid-area: why; display: grid; gap: 20px; }
.book-side { grid-area: side; display: grid; gap: 20px; min-width: 0; }
.side-card { background: var(--card-sleep); border-radius: var(--radius-l); padding: clamp(14px, 1.8vw, 20px); display: grid; gap: 18px; }
.side-card .actions { flex-direction: column; margin: 0; }
.side-card .keywords .chip { box-shadow: inset 0 0 0 1.5px var(--surface); background: var(--card-sleep); font-weight: 400; }
.side-card .kw-label { font-weight: 400; font-size: 0.75rem; }
.side-card .keywords .chip { font-size: 0.75rem; padding: 4px 10px; }
.side-card .keywords .chip:hover { background: var(--surface); }
.side-card .actions .btn { justify-content: center; }
.side-card .actions .btn-primary { background: var(--surface); color: var(--text-primary); }
.side-card .actions .btn-primary:hover { background: #FFFFFF; }
.side-card .actions .btn-quiet { background: var(--surface); box-shadow: none; }
.side-card .actions .btn-quiet:hover { background: #FFFFFF; }
.facts.facts-side { display: none; }
.book-side .notice { margin-top: 0; }
.book-side .notice { display: grid; }
.notice-head { display: flex; align-items: center; gap: 12px; }
/* collapsed: three lines, the fourth fading out; full text stays in the DOM for screen readers */
.notice.is-clamped .body { max-height: calc(12px + 1.55em * 4); overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(12px + 1.55em * 3), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(12px + 1.55em * 3), transparent); }
.notice .more { margin-top: 6px; background: none; border: 0; padding: 4px 0; font: inherit; font-size: var(--step--1); font-weight: 700; color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; justify-self: start; }
.notice .more:hover { color: var(--accent-orange-ink); }

.book-side .notice .body { padding-left: 0; font-size: 0.875rem; line-height: 1.55; gap: 8px; }
.book-side .notice { padding: clamp(16px, 2vw, 20px) clamp(16px, 2vw, 24px); }
.book-head { display: flex; flex-direction: column; gap: 14px; }
.book-head h1 { font-size: clamp(1.375rem, 1rem + 1.7vw, 2.125rem); font-weight: 800; } /* about 1/3 smaller than step-4 */
.book-head .author { font-size: 1rem; font-family: var(--font-title); font-weight: 700; } /* about 1/3 smaller than step-2, kept at body size */
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 2px 0 0; padding: 0; }
.facts div { display: flex; flex-direction: column; }
.facts dt { font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; }
.facts dd { margin: 0; font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.scores { display: flex; flex-wrap: wrap; gap: 10px; }
.score { display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 9px; border-radius: var(--radius-pill); background: var(--card-positive); font-weight: 700; font-size: 0.8125rem; gap: 7px; }
.score .stars svg { width: 13px; height: 13px; }
.score-plain { background: var(--surface); font-weight: 600; }
.score-plain b { font-family: var(--font-title); font-weight: 800; font-variant-numeric: tabular-nums; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.keywords { display: flex; flex-wrap: wrap; gap: 8px; }
.kw-label { font-size: var(--step--1); color: var(--text-secondary); width: 100%; font-weight: 600; }

.notice { margin-top: 28px; background: var(--card-break); border-radius: var(--radius-l); padding: 20px 24px; }
.notice summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.notice summary::-webkit-details-marker { display: none; }
.notice .ico { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-orange); display: grid; place-items: center; flex: none; }
.notice .ico svg { width: 20px; height: 20px; color: var(--text-primary); }
.notice h2 { font-size: var(--step-1); font-weight: 800; flex: 1; }
.notice .toggle { font-size: var(--step--1); font-weight: 700; color: var(--text-secondary); }
.notice[open] .toggle-closed, .notice:not([open]) .toggle-open { display: none; }
.notice .body { display: grid; gap: 10px; padding: 12px 0 2px 48px; max-width: 70ch; }

.review { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.review .col { display: grid; gap: 20px; min-width: 0; }
.box { border-radius: var(--radius-l); padding: 26px 28px; display: grid; gap: 12px; }
.box h2 { font-size: var(--step-1); font-weight: 800; display: flex; align-items: center; gap: 10px; }
.box h2 svg { width: 20px; height: 20px; flex: none; }
.box p { font-size: 0.96875rem; }
.box-why { background: var(--surface); }
.box-why h2 svg { color: var(--accent-green-ink); }
.box-keep { background: var(--card-positive); }
.box-keep h2 svg { color: var(--accent-orange-ink); }
.box-note { background: var(--surface); }
.box-note h2 svg { color: var(--text-secondary); }
.box-rel { background: var(--card-calm); }
.box-rel .stars svg { width: 18px; height: 18px; }
.rel-label { font-family: var(--font-title); font-weight: 800; }

.related { margin-top: 56px; }
.related h2 { font-size: var(--step-2); font-weight: 800; margin-bottom: 16px; }
.mini { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; background: var(--surface); border-radius: var(--radius-l); padding: 16px; text-decoration: none; max-width: 640px; align-items: center; }
.mini img { display: block; width: 96px; height: auto; border-radius: 0; }
.mini h3 { font-size: var(--step-1); font-weight: 800; }
.mini p { font-size: 0.9375rem; color: var(--text-secondary); }
.mini .relevance { margin-top: 6px; }

.report { margin-top: 20px; font-size: var(--step--1); }
.report a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); font-weight: 600; text-underline-offset: 3px; }
.report a:hover { color: var(--text-primary); }
.report svg { width: 16px; height: 16px; flex: none; }
.after-reading { margin-top: 56px; }
.after-reading .support { border-radius: var(--radius-l); }

@media (min-width: 760px) and (max-width: 900px) {
  .book-side .notice .ico { width: 28px; height: 28px; }
  .book-side .notice .ico svg { width: 16px; height: 16px; }
  .book-side .notice-head { gap: 8px; }
}
@media (max-width: 759px) {
  .book-top { grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: "cover head" "cover why" "side side"; grid-template-rows: auto 1fr auto; gap: 28px; }
  .book-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
}
@media (max-width: 760px) {
  .review { grid-template-columns: 1fr; }
  .book-side { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  /* photo alone on its row: title first, photo centered, edition details move under "Se procurer" */
  .book-top { grid-template-columns: 1fr; grid-template-areas: "head" "cover" "why" "side"; }
  .book-cover { width: 200px; max-width: 70%; justify-self: center; }
  .book-head .facts { display: none; }
  .facts.facts-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
  .box { padding: 22px 20px; }
  .after-reading .support { border-radius: 0; }
}

.box-age { background: var(--card-focus); }
.box-idea { background: var(--surface); }
.box-purpose { background: var(--card-positive); }
.box-excerpt { background: var(--surface); }
.box-excerpt p { font-style: italic; }
.box-sum { background: var(--surface); }
.purpose-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 0.96875rem; }
.purpose-list strong { font-weight: 800; }
.related-list { display: grid; gap: 14px; }
.mini .relevance { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; font-weight: 700; }
.mini .stars svg { width: 14px; height: 14px; }
.book-head .subtitle { margin-top: -6px; font-family: var(--font-title); font-weight: 700; font-size: var(--step-1); line-height: 1.3; color: var(--text-secondary); }

/* Small search at the right of the breadcrumb (2026-11-10) */
.crumbs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-block: 4px 20px; }
.crumbs-row .crumbs { padding-block: 0; }
.mini-search { display: flex; align-items: center; background: var(--surface); border-radius: var(--radius-pill); box-shadow: inset 0 0 0 1.5px var(--border-strong); padding: 2px 4px 2px 14px; width: min(260px, 100%); }
.mini-search:focus-within { box-shadow: inset 0 0 0 2px var(--text-primary); }
.mini-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: var(--step--1); padding: 6px 0; color: var(--text-primary); }
.mini-search input::placeholder { color: var(--text-secondary); }
.mini-search input:focus { outline: none; }
.mini-search button { border: 0; background: transparent; color: var(--text-primary); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none; }
.mini-search button:hover { background: var(--card-break); }
.mini-search button:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 1px; }
.mini-search svg { width: 16px; height: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 620px) { .mini-search { width: 100%; } }
.related.similar { margin-top: 40px; }
.related-intro { color: var(--text-secondary); margin: -8px 0 16px; }
.related-more { margin-top: 16px; font-weight: 700; }
.related-more a { color: var(--text-primary); text-underline-offset: 3px; }
.related-more a:hover { color: var(--accent-orange-ink); }
@media (min-width: 760px) { .similar .related-list { grid-template-columns: 1fr 1fr; } }

/* ---- Ma sélection: « Garder » button in the side card, link below (2026-11-18) ---- */
.title-row { display: flex; align-items: flex-start; gap: 12px; }
.title-block { flex: 1; min-width: 0; display: grid; gap: 4px; }
.actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side-card .actions-row .btn { justify-content: center; padding-inline: 10px; }
.bookmark svg { width: 18px; height: 18px; }
.side-card .actions .bookmark.is-on { background: var(--accent-orange); }
.bookmark.is-on svg { fill: currentColor; }
.sel-go { margin-top: -6px; text-align: center; font-size: var(--step--1); font-weight: 700; }
.sel-go a { color: var(--text-primary); text-underline-offset: 3px; }
.sel-go a:hover { color: var(--accent-orange-ink); }
.bookmark-note { font-size: var(--step--1); color: var(--text-secondary); background: var(--surface); border-radius: var(--radius-s); padding: 10px 14px; }
.bookmark-note:empty { display: none; }
.bookmark-note a { color: var(--text-primary); font-weight: 700; text-underline-offset: 3px; }

/* ---- Printable sheet: one clean A4 page, black on white ---- */
@media print {
  .book-top { display: grid; grid-template-columns: minmax(0, 1fr) 32mm; grid-template-areas: "head cover" "side side" "why why"; grid-template-rows: auto; gap: 5mm 8mm; }
  .book-cover { width: auto; max-width: none; justify-self: end; }
  .book-cover img { width: 32mm; }
  .cover-credit { font-size: 7pt; }
  .book-head { gap: 3mm; }
  .book-head h1 { font-size: 20pt; }
  .book-head .facts { display: flex; }
  .book-side { display: block; }
  .book-head .kids-reminder { order: -1; }
  .side-card, .bookmark, .bookmark-note, .sel-go, .notice .more, .related, .report, .after-reading, .crumbs-row { display: none !important; }
  .notice.is-clamped .body, .notice .body { max-height: none !important; overflow: visible !important; -webkit-mask-image: none !important; mask-image: none !important; }
  .notice, .box { background: #FFFFFF !important; border: 1px solid #8C887F; border-radius: 3mm; padding: 4mm 5mm; }
  .notice { break-inside: avoid; }
  .box h2 { break-after: avoid; }
  .score { background: none !important; padding-left: 0; }
  .notice { border-width: 2px; border-color: #0B0B0B; }
  .notice .ico { background: #FFFFFF; box-shadow: inset 0 0 0 1.5px #0B0B0B; }
  .notice .body { padding-left: 0; }
  .review { grid-template-columns: 1fr; gap: 4mm; margin-top: 4mm; }
  .review .col { gap: 4mm; margin-top: 0 !important; }
  .box p, .notice .body, .book-side .notice .body { font-size: 10.5pt; line-height: 1.45; }
  .box h2, .notice h2 { font-size: 12pt; }
  .stars .star-on { fill: #0B0B0B; }
  .stars .star-off { fill: none; stroke: #0B0B0B; stroke-width: 1.2; }
}

/* Titres de livres cités dans les textes : en italique ; lien vers la fiche quand le livre est au catalogue */
cite { font-style: italic; }
.book-ref { color: var(--text-primary); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent-orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.book-ref:hover { color: var(--accent-orange-ink); }
.book-ref:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; border-radius: 2px; }
@media print { .book-ref { font-weight: inherit; text-decoration: none; color: inherit; } }
