/* ============================================================
   Craft Boys — inner pages, part B (feature sections).
   cb-reviews-wall · cb-projects-list · cb-project-hero ·
   cb-project-story · cb-portfolio-grid (+ lightbox).
   Auto-loaded by head.php. Tokens: craftboys.css, primitives:
   _base.css. Review-card / availability primitives are reused
   from home-c.css.
   ============================================================ */

/* ── cb-reviews-wall — /reviews/ ───────────────────────────── */
/* Fuse the dark hero and the wall into one block (the hero's bottom padding
   is the whole seam) — the score-bar chips flow straight into the platforms. */
.cb-page-hero + .cb-revwall { padding-top: 0; }

.cb-revwall__platforms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.cb-revwall__platform {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--cb-panel);
  border-radius: var(--cb-radius);
  padding: 18px 20px;
}
.cb-revwall__platform-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
}
.cb-revwall__platform-meta { min-width: 0; }
.cb-revwall__platform-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--cb-white);
}
.cb-revwall__platform-score {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 6px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: rgba(255, 255, 255, .82);
}
.cb-revwall__platform-rating { font-weight: 700; color: var(--cb-white); }
.cb-revwall__platform-star svg { width: 14px; height: 14px; color: var(--cb-yellow); display: block; }
.cb-revwall__platform-count { color: rgba(255, 255, 255, .6); }
.cb-revwall__platform-link { font-size: 13px; color: var(--cb-yellow); }

.cb-revwall__tabs { margin-bottom: 26px; flex-wrap: wrap; }

/* Masonry wall via CSS columns (order-independent, no JS layout). */
.cb-revwall__list {
  columns: 2;
  column-gap: 20px;
}
.cb-revwall__card {
  position: relative;
  break-inside: avoid;
  margin: 0 0 20px;
  /* Reset the homepage card's carousel flex-basis — here it's a column item. */
  flex: none;
}
.cb-revwall__card[hidden] { display: none; }
.cb-revwall__card-logo {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 22px;
  height: 22px;
  object-fit: contain;
  background: #fff;
  border-radius: 5px;
  padding: 2px;
}
.cb-revwall__empty { margin-top: 8px; }
.cb-revwall__more {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

@media (max-width: 640px) {
  .cb-revwall__list { columns: 1; }
  .cb-revwall__platforms { grid-template-columns: 1fr; }
}

/* ── Shared: filter pills (projects / portfolio) ───────────── */
.cb-pill {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--cb-white);
  color: var(--cb-ink);
  border: 1px solid rgba(20, 20, 20, .14);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.cb-pill:hover { border-color: rgba(20, 20, 20, .4); }
.cb-pill.is-active {
  background: var(--cb-ink);
  border-color: var(--cb-ink);
  color: var(--cb-white);
}

/* ── cb-facts — docked strip under the project hero ────────── */
.cb-facts {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  background: rgba(23, 28, 31, .72);
  backdrop-filter: blur(6px);
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-radius);
}
.cb-facts__cell {
  flex: 1 1 auto;
  min-width: 140px;
  padding: 18px 22px;
  border-right: 1px solid var(--cb-line);
}
.cb-facts__cell:last-child { border-right: 0; }
.cb-facts__label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  margin: 0 0 6px;
}
.cb-facts__value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(18px, 1.8vw, 24px);
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--cb-white);
  margin: 0;
}

