/* Services highlights carousel. Pairs with includes/highlights.php and assets/js/highlights.js. */

.hl { --hl-gutter: 20px; --hl-dur: 6s; overflow: hidden; }
@media (min-width: 900px) { .hl { --hl-gutter: 32px; } }

.hl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.hl-head h2 { margin: 0; font-size: clamp(28px, 5.4vw, 44px); line-height: 1.08; letter-spacing: -.02em; }
.hl-all { color: var(--amber); text-decoration: none; font-weight: 600; white-space: nowrap; font-size: 15px; }
.hl-all:hover { color: var(--amber-hi); }

/* The track runs edge to edge; its padding lines the first card up with the heading
   so the next card peeks in from the right, like Apple's gallery. */
.hl-track {
  --hl-inset: max(var(--hl-gutter), calc((100vw - var(--wrap)) / 2 + var(--hl-gutter)));
  list-style: none; margin: 0;
  display: flex; gap: 16px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 0 var(--hl-inset) 4px; scroll-padding-inline: var(--hl-inset);
  scrollbar-width: none;
}
.hl-track::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: reduce) { .hl-track { scroll-behavior: auto; } }

.hl-slide { flex: 0 0 min(86vw, 1000px); scroll-snap-align: start; }
@media (min-width: 900px) { .hl-slide { flex-basis: min(calc(100vw - 2 * var(--hl-inset) - 80px), 1000px); } }

.hl-card {
  display: grid; height: 100%;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  border-radius: 22px; overflow: hidden; text-decoration: none; color: var(--paper);
  background: linear-gradient(160deg, #22262b, #15181b);
  border: 1px solid var(--line);
  transition: border-color .2s;
}
.hl-card:hover { border-color: rgba(233, 162, 59, .45); }

.hl-copy { min-width: 0; padding: 24px 22px 20px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.hl-copy p { margin: 0; font-size: clamp(19px, 2.3vw, 26px); line-height: 1.25; letter-spacing: -.01em; color: var(--muted); font-weight: 500; }
.hl-copy strong { color: var(--paper); font-weight: 700; }
.hl-more { color: var(--amber); font-weight: 600; font-size: 15px; }

.hl-media { position: relative; min-width: 0; min-height: 0; aspect-ratio: 4 / 3; background: var(--charcoal); }
/* The photo fills its frame without ever setting the card's size. */
.hl-media picture { position: absolute; inset: 0; }
.hl-media img { width: 100%; height: 100%; object-fit: cover; }

/* No photo yet: a quiet text panel with the card number. */
.hl-media-text { display: grid; place-items: center; background: radial-gradient(circle at 70% 30%, rgba(233, 162, 59, .18), transparent 60%), var(--charcoal); }
.hl-media-text span { font-size: clamp(64px, 12vw, 140px); font-weight: 800; color: rgba(233, 162, 59, .35); letter-spacing: -.04em; }

@media (min-width: 760px) {
  .hl-card { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); aspect-ratio: 16 / 8; }
  .hl-copy { padding: 36px 34px; }
  .hl-copy p { font-size: clamp(20px, 2vw, 25px); }
  .hl-media { aspect-ratio: auto; }
}

/* Controls: a pill of dots plus a play/pause button. The active dot stretches into a progress bar. */
.hl-controls { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 26px; }
.hl-controls[hidden] { display: none; }
.hl-dots { display: flex; align-items: center; gap: 10px; padding: 0 18px; height: 50px; border-radius: 999px; background: rgba(255, 255, 255, .08); backdrop-filter: blur(8px); }
.hl-dot {
  position: relative; width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(244, 241, 236, .4); cursor: pointer; overflow: hidden;
  transition: width .4s ease, background-color .3s;
}
.hl-dot::before { content: ""; position: absolute; inset: -12px -5px; } /* bigger tap target */
.hl-dot:hover { background: rgba(244, 241, 236, .65); }
.hl-dot.is-active { width: 48px; background: rgba(244, 241, 236, .35); }
.hl-dot-fill { position: absolute; inset: 0; width: 0; border-radius: inherit; background: var(--paper); }
.hl-dot.is-active .hl-dot-fill { width: 100%; }
.hl.is-playing .hl-dot.is-active .hl-dot-fill { width: 0; animation: hl-fill var(--hl-dur) linear forwards; }
.hl.is-paused .hl-dot.is-active .hl-dot-fill { animation-play-state: paused; }
@keyframes hl-fill { to { width: 100%; } }

.hl-play {
  display: grid; place-items: center; width: 50px; height: 50px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .08); color: var(--paper); cursor: pointer; backdrop-filter: blur(8px);
}
.hl-play:hover { background: rgba(255, 255, 255, .14); }
.hl-ico-play { display: none; }
.hl:not(.is-playing) .hl-ico-play { display: block; }
.hl:not(.is-playing) .hl-ico-pause { display: none; }

@media (prefers-reduced-motion: reduce) { .hl-dot { transition: none; } }
