/*
 * 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;
}

/* 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);
}

/* The live Octiv document is cross-origin, so its content height cannot be
 * measured reliably. Keep the embedded plan usable without leaving a large
 * empty block: the iframe scrolls internally when the schedule is longer. */
.kac-schedule.kac-schedule--embedded {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: var(--kac-radius);
  background: var(--kac-white);
  overflow: hidden;
}

.kac-schedule--embedded .kac-schedule__iframe {
  height: var(--kac-schedule-height, 1200px);
  min-height: 0;
  background: var(--kac-white);
}

/* The Octiv schedule needs its full legacy height to avoid a cramped nested
 * viewport. This also corrects pages imported with the earlier 900px value. */
.kac-schedule--embedded {
  --kac-schedule-height: 1200px !important;
}

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

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

.kac-trust {
  display: grid !important;
  justify-items: center;
  padding-block: 0 !important;
  border-bottom: 1px solid var(--kac-line);
  background: linear-gradient(180deg, var(--kac-white) 0%, #f7fafc 100%);
}

.kac-trust-row {
  display: grid;
  width: min(calc(100% - 2rem), 760px) !important;
  max-width: 760px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  grid-template-columns: 1fr;
  grid-template-areas:
    "copy"
    "logos"
    "cta";
  align-items: center;
  justify-items: center;
  row-gap: clamp(0.85rem, 1.5vw, 1.15rem);
  padding-block: clamp(1.75rem, 2.5vw, 2.25rem);
  text-align: center;
}

/* Divi forces margin-right: 0 on the last column. Keep this full-width
 * content column genuinely centered inside its row at every breakpoint. */
.kac-trust .kac-d5-shell > .kac-trust-row.et_pb_column.et-last-child {
  margin-left: auto !important;
  margin-right: auto !important;
}

.kac-trust > .kac-d5-shell {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  justify-content: center !important;
}

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

.kac-trust-copy .et_pb_text_inner {
  display: block;
}

.kac-trust-copy p {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

.kac-trust-copy strong {
  display: block;
  color: var(--kac-ink);
  font-size: clamp(0.9rem, 1vw, 1rem);
  font-weight: 780;
  line-height: 1.35;
}

.kac-trust-logos {
  --flex-direction: row;
  --flex-wrap: nowrap;
  grid-area: logos;
  display: flex !important;
  width: min(100%, 416px) !important;
  min-width: 0;
  align-items: center;
  justify-content: center !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: clamp(0.7rem, 1.5vw, 0.9rem);
}

/*
 * Divi 5 can render Group children through an additional inner container.
 * Keep the partner images in one row regardless of whether that wrapper is
 * present. The selectors are deliberately structural, not version-specific.
 */
.kac-trust-logos > :where(.et_pb_module_inner, .et_pb_group_inner),
.kac-trust-logos > :where(.et_pb_module_inner, .et_pb_group_inner) > :where(.et_pb_module_inner, .et_pb_group_inner) {
  display: flex !important;
  width: 100% !important;
  min-width: 0;
  align-items: center;
  justify-content: center !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: inherit;
}

.kac-trust-logo {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  margin-bottom: 0 !important;
}

.kac-trust-logo .et_pb_image_wrap {
  display: flex !important;
  box-sizing: border-box;
  height: 60px;
  max-width: none !important;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--kac-line);
  border-radius: 7px;
  background: var(--kac-white);
  overflow: hidden;
}

.kac-trust-logo img {
  display: block;
  width: auto !important;
  max-width: none !important;
  object-fit: contain;
}

.kac-trust-logo--hyrox { order: 1; }
.kac-trust-logo--hansefit { order: 2; }

.kac-trust-logo--hansefit .et_pb_image_wrap {
  width: 222px !important;
  padding: 0.65rem 1rem;
}

.kac-trust-logo--hansefit img {
  width: auto !important;
  height: 30px !important;
  max-width: 184px !important;
}

.kac-trust-logo--hyrox .et_pb_image_wrap {
  width: 180px !important;
  padding: 0.65rem 1.05rem;
  border-color: var(--kac-ink);
  background: var(--kac-ink);
}

.kac-trust-logo--hyrox img {
  width: auto !important;
  height: 34px !important;
  max-width: 136px !important;
}

.kac-trust-link {
  grid-area: cta;
  width: min(100%, 250px) !important;
  padding: 0;
  border: 0;
  margin-bottom: 0 !important;
}

.kac-trust-link .et_pb_text_inner {
  display: flex;
  width: 100%;
  justify-content: center;
}

.kac-trust-link p { width: 100%; }

.kac-trust-link a {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.35rem;
  border: 1px solid var(--kac-blue-dark);
  border-radius: 3px;
  color: var(--kac-white) !important;
  background: var(--kac-blue-dark);
  font: 760 0.7rem/1 var(--kac-body);
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.kac-trust-link a:hover {
  color: var(--kac-white);
  border-color: var(--kac-blue);
  background: var(--kac-blue);
  transform: translateY(-1px);
}

.kac-trust-link-short {
  display: none;
}

.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-grid--active {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Reserve visibility is controlled by Divi's native device switches.
 * This outline only identifies the editable reserve in the builder. */

body.et-fb .kac-d5-section--reserved,
body.et-fb .kac-coach-grid--reserved {
  outline: 2px dashed rgba(0, 119, 184, 0.45);
  outline-offset: -2px;
}

.kac-coach-card {
  display: block;
  min-width: 0;
  align-self: start;
}

/* Divi can retain waypoint styles from an earlier import. Coach cards must be
 * stable immediately so portraits and names never reveal in different frames. */
body:not(.et-fb) .kac-coach-grid :is(
  .kac-coach-card,
  .kac-coach-photo,
  .kac-coach-photo--placeholder,
  .kac-coach-meta
) {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

.kac-coach-photo {
  position: relative;
  box-sizing: border-box;
  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: 980px) {
  .kac-coach-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
  }

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

@media (max-width: 720px) {
  .kac-trust-row {
    width: min(calc(100% - 1.5rem), 480px) !important;
    row-gap: 0.8rem;
    padding-block: 1.65rem;
  }

  .kac-trust-logo .et_pb_image_wrap {
    height: 52px;
  }

  .kac-trust-logo--hyrox .et_pb_image_wrap {
    width: clamp(116px, 32vw, 145px) !important;
    padding-inline: 0.65rem;
  }

  .kac-trust-logo--hansefit .et_pb_image_wrap {
    width: clamp(142px, 39vw, 178px) !important;
    padding-inline: 0.65rem;
  }

  .kac-trust-logo--hyrox img {
    height: 28px !important;
  }

  .kac-trust-logo--hansefit img {
    height: 25px !important;
  }

  .kac-trust-logos { width: min(100%, 340px) !important; }

  .kac-trust-link { width: min(100%, 230px) !important; }

  .kac-trust-link a {
    min-height: 48px;
    font-size: 0.72rem;
  }

  .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;
  }

  .kac-schedule--embedded .kac-schedule__iframe {
    height: clamp(600px, 78svh, 760px);
    min-height: 0;
  }
}

@media (max-width: 420px) {
  .kac-trust-logos {
    gap: 0.55rem;
  }

  .kac-trust-link a {
    padding-inline: 0.9rem;
    font-size: 0.7rem;
  }

  .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: var(--kac-schedule-height, 1200px);
  }

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

@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;
  }
}
