/* ── Product tour — accordion (left) + dynamic visual stage (right) ── */

/* Anchor-jump clearance for the sticky header (nav + footer "Product" links both land here
   natively via #product-tour). The generic `section[id]` rule in layout.html.twig uses 90px,
   which isn't enough for this section's real header clearance. */
#product-tour {
  scroll-margin-top: 180px;
}

.tour-panel {
  position: relative;
  background: linear-gradient(135deg, #0d1b3e 0%, #12354c 55%, #0a2744 100%);
  border-radius: 24px;
  overflow: hidden;
  padding: 44px 56px;
}

.tour-panel-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.tour-panel-inner {
  position: relative;
  z-index: 2;
}

.tour-panel-inner .header-center h6,
.tour-panel-inner .header-center h3 {
  color: #fff;
}

.tour-panel-inner .header-center h6 {
  color: #81d4fa;
}

.tour-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 64px;
  align-items: center;
  margin-top: 28px;
}

/* ── Accordion (left) ── */
.tour-accordion {
  display: flex;
  flex-direction: column;
}

.tour-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 22px 0;
}

.tour-item:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.tour-item-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  font: 17px var(--font-bold), arial, sans-serif;
  color: #fff;
}

.tour-item-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: #fff;
  transition: background 0.2s ease;
}

.tour-item.is-active .tour-item-icon {
  background: rgba(79, 195, 247, 0.3);
  color: #81d4fa;
}

.tour-item-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin-top 0.35s ease;
}

.tour-item.is-active .tour-item-body {
  max-height: 160px;
  opacity: 1;
  margin-top: 14px;
}

.tour-item-body p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
  padding-right: 12px;
}

/* Per-item image: only used on mobile (see media query below), where each accordion item shows
   its own screenshot right under its own text instead of one shared stage for all four. */
.tour-item-image {
  display: none;
}

/* ── Visual stage (right) ── */
/* The /web/screenshots/homepage/*.png crops aren't a uniform aspect ratio (checked: api-create
   1.91, data-ui 1.72, swagger 1.71, api-keys 1.51 — width/height) — sized close to their average
   (~1.7) so "contain" fits each one with only a small, consistent letterbox instead of one image
   filling edge-to-edge while another floats as a thin strip. */
.tour-visual-wrap {
  position: relative;
  height: 380px;
  border-radius: 8px;
  overflow: hidden;
}

.tour-visual {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.tour-visual.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.tour-visual-img {
  /* max-width/height + auto (not width/height:100%) let the image's own box shrink-to-fit its
     natural aspect ratio instead of stretching to fill the full 380px stage with object-fit:contain
     letterboxing inside it — that letterboxing was the actual problem: border/radius on the old
     100%x100% box wrapped a lot of transparent padding, not the visible photo, so it never looked
     rounded. This way the box (and so the border + radius) hugs the visible image exactly, same as
     .tour-item-image on mobile (height: auto there does the same thing). */
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Click-to-zoom: both the desktop stage image and the mobile per-item image scale up in place.
   Their ancestors (.tour-visual-wrap / .tour-item-body) clip overflow for the collapsed/unzoomed
   layout, so the scaled image would otherwise get cropped — .is-zoom-active (toggled by the
   inline script above) opens that clipping back up just while zoomed. */
.tour-visual-img,
.tour-item-image {
  cursor: zoom-in;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.tour-visual-img.is-zoomed,
.tour-item-image.is-zoomed {
  transform: scale(1.12);
  cursor: zoom-out;
  position: relative;
  z-index: 10;
}

.tour-visual-wrap.is-zoom-active,
.tour-item-body.is-zoom-active {
  overflow: visible;
}

.tour-cta {
  text-align: center;
  margin-top: 32px;
}

/* .btn-search-api is a plain solid blue everywhere else on the page (style.css) — on this dark
   navy/blue panel that flat block reads as a mismatched patch, and being an <a> it inherits the
   browser's default underline instead of the button look. Scoped override, not a global change. */
.tour-cta .btn-search-api {
  background: linear-gradient(135deg, #4fc3f7, #1565c0);
  text-decoration: none;
}

.tour-cta .btn-search-api:hover {
  background: linear-gradient(135deg, #64d1ff, #1976d2);
  text-decoration: none;
}

@media only screen and (max-width: 991px) {
  .tour-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Replaced by each item's own .tour-item-image below — no more single shared stage on mobile. */
  .tour-visual-wrap {
    display: none;
  }

  .tour-item-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Tall enough for text + image together; desktop keeps the smaller 160px since it only ever
     holds text there. */
  .tour-item.is-active .tour-item-body {
    max-height: 520px;
  }
}

@media only screen and (max-width: 767px) {
  .tour-panel {
    padding: 40px 22px;
  }
}
