/*
 * Erklärvideo im Hero (individualentwicklung): Poster mit Overlay, Klick startet das Video
 * mit Ton und Untertiteln. Ohne JS bleibt es ein normales <video controls>.
 * Baut auf .service-detail-hero__visual auf (Rahmen ::before, Goldkante ::after).
 */

/* Rahmen und Goldkante sitzen am Video, nicht an der ganzen Figur (Bildunterschrift ist länger) */
.service-detail-hero__visual.hero-video {
  padding: 0;
}

.service-detail-hero__visual.hero-video::before,
.service-detail-hero__visual.hero-video::after {
  content: none;
}

.hero-video__frame {
  position: relative;
  padding: 20px 20px 0 0;
}

.hero-video__frame::before {
  content: "";
  position: absolute;
  inset: 0 0 -14px 20px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .18);
  background: linear-gradient(145deg, rgba(var(--ogency-base-rgb), .1), transparent 60%);
}

.hero-video__frame::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -14px;
  width: 29%;
  height: 3px;
  background: var(--ogency-base);
}

.hero-video__stage {
  position: relative;
  overflow: hidden;
  background: var(--ogency-black2);
  box-shadow: 0 25px 50px rgba(0, 0, 0, .25);
}

.hero-video__media {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: var(--ogency-black2);
}

.hero-video__media:focus-visible {
  outline: 2px solid var(--ogency-base);
  outline-offset: 3px;
}

/* --- Overlay (nur mit JS sichtbar) ---------------------------------------------------- */
.hero-video__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: clamp(14px, 2vw, 22px);
  width: 100%;
  padding: clamp(16px, 3vw, 28px);
  border: 0;
  background: transparent;
  color: var(--ogency-white);
  text-align: left;
  cursor: pointer;
  transition: opacity .35s ease;
}

.hero-video__play[hidden] {
  display: none;
}

.hero-video.is-playing .hero-video__play {
  opacity: 0;
  pointer-events: none;
}

/* Verlauf unten links, damit Text auf dem hellen Poster lesbar bleibt (≥ 4.5:1) */
.hero-video__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(5, 5, 6, .92) 0%, rgba(5, 5, 6, .74) 30%, rgba(5, 5, 6, .16) 62%, rgba(5, 5, 6, 0) 80%),
    linear-gradient(90deg, rgba(5, 5, 6, .35), rgba(5, 5, 6, 0) 60%);
  transition: opacity .35s ease;
}

.hero-video__button {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(58px, 6vw, 76px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ogency-base);
  color: var(--ogency-black);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), background-color .25s ease;
}

/* feiner Ring, der sanft atmet */
.hero-video__button::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px solid rgba(var(--ogency-base-rgb), .55);
  border-radius: 50%;
  animation: hero-video-ring 2.8s ease-out infinite;
}

.hero-video__button svg {
  width: 42%;
  height: 42%;
  margin-left: 8%;
  fill: currentColor;
}

.hero-video__label {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding-bottom: 2px;
}

.hero-video__kicker {
  color: var(--ogency-base);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero-video__title {
  font-size: clamp(17px, 1.7vw, 22px);
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}

.hero-video__meta {
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
}

.hero-video__play:hover .hero-video__button,
.hero-video__play:focus-visible .hero-video__button {
  transform: scale(1.07);
  background: var(--ogency-base-light);
}

.hero-video__play:focus-visible {
  outline: 2px solid var(--ogency-base);
  outline-offset: -6px;
}

@keyframes hero-video-ring {
  0% {
    transform: scale(.92);
    opacity: .9;
  }
  70%,
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

/* --- Größeres Video: mehr Breite für die Medienspalte ---------------------------------- */
@media (min-width: 992px) {
  .service-detail-hero__grid:has(> .hero-video) {
    grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
    gap: clamp(36px, 4vw, 64px);
  }

  .service-detail-hero__grid:has(> .hero-video) h1 {
    font-size: clamp(44px, 4.3vw, 66px);
  }
}

/* auf breiten Bildschirmen etwas in den Rand hinein */
@media (min-width: 1400px) {
  .service-detail-hero__visual.hero-video {
    width: calc(100% + 48px);
    margin-right: -48px;
  }
}

/* --- Transkript: kleiner Schalter rechts unter dem Video, klappt bei Bedarf auf -------- */
.service-detail-hero__visual.hero-video figcaption {
  display: flex;
  justify-content: flex-end;
  padding-top: 28px;
  color: inherit;
  font-size: inherit;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.hero-video__transcript {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
}

.hero-video__transcript summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  list-style: none;
  transition: color .2s ease, border-color .2s ease;
}

.hero-video__transcript summary::-webkit-details-marker {
  display: none;
}

.hero-video__transcript summary svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.hero-video__transcript summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s ease;
}

.hero-video__transcript[open] summary::after {
  transform: translateY(1px) rotate(-135deg);
}

.hero-video__transcript summary:hover,
.hero-video__transcript summary:focus-visible,
.hero-video__transcript[open] summary {
  border-color: rgba(var(--ogency-base-rgb), .6);
  color: var(--ogency-base);
}

.hero-video__transcript summary:focus-visible {
  outline: 2px solid var(--ogency-base);
  outline-offset: 3px;
}

.hero-video__transcript-note {
  align-self: stretch;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, .58);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hero-video__transcript ol {
  align-self: stretch;
  display: grid;
  gap: 10px;
  max-height: 300px;
  margin: 10px 0 0;
  padding: 16px 18px 16px 34px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .03);
  color: rgba(255, 255, 255, .78);
  font-size: 14px;
  line-height: 1.6;
}

.hero-video__transcript li::marker {
  color: var(--ogency-base);
  font-weight: 700;
}

.hero-video__transcript strong {
  color: var(--ogency-white);
  font-weight: 600;
}

/* Untertitel lesbar auf hellem Bild */
.hero-video__media::cue {
  background: rgba(5, 5, 6, .82);
  color: #fff;
  font-family: var(--ogency-font, sans-serif);
  line-height: 1.35;
}

@media (max-width: 575px) {
  .hero-video__meta {
    display: none;
  }

  .hero-video__kicker {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-video__button::after {
    animation: none;
  }

  .hero-video__play,
  .hero-video__shade,
  .hero-video__button,
  .hero-video__transcript summary,
  .hero-video__transcript summary::after {
    transition: none;
  }
}
