/**
 * Shared Website Page Builder renderer layouts.
 * Scoped under .wp-page — does not restyle the rest of the site.
 */

.wp-page {
  --wp-max: 1120px;
  --wp-pad: clamp(1.15rem, 3vw, 1.5rem);
  --wp-section-gap: clamp(3rem, 6vw, 5rem);
  --wp-hero-height: 440px;
  --wp-hero-height-tablet: 360px;
  --wp-hero-height-mobile: 280px;
}

.wp-page .ec-wrap,
.wp-page .wp-sec .ec-wrap {
  width: min(var(--wp-max), calc(100% - (var(--wp-pad) * 2)));
  margin-inline: auto;
}

.wp-page .wp-sec.ec-section {
  padding: var(--wp-section-py, var(--wp-section-gap)) 0;
}

.wp-page .wp-sec.ec-section.wp-designed {
  border-radius: var(--wp-section-radius, 0);
}

.wp-page .wp-sec__head {
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
  max-width: 40rem;
}

/* Design tokens from builder */
.wp-page section.wp-designed,
.wp-page .ec-section.wp-designed {
  background-color: var(--wp-section-bg, transparent);
  color: var(--wp-section-text, inherit);
  text-align: var(--wp-section-align, inherit);
}

.wp-page .wp-designed .wp-typo-heading,
.wp-page .wp-designed .ec-h1,
.wp-page .wp-designed .ec-h2 {
  color: var(--wp-heading-color, inherit);
  font-size: var(--wp-heading-size, inherit);
  font-weight: var(--wp-heading-weight, inherit);
  text-align: var(--wp-heading-align, inherit);
  line-height: var(--wp-heading-lh, inherit);
}

.wp-page .wp-designed .wp-typo-sub,
.wp-page .wp-designed .ec-kicker,
.wp-page .wp-designed .ec-hero__brand {
  color: var(--wp-sub-color, inherit);
  font-size: var(--wp-sub-size, inherit);
  font-weight: var(--wp-sub-weight, inherit);
}

.wp-page .wp-designed .wp-typo-desc,
.wp-page .wp-designed .ec-lead {
  color: var(--wp-desc-color, inherit);
  font-size: var(--wp-desc-size, inherit);
}

