/* Review page
   Uses CSS variables defined in global.css:
   theme bridges (--bg-primary, --accent, --text-primary, etc.),
   font aliases (--font-heading, --font-mono),
   layout tokens (--container-max, --padding-desktop/tablet/mobile)
*/


.review-page {
  background-color: transparent;
  color: var(--color-text-primary);
  scroll-behavior: smooth;
}

/* =============================================
   SECTION DIVIDERS
   ============================================= */
.review-section-divider {
  display: flex;
  justify-content: center;
  padding: 2.5rem 0;
  background: var(--color-bg-base);
}

.review-section-divider svg {
  width: clamp(200px, 30vw, 400px);
  height: auto;
}

.divider-line {
  stroke: var(--color-border-medium);
  stroke-width: 1;
  opacity: 0.5;
}

.divider-dot {
  fill: var(--color-text-muted);
  opacity: 0.4;
}

.divider-dot--accent {
  fill: var(--color-crimson, #ff3d3d);
  opacity: 0.7;
  filter: drop-shadow(0 0 4px var(--color-crimson, #ff3d3d));
}


/* =============================================
   STICKY BAR: books + filter (stays visible while scrolling)
   ============================================= */
.reviews-sticky-bar {
  position: sticky;
  top: var(--nav-height, 62px); /* sticks flush below nav bar — uses global --nav-height token */
  z-index: 100;
  background: var(--color-bg-base);
  padding-top: 0;
  padding-bottom: 0.75rem;
  margin-top: 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border-subtle);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.reviews-sticky-bar .full-reviews-controls {
  margin-bottom: 0;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--padding-desktop);
  position: relative;
  padding-right: 3rem;
}

.full-reviews-controls-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.filter-collapse-btn {
  position: absolute;
  bottom: 0.25rem;
  right: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-elevated);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.filter-collapse-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.filter-collapse-btn .icon-collapsed {
  display: none;
}

.filter-collapse-btn .icon-expanded {
  display: block;
}

.reviews-sticky-bar.is-filter-collapsed .filter-collapse-btn .icon-collapsed {
  display: block;
}

.reviews-sticky-bar.is-filter-collapsed .filter-collapse-btn .icon-expanded {
  display: none;
}

.reviews-sticky-bar.is-filter-collapsed .full-reviews-controls-inner {
  display: none;
}

.reviews-sticky-bar.is-filter-collapsed .full-reviews-controls {
  min-height: 2.5rem;
  padding-bottom: 0;
}

/* =============================================
   BOOK FILTER CARDS – compact, click to scroll
   ============================================= */
.review-main .portfolio-section {
  display: none;
}
.review-main .portfolio-section.active {
  display: block;
  animation: reviewBooksFadeIn 0.6s ease-out;
}

@keyframes reviewBooksFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.review-main .books-showcase {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0.5rem;
  max-width: var(--container-max);
  margin: 0 auto 0.75rem;
  padding: 0 var(--padding-desktop);
}

.review-main .book-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  background: var(--color-bg-card-solid);
  padding: 0.5rem;
  border: 1px solid var(--color-border-subtle);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.review-main .book-item:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 12px var(--color-accent-glow);
}

.review-main .book-cover {
  width: 100%;
  aspect-ratio: 2/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0.4rem;
  flex-shrink: 0;
}

.review-main .book-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.review-main .book-item h3 {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
  margin: 0 0 0.2rem;
  text-align: center;
  line-height: 1.4;
  width: 100%;
  min-height: 0;
}

.review-main .book-item h3 em {
  font-style: italic;
}

/* Desktop: show full title, hide 3-word short */
.review-main .book-item .book-title-short {
  display: none;
}

.review-main .book-item .book-title-full {
  display: inline;
}

.review-main .book-item p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
  text-align: center;
}

/* Desktop: hide publisher, reduce gap between nav and sticky bar */
@media (min-width: 901px) {
  .review-main .book-item p {
    display: none;
  }

  .reviews-sticky-bar {
    top: var(--nav-height, 62px); /* was 2.75rem = 44px — too small, nav is ~62px at this size */
  }
}

/* Tablet / large phone: horizontal scroll, small images, hide publisher */
@media (min-width: 601px) and (max-width: 900px) {
  .book-section {
    scroll-margin-top: 16rem;
  }

  .reviews-sticky-bar {
    top: var(--nav-height, 56px); /* was 3rem = 48px — nav is ~56px at this size */
  }

  .review-main .books-showcase {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    gap: 0.4rem;
    padding-left: var(--padding-tablet);
    padding-right: var(--padding-tablet);
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: none;
  }

  .review-main .book-item {
    flex: 0 0 auto;
    width: 68px;
    min-width: 68px;
    padding: 0.3rem;
  }

  .review-main .book-cover {
    max-height: 64px;
    aspect-ratio: auto;
  }

  .review-main .book-cover picture {
    display: block;
    width: 100%;
    height: 100%;
  }

  .review-main .book-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }

  .review-main .book-item .book-title-full {
    display: none;
  }

  .review-main .book-item .book-title-short {
    display: inline;
  }

  .review-main .book-item h3 {
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .review-main .book-item p {
    display: none;
  }
}

