/* ============================================================
   Craft Boys — homepage sections C (Figma slices 3–4).
     .cb-projects  Home · Featured Projects (dark video cards)
     .cb-reviews   Home · Reviews + Estimate (reviews / availability / form)
   Shared primitives live in _base.css; tokens in craftboys.css (:root --cb-*).
   Desktop-first; columns stack under 1024px.
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   cb-projects — “The deck you see is only half the story”
   ──────────────────────────────────────────────────────────── */
.cb-projects__head {
  text-align: center;
  margin-bottom: clamp(36px, 4vw, 56px);
}
.cb-projects__sub { margin-inline: auto; }

.cb-projects__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cb-projects__card {
  background: var(--cb-panel);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cb-projects__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--cb-dark-2);
  overflow: hidden;
}
.cb-projects__poster,
.cb-projects__player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  display: block;
}
.cb-projects__media .cb-imgph {
  position: absolute;
  inset: 0;
  min-height: 0;
  border-radius: 0;
}
.cb-projects__play {
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 2;
}

.cb-projects__body {
  padding: 26px 28px 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
}
.cb-projects__title {
  font-size: clamp(22px, 2vw, 28px);
  margin: 0 0 8px;
}
.cb-projects__loc {
  font-family: var(--font-body);
  font-size: 16px;
  color: rgba(255, 255, 255, .6);
  margin-bottom: 18px;
}
.cb-projects__desc {
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, .72);
  margin: 0;
}
.cb-projects__rule {
  width: 100%;
  height: 1px;
  background: var(--cb-line);
  margin: 22px 0;
}
.cb-projects__meta {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}
.cb-projects__link { margin-top: 24px; font-size: 18px; }

.cb-projects__cta {
  text-align: center;
  margin-top: clamp(36px, 4vw, 56px);
}

/* ────────────────────────────────────────────────────────────
   cb-reviews — layout
   ──────────────────────────────────────────────────────────── */
.cb-reviews__cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(420px, 39%, 540px);
  gap: clamp(40px, 6vw, 110px);
  align-items: start;
}

/* ── Left column — rating bar ── */
.cb-reviews__scorebar {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 4px 0 36px;
}
.cb-reviews__score {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(48px, 4.4vw, 64px);
  line-height: 1;
  color: var(--cb-white);
}
.cb-reviews__stars {
  display: flex;
  gap: 5px;
  color: var(--cb-yellow);
}
.cb-reviews__stars svg { width: 25px; height: 25px; }
.cb-reviews__score-note {
  font-family: var(--font-body);
  font-size: 16px;
  color: rgba(255, 255, 255, .85);
  margin-top: 7px;
}
.cb-reviews__badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cb-reviews__badge-img {
  margin-left: auto;
  max-height: 56px;
  width: auto;
}
.cb-reviews__badge-check {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #34A853;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.cb-reviews__badge-label {
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.2;
  color: var(--cb-white);
  max-width: 9ch; /* “Google Guaranteed” wraps to two lines like the badge */
}

/* ── Left column — source tabs ── */
.cb-reviews__tabs {
  display: flex;
  gap: 36px;
  border-bottom: 1px solid var(--cb-line);
  margin-bottom: 26px;
}
.cb-reviews__tab {
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 10px 2px 14px;
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 500;
  color: rgba(255, 255, 255, .55);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}
.cb-reviews__tab:hover { color: var(--cb-white); }
.cb-reviews__tab.is-active {
  color: var(--cb-white);
  border-bottom-color: var(--cb-yellow);
  font-weight: 700;
}

/* ── Left column — white summary card ── */
.cb-reviews__summary {
  background: var(--cb-white);
  border-radius: 8px;
  padding: 26px 30px 28px;
  margin-bottom: 22px;
}
.cb-reviews__summary .cb-h3 {
  color: var(--cb-ink); /* re-assert ink inside .cb-on-dark */
  font-size: 22px;
  margin: 0 0 12px;
}
.cb-reviews__summary-text {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--cb-body);
  margin: 0;
}

/* ── Left column — review cards ── */
.cb-reviews__list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 28px;
}
.cb-reviews__card {
  background: var(--cb-panel);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  padding: 24px 28px 26px;
}
.cb-reviews__card[hidden] { display: none; }
.cb-reviews__card-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.cb-reviews__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--cb-yellow);
  color: var(--cb-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.cb-reviews__name {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 17px;
  color: var(--cb-white);
  margin-bottom: 5px;
}
.cb-reviews__card-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, .6);
}
.cb-reviews__mini-stars { display: inline-flex; gap: 3px; }
.cb-reviews__mini-star svg {
  width: 15px;
  height: 15px;
  color: rgba(255, 255, 255, .22);
  display: block;
}
.cb-reviews__mini-star.is-filled svg { color: rgba(255, 255, 255, .92); }
.cb-reviews__dot { color: var(--cb-yellow); }
.cb-reviews__text {
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, .75);
  margin: 0;
}
.cb-reviews__all { margin-top: 2px; }

