/* Block bedri/reviews: .stories*, .rv-*, .tp-score, the faces, the wall (masonry, fold), tabs and "Vis alle".
   Carved from design/style.css (concept approved 23 Oct 2026) in source order; see build/carve/LEDGER.md. */

/* ---------- Stories ---------- */
.stories { padding: clamp(5rem, 10vw, 8rem) 0; background: var(--bg-2); border-block: 1px solid var(--line); }
.stories .h-lg { margin-bottom: clamp(2rem, 4vw, 3rem); }

/* =====================================================
   Stories v2: sellers + companies
   ===================================================== */
.stories .h-lg { margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem); }
.stories-sub { font-family: var(--font-text); font-weight: 600; font-size: 1rem; color: var(--accent); margin: 0 0 1.1rem; }

/* --- Reviews: header with the score, and the audience switch --- */
.rv-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem; margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem); }
.stories .rv-head .h-lg { margin-bottom: 1rem; }
.tp-score { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; color: var(--muted); text-decoration: none; transition: color .25s; }
.tp-score .tp-stars { font-size: 1.3rem; }
.tp-score b { color: var(--ink); font-weight: 600; }
.tp-score:hover { color: var(--ink); }

.rv-switch { position: relative; isolation: isolate; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: calc(var(--card-r) + 4px); background: var(--surface); border: 1px solid var(--line); }
.rv-switch[hidden] { display: none; }
.rv-tab { position: relative; z-index: 1; min-height: 46px; padding: 0 1.4rem; border: 0; border-radius: var(--card-r); background: none; cursor: pointer; font: 600 .95rem/1 var(--font-text); color: var(--muted); white-space: nowrap; transition: color .35s; }
.rv-tab:hover { color: var(--ink); }
/* the selected tab sits on the thumb: navy text on the light thumb in a dark section, light text on the navy thumb in a light one, white on blue */
.rv-tab[aria-selected="true"] { color: var(--bg); }
.rv-switch[data-on="1"] .rv-tab[aria-selected="true"] { color: var(--accent-ink); }
/* The thumb slides between the two, navy for sellers (the paper card's ink) and logo blue for companies */
.rv-thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: var(--card-r); background: var(--ink); transition: transform .55s cubic-bezier(.22, .8, .2, 1), background-color .4s; }
.rv-switch[data-on="1"] .rv-thumb { transform: translateX(100%); background: var(--accent); }

/* Panels: stacked with their own H3 without JS; tabs (H3 kept for the outline) with JS */
.stories .stories-sub { margin-bottom: 1.1rem; }
.rv-panel + .rv-panel { margin-top: clamp(4rem, 8vw, 6rem); }
.rv-panel[hidden] { display: none; }
.stories.is-tabbed .rv-panel + .rv-panel { margin-top: 0; }
.stories.is-tabbed .stories-sub { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Review cards: uniform index cards, the quote set in the display serif --- */
.rv-wall { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.75rem, 1.5vw, 1.25rem); }
/* Masonry: JS gives each card a span of 1px rows equal to its height plus the gap, so it stacks under the shortest column. Without JS the cards keep the even grid */
.rv-wall.is-masonry { grid-auto-rows: 1px; row-gap: 0; align-items: start; }
.rv-wall.is-masonry > * { grid-row-end: span var(--rows, 1); }
/* The seller videos sit in the wall as square tiles; isolation keeps their play button under the fold's fade */
.rv-wall > .reel { aspect-ratio: 1 / 1; isolation: isolate; }
.rv-wall > .reel video { object-position: 50% var(--crop-y, 50%); }
.rv {
  margin: 0; display: flex; flex-direction: column; gap: 1rem;
  padding: clamp(1.25rem, 2vw, 1.6rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--card-r);
  transition: border-color .3s, box-shadow .4s;
}
.rv:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: 0 18px 40px -26px rgba(10, 16, 32, .4); }
.rv-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .82rem; color: var(--muted); }
.rv-top .tp-stars { font-size: 1.1rem; }
.rv blockquote { margin: 0; flex: 1; }
.rv-title { margin: 0 0 .45rem; font-weight: 600; font-size: 1rem; line-height: 1.35; }
.rv blockquote p:last-child { margin: 0; font-family: var(--font-display); font-weight: 450; letter-spacing: -.005em; font-size: clamp(1.12rem, 1rem + .3vw, 1.25rem); line-height: 1.4; }
.rv figcaption { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .5rem 1rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .9rem; line-height: 1.35; }
.rv-who strong { display: block; font-weight: 600; }
.rv-who > span { display: block; color: var(--muted); font-size: .85rem; }
/* a small round portrait beside the reviewer (company reviews, 23 Oct); the initials stand in until there is a photo */
.rv figcaption:has(.has-face) { align-items: center; }
.rv-who.has-face { display: flex; align-items: center; gap: .75rem; }
.rv-who > .rv-face { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent-lit); font: 600 .8rem/1 var(--font-text); letter-spacing: .03em; }
.rv-who > img.rv-face { border: 0; background: var(--line); }
/* a seller's drawn icon (Bedri_Reviews::icon_svg(), 10 Nov) fills the circle; its muted tone mixes toward the circle.
   Unused since 23 Nov: a seller card has no face (client via Jannik); kept for a revert. Without a face the card's
   .rv-who has no .has-face, so name and company stand alone, as before 23 Oct. */