/* Mobile: horizontal scroll, first 3 words only, compact */
@media (max-width: 600px) {
  .book-section {
    scroll-margin-top: 17rem;
  }

  .reviews-sticky-bar {
    top: calc(var(--nav-height, 48px) - 4px); /* slight overlap to avoid gap between nav and bar */
    padding-top: 4px; /* compensate for the overlap */
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
  }

  /* Horizontal scroll for 9 books — edge-to-edge carousel, minimal side padding */
  .review-main .books-showcase {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    margin-left: calc(-1 * var(--padding-mobile, 0.5rem));
    margin-right: calc(-1 * var(--padding-mobile, 0.5rem));
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    width: calc(100% + 2 * var(--padding-mobile, 0.5rem));
    max-width: none;
    box-sizing: border-box;
  }

  .review-main .book-item {
    flex: 0 0 auto;
    width: 72px;
    min-width: 72px;
    padding: 0.25rem;
    height: 108px;
    min-height: 108px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .review-main .book-cover {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-height: 72px;
    margin-bottom: 0.15rem;
    aspect-ratio: auto;
  }

  .review-main .book-cover picture {
    display: block;
    width: 100%;
    height: 100%;
  }

  .review-main .book-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }

  /* Mobile: show first 3 words (short), hide full */
  .review-main .book-item .book-title-full {
    display: none;
  }

  .review-main .book-item .book-title-short {
    display: inline;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }

  .review-main .book-item h3 {
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.4;
  }

  .review-main .book-item p {
    display: none;
  }

  .reviews-sticky-bar .full-reviews-controls {
    padding-right: 2.75rem;
  }

  .filter-collapse-btn {
    width: 2rem;
    height: 2rem;
  }
}


/* =============================================
   HERO
   ============================================= */
.review-hero {
  position: relative;
  overflow: visible;
  padding: 3rem var(--padding-desktop) 2.5rem;
  min-height: 100vh;
  background: transparent;
  border-bottom: 1px solid var(--color-cell-border);
}



.review-hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.5fr);
  gap: 3rem;
  align-items: flex-start;
}

.hero-intro {
  max-width: 34rem;
  padding-top: 4.5rem;
  /* Aligns Reviews title with Poems title (same line, left-aligned) */
}

.hero-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.1rem, 3.6vw, 3.2rem);
  font-weight: 500;
  margin-top: 0.5rem;
}

.hero-subtitle {
  margin-top: 1.25rem;
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  line-height: 1.8;
  color: var(--color-text-secondary);
}

/* Hero highlights — 4 cards in viewport on desktop */

.hero-highlights {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 1024px) {
  .hero-highlights {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
    gap: 0.75rem;
    min-height: 0;
    overflow: visible;
  }

  .hero-highlights .highlight-card {
    padding: 0.85rem 1rem;
    min-height: 0;
    overflow: hidden;
  }

  .hero-highlights .highlight-thumb {
    width: clamp(60px, 6.5vw, 90px);
    min-width: 60px;
    margin: 0 0.65rem 0.4rem 0;
  }

  .hero-highlights .highlight-source,
  .hero-highlights .highlight-year {
    font-size: 0.875rem;
  }

  .hero-highlights .quote-text {
    margin-top: 0.4rem;
    font-size: clamp(0.8rem, 0.95vw, 0.95rem);
    line-height: 1.45;
  }

  .hero-highlights .quote-author {
    margin-top: 0.4rem;
    font-size: 0.875rem;
  }
}

.highlight-card {
  position: relative;
  border: none;
  background: linear-gradient(135deg, var(--color-bg-elevated), var(--color-bg-overlay));
  padding: 1.5rem 1.75rem;
  overflow: visible;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.highlight-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0; /* Safari 14.0 */
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.05), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.03), transparent 55%);
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 0;
}

.highlight-card > * {
  position: relative;
  z-index: 1;
}

.highlight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.highlight-card:hover::before {
  opacity: 0.9;
  transform: translate(4px, -4px);
}

/* Hero card layout: float image left, text wraps around — responsive image */
.highlight-card {
  display: block;
  overflow: hidden;
  min-width: 0;
}

.highlight-thumb {
  float: left;
  width: clamp(140px, 38vw, 220px);
  min-width: 140px;
  margin: 0 1.25rem 0.75rem 0;
  overflow: hidden;
}

.highlight-thumb img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* The quote icon in hero cards now lives inside .quote-block (positioned there) */

.highlight-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.highlight-source {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}

