/*
 * KAC clean design tokens mirror the Divi 5 Design Variables in the build plan.
 * Native Divi modules remain the layout source of truth. This file covers
 * accessibility helpers, the Octiv bridge and reusable coach image slots.
 */

:root {
  --kac-blue: #0077b8;
  --kac-blue-dark: #005f95;
  --kac-blue-light: #37b7ef;
  --kac-ink: #101820;
  --kac-ink-soft: #1a242d;
  --kac-paper: #f7f7f4;
  --kac-soft: #eef1f2;
  --kac-white: #ffffff;
  --kac-muted: #5a6670;
  --kac-line: #dce2e5;
  --kac-line-dark: rgba(255, 255, 255, 0.16);
  --kac-shadow: 0 16px 44px rgba(16, 24, 32, 0.09);
  --kac-display: "Segoe UI Variable Display", "Segoe UI", Helvetica, Arial, sans-serif;
  --kac-body: "Segoe UI Variable Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --kac-shell: 1240px;
  --kac-radius: 8px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}

::selection {
  color: var(--kac-white);
  background: var(--kac-blue-dark);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--kac-white);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--kac-blue-dark);
}

.kac-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.kac-skip-link {
  position: fixed !important;
  z-index: 100000;
  top: 1rem;
  left: 1rem;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

.kac-skip-link:focus-within,
a.kac-skip-link:focus {
  transform: translateY(0);
}

.kac-skip-link a,
a.kac-skip-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--kac-white);
  background: var(--kac-blue-dark);
  font: 760 0.82rem/1.2 var(--kac-body);
  text-decoration: none;
}

/* Click-to-load Octiv schedule */

.kac-schedule {
  position: relative;
  display: flex;
  min-height: 520px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(1.8rem, 4vw, 3rem);
  border: 1px solid var(--kac-line);
  border-radius: var(--kac-radius);
  color: var(--kac-ink);
  background: var(--kac-soft);
  font-family: var(--kac-body);
  overflow: hidden;
}

.kac-schedule__preview {
  display: grid;
  width: min(100%, 520px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.kac-schedule__preview span {
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid var(--kac-line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.7);
  font-family: var(--kac-body);
  font-size: 0.9rem;
  font-weight: 680;
}

.kac-schedule__consent {
  width: min(100%, 520px);
  text-align: center;
}

.kac-schedule__eyebrow {
  margin: 0 0 0.55rem;
  color: var(--kac-blue-dark);
  font-size: 0.7rem;
  font-weight: 760;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.kac-schedule__privacy {
  max-width: 48ch;
  margin: 0 auto 1rem;
  color: var(--kac-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.kac-schedule__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
}

.kac-schedule__button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 0.88rem 1.2rem;
  border: 1px solid var(--kac-blue-dark);
  border-radius: 5px;
  color: var(--kac-white);
  background: var(--kac-blue-dark);
  cursor: pointer;
  font: 760 0.74rem/1 var(--kac-body);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.kac-schedule__button:hover:not(:disabled) {
  border-color: var(--kac-blue);
  background: var(--kac-blue);
  transform: translateY(-1px);
}

.kac-schedule__button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.kac-schedule__direct {
  color: var(--kac-ink);
  font-size: 0.8rem;
  font-weight: 720;
  line-height: 1.35;
  text-decoration: underline;
  text-decoration-color: var(--kac-blue-dark);
  text-underline-offset: 0.22em;
}

.kac-schedule__direct:hover {
  color: var(--kac-blue-dark);
}

.kac-schedule__status {
  margin: 0;
  color: var(--kac-muted);
  font-size: 0.7rem;
  font-weight: 680;
  letter-spacing: 0.07em;
  line-height: 1.45;
  text-align: center;
  text-transform: uppercase;
}

.kac-schedule__frame {
  display: none;
  width: 100%;
}

.kac-schedule.is-loading::after {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0, 95, 149, 0.2);
  border-top-color: var(--kac-blue-dark);
  border-radius: 50%;
  content: "";
  animation: kac-schedule-spin 800ms linear infinite;
}

.kac-schedule.is-loading .kac-schedule__preview {
  opacity: 0.34;
}

.kac-schedule.is-loading .kac-schedule__frame {
  position: absolute;
  inset: 0;
  display: block;
  visibility: hidden;
}

.kac-schedule.is-loaded {
  display: block;
  min-height: var(--kac-schedule-height, 1200px);
  padding: 0;
  border: 0;
  background: var(--kac-white);
}

.kac-schedule.is-loaded .kac-schedule__preview,
.kac-schedule.is-loaded .kac-schedule__consent {
  display: none;
}

.kac-schedule.is-loaded .kac-schedule__status {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.kac-schedule.is-loaded .kac-schedule__frame {
  display: block;
}

.kac-schedule.is-loaded .kac-schedule__direct {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  color: var(--kac-white);
  background: var(--kac-ink);
}

.kac-schedule__iframe {
  display: block;
  width: 100%;
  min-height: var(--kac-schedule-height, 1200px);
  border: 0;
  background: var(--kac-white);
}

.kac-schedule.has-error .kac-schedule__status,
.kac-schedule-error {
  color: #9b251d;
}

/* Optional native Divi classes for compact trust and intro sections */

.kac-trust {
  border-bottom: 1px solid var(--kac-line);
  background: var(--kac-white);
}

.kac-trust-row {
  display: grid;
  min-height: 122px;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.5rem, 5vw, 4.5rem);
  padding-block: 1.15rem;
}

.kac-trust-stack {
  display: grid;
  min-height: 0;
  justify-items: start;
  gap: 0.65rem;
  padding: 0;
  text-align: left;
}

.kac-trust-copy {
  margin-bottom: 0 !important;
}

.kac-trust-copy .et_pb_text_inner {
  display: grid;
  justify-items: start;
  gap: 0.22rem;
}

.kac-trust-copy p {
  margin: 0;
  padding: 0;
}

.kac-trust-logos {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.1rem;
}

.kac-trust-logo {
  margin-bottom: 0 !important;
}

.kac-trust-logo .et_pb_image_wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.kac-trust-logo img {
  display: block;
  width: auto;
  height: 25px;
  object-fit: contain;
}

.kac-trust-logo--hyrox .et_pb_image_wrap {
  padding: 0.34rem 0.52rem;
  border-radius: 3px;
  background: var(--kac-ink);
}

.kac-trust-logo--hyrox img {
  height: 22px;
}

.kac-trust-link {
  margin-bottom: 0 !important;
  justify-self: end;
}

.kac-trust-link .et_pb_text_inner {
  display: flex;
  justify-content: flex-end;
}

.kac-trust-link a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  white-space: nowrap;
}

.kac-intro-media .et_pb_image_wrap {
  display: block;
  aspect-ratio: 5 / 4;
  border-radius: var(--kac-radius);
  overflow: hidden;
}

.kac-intro-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 36%;
}

/* Optional Divi classes for coach image modules and placeholders */

.kac-coach-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.9rem, 2vw, 1.35rem);
}