.wp-page .wp-designed .wp-cta-btn,
.wp-page .wp-designed .ec-btn--primary {
  background: var(--wp-cta-bg, #f97316) !important;
  color: var(--wp-cta-color, #fff) !important;
  border-radius: var(--wp-cta-radius, 10px) !important;
  min-height: var(--wp-cta-min-h, 48px);
}

.wp-page .wp-designed.wp-cta--outline .wp-cta-btn {
  background: transparent !important;
  color: var(--wp-cta-bg, #f97316) !important;
  border: 1px solid var(--wp-cta-bg, #f97316) !important;
}

/* ═══════════════════════════════════════════
   HERO — one image only (no bg + img duplicate)
   ═══════════════════════════════════════════ */
.wp-page .ec-hero.wp-designed,
.wp-page .wp-sec--hero.wp-designed {
  height: var(--wp-hero-height, 440px) !important;
  min-height: var(--wp-hero-height, 440px) !important;
  max-height: var(--wp-hero-height, 440px) !important;
  padding: 0 !important;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  border-bottom: 0;
  background-color: var(--wp-section-bg, #f8fafc);
  /* Classic desktop: NO section background image (media column owns the image) */
  background-image: none;
  border-radius: var(--wp-hero-radius, 0);
}

.wp-page .ec-hero.wp-designed.wp-hero--classic {
  background-image: none !important;
}

.wp-page .wp-hero-classic,
.wp-page .ec-hero.wp-designed .ec-hero__grid {
  width: min(var(--wp-max), calc(100% - (var(--wp-pad) * 2)));
  margin-inline: auto;
  height: 100%;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
}

.wp-page .ec-hero.wp-designed .ec-hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  height: 100%;
  min-width: 0;
  text-align: var(--wp-hero-align, right);
  max-width: var(--wp-hero-text-max, 40rem);
}

.wp-page .ec-hero.wp-designed .ec-hero__copy .ec-h1 {
  max-width: none;
}

.wp-page .ec-hero.wp-designed .ec-actions {
  margin-top: 0.35rem;
}

/* Single media slot — kill legacy 2-column media grid that looked like a duplicate */
.wp-page .wp-hero-media,
.wp-page .ec-hero.wp-designed .ec-hero__media {
  display: block !important;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  max-height: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: #e2e8f0;
  grid-template-columns: none !important;
  gap: 0 !important;
}

.wp-page .wp-hero-media picture,
.wp-page .wp-hero-media img,
.wp-page .wp-hero-media video,
.wp-page .ec-hero.wp-designed .ec-hero__media picture,
.wp-page .ec-hero.wp-designed .ec-hero__media img,
.wp-page .ec-hero.wp-designed .ec-hero__media video,
.wp-page .ec-hero.wp-designed .ec-hero__media figure,
.wp-page .ec-hero.wp-designed .ec-hero__media figure:first-child,
.wp-page .ec-hero.wp-designed .ec-hero__media figure:first-child img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: var(--wp-hero-bg-pos, center center);
  margin: 0;
  border: 0;
  border-radius: inherit;
  grid-row: auto !important;
}

/* Panoramic: ONE full-bleed horizontal image covering the whole hero */
.wp-page .ec-hero.wp-designed.wp-hero--panoramic {
  position: relative;
  width: 100%;
  background-image: var(--wp-hero-bg-image, none) !important;
  background-size: cover !important;
  background-position: var(--wp-hero-bg-pos, center center) !important;
  background-repeat: no-repeat !important;
}

.wp-page .ec-hero.wp-designed.wp-hero--panoramic::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--wp-hero-overlay, rgba(15, 23, 42, 0.45));
  opacity: 1;
  pointer-events: none;
  z-index: 0;
}

.wp-page .wp-hero-pano {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
}

.wp-page .wp-hero-pano__copy {
  max-width: var(--wp-hero-text-max, 40rem);
  text-align: var(--wp-hero-align, right);
  color: #fff;
}

.wp-page .wp-hero-pano__copy .ec-lead,
.wp-page .wp-hero-pano__copy .wp-typo-desc {
  color: rgba(255, 255, 255, 0.9);
}

.wp-page .ec-hero.wp-designed.wp-hero--panoramic .wp-hero-media,
.wp-page .ec-hero.wp-designed.wp-hero--panoramic .ec-hero__media {
  display: none !important;
}

/* ═══════════════════════════════════════════
   IMAGE + TEXT — 2 col desktop / 1 col mobile
   ═══════════════════════════════════════════ */
.wp-page .wp-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.wp-page .wp-split--media-start {
  direction: ltr;
}
.wp-page .wp-split--media-start > * {
  direction: rtl;
}

.wp-page .wp-split__media {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #f1f5f9;
  aspect-ratio: 4 / 5;
  max-height: 560px;
}

.wp-page .wp-split__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wp-page .wp-split__copy {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.wp-page .wp-feature-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.wp-page .wp-feature-list li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.wp-page .wp-feature-list__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff7ed;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 1.1rem;
}

.wp-page .wp-feature-list__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wp-page .wp-feature-list p {
  margin: 0.2rem 0 0;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Kill legacy ec-split fighting the new layout on builder pages */
.wp-page .ec-split {
  display: contents;
}

/* ═══════════════════════════════════════════
   FEATURES / CARDS
   ═══════════════════════════════════════════ */
.wp-page .wp-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.85rem, 2vw, 1.25rem);
}

.wp-page .wp-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.15rem 1.1rem;
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.wp-page .ec-section--soft .wp-card {
  background: #fff;
}

.wp-page .wp-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff7ed;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.wp-page .wp-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wp-page .wp-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.94rem;
  line-height: 1.75;
}

/* ═══════════════════════════════════════════
   CTA
   ═══════════════════════════════════════════ */
.wp-page .wp-cta-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: var(--wp-section-bg, #fff);
}

