/* assets/photo-slider.css
 *
 * Dependency-free photo slider. Responsive 3/2/1 grid driven by CSS
 * custom properties set per-instance by photo-slider.js from the
 * data-per-* attributes. Fixed 4:3 tile aspect ratio keeps page
 * height stable when portrait and landscape photos mix.
 */

.tbms-slider {
  position: relative;
  max-width: 72rem;
  margin: 48px auto;
  padding: 0 16px;
  /* --tbms-pv is set at runtime from data-per-* (3 desktop, 2 tablet, 1 mobile). */
  --tbms-pv: 1;
  --tbms-gap: 16px;
}

.tbms-slider-title {
  color: #0F1F3D;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 24px;
  line-height: 1.25;
}
@media (min-width: 640px) { .tbms-slider-title { font-size: 28px; } }

.tbms-slider-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.tbms-slider-track {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--tbms-gap);
  /* JS updates translateX for navigation; this transform runs on the
   * GPU on modern browsers and does not reflow siblings. */
  transition: transform 350ms cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}

.tbms-slide {
  /* Width per slide = (100% - (pv-1)*gap) / pv */
  flex: 0 0 calc((100% - (var(--tbms-pv) - 1) * var(--tbms-gap)) / var(--tbms-pv));
  box-sizing: border-box;
}

.tbms-slide-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tbms-slide-media {
  position: relative;
  width: 100%;
  /* Fixed 4:3 aspect ratio; mixed portrait/landscape tiles stay the
   * same height, so flipping between slides does not shift page
   * layout and nothing jumps. */
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.tbms-slide-media img,
.tbms-slide-media picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tbms-slide-caption {
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
  text-align: center;
  padding: 0 4px;
}

/* ---- Controls ---------------------------------------------------- */
.tbms-slider-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.tbms-slider-btn {
  background: #0F1F3D;
  color: #fff;
  border: 0;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  min-width: 44px;      /* touch target */
  min-height: 44px;
}
.tbms-slider-btn:hover,
.tbms-slider-btn:focus-visible {
  background: #C9A961;
  color: #0F1F3D;
  outline: 2px solid #0F1F3D;
  outline-offset: 2px;
}
.tbms-slider-prev,
.tbms-slider-next { font-size: 22px; padding: 0 14px; }

.tbms-slider-playpause {
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---- Dots -------------------------------------------------------- */
.tbms-slider-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.tbms-slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: #cbd5e1;
  cursor: pointer;
  min-width: 24px;   /* oversized hit area, visible dot inside */
  min-height: 24px;
  position: relative;
}
.tbms-slider-dot::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #94a3b8;
}
.tbms-slider-dot[aria-current="true"]::after { background: #0F1F3D; }
.tbms-slider-dot:hover::after,
.tbms-slider-dot:focus-visible::after { background: #C9A961; }

/* ---- Reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .tbms-slider-track { transition: none; }
}

/* ---- Founder portrait block (used on /about) --------------------- */
.tbms-founder-portrait {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
  margin: 32px auto;
  max-width: 72rem;
  padding: 0 16px;
}
@media (min-width: 768px) {
  .tbms-founder-portrait { grid-template-columns: 280px 1fr; gap: 40px; }
}
.tbms-founder-portrait img {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  display: block;
}
.tbms-founder-portrait h3 {
  color: #0F1F3D;
  font-size: 22px;
  margin: 0 0 8px;
}
.tbms-founder-portrait .tbms-founder-sub {
  color: #64748b;
  font-size: 14px;
  margin: 0 0 16px;
  font-weight: 600;
}
.tbms-founder-portrait p {
  color: #334155;
  line-height: 1.7;
  margin: 0 0 12px;
}