.kac-coach-card {
  min-width: 0;
}

.kac-coach-photo {
  position: relative;
  aspect-ratio: 2 / 3;
  border: 1px solid #d6dde1;
  border-radius: var(--kac-radius);
  background: #e2e6e8;
  overflow: hidden;
}

.kac-coach-photo .et_pb_image_wrap,
.kac-coach-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kac-coach-photo--placeholder {
  display: flex;
  align-items: flex-end;
  padding: 0.9rem;
}

.kac-coach-placeholder-label {
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  color: #56616a;
  background: rgba(255, 255, 255, 0.78);
  font: 720 0.62rem/1.2 var(--kac-body);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.kac-coach-meta {
  padding: 0.9rem 0.1rem 0;
}

.kac-coach-meta h3 {
  margin: 0;
  font: 720 clamp(1.18rem, 2vw, 1.48rem)/1.2 var(--kac-display);
}

.kac-coach-meta p {
  margin: 0.18rem 0 0;
  color: var(--kac-muted);
  font: 400 0.82rem/1.5 var(--kac-body);
}

@keyframes kac-schedule-spin {
  to { transform: rotate(1turn); }
}


@media (min-width: 1041px) {
  .kac-intro-media .et_pb_image_wrap {
    aspect-ratio: 8 / 9;
  }
}
@media (max-width: 1100px) {
  .kac-coach-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .kac-coach-grid > .kac-coach-card {
    grid-column: span 2;
  }

  .kac-coach-grid > .kac-coach-card:nth-child(7) {
    grid-column: 2 / span 2;
    grid-row: 3;
  }

  .kac-coach-grid > .kac-coach-card:nth-child(8) {
    grid-column: 4 / span 2;
    grid-row: 3;
  }
}

@media (max-width: 720px) {
  .kac-trust-row {
    min-height: 0;
    align-items: start;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding-block: 1.15rem;
  }

  .kac-trust-link {
    justify-self: start;
  }

  .kac-trust-link .et_pb_text_inner {
    justify-content: flex-start;
  }

  .kac-intro-media .et_pb_image_wrap {
    aspect-ratio: 16 / 9;
    max-height: 320px;
  }

  .kac-coach-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
  }

  .kac-coach-grid > .kac-coach-card {
    width: auto;
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
  }

  .kac-coach-photo--placeholder {
    padding: 0.65rem;
  }

  .kac-coach-placeholder-label {
    font-size: 0.55rem;
  }
}

@media (max-width: 420px) {
  .kac-trust-copy {
    font-size: 0.82rem;
  }

  .kac-trust-logos {
    gap: 0.8rem;
  }

  .kac-trust-logo img {
    height: 21px;
  }

  .kac-trust-logo--hyrox .et_pb_image_wrap {
    padding: 0.28rem 0.45rem;
  }

  .kac-trust-logo--hyrox img {
    height: 20px;
  }

  .kac-schedule {
    min-height: 390px;
    padding: 1.3rem;
  }

  .kac-schedule__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .kac-schedule__button {
    width: 100%;
  }

  .kac-schedule.is-loaded,
  .kac-schedule__iframe {
    min-height: min(var(--kac-schedule-height, 1200px), 1200px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
