/**
 * PractiRoute app-screens section.
 *
 * Places the PhoneOne showcase: inside the feature map's control column beside
 * the card list, and in the standalone app-screens section. PhoneOne owns the
 * frame, the screenshots and the swipe behaviour, so this file sets layout,
 * rhythm and the copy column only - it never restyles the device itself.
 */

.pr-phoneone {
  padding: clamp(40px, 5vw, 72px) 0;
}

.pr-phoneone-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.pr-phoneone-copy > h2 {
  margin: 0 0 16px;
}

.pr-phoneone-description {
  margin: 0 0 26px;
  max-width: 46ch;
  line-height: 1.65;
}

.pr-phoneone-steps {
  list-style: none;
  counter-reset: pr-phoneone-step;
  display: grid;
  gap: 18px;
  margin: 0 0 28px;
  padding: 0;
}

.pr-phoneone-step {
  position: relative;
  padding-left: 44px;
}

.pr-phoneone-step::before {
  counter-increment: pr-phoneone-step;
  content: counter(pr-phoneone-step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 3px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.55;
}

.pr-phoneone-step h3 {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.3;
}

.pr-phoneone-step p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.82;
}

.pr-phoneone-device {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 0;
  min-width: 0;
}

/* The frame may be wider than the column on small screens; never overflow. */
.pr-phoneone-device > * {
  max-width: 100%;
  height: auto;
}

/* Keep the artwork's empty canvas out of the section's vertical rhythm.
   PhoneOne writes --phoneone-max-width inline from the profile's phone width, so
   any value declared here would be dead. The column alone sizes this frame. */
.pr-phoneone-device .phoneone-showcase {
  width: 100%;
  margin: 0 auto;
}

.pr-phoneone-device .phoneone-showcase__device {
  margin-top: calc(-1 * var(--phoneone-screen-top));
}

.pr-phoneone-device img,
.pr-phoneone-device svg,
.pr-phoneone-device canvas {
  max-width: 100%;
  height: auto;
}

.pr-phoneone-caption {
  max-width: 34ch;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  opacity: 0.66;
}

.pr-phoneone-footer {
  margin: clamp(28px, 4vw, 44px) auto 0;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  opacity: 0.66;
}

/* Feature map: the phone fills the space under the filters in the control column.
   The column keeps 21px of right padding for the vertical rule; only 8px of it is
   left as breathing room so the phone reads at full size instead of inset by a
   wide side margin. 13px is that reclaim, and it is cancelled below 600px where
   the column drops its padding and a negative margin would overflow the shell. */
.pr-catalog-controls .pr-phoneone-device {
  gap: 10px;
  margin: clamp(22px, 2.6vw, 30px) -13px 0 0;
  padding-top: clamp(18px, 2.2vw, 24px);
  border-top: 1px solid #d9dfd5;
}

.pr-catalog-controls .pr-phoneone-caption {
  font-size: 11.5px;
  line-height: 1.45;
  text-align: left;
}

/* The profile's inline width cap would keep the phone at its configured size no
   matter how wide the column gets, so it needs !important to lift. 760px is
   PhoneOne's own upper bound; the column stays the real limit. Arrow size, swipe,
   drag and the dots are left exactly as the profile ships them. */
.pr-catalog-controls .pr-phoneone-device .phoneone-showcase {
  --phoneone-max-width: 760px !important;
  --phoneone-dot-w: 8px !important;
  --phoneone-dot-h: 8px !important;
  margin: 0 auto 0.75rem;
}

/* The feature map phone carries one screen per feature group, about thirty
   dots; tighter spacing keeps them to two short rows under the phone. */
.pr-catalog-controls .pr-phoneone-device .phoneone-showcase__dots {
  gap: 6px;
}

/* Opening a card switches the phone to that feature's screen, so the phone must
   stay beside a card opened far down the 115-card list. The column stretches
   to the list height for the phone to travel in; only screens tall enough to
   show the whole phone get this, otherwise its arrows would sit off-screen. */
@media (min-width: 601px) and (min-height: 860px) {
  /* The WPBakery row hides overflow, which makes it the sticky scroll box and
     pins the phone to the row instead of the window. clip still cuts the
     overflow without being a scroll container. */
  .vc_row:has([data-pr-catalog]) {
    overflow: clip !important;
  }

  .pr-catalog-controls {
    align-self: stretch;
  }

  .pr-catalog-controls .pr-phoneone-device {
    position: sticky;
    top: 16px;
  }
}

/* PhoneOne absent or its shortcode removed: keep the copy readable, no empty column. */
.pr-phoneone-no-device .pr-phoneone-grid {
  grid-template-columns: minmax(0, 1fr);
}

.pr-phoneone-no-device .pr-phoneone-description {
  max-width: 62ch;
}

@media (max-width: 600px) {
  /* Stacked layout: the column has no side padding to reclaim, so drop the
     negative margin rather than push the phone past the shell gutter. */
  .pr-catalog-controls .pr-phoneone-device {
    margin-right: 0;
  }
}

@media (max-width: 860px) {
  .pr-phoneone-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pr-phoneone-device {
    order: -1;
    justify-self: center;
  }

  .pr-phoneone-description {
    max-width: none;
  }
}