/* ── Right column — sticky stack ── */
.cb-reviews__sticky {
  position: sticky;
  top: 96px; /* clears the sticky site header */
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Green availability card */
.cb-avail {
  background: var(--cb-green);
  border: 1px solid rgba(32, 126, 32, .6);
  border-radius: 8px;
  padding: 32px 36px 34px;
}
.cb-avail__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.4;
  color: var(--cb-white);
  margin: 0 0 16px;
}
.cb-avail__note {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 16px;
  color: rgba(255, 255, 255, .72);
  margin-bottom: 16px;
}
.cb-avail__months {
  display: flex;
  gap: 12px;
}
.cb-avail__chip {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--cb-white);
  border-radius: var(--cb-radius);
  padding: 13px 12px;
}
.cb-avail__month {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 16px;
  color: var(--cb-ink);
}
/* Month label: full name on desktop, 3-letter version on phones. */
.cb-avail__month-short { display: none; }
@media (max-width: 640px) {
  .cb-avail__month-full { display: none; }
  .cb-avail__month-short { display: inline; }
}
.cb-avail__meter { display: inline-flex; gap: 3px; }
.cb-avail__seg {
  width: 7px;
  height: 20px;
  border-radius: 2px;
  background: #C9CDD1;
}
.cb-avail__seg.is-on { background: #2E7D32; }
/* The green "available" segments gently pulse (light shimmer) to draw the eye
   to open slots. Staggered per segment; disabled under reduced-motion. */
@keyframes cb-avail-pulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
  50%      { opacity: .5;  box-shadow: 0 0 6px 1px rgba(46, 125, 50, .5); }
}
@media (prefers-reduced-motion: no-preference) {
  .cb-avail__seg.is-on { animation: cb-avail-pulse 1.5s ease-in-out infinite; }
  .cb-avail__seg.is-on:nth-of-type(2) { animation-delay: .25s; }
  .cb-avail__seg.is-on:nth-of-type(3) { animation-delay: .5s; }
}

/* Estimate form card */
.cb-estimate {
  background: var(--cb-panel);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  padding: 34px 36px 36px;
  color-scheme: dark; /* dark native select/file dialogs */
}
.cb-estimate__heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 2.2vw, 32px);
  line-height: 1.15;
  color: var(--cb-white);
  margin: 0 0 10px;
}
.cb-estimate__sub {
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .7);
  margin: 0 0 24px;
}

.cb-estimate__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cb-estimate__input {
  width: 100%;
  background: var(--cb-input);
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-radius);
  padding: 15px 16px;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--cb-white);
  transition: border-color .18s ease;
}
.cb-estimate__input::placeholder { color: rgba(255, 255, 255, .55); }
.cb-estimate__input:focus {
  outline: none;
  border-color: var(--cb-yellow);
}

.cb-estimate__label {
  display: block;
  font-family: var(--font-ui);
  font-size: 14.5px;
  color: rgba(255, 255, 255, .75);
  margin: 20px 0 10px;
}

.cb-estimate__select-wrap { position: relative; }
.cb-estimate__select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  cursor: pointer;
}
.cb-estimate__chev {
  position: absolute;
  right: 17px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, .7);
  pointer-events: none;
}

/* Day / time chips */
.cb-estimate__chips {
  display: grid;
  gap: 10px;
}
.cb-estimate__chips--days  { grid-template-columns: repeat(5, 1fr); }
.cb-estimate__chips--times { grid-template-columns: repeat(3, 1fr); }
.cb-estimate__chip {
  background: var(--cb-input);
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-radius);
  padding: 12px 4px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  color: var(--cb-white);
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.cb-estimate__chip:hover { border-color: rgba(255, 255, 255, .4); }
.cb-estimate__chip.is-active {
  background: var(--cb-white);
  border-color: var(--cb-white);
  color: var(--cb-ink);
  font-weight: 700;
}
/* "Other date" chip = a label wrapping a native date input (opens the calendar).
   The input covers the chip but is transparent and click-through; the JS opens
   the picker via showPicker() so the calendar anchors to the chip. */
.cb-estimate__chip--other {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cb-estimate__date {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none; /* clicks go to the chip; JS calls showPicker() */
}

/* Attach file */
.cb-estimate__attach {
  position: relative;
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1.5px dashed rgba(255, 255, 255, .28);
  border-radius: var(--cb-radius);
  padding: 26px 18px;
  font-family: var(--font-ui);
  font-size: 15.5px;
  color: var(--cb-white);
  cursor: pointer;
  transition: border-color .18s ease;
}
.cb-estimate__attach:hover,
.cb-estimate__attach:focus-within { border-color: var(--cb-yellow); }
.cb-estimate__attach svg { flex: 0 0 auto; }
.cb-estimate__attach-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cb-estimate__file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.cb-estimate__attach-hint {
  margin-top: 8px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, .55);
  text-align: center;
}

