/* Lead House 365 Components
   Brand values are read from the Elementor kit's global variables so this
   never carries a second copy of the palette. Fallbacks match the Developer
   Guide in case the kit variables are ever renamed. */

.lh365-rotator {
  --lh-accent: var(--accent, #2ED47A);
  --lh-gold: var(--accent-gold, #D9AF3C);
  --lh-heading: var(--heading, #F5F7F4);
  --lh-body: var(--body-text, #C3CBC5);
  --lh-muted: var(--muted-text, #8A958D);
  --lh-surface: var(--surface, #161D19);
  --lh-line: var(--line, #26302A);
  --lh-display: var(--display, 'Archivo', sans-serif);
  --lh-font: var(--body, 'IBM Plex Sans', sans-serif);
  display: block;
  width: 100%;
}

/* ---- stage ---- */

.lh365-deck {
  display: grid;
  background-color: var(--lh-surface);
  border: 1px solid var(--lh-line);
  border-radius: 5px;
  overflow: hidden;
}

.lh365-slide {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition:
    opacity .45s cubic-bezier(.22, .61, .36, 1),
    transform .45s cubic-bezier(.22, .61, .36, 1),
    visibility 0s linear .45s;
}

.lh365-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

/* Pure black letterbox is deliberate — the only place it appears, so the
   client's screenshots sit on a neutral field rather than the surface tint. */
.lh365-shot {
  width: 100%;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000;
  padding: 0;
}

.lh365-shot img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  display: block;
}

.lh365-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-block-start: 1px solid var(--lh-line);
  font-family: var(--lh-font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--lh-body);
}

.lh365-caption strong {
  color: var(--lh-heading);
  font-weight: 600;
}

.lh365-sep {
  color: var(--lh-muted);
}

.lh365-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background-color: var(--lh-accent);
  box-shadow: 0 0 0 0 rgba(46, 212, 122, .55);
  animation: lh365-pulse 1.8s ease-out infinite;
}

@keyframes lh365-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 212, 122, .55); }
  100% { box-shadow: 0 0 0 10px rgba(46, 212, 122, 0); }
}

/* ---- controls ---- */

.lh365-ctrl {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-block-start: 24px;
}

.lh365-btn {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background-color: transparent;
  color: var(--lh-heading);
  border: 1px solid var(--lh-line);
  border-radius: 3px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.lh365-btn:hover {
  color: var(--lh-accent);
  border-color: var(--lh-accent);
}

.lh365-btn:active {
  background-color: rgba(46, 212, 122, .12);
}

.lh365-btn:focus-visible {
  outline: 2px solid var(--lh-accent);
  outline-offset: 3px;
}

.lh365-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.lh365-track {
  flex: 1 1 auto;
  height: 3px;
  background-color: var(--lh-line);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.lh365-track span {
  position: absolute;
  inset: 0;
  background-color: var(--lh-accent);
  transform: scaleX(0);
  transform-origin: left;
}

.lh365-track span.is-done {
  transform: scaleX(1);
}

.lh365-rotator.is-playing .lh365-track span.is-running {
  animation: lh365-fill var(--lh-interval, 5000ms) linear forwards;
}

@keyframes lh365-fill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.lh365-count {
  font-family: var(--lh-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--lh-muted);
  min-width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---- shorts rail controls ---- */

.lh365-rail-nav {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.lh365-rail-nav .lh365-btn {
  background-color: transparent;
}

@media (max-width: 1024px) {
  .lh365-shot { height: 560px; }
}

@media (max-width: 767px) {
  .lh365-shot { height: 440px; }
  .lh365-rail-nav { display: none; }
}

/* Under reduced motion the rotator never auto-advances (enforced in JS too),
   so kill the fill animation and the pulse rather than merely shortening
   them — a 0.01ms infinite pulse still repaints forever. */
@media (prefers-reduced-motion: reduce) {
  .lh365-dot { animation: none; }
  .lh365-rotator.is-playing .lh365-track span.is-running { animation: none; transform: scaleX(1); }
  .lh365-slide { transition: none; }
}
