/*
 * Idées de lecture : liste en « étagère » et fiche d'un livre.
 * Couleur par genre : roman (bleu-vert), théâtre (bordeaux), conte (olive).
 */

.lp-books, .lp-book-page {
	--lb-fg: var(--wp--preset--color--ti-fg);
	--lb-bg: var(--wp--preset--color--ti-bg);
	--lb-card: color-mix(in srgb, var(--wp--preset--color--ti-bg) 55%, #fff);
	--lb-rule: color-mix(in srgb, var(--lb-fg) 14%, var(--lb-bg));
	--lb-muted: color-mix(in srgb, var(--lb-fg) 60%, var(--lb-bg));
	--lb-accent: var(--wp--preset--color--ti-accent);
	--lb-wide: var(--wp--style--global--wide-size, 1320px);
}
.wp-block-post { --g: #1F5C63; }
.wp-block-post.category-theatre { --g: #7A2632; }
.wp-block-post.category-conte { --g: #5E6B3A; }

/* ---------- Introduction et filtres ---------- */
.lp-books-intro { text-align: center; max-width: 42em; margin: 0 auto 8px !important; color: var(--lb-muted, #7B6656); }
.lp-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px auto 36px; max-width: 900px; }
.lp-chip { border: 1px solid color-mix(in srgb, var(--wp--preset--color--ti-fg) 14%, var(--wp--preset--color--ti-bg)); background: color-mix(in srgb, var(--wp--preset--color--ti-bg) 55%, #fff); color: var(--wp--preset--color--ti-fg); padding: 7px 16px; border-radius: 999px; font: 600 .86rem/1.2 var(--wp--preset--font-family--hanken-grotesk, system-ui, sans-serif); cursor: pointer; }
.lp-chip-sub { font-weight: 500; font-size: .82rem; }
.lp-chip:hover { border-color: var(--wp--preset--color--ti-accent); }
.lp-chip[aria-pressed="true"] { background: var(--lp-grad); box-shadow: var(--lp-grad-shadow); color: var(--wp--preset--color--ti-fg-alt); border-color: transparent; }
.lp-chip:focus-visible { outline: 2px solid var(--wp--preset--color--ti-accent); outline-offset: 2px; }

/* ---------- Cartes de livre (liste et suggestions) ---------- */
.lp-books { max-width: var(--lb-wide) !important; margin-inline: auto !important; }
.lp-books .wp-block-post-template { gap: 26px; }
.lp-books .wp-block-post[hidden] { display: none; }
/* Bouton clair « Autres propositions » sous la liste */
.wp-block-buttons.lp-reshuffle { justify-content: center; margin-top: 30px !important; }
.wp-block-buttons.lp-reshuffle[hidden] { display: none; }
.wp-block-buttons.lp-reshuffle .wp-block-button:not(.is-style-outline) > .wp-block-button__link { background: color-mix(in srgb, var(--wp--preset--color--ti-bg) 55%, #fff); color: var(--wp--preset--color--ti-accent); border: 1px solid color-mix(in srgb, var(--wp--preset--color--ti-accent) 30%, transparent); box-shadow: 0 2px 8px rgba(42,28,20,.06); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.wp-block-buttons.lp-reshuffle .wp-block-button:not(.is-style-outline) > .wp-block-button__link::before { content: "↻"; font-size: 1.1em; line-height: 1; }
.wp-block-buttons.lp-reshuffle .wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover { filter: none; background: color-mix(in srgb, var(--wp--preset--color--ti-accent) 10%, #fff); color: var(--wp--preset--color--ti-accent); }
.wp-block-buttons.lp-reshuffle .wp-block-button__link:focus-visible { outline: 2px solid var(--wp--preset--color--ti-accent); outline-offset: 2px; }
.lp-book { height: 100%; display: grid; grid-template-rows: auto 1fr; border-radius: 18px; overflow: hidden; background: var(--lb-card); border: 1px solid var(--lb-rule); transition: transform .2s ease, box-shadow .2s ease; }
.lp-book:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(42,28,20,.14); }
.lp-book .lp-book-img { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; }
.lp-book .lp-book-img img { width: 100%; height: 100%; object-fit: cover; }
.lp-book > * { margin-block: 0 !important; }
.lp-book .lp-book-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.lp-book .lp-book-body > * { margin: 0 !important; }
.lp-genre { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--g); }
.lp-genre a { color: inherit; text-decoration: none; }
.lp-genre .wp-block-post-terms__separator { opacity: .6; }
.lp-book-title { font-size: 1.35rem !important; line-height: 1.2; }
.lp-book-title a { color: inherit; text-decoration: none; }
.lp-byline { gap: 0 !important; font-size: .88rem; color: var(--lb-muted); }
.lp-byline p { margin: 0; }
.lp-byline .lp-auteur { color: var(--lb-fg); font-weight: 600; }
.lp-byline p:empty { display: none; }
.lp-byline .lp-auteur:not(:empty) + .lp-annee:not(:empty)::before { content: " · "; white-space: pre; }
.lp-book-excerpt { font-size: .93rem; }
.lp-book-excerpt .wp-block-post-excerpt__excerpt { margin: 0 0 8px; }
.lp-book-excerpt .wp-block-post-excerpt__more-text { margin: 0; }
.lp-book-excerpt .wp-block-post-excerpt__more-link { color: var(--lb-accent); font-weight: 600; text-decoration: none; }
.lp-book-excerpt .wp-block-post-excerpt__more-link::after { content: " →"; }

/* ---------- Fiche d'un livre ---------- */
.lp-book-page > * { margin-block: 0; }
.wp-site-blocks > .lp-book-page { margin-block-start: 0; }
.lp-book-page .lp-book-hero.alignfull { position: relative; padding-left: 0; padding-right: 0; z-index: 0; color: #fff; }
.lp-book-hero > .lp-book-hero-img { max-width: none; width: 100%; height: 420px; margin: 0; position: relative; overflow: hidden; }
.lp-book-hero-img img { width: 100%; height: 100% !important; object-fit: cover; object-position: center 35%; }
.lp-book-hero-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(42,28,20,.1) 20%, rgba(42,28,20,.88)); }
.lp-book-page .lp-book-hero > .lp-book-hero-txt { position: absolute; left: 0; right: 0; bottom: 34px; max-width: none; margin: 0; padding: 0 var(--wp--custom--spacing--outer, 24px); z-index: 1; }
.lp-book-page .lp-book-hero-txt > * { max-width: var(--lb-wide); margin-inline: auto !important; width: 100%; }
.lp-crumb { margin: 0 0 8px; font-size: .85rem; opacity: .85; }
.lp-crumb a { color: #fff; text-decoration: none; }
.lp-crumb a::after { content: "  ›"; white-space: pre; }
.lp-book-hero .wp-block-post-title { color: #fff; font-size: clamp(2rem, 4.4vw, 3rem); margin: 0; line-height: 1.1; }
.lp-book-hero .lp-byline { color: rgba(255,248,240,.92); font-size: 1.1rem; margin-top: 6px; }
.lp-book-hero .lp-byline .lp-auteur { color: #fff; }
.lp-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px !important; }
.lp-book-hero .lp-hero-tags a { border: 0; padding: 4px 12px; border-radius: 999px; background: rgba(255,248,240,.18) !important; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff !important; font-size: .82rem; font-weight: 600; text-decoration: none; }
.lp-hero-tags .wp-block-post-terms__separator { display: none; }

.lp-book-page .wp-block-columns.lp-book-body { max-width: var(--lb-wide) !important; margin: 44px auto 0 !important; gap: 48px; align-items: flex-start; flex-direction: row; padding: 0; }
.lp-book-body > .lp-brief { flex: 0 0 300px !important; }
.lp-book-text .wp-block-post-content > p { font-size: 1.05rem; line-height: 1.75; max-width: 40em; }
.lp-book-text .wp-block-post-content > p:first-child::first-letter { float: left; font-family: var(--wp--preset--font-family--playfair-display, Georgia, serif); font-weight: 700; font-size: 3.6rem; line-height: .85; color: var(--lb-accent); padding: 6px 10px 0 0; }

.lp-brief { position: sticky; top: 20px; padding: 22px !important; border-radius: 18px; background: var(--lb-card); border: 1px solid var(--lb-rule); }
.lp-brief > * { margin-block: 0 !important; }
.lp-brief h2 { font-size: 1.15rem; margin-bottom: 12px !important; }
.lp-brief-row { display: grid !important; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--lb-rule); font-size: .92rem; }
.lp-brief-row > * { margin: 0 !important; }
.lp-brief-row > p:first-child { color: var(--lb-muted); }
.lp-brief-row > :last-child { font-weight: 600; }
.lp-brief-row:has(> p:last-child:empty), .lp-brief-row:has(> .wp-block-post-terms:empty) { display: none !important; }
.lp-brief-row .wp-block-post-terms a { color: inherit !important; text-decoration: none; background: none !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; margin: 0 !important; font-size: inherit !important; display: inline !important; }
.lp-brief-row .wp-block-post-terms__separator { display: inline !important; }
.lp-brief .wp-block-buttons { margin-top: 16px !important; }
.lp-brief .wp-block-button:not(.is-style-outline) > .wp-block-button__link { padding: 8px 18px; font-size: .88rem; line-height: 1.3; }

/* Encadré « Pourquoi le lire ? » (composition à insérer dans l'article) */
.lp-why { margin-top: 26px !important; padding: 22px 24px !important; border-radius: 18px; background: var(--lb-card, #FBF6F0); border: 1px solid var(--lb-rule, #E2D3BF); }
.lp-why h3 { font-size: 1.2rem; margin: 0 0 12px !important; }
.lp-why ol { list-style: none; counter-reset: why; margin: 0; padding: 0; display: grid; gap: 10px; }
.lp-why li { counter-increment: why; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; margin: 0; }
.lp-why li::before { content: counter(why); width: 30px; height: 30px; border-radius: var(--lp-squircle, 23%); background: var(--lp-grad); box-shadow: var(--lp-grad-shadow); color: var(--wp--preset--color--ti-fg-alt); display: grid; place-items: center; font-family: var(--wp--preset--font-family--playfair-display, Georgia, serif); font-weight: 700; font-size: .9rem; }

/* Suggestions */
.lp-related-wrap { max-width: var(--lb-wide) !important; margin: 40px auto 0 !important; padding-bottom: 56px; }
.lp-book-page .lp-related-wrap > h2 { font-size: 1.5rem; margin-bottom: 18px !important; max-width: var(--lb-wide); }
.lp-related .lp-book-excerpt { display: none; }

@media (max-width: 781px) {
	.lp-book-hero > .lp-book-hero-img { height: 320px; }
	.lp-book-page .wp-block-columns.lp-book-body { gap: 26px; margin-top: 28px !important; }
	.lp-book-body > .lp-brief { flex-basis: 100% !important; position: static; }
}
@media (prefers-reduced-motion: reduce) {
	.lp-book { transition: none; }
	.lp-book:hover { transform: none; }
}