.wp-page .wp-cta-banner--dark {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.14);
}

.wp-page .wp-cta-banner__copy {
  flex: 1 1 280px;
  min-width: 0;
  display: grid;
  gap: 0.5rem;
}

.wp-page .wp-cta-banner .ec-actions {
  flex: 0 0 auto;
}

/* ═══════════════════════════════════════════
   VIDEO
   ═══════════════════════════════════════════ */
.wp-page .wp-video {
  border-radius: 18px;
  overflow: hidden;
  background: #0f172a;
  aspect-ratio: 16 / 9;
  max-width: 920px;
}

.wp-page .wp-video video,
.wp-page .wp-video img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wp-page .wp-video__link {
  height: 100%;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════
   COURSE LEVELS
   ═══════════════════════════════════════════ */
.wp-page .wp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.wp-page .wp-tab {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  border-radius: 999px;
  min-height: 38px;
  padding: 0.35rem 0.9rem;
  font: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
}

.wp-page .wp-tab.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.wp-page .wp-level {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 1.75rem);
  align-items: start;
  padding: 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
}

.wp-page .wp-level[hidden] { display: none !important; }

.wp-page .wp-level__cover {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #f1f5f9;
  aspect-ratio: 3 / 4;
}

.wp-page .wp-level__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wp-page .wp-level__body {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.wp-page .wp-level__body .ec-h2 {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  margin: 0;
}

.wp-page .wp-level__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wp-page .wp-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
}

.wp-page .wp-level__list {
  margin: 0;
  padding: 0 1.1rem 0 0;
  color: #475569;
  line-height: 1.8;
}

/* ═══════════════════════════════════════════
   FAQ — full-width minimal accordion (+ / −)
   ═══════════════════════════════════════════ */
.wp-page .wp-faq-layout {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.25rem);
  width: 100%;
}

.wp-page .wp-faq-layout__head {
  max-width: 40rem;
  margin-bottom: 0;
}

.wp-page .wp-faq {
  display: grid;
  gap: 0.65rem;
  width: 100%;
  max-width: none;
  border-top: 0;
}

.wp-page .wp-faq__item,
.wp-page .wp-sec--faq .wp-faq__item,
.wp-page details.wp-faq__item {
  border: 1px solid #93c5fd !important;
  border-radius: 12px !important;
  background: #dbeafe !important;
  background-color: #dbeafe !important;
  padding: 0 1.1rem !important;
  margin: 0;
  overflow: hidden;
  box-shadow: none;
}

.wp-page .wp-faq__item[open],
.wp-page details.wp-faq__item[open] {
  background: #bfdbfe !important;
  background-color: #bfdbfe !important;
  border-color: #60a5fa !important;
}

.wp-page .wp-faq__summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  cursor: pointer;
  list-style: none;
  padding: 1.05rem 0;
  color: var(--wp-heading-color, #0f172a);
  transition: color 0.2s ease;
}

.wp-page .wp-faq__summary::-webkit-details-marker { display: none; }
.wp-page .wp-faq__summary::marker { content: ""; }

.wp-page .wp-faq__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
}

.wp-page .wp-faq__q {
  font-weight: 700;
  font-size: clamp(0.98rem, 1.5vw, 1.1rem);
  line-height: 1.55;
  min-width: 0;
}

.wp-page .wp-faq__icon {
  position: relative;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  border: 1px solid #93c5fd;
  background: #fff;
  color: #1d4ed8;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.wp-page .wp-faq__icon::before,
.wp-page .wp-faq__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: currentColor;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}

.wp-page .wp-faq__icon::before {
  width: 12px;
  height: 1.5px;
}

.wp-page .wp-faq__icon::after {
  width: 1.5px;
  height: 12px;
}