.highlight-year {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.highlight-quote {
  margin-top: 0.85rem;
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  line-height: 1.8;
}

.highlight-meta {
  margin-top: 0.75rem;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

/* --- Hero highlight frame: selective borders across 4 cards --- */

/* Middle cards (2 & 3): thin vertical lines only, no corners */
.highlight-card:not(:first-child):not(:last-child) {
  border-left: 1px solid rgba(139, 117, 53, 0.6);
  border-right: 1px solid rgba(139, 117, 53, 0.6);
}

/* Card 1 & 4: use ::before/::after for corner accents */
.highlight-card:first-child::after,
.highlight-card:last-child::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  pointer-events: none;
  opacity: 0.85;
  z-index: 2;
}

/* Card 1: corner accents top-left + top-right */
.highlight-card:first-child::after {
  top: 0;
  background:
    linear-gradient(#8B7535, #8B7535) 0    0 / 24px 1.5px no-repeat,
    linear-gradient(#8B7535, #8B7535) 0    0 / 1.5px 22px  no-repeat,
    linear-gradient(#8B7535, #8B7535) 100% 0 / 24px 1.5px no-repeat,
    linear-gradient(#8B7535, #8B7535) 100% 0 / 1.5px 22px  no-repeat;
}

/* Card 4: corner accents bottom-left + bottom-right */
.highlight-card:last-child::after {
  bottom: 0;
  background:
    linear-gradient(#8B7535, #8B7535) 0    100% / 24px 1.5px no-repeat,
    linear-gradient(#8B7535, #8B7535) 0    100% / 1.5px 22px  no-repeat,
    linear-gradient(#8B7535, #8B7535) 100% 100% / 24px 1.5px no-repeat,
    linear-gradient(#8B7535, #8B7535) 100% 100% / 1.5px 22px  no-repeat;
}

/* Hero ornament */

.hero-ornament {
  grid-column: 1 / -1;
  margin-top: 3rem;
}

.hero-ornament svg {
  width: 260px;
  height: auto;
}

.hero-line {
  stroke: var(--accent);
  stroke-width: 1.5;
}

.hero-chevron {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
}

.hero-node {
  fill: var(--color-crimson, #ff3d3d);
  filter: drop-shadow(0 0 4px var(--color-crimson, #ff3d3d));
}


/* =============================================
   MAIN
   ============================================= */
.review-main {
  padding: 3.5rem var(--padding-desktop) 5rem;
}

/* Language legend */

.language-legend {
  max-width: var(--container-max);
  margin: 0 auto 2rem;
}

.legend-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  font-size: var(--text-xs);
}

.legend-label {
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.legend-pill {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.875rem;
}

.legend-pill--es { color: #f1d4a6; border-color: rgba(241, 212, 166, 0.5); }
.legend-pill--de { color: #b0c7ff; border-color: rgba(176, 199, 255, 0.5); }
.legend-pill--en { color: #c2f0ff; border-color: rgba(194, 240, 255, 0.5); }
.legend-pill--ro { color: #ffd0da; border-color: rgba(255, 208, 218, 0.5); }


/* =============================================
   TIMELINE SECTION — full-width background wrapper
   ============================================= */
.timeline-section {
  background: transparent;
  padding: 3rem var(--padding-desktop) 4rem;
  /* Break out of parent padding to go full-width */
  margin-left: calc(-1 * var(--padding-desktop));
  margin-right: calc(-1 * var(--padding-desktop));
  margin-bottom: 0;
}

/* =============================================
   TIMELINE
   ============================================= */
.timeline {
  max-width: var(--container-max);
  margin: 0 auto;
  position: relative;
}

.timeline-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 3.5rem;
  position: relative;
  padding: 1rem 0;
}

/* Central vertical spine */

.timeline-spine {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.08)
  );
  transform: translateX(-50%);
  pointer-events: none;
}

/* Items */

.timeline-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  position: relative;
  overflow: visible;
}

.timeline-item--left .timeline-year {
  grid-column: 2;
  grid-row: 1;
  text-align: center;
  justify-self: center;
}

.timeline-item--left .timeline-card {
  grid-column: 1;
  grid-row: 1;
  justify-self: flex-end;
}

.timeline-item--right .timeline-year {
  grid-column: 1;
  grid-row: 1;
  text-align: center;
  justify-self: center;
}

.timeline-item--right .timeline-card {
  grid-column: 2;
  grid-row: 1;
  justify-self: flex-start;
}

/* Year block */

.timeline-year {
  position: relative;
  width: 100%;
  pointer-events: none;
}

.timeline-year span {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--color-border-medium);
  background-color: var(--color-bg-base);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  position: relative;
  z-index: 1;
  box-shadow: 0 0 8px var(--color-accent-glow), 0 0 2px var(--color-border-medium);
}

.timeline-year svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 80px;
  transform: translate(-50%, -50%);
}

.year-line {
  stroke: var(--color-border-subtle);
  stroke-width: 2;
  opacity: 0.8;
}

.year-node {
  fill: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent));
}

/* Card */

.timeline-card {
  position: relative;
  max-width: 430px;
  border: 1px solid var(--color-cell-border);
  background-color: var(--color-bg-elevated);
  padding: 1.9rem 2.1rem;
  overflow: hidden;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.timeline-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0; /* Safari 14.0 */
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.05), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.03), transparent 60%);
  opacity: 0.25;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.timeline-card > * {
  position: relative;
  z-index: 1;
}

/* Proximity effect on spine — line glows on hover, extends to divider dots */

.timeline-inner,
.timeline-section {
  overflow: visible;
}

/* SCROLL-009: the spine used to animate height 0→80% (and top+height on the
   first/last cards) — a layout animation per frame exactly while the cursor
   moves over the list. Geometry is now STATIC per variant; hover animates
   only transform: scaleY (compositor) + opacity. Same look: scaleY with
   transform-origin top grows downward exactly like height-from-top did. */
.timeline-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 80%;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--accent) 20%,
    var(--accent) 80%,
    transparent
  );
  transform: translateX(-50%) scaleY(0);
  transform-origin: top center;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.timeline-item:hover::before {
  transform: translateX(-50%) scaleY(1);
  opacity: 0.6;
}

/* First card: line extends upward to divider dot above (use first-of-type: spine is first child) */
.timeline-inner > .timeline-item:first-of-type::before {
  top: -14.5rem;
  height: calc(50% + 14.5rem);
  z-index: 10;
}

/* Last card: line extends downward to divider dot below — stop exactly at diamond */
.timeline-inner > .timeline-item:last-of-type::before {
  top: 50%;
  height: calc(50% + 10.5rem);
  z-index: 10;
}

/* Hover on card */

.timeline-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
  border-color: var(--color-border-subtle);
}

.timeline-card:hover::before {
  opacity: 0.5;
  transform: translate(4px, -4px);
}

/* Card content */

.card-header {
  margin-bottom: 1rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
  font-size: var(--text-xs);
}

.card-type {
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.card-source {
  color: var(--color-text-muted);
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 500;
  margin-top: 0.4rem;
}

.card-body {
  margin-top: 0.6rem;
}

.card-excerpt {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  line-height: 1.8;
  color: var(--color-text-secondary);
}

.card-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: var(--text-xs);
}

.card-tag {
  color: var(--color-text-muted);
}

.card-link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  position: relative;
}

.card-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 100%;
  height: 1px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.card-link:hover::after {
  transform: scaleX(1);
}

/* Card accents */

.card-accent {
  position: absolute;
  bottom: 0.2rem;

  opacity: 0.9;
}

.card-accent--right {
  right: auto;
  left: auto;
}

.card-accent svg {
  width: 120px;
  height: auto;
}

.accent-stroke {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  transition: stroke 0.3s ease, opacity 0.3s ease;
}

.accent-stroke--light {
  stroke: rgba(212, 175, 55, 0.4);
}

.accent-dot {
  fill: rgba(212, 175, 55, 0.9);
}

.timeline-card:hover .accent-stroke {
  opacity: 1;
}

/* Language pills on cards */

.card-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.card-lang--es { color: #f1d4a6; border-color: rgba(241, 212, 166, 0.6); }
.card-lang--de { color: #b0c7ff; border-color: rgba(176, 199, 255, 0.6); }
.card-lang--en { color: #c2f0ff; border-color: rgba(194, 240, 255, 0.6); }
.card-lang--ro { color: #ffd0da; border-color: rgba(255, 208, 218, 0.6); }


/* =============================================
   FULL REVIEWS — Book Cards
   ============================================= */
.full-reviews {
  max-width: var(--container-max);
  margin: 0 auto;
  border-top: 1px solid var(--color-cell-border);
  padding-top: 3rem;
  box-sizing: border-box;
  width: 100%;
}

.full-reviews-header {
  margin-bottom: 1rem;
}

.full-reviews-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.full-reviews-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 500;
  margin-top: 0.6rem;
}

/* ============================================================
   OUTER BOOK SECTION — large frame per book/edition
   ============================================================ */
.book-section {
  position: relative;
  /* Offset scroll so content stays visible below sticky bar (nav + books + filter) */
  scroll-margin-top: 20rem;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background-color: var(--color-bg-elevated);
  padding: 2rem 2.5rem;
  margin-bottom: 2.5rem;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.book-section::before { display: none; }

.book-section:nth-child(odd) {
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.25);
}

.book-section:nth-child(even) {
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.3),
    0 8px 24px rgba(0, 0, 0, 0.35),
    -4px 0 20px rgba(0, 0, 0, 0.15);
}

/* Gold corner accents — all 4 corners */
.book-section::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) top left / 40px 2px no-repeat,
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) top left / 2px 40px no-repeat,
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) top right / 40px 2px no-repeat,
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) top right / 2px 40px no-repeat,
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) bottom left / 40px 2px no-repeat,
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) bottom left / 2px 40px no-repeat,
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) bottom right / 40px 2px no-repeat,
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) bottom right / 2px 40px no-repeat;
  filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.4));
}

