/* =========================================
   BRIGHTSMILE DENTAL — GALLERY PAGE
   ========================================= */

/* ─────────────────────────────────────────
   RESULTS STRIP — Stat Cards
───────────────────────────────────────── */

.gallery-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.gallery-stat {
  text-align: center;
  padding: 28px var(--space-4) 24px;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  border: 1px solid #eaeff8;
  box-shadow: 0 1px 4px rgba(27, 58, 107, 0.05);
  transition:
    box-shadow 220ms ease,
    transform 220ms ease,
    border-color 220ms ease;
}

.gallery-stat:hover {
  box-shadow: 0 6px 24px rgba(27, 58, 107, 0.11);
  transform: translateY(-3px);
  border-color: rgba(13, 148, 136, 0.22);
}

.gallery-stat__num {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: var(--weight-bold);
  color: var(--color-navy);
  line-height: 1.1;
  margin-bottom: 7px;
  letter-spacing: -0.02em;
}

.gallery-stat__label {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
  line-height: 1.4;
}

/* ─────────────────────────────────────────
   FILTER BAR
───────────────────────────────────────── */

.gallery-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.gallery-count {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: 28px;
}

.gallery-count strong {
  color: var(--color-navy);
  font-weight: 600;
}

.chip--filter {
  transition:
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.chip--filter:hover:not(.is-active) {
  background: #f0f9f8;
  color: var(--color-teal);
  transform: translateY(-1px);
}

.chip--filter.is-active {
  background: var(--color-navy);
  color: white;
  box-shadow: 0 2px 8px rgba(27, 58, 107, 0.22);
}

/* ─────────────────────────────────────────
   GALLERY GRID
───────────────────────────────────────── */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* ─────────────────────────────────────────
   GALLERY CARD
───────────────────────────────────────── */

.gallery-item {
  background: var(--color-white);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #eaeff8;
  box-shadow:
    0 1px 3px rgba(27, 58, 107, 0.06),
    0 4px 12px rgba(27, 58, 107, 0.04);
  display: flex;
  flex-direction: column;
  cursor: default;
  transition:
    box-shadow 260ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 260ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 260ms ease;
}

.gallery-item:hover {
  box-shadow:
    0 2px 6px rgba(27, 58, 107, 0.06),
    0 14px 44px rgba(27, 58, 107, 0.14);
  transform: translateY(-5px);
  border-color: rgba(13, 148, 136, 0.28);
}

.gallery-item.is-hidden {
  display: none;
}

/* ─────────────────────────────────────────
   BEFORE / AFTER COMPARISON AREA
───────────────────────────────────────── */

.gallery-item__ba {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
  background: var(--color-soft-blue);
  flex-shrink: 0;
}

.gallery-item__before,
.gallery-item__after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.gallery-item__photo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.gallery-item__photo--before {
  background: linear-gradient(160deg, #b8c4d4 0%, #8fa0b8 100%);
}

.gallery-item__photo--after {
  background: linear-gradient(160deg, #c8ede8 0%, #8fd0c8 100%);
}

/* ── Tooth mock visuals ── */
.gallery-item__mock {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-4);
  width: 100%;
  height: 100%;
}

.gallery-mock-teeth {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.gallery-mock-teeth span {
  display: block;
  width: 22px;
  border-radius: 4px 4px 2px 2px;
}

/* Before — yellowed/stained */
.gallery-mock-teeth--before span { background: #d4c090; height: 36px; }
.gallery-mock-teeth--before span:nth-child(1),
.gallery-mock-teeth--before span:nth-child(6) { height: 28px; width: 18px; }

/* After — bright white */
.gallery-mock-teeth--after span { background: #f4f4f6; height: 40px; box-shadow: 0 2px 8px rgba(255,255,255,0.5); }
.gallery-mock-teeth--after span:nth-child(1),
.gallery-mock-teeth--after span:nth-child(6) { height: 30px; width: 18px; }

/* Variants */
.gallery-mock-teeth--gapped { gap: 8px; }
.gallery-mock-teeth--crowded span { width: 16px; transform: rotate(var(--rot, 0deg)); }
.gallery-mock-teeth--crowded span:nth-child(2) { --rot: 8deg; height: 32px; }
.gallery-mock-teeth--crowded span:nth-child(4) { --rot: -6deg; height: 30px; }
.gallery-mock-teeth span.gap { background: transparent; width: 20px; }
.gallery-mock-teeth span.sm-gap { background: transparent; width: 10px; }
.gallery-mock-teeth--worn span { background: #c4a870; }
.gallery-mock-teeth--worn span:nth-child(2),
.gallery-mock-teeth--worn span:nth-child(3) { height: 20px; }
.gallery-mock-teeth--stained span { background: #b8a060; }
.gallery-mock-teeth span.chipped { height: 22px; clip-path: polygon(0 0, 80% 0, 100% 30%, 100% 100%, 0 100%); }
.gallery-mock-teeth--uniform span { width: 22px; height: 42px; border-radius: 3px 3px 2px 2px; }
.gallery-mock-teeth--large span { width: 30px; height: 52px; }
.gallery-mock-teeth--large.gallery-mock-teeth--before span { background: #c8a870; }
.gallery-mock-teeth--severe span { background: #987040; height: 24px; }
.gallery-mock-teeth--spaced { gap: 10px; }

/* ── Labels — Before / After corners ── */
.gallery-item__label {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  z-index: 2;
  pointer-events: none;
}

/* After image is clipped from the left — label must sit at the right so it stays visible */
.gallery-item__after .gallery-item__label {
  left: auto;
  right: 10px;
}

/* ── Divider line ── */
.gallery-item__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.88);
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.18);
}

/* ── Drag handle circle ── */
.gallery-item__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: white;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.18),
    0 0 0 2px rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-navy);
  z-index: 4;
  pointer-events: none;
}

/* ── Drag hint pill ── */
.gallery-item__drag-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: white;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 999px;
  z-index: 2;
  pointer-events: none;
}

/* ─────────────────────────────────────────
   CARD INFO SECTION
───────────────────────────────────────── */

.gallery-item__info {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

/* Badge: never stretch to full width in flex column */
.gallery-item__info .badge {
  align-self: flex-start;
  margin-bottom: 1px;
}

.gallery-item__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-navy);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.gallery-item__desc {
  font-size: 13px;
  color: #5a6a7e;
  line-height: 1.62;
  /* Clamp to 2 lines — prevents tall cards breaking grid alignment */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-item__meta {
  display: flex;
  gap: 16px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f0f4fb;
}

.gallery-item__meta span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #7a8fa6;
  font-weight: 500;
}

.gallery-item__meta svg {
  color: var(--color-teal);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   PATIENT SPOTLIGHT
───────────────────────────────────────── */

.spotlight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

/* ── Before / After large images ── */
.spotlight-ba-large {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.spotlight-ba-large__card {
  flex: 1;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 4px 20px rgba(27, 58, 107, 0.12),
    0 1px 4px rgba(27, 58, 107, 0.06);
  transition: box-shadow 220ms ease, transform 220ms ease;
}

.spotlight-ba-large__card:hover {
  box-shadow: 0 10px 40px rgba(27, 58, 107, 0.18);
  transform: translateY(-4px);
}

.spotlight-ba-large__img {
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spotlight-mock--before {
  background: linear-gradient(160deg, #c4cfde 0%, #96aac0 100%);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.spotlight-mock--after {
  background: linear-gradient(160deg, #b8ebe6 0%, #76ccc5 100%);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.spotlight-ba-large__tag {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.spotlight-ba-large__tag--after {
  background: rgba(13, 148, 136, 0.88);
}

.spotlight-ba-large__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: var(--color-white);
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(27, 58, 107, 0.10);
  font-size: 15px;
  color: var(--color-teal);
  align-self: center;
}

/* ── Testimonial Quote Card ── */
.spotlight-quote {
  position: relative;
  background: var(--color-white);
  border: 1px solid #e4eaf3;
  border-radius: 20px;
  padding: 36px 36px 30px;
  margin-bottom: 24px;
  box-shadow:
    0 4px 24px rgba(27, 58, 107, 0.08),
    0 1px 4px rgba(27, 58, 107, 0.05);
  font-style: normal;
}

/* Teal left border accent */
.spotlight-quote::after {
  content: '';
  position: absolute;
  left: 0;
  top: 28px;
  bottom: 28px;
  width: 3px;
  background: linear-gradient(to bottom, var(--color-teal), rgba(13, 148, 136, 0.25));
  border-radius: 0 2px 2px 0;
}

/* Decorative opening quote */
.spotlight-quote::before {
  content: '\201C';
  position: absolute;
  top: 8px;
  left: 28px;
  font-family: var(--font-heading);
  font-size: 80px;
  line-height: 1;
  color: var(--color-teal);
  opacity: 0.12;
  pointer-events: none;
}

.spotlight-quote p {
  font-family: var(--font-heading);
  font-size: 17px;
  color: #1a2a3a;
  line-height: 1.72;
  font-style: italic;
  font-weight: 400;
  margin-bottom: 24px;
  position: relative;
  padding-top: 4px;
}

/* Footer grid: name + rating in same row */
.spotlight-quote footer {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 16px;
  padding-top: 20px;
  border-top: 1px solid #edf2f7;
  font-style: normal;
}

.spotlight-quote footer strong {
  grid-column: 1;
  grid-row: 1;
  font-size: 15px;
  font-weight: 600;
  color: #1a2a3a;
}

.spotlight-quote footer span {
  grid-column: 1;
  grid-row: 2;
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.45;
}

/* Rating badge */
.spotlight-rating {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #f59e0b;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 8px 12px;
}

.spotlight-rating svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.spotlight-rating::after {
  content: '5.0';
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
}

/* ── Treatments list ── */
.spotlight-treatments {
  margin-bottom: 24px;
}

.spotlight-treatments__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-navy);
  margin-bottom: var(--space-2);
}

/* ── Disclaimer ── */
.gallery-disclaimer {
  max-width: 800px;
  margin: 0 auto;
  display: block;
  padding: var(--space-3) var(--space-4);
  background: var(--color-warm-neutral);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--color-accent-gold);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

/* ─────────────────────────────────────────
   RESPONSIVE — Built-in breakpoints
───────────────────────────────────────── */

/* Tablet: 2-column grid */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .gallery-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Spotlight: stack visual above content */
  .spotlight-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .spotlight-ba-large {
    max-width: 500px;
    margin: 0 auto;
  }
}

/* Mobile: 1-column grid */
@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Stats: 2×2 grid */
  .gallery-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }

  .gallery-stat {
    padding: 20px var(--space-3) 18px;
  }

  .gallery-stat__num {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
    margin-bottom: 4px;
  }

  .gallery-stat__label {
    font-size: 12px;
  }

  /* Filter chips: scrollable single row */
  .gallery-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
    margin-inline: -20px;
    padding-inline: 20px;
  }

  .gallery-filters::-webkit-scrollbar { display: none; }

  .chip--filter {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 13px;
  }

  .gallery-count {
    margin-top: 4px;
    margin-bottom: 20px;
  }

  /* Cards: 16:9 BA area (shorter) so title/desc visible */
  .gallery-item__ba {
    aspect-ratio: 16 / 9;
  }

  /* Drag handle: always visible, teal = interactive */
  .gallery-item .gallery-item__divider {
    opacity: 1;
  }

  .gallery-item .gallery-item__handle {
    opacity: 1;
    width: 44px;
    height: 44px;
    background: var(--color-teal);
    color: #fff;
    box-shadow: 0 2px 12px rgba(13, 148, 136, 0.40);
  }

  /* Drag hint: always visible, pinned top-right */
  .gallery-item__drag-hint {
    opacity: 1 !important;
    bottom: auto;
    top: 10px;
    right: 10px;
    left: auto;
    transform: none;
    font-size: 10px;
    padding: 3px 8px;
  }

  /* Info section */
  .gallery-item__info {
    padding: 14px 16px 16px;
    gap: 6px;
  }

  .gallery-item__title {
    font-size: 14.5px;
  }

  .gallery-item__desc {
    font-size: 13px;
  }

  /* Spotlight: stack BA images vertically, full width */
  .spotlight-ba-large {
    flex-direction: column;
    max-width: 100%;
    gap: 8px;
  }

  .spotlight-ba-large__arrow {
    transform: rotate(90deg);
    align-self: center;
    width: 30px;
    height: 30px;
  }

  .spotlight-ba-large__img {
    aspect-ratio: 4 / 3;
  }

  .spotlight-quote {
    padding: 24px 20px 20px;
    border-radius: 14px;
  }

  .spotlight-quote::before {
    font-size: 60px;
    top: 4px;
    left: 18px;
  }

  .spotlight-quote::after {
    top: 20px;
    bottom: 20px;
  }

  .spotlight-quote p {
    font-size: 15.5px;
    margin-bottom: var(--space-4);
  }

  .spotlight-quote footer {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 16px;
  }

  .spotlight-rating {
    grid-column: 1;
    grid-row: auto;
    flex-direction: row;
    align-self: flex-start;
    padding: 6px 10px;
    gap: 2px;
  }

  .spotlight-rating::after {
    margin-left: 4px;
  }
}