.wp-page .wp-faq__item[open] .wp-faq__icon {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.wp-page .wp-faq__item[open] .wp-faq__icon::after {
  opacity: 0;
}

.wp-page .wp-faq__item[open] .wp-faq__q {
  color: var(--wp-heading-color, #0f172a);
}

.wp-page .wp-faq__summary:hover .wp-faq__icon {
  border-color: #2563eb;
}

.wp-page .wp-faq__body {
  padding: 0 0 1.15rem;
  color: var(--wp-desc-color, #475569);
  font-size: 0.98rem;
  line-height: 1.9;
  max-width: none;
  border-top: 1px solid rgba(147, 197, 253, 0.45);
}

.wp-page .wp-faq__body p {
  margin: 0;
  padding-top: 0.85rem;
  padding-left: 0;
}

@media (max-width: 720px) {
  .wp-page .wp-faq__summary {
    padding: 1rem 0;
    gap: 0.75rem;
  }

  .wp-page .wp-faq__body p {
    padding-left: 0;
  }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 980px) {
  .wp-page .ec-hero.wp-designed,
  .wp-page .wp-sec--hero.wp-designed {
    height: var(--wp-hero-height-tablet, 360px) !important;
    min-height: var(--wp-hero-height-tablet, 360px) !important;
    max-height: var(--wp-hero-height-tablet, 360px) !important;
  }

  .wp-page .wp-hero-classic,
  .wp-page .ec-hero.wp-designed .ec-hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .wp-page .wp-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wp-page .wp-level {
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .wp-page .ec-hero.wp-designed,
  .wp-page .wp-sec--hero.wp-designed {
    height: var(--wp-hero-height-mobile, 280px) !important;
    min-height: var(--wp-hero-height-mobile, 280px) !important;
    max-height: var(--wp-hero-height-mobile, 280px) !important;
  }

  /* Classic mobile: one background image (media column hidden) — still a single visual */
  .wp-page .ec-hero.wp-designed.wp-hero--classic {
    background-image: var(--wp-hero-bg-image, none) !important;
    background-size: cover !important;
    background-position: var(--wp-hero-bg-pos-mobile, var(--wp-hero-bg-pos, center)) !important;
    position: relative;
  }

  .wp-page .ec-hero.wp-designed.wp-hero--classic::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--wp-hero-overlay, rgba(15, 23, 42, 0.4));
    z-index: 0;
  }

  .wp-page .ec-hero.wp-designed.wp-hero--classic .wp-hero-classic,
  .wp-page .ec-hero.wp-designed.wp-hero--classic .ec-hero__grid {
    position: relative;
    z-index: 1;
    grid-template-columns: 1fr;
  }

  .wp-page .ec-hero.wp-designed.wp-hero--classic .wp-hero-media,
  .wp-page .ec-hero.wp-designed.wp-hero--classic .ec-hero__media {
    display: none !important;
  }

  .wp-page .ec-hero.wp-designed.wp-hero--classic .ec-hero__copy {
    color: #fff;
    max-width: none;
  }

  .wp-page .ec-hero.wp-designed.wp-hero--classic .ec-hero__copy .ec-lead,
  .wp-page .ec-hero.wp-designed.wp-hero--classic .ec-hero__copy .wp-typo-desc {
    color: rgba(255, 255, 255, 0.9);
  }

  .wp-page .wp-split {
    grid-template-columns: 1fr;
  }

  .wp-page .wp-split__media {
    aspect-ratio: 16 / 10;
    max-height: 280px;
  }

  .wp-page .wp-cards {
    grid-template-columns: 1fr;
  }

  .wp-page .wp-level {
    grid-template-columns: 1fr;
  }

  .wp-page .wp-level__cover {
    max-width: 200px;
  }

  .wp-page .wp-cta-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .wp-page .wp-cta-banner .ec-actions {
    width: 100%;
  }

  .wp-page .wp-cta-banner .ec-actions .ec-btn {
    flex: 1 1 auto;
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .wp-page .ec-hero.wp-designed .ec-h1,
  .wp-page .wp-sec--hero.wp-designed .ec-h1,
  .wp-page .wp-typo-title {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .wp-page .wp-cards,
  .wp-page .wp-split,
  .wp-page .wp-level {
    width: 100%;
    max-width: 100%;
  }

  .wp-page .ec-table-wrap,
  .wp-page .wp-sec--table {
    max-width: 100%;
  }
}