.rv-who > .rv-face.is-icon { --ic-bg: color-mix(in srgb, var(--accent) 14%, var(--surface)); overflow: hidden; }
.rv-face.is-icon svg { width: 100%; height: 100%; }
.rv-face.is-icon .ic-skin { fill: color-mix(in srgb, currentColor 42%, var(--ic-bg)); }
.rv-who > .rv-id { color: inherit; font-size: inherit; }
.rv-id > span { display: block; color: var(--muted); font-size: .85rem; }
.rv-link { color: var(--accent-lit); font-weight: 600; font-size: .85rem; text-decoration: none; white-space: nowrap; }
.rv-link::after { content: ""; display: inline-block; width: .4em; height: .4em; margin-left: .45em; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: translateY(-.2em); }
.rv-link:hover { text-decoration: underline; text-underline-offset: .2em; }

/* Folded (JS only): the lead tiles (the first ones, without data-more; at most three on phones) show in full, the next ones peek out
   under a blurred fade. JS sets --fold to the bottom of the lead tiles. "Vis alle" sits below the fade, unrolls the wall and turns into "Vis færre" */
.rv-panel { --rv-peek: clamp(7rem, 11vw, 10rem); }
/* the fade ends in the section's own colour: the dark reviews section sits on --bg-2, a light one on --bg */
.stories { --section-bg: var(--bg-2); }
.surface-light { --section-bg: var(--bg); }
/* No transitions on the wall itself: the reduced-motion rule would turn the masonry and fold changes into .01ms transitions, and the JS measures them in the same frame */
.rv-wall { position: relative; transition-property: none; }
.rv-wall.is-collapsed { max-height: calc(var(--fold) + var(--rv-peek)); overflow: hidden; }
.rv-wall.is-unrolling { overflow: hidden; }
.rv-wall.is-collapsed::after, .rv-wall.is-unrolling::after {
  content: ""; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: var(--rv-peek); pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--section-bg, var(--bg)) 92%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 60%); mask-image: linear-gradient(to bottom, transparent, #000 60%);
  transition: opacity .6s;
}
.rv-wall.is-unrolling::after { opacity: 0; }
.rv-wall.is-folding::after { animation: rv-fade-in .65s cubic-bezier(.22, .8, .2, 1) both; }
@keyframes rv-fade-in { from { opacity: 0; } }
.rv-more {
  display: flex; align-items: center; justify-content: center; gap: .65rem; min-height: 48px; margin: clamp(1.25rem, 2.5vw, 1.75rem) auto 0; padding: 0 1.4rem;
  border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); border-radius: var(--card-r); background: none; cursor: pointer;
  color: var(--ink); font: 600 .95rem/1 var(--font-text); transition: border-color .25s, color .25s;
}
.rv-more[hidden] { display: none; }
.rv-more::after { content: ""; width: .45em; height: .45em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-.15em) rotate(45deg); transition: transform .3s; }
.rv-more[aria-expanded="true"]::after { transform: translateY(.15em) rotate(-135deg); }
.rv-more:hover { border-color: var(--accent); color: var(--accent-lit); }

/* --- Responsive --- */
@media (max-width: 1080px) {
  .rv-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* the wall goes to one column a little earlier than the rest: at 601-640px two columns were cramped and stacked Nikolaj on Oskar */
@media (max-width: 640px) {
  .rv-wall { grid-template-columns: 1fr; }
  .rv-wall.is-masonry { grid-auto-rows: auto; row-gap: clamp(.75rem, 1.5vw, 1.25rem); }
  .rv-wall.is-masonry > * { grid-row-end: auto; }
}
@media (max-width: 600px) {
  .rv-switch { width: 100%; }
  .rv-tab { padding: 0 .75rem; }
}

@media (max-width: 899px) {
  .stories .reel figcaption { left: 1rem; right: 3.9rem; bottom: .95rem; }
  .stories .reel figcaption strong { font-size: 1.25rem; }
  .stories .reel-sound { right: .8rem; bottom: .95rem; width: 42px; height: 42px; }
}
