.abc-carousel {
  --abc-carousel-accent: #4530e5;
  color: #fff;
  background: #000;
}
.abc-carousel *, .abc-carousel *::before, .abc-carousel *::after { box-sizing: border-box; }
.abc-carousel .abc-slide[hidden] { display:none !important; }
.abc-carousel .abc-slide { margin: 0; }
.abc-slide__inner {
  width: min(100%, 1500px);
  margin-inline:auto;
  padding: clamp(36px,6vw,100px) clamp(20px,6vw,75px) 30px;
  min-height: clamp(390px,40vw,560px);
  display:grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap:5%;
  align-items:center;
}

.abc-slide--brand .abc-slide__inner, .abc-slide--text .abc-slide__inner {
  grid-template-columns: minmax(0,1fr);
  text-align:left;
}
.abc-slide h2 {
  color:#fff;
  margin:0;
  /* Mirrors the ABC Learning hero's H1 scale; slides retain H2 semantics. */
  font-size:clamp(29.768px, 1.861rem + ((1vw - 3.9px) * 1.837), 52px);
  font-weight:400;
  line-height:1.1;
  letter-spacing:0;
  overflow-wrap:anywhere;
}
.abc-slide .abc-slide__kicker {
  margin:0 0 14px;
  font-size:var(--wp--preset--font-size--overline, 14px);
  font-weight:700;
  letter-spacing:.095em;
  text-transform:uppercase;
}
.abc-slide .abc-slide__copy {
  color:#f0eff4;
  font-size:var(--wp--preset--font-size--body-base, 18px);
  font-weight:300;
  line-height:1.5;
  margin:16px 0;
}
.abc-slide .abc-slide__offer { margin:0 0 20px; font-size:var(--wp--preset--font-size--body-base, 18px); line-height:1.5; }
.abc-slide__actions { display:flex; flex-wrap:wrap; gap:9px; margin-top:18px; }
.abc-slide__actions > .wp-block-button { margin:0; }
.abc-slide__actions .abc-slide__action { display:inline-block; }
.abc-slide__actions .abc-slide__action:hover { text-decoration:none; }
.abc-slide .abc-slide__image { width:100%; height:auto; aspect-ratio:582 / 314; object-fit:cover; display:block; }
.abc-carousel__slides { touch-action:pan-y pinch-zoom; }
.abc-carousel__controls {
  width:min(100%,1500px);
  margin-inline:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:3px clamp(12px,6vw,75px) 15px;
  gap:6px;
}
.abc-carousel__positions, .abc-carousel__arrows { display:flex; flex-wrap:wrap; gap:4px; align-items:center; }
.abc-carousel__arrows { flex-wrap:nowrap; }
.abc-carousel__controls button {
  appearance:none;
  color:#fff;
  background:transparent;
  font:inherit;
  border:0;
  padding:0;
  min-width:44px;
  min-height:44px;
  cursor:pointer;
}
.abc-carousel__positions button::before {
  content:"";display:block;margin:auto;width:32px;height:4px;background:#888;
}
.abc-carousel__positions button[aria-current="true"]::before { background:#b3f000;height:5px; }
.abc-carousel__arrows button { border:1px solid #777;border-radius:50%;font-size:1.35rem; }
.abc-carousel button:focus-visible, .abc-carousel a:focus-visible { outline:2px solid #b3f000;outline-offset:2px; }
.abc-carousel__sr { position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
.abc-carousel--editing { color:inherit;background:transparent;border:1px solid #aaa;padding:16px; }
.abc-carousel--editing .abc-editor-slide { margin:16px 0;padding:16px;border:1px solid #aaa; }
.abc-editor-image { display:block;max-width:min(100%,320px);height:auto;margin:10px 0; }
@media (max-width: 680px) {
  .abc-carousel .abc-slide__inner {
    grid-template-columns: minmax(0, 1fr);
    padding: 0;
    min-height: 0;
    gap: 0;
  }
  .abc-carousel .abc-slide__image {
    grid-row: 1;
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
  }
  .abc-carousel .abc-slide__content { padding: 24px 20px 16px; }
  .abc-carousel .abc-slide__actions { flex-direction: column; gap: 10px; }
  .abc-carousel .abc-slide__actions > *,
  .abc-carousel .abc-slide__actions .abc-slide__action { width: 100%; }
  .abc-carousel .abc-slide__actions .abc-slide__action {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .abc-carousel__controls { padding: 8px 20px 16px; }
  .abc-carousel__positions { gap: 0; }
  .abc-carousel__controls .abc-carousel__arrows { display: none; }
}

/* Compact slide previews in the block editor. */
.abc-carousel--editing .abc-editor-note { margin: 0 0 12px; font-size: 14px; }
.abc-carousel--editing .abc-editor-slide {
  margin: 12px 0;
  padding: 0;
  border: 1px solid #c7c9cf;
  border-radius: 8px;
}
.abc-carousel--editing .abc-editor-slide--selected { border-color:#4530e5; }
.abc-editor-preview {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  background:#101013;
  color:#fff;
  border-radius:7px 7px 0 0;
  padding:16px;
}
.abc-editor-preview__text { min-width:0; overflow-wrap:anywhere; }
.abc-editor-preview__text strong { display:block;font-size:20px;line-height:1.25; }
.abc-editor-preview__text p { margin:5px 0;font-size:13px;line-height:1.35; }
.abc-editor-preview__text span { font-size:12px; }
.abc-editor-preview__cta { display:inline-block;margin-top:6px;background:#fff;color:#4530e5;border-radius:4px;padding:4px 8px; }
.abc-editor-preview__image { width:clamp(72px,24%,190px);height:auto;aspect-ratio:582 / 314;object-fit:cover;flex:none; }
.abc-editor-slide__footer { display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:8px 12px;font-size:13px; }
.abc-manager-toolbar {display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:14px;}

/* Keep the existing mobile image-above-text layout for both image modes. */
@media (min-width: 681px) {
  .abc-carousel .abc-slide.abc-image-background {
    position: relative;
    isolation: isolate;
    background: #000;
  }
  .abc-slide.abc-image-background .abc-slide__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding-bottom: clamp(36px,6vw,100px);
  }
  .abc-slide.abc-image-background .abc-slide__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right var(--abc-image-crop, 50%);
    z-index: -2;
  }
  .abc-slide.abc-image-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.7) 48%, transparent 76%);
    pointer-events: none;
    z-index: -1;
  }
}

@media (min-width: 681px) {
  .abc-carousel.abc-carousel--overlay-controls {
    position: relative;
  }
  .abc-carousel--overlay-controls .abc-slide__inner {
    padding-bottom: max(84px, min(6vw, 100px));
  }
  .abc-carousel--overlay-controls .abc-carousel__controls {
    position: absolute;
    z-index: 1;
    inset: auto 0 0;
    isolation: isolate;
  }
  .abc-carousel--overlay-controls .abc-carousel__controls::before {
    content: "";
    position: absolute;
    inset: -16px 0 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,.88), transparent);
  }
  .abc-carousel--overlay-controls .abc-carousel__positions button:not([aria-current="true"])::before {
    background: #ddd;
  }
  .abc-carousel--overlay-controls .abc-carousel__arrows button {
    background: rgba(0,0,0,.65);
    border-color: #ccc;
  }
}

@media (min-width: 681px) {
  .abc-carousel:not(.abc-carousel--overlay-controls):not(.abc-carousel--editing) .abc-slide__inner {
    padding-bottom: 12px;
    min-height: auto;
  }
  .abc-carousel:not(.abc-carousel--overlay-controls) > .abc-carousel__controls {
    margin-block-start: 0;
    padding-top: 4px;
  }
}

.abc-image-crop-top { --abc-image-crop: 0%; }
.abc-image-crop-bottom { --abc-image-crop: 100%; }

/* Decorative tiles are independent of slide artwork and navigation. */
.abc-carousel:not(.abc-carousel--editing) {
  position: relative;
  isolation: isolate;
  --abc-accent-size: clamp(44px, 6.3vw, 120px);
}
.abc-carousel > .abc-brand-tiles, .abc-carousel .abc-slide > .abc-brand-tiles {

  position: absolute;
  display: flex;
  z-index: 1;
  pointer-events: none;
}
.abc-brand-tiles--top-left, .abc-brand-tiles--top-right { inset-block-start: 0; }
.abc-brand-tiles--top-left, .abc-brand-tiles--bottom-left { inset-inline-start: 0; }
.abc-brand-tiles--top-right, .abc-brand-tiles--bottom-right { inset-inline-end: 0; }
.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right { inset-block-end: 0; }
.abc-carousel:has(> .abc-carousel__controls) > :is(.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right) {
  inset-block-end: 72px;
}
.abc-carousel:has(> :is(.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right)) .abc-slide__inner {
  padding-bottom: calc(var(--abc-accent-size) + 12px);
}
.abc-carousel.abc-carousel--overlay-controls:has(> :is(.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right)) .abc-slide__inner {
  padding-bottom: calc(var(--abc-accent-size) + 80px);
}
@media (max-width: 680px) {
  .abc-carousel:has(> .abc-carousel__controls) > :is(.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right) {
    inset-block-end: 68px;
  }
  .abc-carousel:has(> :is(.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right)) .abc-slide__inner,
  .abc-carousel.abc-carousel--overlay-controls:has(> :is(.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right)) .abc-slide__inner {
    padding-bottom: calc(var(--abc-accent-size) + 0px);
  }
}
.abc-brand-tile {
  display: block;
  position: relative;
  width: var(--abc-accent-size);
  height: var(--abc-accent-size);
}
.abc-brand-tile--teal { background: url('assets/brand-teal.svg') center / contain no-repeat; }
.abc-brand-tile--yellow { background: url('assets/brand-yellow.svg') center / contain no-repeat; }
.abc-brand-tile--orange { background: url('assets/brand-orange.svg') center / contain no-repeat; }
.abc-brand-tile--magenta { background: url('assets/brand-magenta.svg') center / contain no-repeat; }
.abc-brand-tile--blue { background: url('assets/brand-blue.svg') center / contain no-repeat; }
.abc-brand-tile--lime { background: url('assets/brand-lime.svg') center / contain no-repeat; }
@media (max-width: 680px) {
  .abc-carousel:not(.abc-carousel--editing) { --abc-accent-size: 22px; }
}

.abc-carousel .abc-slide:has(> .abc-brand-override-marker) { position: relative; }
.abc-carousel:has(.abc-slide:not([hidden]) > .abc-brand-override-marker) > .abc-brand-tiles {
  display: none;
}
.abc-carousel .abc-slide:has(> :is(.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right)) .abc-slide__inner {
  padding-bottom: calc(var(--abc-accent-size) + 8px);
}
@media (min-width: 681px) {
  .abc-carousel--overlay-controls .abc-slide > :is(.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right) {
    inset-block-end: 72px;
  }
  .abc-carousel.abc-carousel--overlay-controls .abc-slide:has(> :is(.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right)) .abc-slide__inner {
    padding-bottom: calc(var(--abc-accent-size) + 80px);
  }
}
@media (max-width: 680px) {
  .abc-carousel .abc-slide:has(> :is(.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right)) .abc-slide__inner {
    padding-bottom: calc(var(--abc-accent-size) + 0px);
  }
}

@media (min-width: 681px) {
  .abc-carousel:has(> :is(.abc-brand-tiles--top-left, .abc-brand-tiles--top-right)) .abc-slide__inner,
  .abc-carousel .abc-slide:has(> :is(.abc-brand-tiles--top-left, .abc-brand-tiles--top-right)) .abc-slide__inner {
    padding-top: calc(var(--abc-accent-size) + 12px);
  }
}

/* On full-width desktop slides, anchor decorations to the banner edge
   and move navigation inward only as far as the occupied corners need. */
@media (min-width: 681px) {
  .abc-carousel.abc-carousel--overlay-controls > :is(.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right),
  .abc-carousel.abc-carousel--overlay-controls .abc-slide > :is(.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right) {
    inset-block-end: 0;
  }
  .abc-carousel.abc-carousel--overlay-controls > .abc-carousel__controls {
    width: 100%;
    --abc-nav-gutter: calc(max(0px, (100% - 1500px) / 2) + clamp(12px, 6vw, 75px));
    padding-inline-start: max(var(--abc-nav-gutter), calc(var(--abc-bottom-left, 0) * var(--abc-accent-size) + 12px));
    padding-inline-end: max(var(--abc-nav-gutter), calc(var(--abc-bottom-right, 0) * var(--abc-accent-size) + 12px));
  }
  .abc-carousel.abc-carousel--overlay-controls:has(> :is(.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right)) .abc-slide__inner,
  .abc-carousel.abc-carousel--overlay-controls .abc-slide:has(> :is(.abc-brand-tiles--bottom-left, .abc-brand-tiles--bottom-right)) .abc-slide__inner {
    padding-bottom: max(84px, calc(var(--abc-accent-size) + 12px));
  }
}

/* The approved treatments are grouped SVGs and stay anchored top right. */
.abc-brand-tile--classic,
.abc-brand-tile--campaign { width: calc(2 * var(--abc-accent-size)); }
.abc-brand-tile--editorial,
.abc-brand-tile--campaign { height: calc(2 * var(--abc-accent-size)); }
.abc-brand-tile--classic { background: url('assets/brand-classic.svg') center / contain no-repeat; }
.abc-brand-tile--editorial { background: url('assets/brand-editorial.svg') center / contain no-repeat; }
.abc-brand-tile--campaign { background: url('assets/brand-campaign.svg') center / contain no-repeat; }

.abc-brand-tile--magenta-arc { background: url('assets/brand-magenta-arc.svg') center / contain no-repeat; }
.abc-brand-tile--orange-stack { height: calc(2 * var(--abc-accent-size)); background: url('assets/brand-orange-stack.svg') center / contain no-repeat; }
.abc-brand-tile--lime-pair { width: calc(2 * var(--abc-accent-size)); background: url('assets/brand-lime-pair.svg') center / contain no-repeat; }

.abc-brand-tile--magenta-orange-pair { width: calc(2 * var(--abc-accent-size)); background: url('assets/brand-magenta-orange-pair.svg') center / contain no-repeat; }
.abc-brand-tile--blue-orange-pair { width: calc(2 * var(--abc-accent-size)); background: url('assets/brand-blue-orange-pair.svg') center / contain no-repeat; }