/* ── cb-project-hero — dark photo hero + docked facts ──────── */
.cb-project-hero {
  position: relative;
  background: var(--cb-dark);
  padding-block: clamp(48px, 6vw, 96px) 0;
  overflow: hidden;
}
.cb-project-hero__bg { position: absolute; inset: 0; z-index: 0; }
.cb-project-hero__bg-img,
.cb-project-hero__bg-ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.cb-project-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(23, 28, 31, .30) 0%, rgba(23, 28, 31, .90) 100%),
    linear-gradient(90deg, rgba(23, 28, 31, .82) 0%, rgba(23, 28, 31, .35) 100%);
}
.cb-project-hero__inner {
  position: relative;
  z-index: 1;
  padding-top: clamp(120px, 18vh, 220px);
}
.cb-project-hero .breadcrumb {
  font-family: var(--font-ui);
  font-size: 13px;
  margin: 0 0 18px;
}
.cb-project-hero .breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; }
.cb-project-hero .breadcrumb li { display: inline-flex; align-items: center; color: rgba(255, 255, 255, .55); }
.cb-project-hero .breadcrumb a { color: rgba(255, 255, 255, .55); text-decoration: none; }
.cb-project-hero .breadcrumb a:hover { color: var(--cb-yellow); }
.cb-project-hero .breadcrumb .sep { margin-inline: 9px; color: rgba(255, 255, 255, .35); }
.cb-project-hero .breadcrumb [aria-current="page"] { color: rgba(255, 255, 255, .85); }
.cb-project-hero__title { font-size: clamp(34px, 4vw, 56px); margin-bottom: 14px; max-width: 16ch; }
.cb-project-hero__intro { margin-bottom: 0; max-width: 620px; }
.cb-project-hero__services {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
}
.cb-project-hero__service {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--cb-white);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--cb-line);
  border-radius: 999px;
  transition: border-color .18s ease, color .18s ease;
}
a.cb-project-hero__service:hover { border-color: var(--cb-yellow); color: var(--cb-yellow); }
.cb-project-hero__cta { margin-top: 26px; }
/* The facts strip is docked flush at the dark hero's bottom edge. */
.cb-project-hero__facts-wrap {
  position: relative;
  z-index: 1;
  margin-top: clamp(36px, 5vw, 64px);
}

@media (max-width: 1024px) {
  .cb-project-hero__inner { padding-top: clamp(100px, 14vh, 160px); }
}
@media (max-width: 640px) {
  .cb-project-hero__title { font-size: 30px; }
  .cb-facts__cell { flex: 1 1 45%; min-width: 0; border-right: 1px solid var(--cb-line); }
  .cb-facts__cell:nth-child(2n) { border-right: 0; }
  .cb-facts__value { font-size: 18px; }
}

/* ── cb-story — project narrative chapters + quote ─────────── */
.cb-story__head { margin-bottom: 44px; max-width: 760px; }
.cb-story__chapters { display: flex; flex-direction: column; gap: clamp(40px, 6vw, 80px); }
.cb-story__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.cb-story__row--reverse .cb-story__media { order: -1; }
.cb-story__kicker { color: #5A6A72; }
.cb-story__ch-title { margin-bottom: 14px; }
.cb-story__body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--cb-body);
  margin: 0;
}
.cb-story__media { min-width: 0; }
.cb-story__img,
.cb-story__img-ph {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--cb-radius);
  display: block;
}
.cb-story__img-ph { min-height: 0; }
.cb-story__quote {
  margin: clamp(44px, 6vw, 80px) auto 0;
  max-width: 760px;
  text-align: center;
}
.cb-story__quote-stars {
  display: inline-flex;
  gap: 4px;
  color: var(--cb-yellow);
  margin-bottom: 16px;
}
.cb-story__quote-stars svg { width: 20px; height: 20px; }
.cb-story__quote-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.35;
  color: var(--cb-ink);
  margin: 0 0 18px;
}
.cb-story__quote-by { font-family: var(--font-ui); font-size: 15px; }
.cb-story__quote-author { font-weight: 700; color: var(--cb-ink); }
.cb-story__quote-loc { color: var(--cb-body); }
.cb-story__quote-author + .cb-story__quote-loc::before { content: ' · '; }

@media (max-width: 1024px) {
  .cb-story__row { grid-template-columns: 1fr; }
  .cb-story__row--reverse .cb-story__media,
  .cb-story__media { order: -1; }  /* photo above text on mobile */
}

