/* Angled Slider */
@import url("https://fonts.googleapis.com/css2?family=Unbounded:wght@600&family=IBM+Plex+Mono:wght@400;500&display=swap");

.brxe-angled-slider {
  --card-gap: 16px;
  --card-w: 372px;
  --card-min-h: 420px;
  --card-img-h: 279px;
  --banner-h: 60px;
  --slant-run: calc(var(--banner-h) * 0.6494); /* width / tan(57°) */

  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* clip-path (tab shape + rounded corners) set by JS — plain div, no Bricks
   style conflicts. Clips the canvas gradient to the correct shape. */
.angled-canvas-wrap {
  position: relative;
}

.angled-canvas {
  position: relative;
  overflow: clip;
  /* Bottom and middle follow the theme; the TOP stop is pinned. Themed, the top
     is --gm-text, which flips to #e6e5ff in dark and washes the panel out to
     pale lilac. It is also the ground the title sits on, so keeping it dark is
     what lets .angled-title below stay a fixed light in both themes.
     Dark therefore reads #0a0a0f -> purple -> #0a0a0f rather than inverting. */
  background: linear-gradient(0deg, var(--gm-bg, #f9f9fa) 16.31%, var(--gm-purple, #514dff) 69.31%, #0a0a0f 122.3%);
}

/* Absolutely-positioned SVG that strokes the slant border line */
.angled-slant-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.angled-banner {
  height: var(--banner-h);
  width: fit-content;
  max-width: calc(100% - var(--slant-run));
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.angled-title {
  margin: 0;
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  /* Fixed by choice. #e6e5ff is --gm-text's DARK value; there is no token that
     holds it in both themes, and var(--gm-text) would be #0a0a0f in light — dark
     text on the gradient's pinned-dark top. Since that ground no longer moves,
     the title must not either. */
  color: #e6e5ff;
  white-space: nowrap;
}

.angled-stage {
  padding: var(--stage-pad-top, 16px) var(--stage-pad-right, 16px) var(--stage-pad-bottom, 16px) var(--stage-pad-left, 16px);
}

/* Edge shadows — pinned to the left/right edges of the splide track viewport.
   They indicate more content in that direction and fade out at each end
   (.at-start / .at-end added by JS). */
.brxe-angled-slider .splide {
  position: relative;
}

.brxe-angled-slider .splide::before,
.brxe-angled-slider .splide::after {
  content: '';
  position: absolute;
  top: 0;
  width: 80px;
  height: 100%;
  opacity: 0.2;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.25s ease;
}

/* Right edge — dark fades in toward the right */
.brxe-angled-slider .splide::after {
  right: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #0a0a0f 100%);
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

/* Left edge — dark fades in toward the left */
.brxe-angled-slider .splide::before {
  left: 0;
  background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, #0a0a0f 100%);
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.brxe-angled-slider.at-end .splide::after {
  opacity: 0;
}

.brxe-angled-slider.at-start .splide::before {
  opacity: 0;
}

/* Cards clip at the padded stage box — progressive enhancement:
   overflow:hidden as fallback, overflow:clip avoids focus-scroll side-effects */
.brxe-angled-slider .splide,
.brxe-angled-slider .splide__track {
  overflow: hidden !important;
  overflow: clip !important;
}

/* Beats the Bricks .brxe-block default of flex-direction:column */
.brxe-angled-slider .splide__list {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  /* Own compositor layer — prevents full gradient repaint on every slide frame */
  will-change: transform;
}

.brxe-angled-slider .angled-card {
  flex: 0 0 auto !important;
  width: var(--card-w) !important;
  max-width: none !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  min-height: var(--card-min-h) !important;
  display: flex !important;
  flex-direction: column !important;
  background: var(--gm-bg, #f9f9fa);
  border: 1px solid var(--gm-text, #0a0a0f);
  border-radius: 6px;
  overflow: hidden;
}

/* Head row: date left, genre right */
.brxe-angled-slider .card-head {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
}

.brxe-angled-slider .card-date,
.brxe-angled-slider .card-genre {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-weight: 400;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--gm-text, #0a0a0f);
  white-space: nowrap;
}

.brxe-angled-slider .card-genre {
  text-align: center;
  text-decoration: none;
}

/* Genre is a text-link (<a> when linked) — recolor on hover */
.brxe-angled-slider a.card-genre {
  transition: color 0.2s ease;
}

.brxe-angled-slider a.card-genre:hover {
  color: color-mix(in srgb, var(--gm-purple, #514dff) 90%, transparent); /* #514dff @ 90% */
}

/* Full-width image band with hairline top/bottom borders */
.brxe-angled-slider .angled-card .card-image {
  width: 100% !important;
  height: var(--card-img-h);
  flex: 0 0 auto;
  object-fit: cover;
  border-top: 1px solid var(--gm-text, #0a0a0f);
  border-bottom: 1px solid var(--gm-text, #0a0a0f);
  display: block;
}

.brxe-angled-slider .angled-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brxe-angled-slider .card-body {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between;
  gap: 12px;
  flex: 1 1 auto;
  padding: 12px;
}

.brxe-angled-slider .card-title {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--gm-text, #0a0a0f);
  text-decoration: none;
}

/* Title is a text-link (<a> when linked) — recolor on hover */
.brxe-angled-slider a.card-title {
  transition: color 0.2s ease;
}

.brxe-angled-slider a.card-title:hover {
  color: color-mix(in srgb, var(--gm-purple, #514dff) 90%, transparent); /* #514dff @ 90% */
}

.brxe-angled-slider .card-author {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-weight: 400;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--gm-text-muted, #6d6c6c);
}

/* Author holds dynamic term links (e.g. {post_terms_writers}) — style the
   inner <a> tags, not the element itself. Inherit the muted author color,
   recolor on hover. */
.brxe-angled-slider .card-author a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.brxe-angled-slider .card-author a:hover {
  color: color-mix(in srgb, var(--gm-purple, #514dff) 90%, transparent); /* #514dff @ 90% */
}

.angled-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--stage-pad-right, 16px) 16px var(--stage-pad-left, 16px);
}

.angled-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  padding: 8px 12px;
  background: none;
  border: 1px solid var(--gm-text, #0a0a0f);
  border-radius: 4px;
  color: var(--gm-text, #0a0a0f);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.angled-nav-btn .angled-nav-icon {
  width: 15px;
  height: auto;
  display: block;
  flex: 0 0 auto;
}

.angled-nav-btn:hover { opacity: 0.6; }
.angled-nav-btn:active { transform: translateY(1px); }

.angled-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.angled-nav-btn:disabled:hover  { opacity: 0.3; }
.angled-nav-btn:disabled:active { transform: none; }

/* Hide built-in Splide chrome */
.brxe-angled-slider .splide__arrows,
.brxe-angled-slider .splide__pagination {
  display: none !important;
}

/* Splide appends a visually-hidden "…" span on each move for screen readers.
   Without this it renders inline and shoves the nav row down on click. */
.brxe-angled-slider .splide__sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/* Hide the strip until Splide has measured and positioned the slides */
.brxe-angled-slider:not(.initialized) .splide__list {
  visibility: hidden;
}

@media (max-width: 768px) {
  .brxe-angled-slider { --card-w: 320px; }
  .angled-title { font-size: 32px; }
}

@media (max-width: 480px) {
  .brxe-angled-slider {
    --card-w: 280px;
    --card-img-h: 210px;
    --card-min-h: 340px;
    --banner-h: 48px;
  }
  .angled-title { font-size: 24px; }
}

.bricks-builder .angled-nav-btn,
.bricks-builder .brxe-angled-slider .splide__slide {
  pointer-events: auto;
}