/* ============================================================
   ACCORDION — header row with thumbnail, toggle, review count
   ============================================================ */
.book-section-header {
  margin-bottom: 1rem;
  cursor: pointer;
  user-select: none;
}

.book-section-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Desktop: horizontal row with large cover */
.book-section-header-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 1.25rem;
  align-items: stretch;
}

.book-section-thumb {
  grid-row: 1;
  width: 140px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-section-header:hover .book-section-thumb {
  transform: scale(1.04);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.5),
    0 3px 10px rgba(0, 0, 0, 0.3);
}

.book-section-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.book-section-header-text {
  min-width: 0;
}

.book-section-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--color-border-subtle);
  border-radius: 50%;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: transform 0.35s ease, color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.book-section-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.35s ease;
}

.book-section-header:hover .book-section-toggle {
  border-color: var(--accent);
  color: var(--accent);
  background-color: rgba(212, 175, 55, 0.06);
}

/* Chevron: down = open (expanded), up = closed (collapsed) */
/* 4) Reversed: open state → chevron points DOWN (no rotation) */
.book-section:not(.collapsed) .book-section-toggle svg {
  transform: rotate(0deg);
}

/* Collapsed state → chevron points UP (rotated 180) */
.book-section.collapsed .book-section-toggle svg {
  transform: rotate(180deg);
}

.book-section.collapsed .book-section-body {
  display: none;
}

.book-section:not(.collapsed) .book-section-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   QUOTE-CARD TRUNCATION — show ~3 lines + author, expandable
   ============================================================ */
/* Truncated state: limit visible height to ~3 lines + author */
.quote-card.is-truncated .quote-card-body {
  max-height: 7.5em;            /* ~3 lines of text at body font size */
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}

/* Show the author peek line below truncated text */
.quote-card-author-peek {
  display: none;
  font-size: var(--text-xs);
  font-style: normal;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
  padding-left: 1.2rem;
  border-left: 2px solid rgba(212, 175, 55, 0.2);
}

.quote-card.is-truncated .quote-card-author-peek {
  display: block;
}

.quote-card:not(.is-truncated) .quote-card-author-peek {
  display: none;
}

