/* SR-83/90/92/93 — Related tours carousel + mid-article conversion (TravelAddon 4.9.37)
   Tokens match home/tour: ink / orange-deep / cyan. One primary CTA; secondary = text link.
   Banner copy + link colours meet WCAG AA on dark banner.
   SR-92: hide native scrollbar on track; keep swipe + dots (desktop arrows unchanged).
   SR-93: reinforce finger swipe (touch-action), drag cursor, CSF auto-run/loop. */

.sr-related-banner {
  --sr-ink: #1a1c20;
  --sr-orange-deep: #b85a00; /* ~4.68:1 on white — AA for UI text */
  --sr-cyan: #36d2d3;
  --sr-banner-fg: #f4f7f8; /* ≥15:1 on #152028 */
  --sr-banner-link: #9aebec; /* ≥12:1 on #152028 */
  margin: 1.75rem 0 1.35rem;
  padding: 1.25rem 1.35rem;
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(54, 210, 211, 0.28) 0%, transparent 55%),
    linear-gradient(125deg, #152028 0%, #1c333c 52%, #0e6f72 125%);
  color: var(--sr-banner-fg);
  display: grid;
  gap: 0.95rem;
  box-shadow: 0 18px 40px -28px rgba(21, 32, 40, 0.65);
}
.sr-related-banner__text {
  margin: 0;
  font-size: clamp(0.98rem, 2.2vw, 1.08rem);
  line-height: 1.55;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--sr-banner-fg) !important; /* beat .entry-content p body color */
  max-width: 42rem;
}
.sr-related-banner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.15rem;
}
.sr-related-banner__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.2rem;
  border-radius: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none !important;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}
.sr-related-banner__cta:hover {
  transform: translateY(-1px);
}
.sr-related-banner__cta--primary {
  background: var(--sr-orange-deep);
  color: #fff !important;
  box-shadow: 0 10px 22px -14px rgba(184, 90, 0, 0.85);
}
.sr-related-banner__cta--primary:hover {
  background: #9a4c00;
  color: #fff !important;
}
/* Legacy secondary button class — keep AA-safe if older HTML cached */
.sr-related-banner__cta--secondary {
  background: transparent;
  color: var(--sr-banner-link) !important;
  border: 0;
  box-shadow: none;
  min-height: auto;
  padding: 0.35rem 0;
  border-radius: 0;
  font-weight: 650;
  text-decoration: underline !important;
  text-underline-offset: 0.18em;
}
.sr-related-banner__cta--secondary:hover {
  background: transparent;
  color: #fff !important;
}
/* SR-90 primary demotion: text link sibling of Tour anfragen */
.sr-related-banner__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.2rem 0;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--sr-banner-link) !important;
  text-decoration: underline !important;
  text-underline-offset: 0.18em;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transition: color 0.18s ease;
}
.sr-related-banner__link:hover,
.sr-related-banner__link:focus-visible {
  color: #ffffff !important;
}
@media (max-width: 640px) {
  .sr-related-banner {
    padding: 1.1rem 1.05rem;
    border-radius: 14px;
  }
  .sr-related-banner__cta--primary {
    width: 100%;
    min-height: 52px;
  }
  .sr-related-banner__link {
    width: auto;
    min-height: 44px;
  }
}

/* —— Related section —— */
.sr-related {
  --sr-ink: #1a1c20;
  --sr-orange-deep: #b85a00;
  --sr-cyan: #36d2d3;
  --sr-line: rgba(26, 28, 32, 0.1);
  margin: 2.75rem 0 3.25rem;
  padding: 1.65rem 0 0.35rem;
  border-top: 1px solid var(--sr-line);
  max-width: none;
}
.sr-related__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  margin-bottom: 1.2rem;
  padding: 0 0.1rem;
}
.sr-related__title {
  margin: 0;
  font-size: clamp(1.35rem, 3.2vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--sr-ink) !important;
  font-weight: 700;
}
.sr-related__book {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.6rem 1.2rem;
  border-radius: 11px;
  background: var(--sr-orange-deep);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
  transition: background-color 0.18s ease, transform 0.18s ease;
}
.sr-related__book:hover {
  background: #9a4c00;
  color: #fff !important;
  transform: translateY(-1px);
}

.sr-related__viewport {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.sr-related__track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x !important; /* SR-93: beat theme/global auto */
  overscroll-behavior-x: contain;
  padding: 0.4rem 0.2rem 0.55rem;
  min-width: 0;
  cursor: grab;
  /* SR-92/93: native scrollbar off — swipe + dots only (all engines) */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* legacy Edge */
  scrollbar-color: transparent transparent;
}
.sr-related__track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
  user-select: none;
}
.sr-related__track::-webkit-scrollbar,
.sr-related__track::-webkit-scrollbar-thumb,
.sr-related__track::-webkit-scrollbar-track,
.sr-related__track::-webkit-scrollbar-button,
.sr-related__track::-webkit-scrollbar-corner {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .sr-related__track {
    scroll-behavior: auto;
  }
}