.cb-estimate__submit {
  width: 100%;
  margin-top: 22px;
  padding-block: 19px;
  font-size: 16px;
}
.cb-estimate__note {
  text-align: center;
  font-family: var(--font-body);
  font-size: 15px;
  color: rgba(255, 255, 255, .7);
  margin-top: 16px;
}

/* AJAX feedback */
.cb-estimate__msg {
  border-radius: var(--cb-radius);
  padding: 13px 16px;
  margin: 18px 0 0;
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.5;
}
.cb-estimate__msg--ok {
  background: rgba(46, 125, 50, .2);
  border: 1px solid rgba(102, 187, 106, .5);
  color: #A5D6A7;
}
.cb-estimate__msg--err {
  background: rgba(211, 47, 47, .16);
  border: 1px solid rgba(229, 115, 115, .5);
  color: #EF9A9A;
}

/* Visually hidden (a11y labels for placeholder-only inputs) */
.cb-vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ────────────────────────────────────────────────────────────
   Responsive
   ──────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .cb-reviews__cols { grid-template-columns: minmax(0, 1fr) minmax(400px, 44%); }
  .cb-avail,
  .cb-estimate { padding: 28px 26px 30px; }
}

@media (max-width: 1024px) {
  .cb-projects__grid { grid-template-columns: 1fr; }

  .cb-reviews__cols {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  /* Keep the columns clampable — the review carousel's content must not
     dictate the grid track's min-content width. */
  .cb-reviews__left,
  .cb-reviews__right { min-width: 0; }
  /* Mobile design order: availability + estimate form ABOVE the reviews. */
  .cb-reviews__right { order: -1; }
  .cb-reviews__sticky { position: static; }
}

@media (max-width: 640px) {
  /* Projects — horizontal swipe carousel (mobile design): card + peek of the
     next one, scroll-snap, progress bar (see .cb-hscroll-bar in _base.css). */
  .cb-projects__grid {
    display: flex;
    gap: 14px;
    margin-inline: -24px;
    padding-inline: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cb-projects__grid::-webkit-scrollbar { display: none; }
  .cb-projects__card { flex: 0 0 86%; scroll-snap-align: start; }
  .cb-projects__body { padding: 22px 20px 26px; }
  .cb-projects__desc {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .cb-projects__cta { margin-top: 26px; }
  .cb-projects__cta .cb-btn { width: 100%; }

  .cb-reviews__scorebar {
    flex-wrap: wrap;
    gap: 16px;
    row-gap: 20px;
  }
  .cb-reviews__score { font-size: 40px; }
  .cb-reviews__badge,
  .cb-reviews__badge-img { margin-left: 0; }
  .cb-reviews__tabs { gap: 24px; }
  /* Compact per the owner's call: the long summary card is desktop-only. */
  .cb-reviews__summary { display: none; }

  /* Reviews — swipe carousel of the client-written cards. */
  .cb-reviews__list {
    display: flex;
    flex-direction: row;
    gap: 14px;
    margin-inline: -24px;
    padding-inline: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cb-reviews__list::-webkit-scrollbar { display: none; }
  .cb-reviews__card { flex: 0 0 86%; scroll-snap-align: start; padding: 20px 18px 22px; }
  .cb-reviews__text {
    display: -webkit-box;
    -webkit-line-clamp: 7;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Three month chips stay on ONE row like the mobile design */
  .cb-avail__months { flex-wrap: nowrap; gap: 8px; }
  .cb-avail__chip { flex: 1 1 0; min-width: 0; padding: 11px 6px; gap: 8px; }
  .cb-avail__month { font-size: 14px; }

  /* Estimate form — owner call 2026-07-19: the old two-column mobile layout was
     too cramped, so fields STACK full-width; 16px inputs (stops iOS auto-zoom);
     day chips wrap 3-up (3+2), time chips are full-width tappable rows. Shared
     .cb-estimate__input sizing also covers the Deck Academy apply card. */
  .cb-estimate { padding: 24px 18px 28px; }
  .cb-estimate__grid { grid-template-columns: 1fr; gap: 10px; }
  .cb-estimate__input { font-size: 16px; padding: 14px 15px; }
  .cb-estimate__label { margin: 16px 0 8px; font-size: 14px; }
  .cb-estimate__chips { gap: 8px; }
  .cb-estimate__chips--days  { grid-template-columns: repeat(3, 1fr); }
  .cb-estimate__chips--times { grid-template-columns: 1fr; }
  .cb-estimate__chip { font-size: 14.5px; padding: 13px 6px; white-space: normal; }
  .cb-estimate__attach { padding: 20px 14px; font-size: 15px; }
  .cb-estimate__heading { font-size: 24px; }
  .cb-estimate__sub { font-size: 15px; margin-bottom: 18px; }
}
