/* Draft tweaks: shorter scrolling. Linked from every page by tools/add_tweaks.py. */

/* Home story: shorter pinned steps on desktop */
@media (min-width: 861px) {
  .step { min-height: 44vh !important; padding-block: 16px !important; }
  .step:first-of-type { min-height: 38vh !important; padding-top: 6vh !important; }
  .step:first-of-type .step__dot { top: calc(6vh + 6px) !important; }
  .step:last-of-type { min-height: 38vh !important; }
}

/* Phones: service list shows names only; full descriptions live on each service page */
@media (max-width: 760px) {
  .svc__sum { display: none !important; }
  .svc__list a { padding: 12px 12px !important; }
  .svc__head { padding: 20px 20px 14px !important; }
  .reason__kicker { display: none; }
  .step { min-height: 0 !important; padding-block: 8px 20px !important; }
}

@media (max-width: 760px) {
  /* Home: story images smaller, stats 2x2, tighter reason cards */
  .step__img { display: block !important; aspect-ratio: 2 / 1; max-height: 170px; margin-bottom: 14px !important; overflow: hidden; border-radius: 18px; }
  .step__img img { width: 100%; height: 100%; object-fit: cover; }
  .stats { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
  .stat { padding: 16px !important; min-height: 0 !important; }
  .reasons { gap: 12px !important; }
  .reason { padding: 18px 18px !important; }
  /* Home: service groups collapse (JS adds .svc--fold) */
  .svc--fold .svc__head { cursor: pointer; position: relative; padding-right: 56px !important; }
  .svc--fold .svc__head:after { content: ""; position: absolute; right: 22px; top: 50%; width: 10px; height: 10px; border: solid var(--navy); border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); transition: transform .3s; }
  .svc--fold.is-open .svc__head:after { transform: translateY(-30%) rotate(-135deg); }
  .svc--fold:not(.is-open) .svc__list { display: none; }
}

@media (max-width: 760px) {
  .reason__ic { display: none !important; }
  .role__fold { border-top: 1px solid var(--line); padding: 4px 0; }
  .role__fold summary { cursor: pointer; font-weight: 700; padding: 12px 28px 12px 0; position: relative; list-style: none; min-height: 44px; display: flex; align-items: center; }
  .role__fold summary::-webkit-details-marker { display: none; }
  .role__fold summary:after { content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; border: solid var(--navy); border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); transition: transform .3s; }
  .role__fold[open] summary:after { transform: translateY(-30%) rotate(-135deg); }
  .role__fold > :not(summary) { padding-bottom: 12px; }
  .role__btn { margin-top: 16px; }
}

/* Tighter vertical rhythm between sections on every page */
.section { padding-block: clamp(52px, 7vw, 92px) !important; }
@media (min-width: 861px) {
  .step { min-height: 38vh !important; }
  .step:first-of-type, .step:last-of-type { min-height: 34vh !important; }
}

/* ---- Layout fixes: header, tap targets, bubble, phone menu ---- */
.is-scrolled .hdr__bar { background: #fffffff5 !important; }

.ftr__legal a { display: inline-flex !important; align-items: center; min-height: 44px; }
.cqc__line a, .fx-check label a, .check label a { display: inline-block; padding-block: 11px; margin-block: -11px; }

/* "Help me choose" bubble steps aside while a form is on screen */
body.form-in-view .hl { opacity: 0 !important; visibility: hidden !important; pointer-events: none; transition: opacity .2s; }

@media (max-width: 760px) {
  .form, .fx__form { margin-bottom: 96px; }
  .menu .ct--grid, .cp .ct--grid { grid-template-columns: 1fr !important; }
  .ct__txt small, .ct__txt span { white-space: nowrap; }

  /* Home: reasons and reviews become swipeable rows instead of tall stacks */
  .reasons, .rv__grid { display: flex !important; gap: 12px !important; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--gutter, 16px) * -1); padding: 4px var(--gutter, 16px) 14px; scrollbar-width: none; }
  .reasons::-webkit-scrollbar, .rv__grid::-webkit-scrollbar { display: none; }
  .reasons > *, .rv__grid > * { flex: 0 0 84%; scroll-snap-align: center; min-width: 0; }
  .why__top .lede { display: none; }
  /* Footer: two columns for the link lists */
  .ftr__grid { grid-template-columns: 1fr 1fr !important; gap: 24px 16px !important; }
  .ftr__brand, .ftr__grid > :nth-child(n+4) { grid-column: 1 / -1; }
}
.qa__a a { color: var(--navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Home on phones: shorter still ---- */
@media (max-width: 760px) {
  .hero { padding-top: 96px !important; padding-bottom: 32px !important; }
  .hero__facts { display: none !important; }
  .hero__note { display: none !important; }
  .svc__ic { display: none !important; }
  .svc__head { padding: 16px 52px 16px 20px !important; }
  .svc__head h3 { font-size: 1.15rem !important; margin-bottom: 2px !important; }
  .faq__intro > p.reveal { display: none; }
  .step__title { font-size: 1.35rem !important; margin-bottom: 6px !important; }
  .step__body { font-size: 1rem !important; }
  .section { padding-block: 44px !important; }
  .sec-head { gap: 12px !important; margin-bottom: 20px !important; }
}

/* Story: inactive steps dim, active step lights up (original rules never matched, so restate them) */
.js .step .step__num, .js .step .step__title, .js .step .step__body { opacity: .28 !important; transition: opacity .7s var(--ease); }
.js .step.is-active .step__num, .js .step.is-active .step__title, .js .step.is-active .step__body { opacity: 1 !important; }
.js .step .step__img { opacity: .55; transition: opacity .7s var(--ease); }
.js .step.is-active .step__img { opacity: 1; }