/*
 * CRITICAL (SR-83): flex-basis % was relative to the narrow track,
 * so min(31%, 360px) collapsed to ~120px inside article measure.
 * Use fixed px bases + scroll peek instead.
 */
.sr-related__slide {
  flex: 0 0 300px;
  width: 300px;
  max-width: 85%;
  scroll-snap-align: start;
  margin: 0;
  min-width: 0;
}
@media (min-width: 900px) {
  .sr-related__slide {
    flex-basis: 320px;
    width: 320px;
  }
}

/* Cards inside related: keep dual CTAs usable even on narrow slides */
.sr-related .sr-card {
  position: relative;
  height: 100%;
  content-visibility: visible;
  contain-intrinsic-size: auto 420px;
}
/* SR-135 — entire card (image + title + body) is a tour link; CTAs stay above */
.sr-related .sr-card__hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: auto !important;
  cursor: pointer;
}
.sr-related .sr-card a[href]:not(.sr-card__hit),
.sr-related .sr-card [data-sr-related-link]:not(.sr-card__hit) {
  pointer-events: auto !important;
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.sr-related .sr-card__media {
  aspect-ratio: 16 / 10;
  min-height: 160px;
  z-index: 2;
  pointer-events: auto !important;
}
.sr-related .sr-card__media::after {
  pointer-events: none !important;
}
.sr-related .sr-card__title a {
  z-index: 3;
}
.sr-related .sr-card__actions,
.sr-related .sr-card__cta {
  position: relative;
  z-index: 4;
  pointer-events: auto !important;
}
.sr-related .sr-card__img {
  aspect-ratio: 16 / 10;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sr-related .sr-card__body {
  padding: 1rem 1.05rem 1.1rem;
  gap: 0.5rem;
}
.sr-related .sr-card__title {
  font-size: 1.02rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.sr-related .sr-card__excerpt {
  -webkit-line-clamp: 2;
  font-size: 0.88rem;
}
.sr-related .sr-card__price {
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
  font-size: 0.8rem;
  border-radius: 10px;
  padding: 0.35rem 0.65rem;
  min-height: 0;
}
.sr-related .sr-card__actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0.55rem;
  width: 100%;
}
.sr-related .sr-card__cta {
  min-height: 46px;
  font-size: 0.9rem;
  padding: 0.55rem 0.5rem;
}

/* SR-153 — full-circle frosted/brand arrows (kill theme 15px 30px pills) */
.sr-related__nav,
.sr-related button.sr-related__nav {
  box-sizing: border-box !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  border: 1.5px solid rgba(26, 90, 100, 0.45) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(12px) saturate(1.25);
  -webkit-backdrop-filter: blur(12px) saturate(1.25);
  color: #1a5a64 !important;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(15, 28, 34, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  font-size: 1.15rem;
  line-height: 1;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.sr-related__nav:hover,
.sr-related__nav:focus-visible,
.sr-related button.sr-related__nav:hover,
.sr-related button.sr-related__nav:focus-visible {
  background: #1a5a64 !important;
  color: #fff !important;
  border-color: #36d2d3 !important;
  outline: none;
  transform: scale(1.05);
  box-shadow: 0 10px 26px rgba(26, 90, 100, 0.38);
}
.sr-related__nav:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.sr-related__dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.15rem;
}
.sr-related__dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(26, 28, 32, 0.22);
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease;
}
.sr-related__dots button.is-active {
  background: var(--sr-orange-deep);
  transform: scale(1.25);
}

@media (max-width: 640px) {
  .sr-related {
    margin: 2.1rem 0 2.5rem;
    padding-top: 1.25rem;
  }
  .sr-related__viewport {
    grid-template-columns: minmax(0, 1fr);
  }
  .sr-related__nav,
  .sr-related button.sr-related__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: grid;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
  }
  .sr-related__nav--prev { left: 0.35rem; }
  .sr-related__nav--next { right: 0.35rem; }
  .sr-related__nav:hover,
  .sr-related__nav:focus-visible {
    transform: translateY(-50%) scale(1.05);
  }
  .sr-related__slide {
    flex-basis: min(292px, 86%);
    width: min(292px, 86%);
    max-width: 86%;
  }
  .sr-related__book {
    width: 100%;
    justify-content: center;
  }
  .sr-related__head {
    flex-direction: column;
    align-items: stretch;
  }
  .sr-related .sr-card__media {
    min-height: 148px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sr-related__track {
    scroll-behavior: auto;
  }
  .sr-related-banner__cta,
  .sr-related-banner__link,
  .sr-related__book,
  .sr-related__nav,
  .sr-related__dots button {
    transition: none;
  }
  .sr-related-banner__cta:hover,
  .sr-related__book:hover,
  .sr-related__nav:hover {
    transform: none;
  }
}