/* ── cb-portfolio — mosaic + captions + lightbox ───────────── */
.cb-portfolio__head { margin-bottom: 30px; max-width: 760px; }
.cb-portfolio__filters,
.cb-projlist__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}
.cb-portfolio__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.cb-portfolio__item { margin: 0; }
.cb-portfolio__item[hidden] { display: none; }
.cb-portfolio__link {
  position: relative;
  display: block;
  border-radius: var(--cb-radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
}
.cb-portfolio__img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.cb-portfolio__link:hover .cb-portfolio__img { transform: scale(1.04); }
.cb-portfolio__cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 34px 16px 14px;
  background: linear-gradient(180deg, transparent, rgba(20, 20, 20, .82));
  color: #fff;
  opacity: 0;
  transition: opacity .2s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cb-portfolio__link:hover .cb-portfolio__cap,
.cb-portfolio__link:focus-visible .cb-portfolio__cap { opacity: 1; }
.cb-portfolio__cap-title { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; font-size: 14px; }
.cb-portfolio__cap-tag { font-family: var(--font-ui); font-size: 12px; color: var(--cb-yellow); }
.cb-portfolio__more,
.cb-projlist__more { display: flex; justify-content: center; margin-top: 28px; }

@media (max-width: 1024px) { .cb-portfolio__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .cb-portfolio__grid { grid-template-columns: 1fr; }
  .cb-portfolio__filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -24px; padding-inline: 24px; }
  .cb-portfolio__cap { opacity: 1; }  /* no hover on touch */
}

/* Lightbox overlay */
body.cb-lb-open { overflow: hidden; }
.cb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 28, 31, .94);
  padding: clamp(16px, 4vw, 56px);
}
.cb-lightbox[hidden] { display: none; }
.cb-lightbox__figure { margin: 0; max-width: 100%; max-height: 100%; text-align: center; }
.cb-lightbox__img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--cb-radius);
  display: block;
  margin: 0 auto;
}
.cb-lightbox__caption {
  font-family: var(--font-ui);
  font-size: 15px;
  color: rgba(255, 255, 255, .85);
  margin-top: 14px;
}
.cb-lightbox__close,
.cb-lightbox__nav {
  position: absolute;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .18s ease;
}
.cb-lightbox__close:hover,
.cb-lightbox__nav:hover { background: rgba(255, 255, 255, .22); }
.cb-lightbox__close {
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}
.cb-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 34px;
  line-height: 1;
}
.cb-lightbox__nav--prev { left: 20px; }
.cb-lightbox__nav--next { right: 20px; }
.cb-lightbox__counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .06em;
  color: var(--cb-yellow);
}
@media (max-width: 640px) {
  .cb-lightbox__nav { width: 42px; height: 42px; font-size: 26px; }
  .cb-lightbox__nav--prev { left: 8px; }
  .cb-lightbox__nav--next { right: 8px; }
}

/* ── cb-projlist — hub grid / related row ──────────────────── */
.cb-projlist__head { margin-bottom: 34px; max-width: 760px; }
.cb-projlist__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 32px);
}
.cb-projlist__card {
  background: var(--cb-white);
  border-radius: var(--cb-radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 10px 28px rgba(20, 20, 20, .07);
  display: flex;
  flex-direction: column;
}
.cb-projlist__card[hidden] { display: none; }
.cb-projlist__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.cb-projlist__media .cb-imgph { width: 100%; height: 100%; }
.cb-projlist__img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.cb-projlist__card:hover .cb-projlist__img { transform: scale(1.04); }
.cb-projlist__body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.cb-projlist__title { margin-bottom: 6px; }
.cb-projlist__title a { color: inherit; text-decoration: none; }
.cb-projlist__title a:hover { color: var(--cb-yellow-2); }
.cb-projlist__loc {
  font-family: var(--font-ui);
  font-size: 14px;
  color: #5A6A72;
  margin-bottom: 12px;
}
.cb-projlist__desc {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--cb-body);
  margin: 0 0 16px;
}
.cb-projlist__rule { height: 1px; background: rgba(20, 20, 20, .12); margin-bottom: 12px; }
.cb-projlist__meta {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-style: italic;
  color: #5A6A72;
  margin-bottom: 16px;
}
.cb-projlist__link { margin-top: auto; }

@media (max-width: 640px) {
  /* Related rows (limit ≤ 3) become a swipe carousel; the hub grid stacks. */
  .cb-projlist__grid {
    grid-template-columns: 1fr;
  }
}