/* Read more / less toggle inside each quote-card */
.quote-card-expand {
  display: none;
  margin-top: 0.6rem;
  padding: 0.3rem 0;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.quote-card-expand:hover {
  opacity: 0.75;
}

.quote-card.has-expand .quote-card-expand {
  display: inline-flex;
  margin-left: auto;          /* push to right side */
}

/* Expand button container: use flex to right-align */
.quote-card.has-expand {
  display: flex;
  flex-direction: column;
}

/* ============================================================
   FULL REVIEWS CONTROLS ROW (sort + expand/collapse)
   ============================================================ */
.full-reviews-controls {
  margin-bottom: 1.75rem;
}

.full-reviews-controls .sort-controls {
  margin-bottom: 0;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: nowrap;
}

.control-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-right: 0.25rem;
  opacity: 0.85;
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.expand-books-btn:disabled,
.expand-reviews-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   SORT CONTROLS
   ============================================================ */
.sort-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
  flex-wrap: nowrap;
}

.sort-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-right: 0.25rem;
  opacity: 0.85;
}

.sort-btn {
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.sort-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sort-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sort-btn--active {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.sort-btn--inactive {
  opacity: 0.85;
  color: var(--color-text-muted);
  border-color: var(--color-border-subtle);
}
.sort-btn.sort-btn--inactive:hover {
  opacity: 1;
  border-color: var(--color-border-subtle);
  color: var(--color-text-muted);
}

/* ============================================================
   REVIEW QUOTE ICON — decorative open-quote mark
   ============================================================ */
.review-quote-icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
  opacity: 0.22;
  flex-shrink: 0;
  pointer-events: none;
}

/* In quote-cards: positioned at top-left of text body */
.quote-card-body {
  position: relative;
}

.quote-card-body .quote-block {
  position: relative;
}

.quote-card-body .quote-block > .review-quote-icon {
  position: absolute;
  top: 0.5rem;
  left: 0.35rem;
  width: 18px;
  height: 18px;
  z-index: 11;
}

/* In hero highlight-cards: SVG as first child of .quote-block */
.highlight-card .quote-block {
  position: relative;
}

.highlight-card .quote-block > .review-quote-icon {
  position: absolute;
  top: -0.15rem;
  left: 0.25rem;
  width: 16px;
  height: 16px;
  opacity: 0.18;
}

/* ============================================================
   TIMELINE SORT CONTROLS
   ============================================================ */
.timeline-sort-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.timeline-sort-controls .sort-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.timeline-sort-btn {
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.timeline-sort-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.timeline-sort-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.timeline-sort-btn[aria-pressed="true"] {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   VISUAL ENHANCEMENTS
   ============================================================ */

/* A) Subtle left-edge accent bar on each book-section for the lang color */
.book-section--es { border-left: 3px solid rgba(241, 212, 166, 0.45); }
.book-section--ro { border-left: 3px solid rgba(255, 208, 218, 0.45); }
.book-section--en { border-left: 3px solid rgba(194, 240, 255, 0.45); }
.book-section--de { border-left: 3px solid rgba(176, 199, 255, 0.45); }

/* B) Hover glow on the book cover thumbnail */
.book-section-thumb {
  position: relative;
}

.book-section-thumb::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0; /* Safari 14.0 */
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.book-section--es .book-section-thumb::after { box-shadow: 0 0 18px rgba(241, 212, 166, 0.3); }
.book-section--ro .book-section-thumb::after { box-shadow: 0 0 18px rgba(255, 208, 218, 0.3); }
.book-section--en .book-section-thumb::after { box-shadow: 0 0 18px rgba(194, 240, 255, 0.3); }
.book-section--de .book-section-thumb::after { box-shadow: 0 0 18px rgba(176, 199, 255, 0.3); }

.book-section-header:hover .book-section-thumb::after {
  opacity: 1;
}

/* C) Smooth collapse/expand transition for book-section body */
.book-section-body {
  transition: opacity 0.3s ease;
  opacity: 1;
}

.book-section.collapsed .book-section-body {
  opacity: 0;
}

/* D) Expand button arrow indicator */
.quote-card-expand::after {
  content: " ↓";
  font-size: 0.8em;
}

.quote-card:not(.is-truncated) .quote-card-expand::after {
  content: " ↑";
}

/* E) Subtle separator between quote-cards */
.quote-card + .quote-card {
  border-top: 1px solid rgba(212, 175, 55, 0.08);
  padding-top: 1.25rem;
}

.book-section-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.book-section-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.book-section-lang--es { color: #f1d4a6; border-color: rgba(241, 212, 166, 0.6); }
.book-section-lang--de { color: #b0c7ff; border-color: rgba(176, 199, 255, 0.6); }
.book-section-lang--en { color: #c2f0ff; border-color: rgba(194, 240, 255, 0.6); }
.book-section-lang--ro { color: #ffd0da; border-color: rgba(255, 208, 218, 0.6); }

.book-section-year {
  font-family: var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.book-section-source {
  border-left: 1px solid var(--color-border-subtle);
  padding-left: 0.75rem;
}

.book-section-title {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 500;
  margin-top: 0.4rem;
}

.book-section-body {
  margin-top: 0.6rem;
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  line-height: 1.9;
  color: var(--color-text-secondary);
}

/* ============================================================
   INNER QUOTE CARD — one frame per individual quote/review
   ============================================================ */
.quote-card {
  position: relative;
  border: 1px solid rgba(212, 175, 55, 0.18);
  background-color: var(--color-bg-elevated);
  padding: 1.25rem 1.75rem;
  margin-bottom: 1.25rem;
  /* SCROLL-001: was a 6-layer shadow stack (48px + 16px + ring + 3 inset blurs)
     — multi-pass blur re-raster on every scroll frame across dozens of cards,
     the #1 paint cost of the site. Now: ONE soft elevation shadow + a blur-free
     inset top-light. Same dark elevated look, ~flat raster cost. */
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(212, 175, 55, 0.14);
  transition: border-color 0.3s ease;
}

.quote-card:last-child { margin-bottom: 0; }

/* Corner accents — split ::before (top) / ::after (bottom) so each pair
   lives in a narrow 22 px strip at its own edge. z-index: 10 guarantees
   they always paint above every child element inside the card, regardless
   of any parent stacking-context interaction. */
.quote-card::before,
.quote-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  z-index: 10;
  pointer-events: none;
  opacity: 0.78;
}

/* TOP corners */
.quote-card::before {
  top: 0;
  background:
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) 0 0     / 20px 1px no-repeat,
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) 0 0     / 1px 20px no-repeat,
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) 100% 0  / 20px 1px no-repeat,
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) 100% 0  / 1px 20px no-repeat;
}

/* BOTTOM corners */
.quote-card::after {
  bottom: 0;
  background:
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) 0    100% / 20px 1px no-repeat,
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) 0    100% / 1px 20px no-repeat,
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) 100% 100% / 20px 1px no-repeat,
    linear-gradient(var(--color-accent-dark, #8B7535), var(--color-accent-dark, #8B7535)) 100% 100% / 1px 20px no-repeat;
}

.quote-card-header { margin-bottom: 0.6rem; }

.quote-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
}

.quote-card-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.quote-card-lang--es { color: #f1d4a6; border-color: rgba(241, 212, 166, 0.5); }
.quote-card-lang--de { color: #b0c7ff; border-color: rgba(176, 199, 255, 0.5); }
.quote-card-lang--en { color: #c2f0ff; border-color: rgba(194, 240, 255, 0.5); }
.quote-card-lang--ro { color: #ffd0da; border-color: rgba(255, 208, 218, 0.5); }

.quote-card-year {
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.quote-card-source {
  border-left: 1px solid var(--color-border-subtle);
  padding-left: 0.6rem;
}

.quote-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-top: 0.25rem;
  color: var(--color-text-secondary);
}

.quote-card-body {
  margin-top: 0.4rem;
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.9;
  color: var(--color-text-secondary);
}

/* Remove bottom border from last quote-block inside a quote-card */
.quote-card-body .quote-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Legacy single `.full-review*` block removed 2026-06-19 (audit CSS-016):
   provably unreferenced — reviews.html/reviews.js use only the live plural
   `.full-reviews` section; the "keep until migrated" note's condition was void
   (migration complete). See _info_AUDIT-STATUS.md. */

/* --- Quote blocks: clear visual grouping --- */
.quote-block {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--color-border-subtle);
  margin-bottom: 0;
}

.quote-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.quote-block:first-child {
  padding-top: 0.6rem;
}

.quote-text {
  margin: 0;
  font-style: normal;
  color: var(--color-text-primary);
  position: relative;
  padding-left: 1.2rem !important;
  border-left: 2px solid var(--color-border-medium) !important;
}

/* Left quote accent bar — using border-left; no ::before quote character */
.quote-text::before {
  display: none !important;
}

.quote-author {
  margin-top: 0.5rem;
  padding-left: 1rem;
  font-size: 0.9em;
  font-style: normal;
  color: var(--color-text-muted);
}

.quote-original-link-wrap {
  display: block;
  margin-top: 0.5rem;
  margin-left: 1rem;
  font-size: 0.85em;
  color: var(--color-text-muted);
  white-space: pre;
  overflow-wrap: break-word;
  word-break: break-word;
}
.quote-original-link {
  color: var(--color-text-muted);
  overflow-wrap: break-word;
  word-break: break-word;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.quote-original-link:hover {
  color: var(--color-text-primary);
}

/* --- Quote styling inside hero highlight cards --- */
.highlight-card .quote-block {
  padding: 0;
  border-bottom: none;
  margin-top: 0.85rem;
}

.highlight-card .quote-text {
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  line-height: 1.8;
  font-style: normal;
  color: var(--color-text-primary);
  position: relative;
  padding-left: 1.2rem;
  border-left: 2px solid var(--color-border-medium);
}


.highlight-card .quote-author {
  margin-top: 0.5rem;
  padding-left: 1.2rem;
  font-size: var(--text-xs);
  font-style: normal;
  color: var(--color-text-muted);
}


/* --- Alternate section divider: elegant ornamental --- */
.review-section-divider--alt {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 0;
  gap: 1.2rem;
  background: var(--color-bg-base);
}

.divider-wing {
  flex: 0 1 160px;
  height: 1px;
  background: linear-gradient(
    to var(--wing-dir, right),
    var(--color-border-medium),
    transparent
  );
  opacity: 0.5;
}

.divider-wing--left {
  --wing-dir: left;
  background: linear-gradient(to right, transparent, var(--color-border-medium));
}

.divider-wing--right {
  background: linear-gradient(to right, var(--color-border-medium), transparent);
}

.divider-diamond {
  width: 10px;
  height: 10px;
  background: var(--color-accent);
  transform: rotate(45deg);
  opacity: 0.4;
  flex-shrink: 0;
}

.divider-diamond--sm {
  width: 6px;
  height: 6px;
  opacity: 0.25;
}

/* (Legacy `.full-review-body p + p` reset removed with the .full-review block — CSS-016.) */


/* =============================================
   LAPTOP SIDEBAR — books + filter as left sidebar
   (901px–1920px: laptops & typical desktop widths; reading column stays wide)
   (1921px+: full-width sticky bar under nav — ultra-wide / large monitors)
   ============================================= */
@media (min-width: 901px) and (max-width: 1920px) {
  .review-page {
    /* Wider than 78px so filter labels/buttons have room on MDPI laptops */
    --reviews-rail-width: 112px;
  }

  /* --- Sidebar container --- */
  .reviews-sticky-bar {
    position: fixed;
    top: var(--nav-height, 62px);
    left: 0;
    width: var(--reviews-rail-width, 112px);
    height: calc(100vh - var(--nav-height, 62px));
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;          /* Firefox */
    border-bottom: none;
    border-right: 1px solid var(--color-border-subtle);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
    padding: 0.55rem 0.45rem;
    margin: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .reviews-sticky-bar::-webkit-scrollbar {
    display: none;                  /* Chrome/Safari */
  }

  /* --- Books: vertical stack --- */
  .review-main .books-showcase {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0;
    margin: 0;
    max-width: none;
  }

  .review-main .portfolio-section {
    margin-bottom: 0.45rem;
  }

  .review-main .book-item {
    width: 100%;
    padding: 0.2rem;
    border: 1px solid transparent;
    background: transparent;
    flex-direction: column;
    align-items: center;
  }

  .review-main .book-item:hover {
    border-color: var(--color-accent);
    background: var(--color-bg-elevated);
  }

  /* Covers: intrinsic portrait ratio — avoids WebKit squashing when aspect-ratio + max-height fight */
  .review-main .book-cover {
    width: 100%;
    display: block;
    overflow: hidden;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .review-main .book-cover img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
  }

  /* Hide all text in sidebar book cards */
  .review-main .book-item h3,
  .review-main .book-item p {
    display: none;
  }

  /* --- Filter controls: vertical stack with readable type & hit targets --- */
  .reviews-sticky-bar .full-reviews-controls {
    padding: 0.65rem 0 0.35rem;
    padding-right: 0;
    margin: 0;
    border-top: 1px solid var(--color-border-subtle);
  }

  .reviews-sticky-bar .full-reviews-controls-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 0.15rem 0 0.35rem;
  }

  .reviews-sticky-bar .control-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    padding: 0 0.05rem;
  }

  .reviews-sticky-bar .control-label {
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-align: center;
    white-space: normal;
    margin: 0;
    line-height: 1.25;
    max-width: 100%;
  }

  .reviews-sticky-bar .control-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
  }

  .reviews-sticky-bar .sort-btn {
    font-size: var(--text-xs);
    padding: 0.45rem 0.35rem;
    min-height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    letter-spacing: 0.06em;
    line-height: 1.2;
    hyphens: auto;
    overflow-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
  }

  /* Hide the collapse button in sidebar mode — not needed */
  .reviews-sticky-bar .filter-collapse-btn {
    display: none;
  }

  /* Hero ↔ main divider: align with indented hero text (not under the rail) */
  .review-section-divider {
    padding-left: calc(var(--reviews-rail-width, 112px) + 1.5rem);
    padding-right: 1.5rem;
  }

  /* Full-bleed timeline: do not extend background under the fixed rail */
  .review-main .timeline-section {
    margin-left: 0;
    margin-right: calc(-1 * 1.2rem);
    padding-left: var(--padding-desktop);
    padding-right: calc(var(--padding-desktop) + 1.2rem);
  }

  /* --- Push ALL content right to clear the sidebar --- */
  .review-hero {
    padding-left: calc(var(--reviews-rail-width, 112px) + 1.5rem);
    padding-right: 1.5rem;
    min-height: auto;
  }

  .review-hero-inner {
    max-width: none;
    gap: 2rem;
  }

  .review-main {
    padding-left: calc(var(--reviews-rail-width, 112px) + 1.2rem);
    padding-right: 1.2rem;
  }

  .full-reviews {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }

  .full-reviews-header {
    margin-bottom: 0.5rem;
  }

  /* Reduce scroll offset — rail is fixed left, not a tall sticky stack */
  .book-section {
    scroll-margin-top: calc(var(--nav-height, 62px) + 1rem);
    padding: 1.5rem 1.5rem;
    margin-bottom: 1.5rem;
  }

  /* Tighter quote text for laptop */
  .quote-card {
    padding: 0.6rem 0.75rem;
  }

  .quote-card-body {
    font-size: 1.125rem;
  }
}


/* =============================================
   RESPONSIVE
   ============================================= */
/* Tablet width only (sidebar starts at 901px — do not override rail offsets 901–1023) */
@media (min-width: 601px) and (max-width: 900px) {
  .review-hero {
    padding: 4rem var(--padding-tablet) 3rem;
  }

  .review-main {
    padding: 3rem var(--padding-tablet) 4rem;
  }

  .timeline-section {
    margin-left: calc(-1 * var(--padding-tablet));
    margin-right: calc(-1 * var(--padding-tablet));
    padding-left: var(--padding-tablet);
    padding-right: var(--padding-tablet);
  }
}

@media (max-width: 1023px) {
  .review-hero-inner {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr);
  }

  /* Tablet: hero cards */
  .hero-highlights {
    overflow: visible;
    min-height: 0;
  }

  .hero-highlights .highlight-card {
    overflow: hidden;
    min-width: 0;
  }

  .hero-highlights .highlight-thumb {
    width: clamp(80px, 12vw, 120px);
    min-width: 80px;
  }


  /* Tablet: quote-cards — prevent vertical scrollbar (Safari can show one with mask) */
  .quote-card.is-truncated .quote-card-body {
    overflow: hidden;
  }
}

@media (max-width: 768px) {
  .reviews-sticky-bar {
    top: calc(var(--nav-height, 48px) - 4px); /* slight overlap to eliminate gap */
    padding-top: 4px;
  }

  .review-hero {
    padding: 3.5rem var(--padding-mobile) 2.5rem;
  }

  .review-main {
    padding: 2.5rem var(--padding-mobile) 3rem;
  }

  .timeline-section {
    margin-left: calc(-1 * var(--padding-mobile));
    margin-right: calc(-1 * var(--padding-mobile));
    padding-left: var(--padding-mobile);
    padding-right: var(--padding-mobile);
  }

  .hero-intro {
    padding-top: 0;
  }

  .review-hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .hero-ornament {
    margin-top: 2.2rem;
  }

  /* Full reviews filter controls: compact but aligned on mobile */
  .full-reviews-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    padding: 0.6rem 0;
    margin-bottom: 1.25rem;
  }

  .full-reviews-controls .control-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .full-reviews-controls .control-label {
    font-size: var(--text-xs);
    letter-spacing: 0.18em;
  }

  .full-reviews-controls .control-buttons {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
  }

  .full-reviews-controls .sort-btn {
    padding: 0.35rem 0.75rem;
    font-size: var(--text-xs);
  }

  .full-reviews-controls .sort-btn--active {
    background: rgba(212, 175, 55, 0.14);
  }

  /* Hero highlight cards: tighter padding on mobile */
  .highlight-card {
    padding: 1.25rem 1rem;
  }

  .highlight-thumb {
    margin-right: 1rem;
  }

  .timeline-inner {
    row-gap: 1.75rem;
    padding-left: 0;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    row-gap: 1.75rem;
    align-items: stretch;
    padding-left: 0;
  }

  /* --- Dual vertical lines, shifted toward center like the old spine --- */
  .timeline-spine {
    display: none;               /* hide the centered desktop spine */
  }

  .timeline-item::before,
  .timeline-item::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    pointer-events: none;
    transform: none;
    border-radius: 0;
    opacity: 1;
    height: auto;
    z-index: 0;                  /* behind the cards */
  }

  /* Outer line — white, matching old spine peak of 0.3 */
  .timeline-item::before {
    left: 0.5rem;
    background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.08),
      rgba(255, 255, 255, 0.3),
      rgba(255, 255, 255, 0.08)
    );
  }

  /* Inner line — gold accent, slightly softer than white */
  .timeline-item::after {
    left: 1.0rem;
    background: linear-gradient(
      to bottom,
      rgba(212, 175, 55, 0.08),
      rgba(212, 175, 55, 0.25),
      rgba(212, 175, 55, 0.08)
    );
  }

  .timeline-item:hover::before {
    height: auto;
    opacity: 1;
  }

  /* Year bubble: left-aligned like old code — only override grid-column + padding-left */
  .timeline-item--left .timeline-year,
  .timeline-item--right .timeline-year {
    grid-column: 1;
  }

  .timeline-year {
    text-align: left;
    padding-left: 1.75rem;
  }

  /* Glowing dot — aligned with the inner line, matching old year-node style */
  .timeline-year::before {
    content: "";
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    filter: drop-shadow(0 0 6px var(--accent));
    box-shadow: none;
    z-index: 3;
  }

  .timeline-year svg {
    display: none;
  }

  /* Cards: full-width, 3D elevated, on top of the dual lines */
  .timeline-item--left .timeline-card,
  .timeline-item--right .timeline-card {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
    max-width: 100%;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
    box-shadow:
      0 12px 35px rgba(0, 0, 0, 0.5),
      0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .timeline-card {
    max-width: 100%;
  }

  .book-section {
    padding: 1rem 0.75rem;
    margin-bottom: 1.25rem;
  }

  /* Mobile: image fills full header height, edge-to-edge vertically */
  .book-section-header {
    margin-bottom: 0.75rem;
  }

  .book-section-header-row {
    grid-template-columns: 80px 1fr 30px;
    gap: 0.6rem;
    align-items: stretch;
  }

  .book-section-thumb {
    width: 80px;
    height: auto;
    min-height: 100px;
    border: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  }

  .book-section-thumb img {
    object-fit: contain;         /* show full cover, no stretching */
  }

  .book-section-header-text {
    align-self: center;
  }

  .book-section-toggle {
    width: 30px;
    height: 30px;
    align-self: center;
  }

  .book-section-toggle svg {
    width: 15px;
    height: 15px;
  }

  /* Reduce card inner padding on mobile (single source — the .quote-card gap/padding
     rule lives once below; CSS-001 removed the earlier dead duplicate). */
  .quote-card-body {
    font-size: 1.0625rem;
  }

  /* Link overflow: allow wrapping on mobile */
  .quote-original-link-wrap {
    white-space: normal;
    margin-left: 0.75rem;
  }

  /* Maximize horizontal space: reduce nested padding/margins */
  .review-main {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .full-reviews {
    padding-left: 0;
    padding-right: 0;
  }

  .book-section {
    padding: 0.85rem 0.5rem;
    margin-bottom: 1rem;
    border-width: 1px;
  }

  .quote-card {
    padding: 0.5rem 0.4rem;
    margin-bottom: 0.5rem;
  }

  .quote-block {
    padding: 1rem 0;
  }

  .quote-text {
    padding-left: 0.75rem !important;
  }

  .quote-author {
    padding-left: 0.75rem;
  }
}

/* ============================================================
   SCROLL-008 — render cost containment (audit P1-3, 2026-06-13)
   content-visibility: auto lets the engine SKIP style/layout/paint
   for book sections that are outside the viewport; the page stops
   paying for all ~8 heavy sections on every invalidation.
   contain-intrinsic-size "auto <est>" keeps the scrollbar stable:
   the browser uses the real size once a section has rendered.
   Older browsers ignore both properties (pure progressive perf).
   ============================================================ */
.book-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}
