/* Phones (15 Nov 2026). Loaded last on every page by _dev/cleanup.py, so it wins over the older desktop rules.
   The idea: on a phone, long stacks of full-width boxes become swipe rails (one card and a peek of the next,
   snapping into place, a hairline navy bar showing how far you are), long text and lists fold away,
   and the footer becomes tap-to-open groups. assets/mobile.js adds the m-* classes; nothing here
   applies above 767px. */

/* Form labels everywhere: "(optional)" stays on the label's line */
.ab-form label { flex-direction: row !important; flex-wrap: wrap; align-items: baseline; gap: 8px 6px !important; }
.ab-form label > input, .ab-form label > textarea, .ab-form label > select, .ab-form label > .ab-form__sel, .ab-form label > .ab-err { flex: 1 0 100%; }

.m-bar, .m-more, .m-acc__icon { display: none; }

@media (max-width: 767px) {
  html { -webkit-text-size-adjust: 100%; }
  body { touch-action: manipulation; }
  /* the bottom bar already sits there; the floating "back to top" square only covered text */
  #back-to-top { display: none !important; }

  /* ---------- Swipe rails ---------- */
  .m-rail { display: flex !important; flex-wrap: nowrap !important; gap: 12px !important; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: 20px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin-left: -20px !important; margin-right: -20px !important; padding: 2px 20px 4px !important;
    grid-template-columns: none !important; height: auto !important; transform: none !important; width: auto !important; max-width: none !important; }
  .m-rail::-webkit-scrollbar { display: none; }
  .m-rail > * { flex: 0 0 82% !important; width: 82% !important; max-width: 82% !important; min-width: 0; margin: 0 !important; scroll-snap-align: start; scroll-snap-stop: always; }
  .m-rail--wide > * { flex-basis: 88% !important; width: 88% !important; max-width: 88% !important; }
  .m-bar { display: block; position: relative; height: 1px; margin: 22px 0 0; background: rgba(0, 0, 0, .14); }
  .m-bar > span { position: absolute; left: 0; top: -1px; height: 3px; width: 30%; background: var(--ab-navy); transition: transform .15s linear, width .2s; }
  .m-on-dark .m-bar, .ab-soon .m-bar, .ab-pp-am .m-bar, .ab-rcta .m-bar { background: rgba(255, 255, 255, .2); }
  .m-on-dark .m-bar > span, .ab-soon .m-bar > span { background: #fff; }

  /* ---------- Home: expertise boxes ---------- */
  .elementor-element-2dd6bd3 .m-rail > .elementor-column { display: flex; }
  .elementor-element-2dd6bd3 .m-rail > .elementor-column > .elementor-widget-wrap { padding: 0 !important; }
  .elementor-element-2dd6bd3 .icon-box { height: 100%; padding: 32px 24px 30px !important; text-align: left !important; }
  .elementor-element-2dd6bd3 .icon-box .icon-main { justify-content: flex-start !important; margin: 0 0 18px !important; text-align: left !important; }
  .elementor-element-2dd6bd3 .icon-box .content-box, .elementor-element-2dd6bd3 .icon-box p { text-align: left !important; }
  .elementor-element-2dd6bd3 .icon-box p { font-size: 14.5px !important; line-height: 1.7 !important; }

  /* ---------- Home: our journey, one card per year ---------- */
  .ab-tl { display: block !important; }
  .ab-tl::before, .ab-tl::after { display: none !important; }
  .ab-tl__years.m-rail > .ab-yr { flex-basis: 64% !important; width: 64% !important; max-width: 64% !important; position: relative !important; display: block !important; height: auto !important; }
  .ab-tl__years.m-rail .ab-yr__dot { display: none !important; }
  .ab-tl__years.m-rail .ab-yr__box { position: static !important; display: block !important; width: auto !important; height: 100%; padding: 22px 20px 20px !important;
    border: 1px solid #dcdcdc !important; border-top: 2px solid var(--ab-navy) !important; background: #fff; opacity: 1 !important; transform: none !important; }
  .ab-tl__years.m-rail .ab-yr__num { font-size: 40px !important; line-height: 1 !important; }
  .ab-tl__years.m-rail .ab-yr__box > *:not(:first-child) { margin-top: 8px; }
  .ab-now { margin-top: 28px !important; }

  /* ---------- Home: blog cards ---------- */
  .blog-slider .m-rail > .swiper-slide { height: auto !important; }
  .blog-slider .m-rail .post-box { height: 100%; }

  /* ---------- Listing cards: projects, upcoming, teams, related ---------- */
  .ab-going__grid.m-rail > li, .ab-sold__grid.m-rail > li, .ab-up__grid.m-rail > li { height: auto; }
  .ab-going__grid.m-rail .ab-going-card__img img, .ab-sold__grid.m-rail img { aspect-ratio: 4 / 3; object-fit: cover; }

  /* ---------- Project pages ---------- */
  .ab-pp-res.m-rail { margin-bottom: 0 !important; }
  .ab-pp-res.m-rail > .ab-pp-res__card { padding: 26px 22px 24px !important; }
  .ab-pp-res + .m-bar { margin-bottom: 48px; }
  .ab-pp-plans.m-rail > li { flex-basis: 86% !important; width: 86% !important; max-width: 86% !important; }
  .ab-pp-hl__grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 0 !important; }
  .ab-pp-hl__grid > li { padding: 22px 16px 20px 0 !important; border-bottom: 1px solid rgba(255, 255, 255, .12); }
  .ab-pp-hl__grid > li:nth-child(even) { padding-left: 16px !important; padding-right: 0 !important; border-left: 1px solid rgba(255, 255, 255, .12); }
  .ab-pp-hl__grid h3 { font-size: 11px !important; letter-spacing: .16em !important; }
  .ab-pp-hl__grid p { font-size: 13.5px !important; line-height: 1.6 !important; }
  .m-collapsed > li.m-extra { display: none !important; }

  /* ---------- "Read more" and "Show all" ---------- */
  .m-clamp .elementor-widget-container, .m-clamp.m-clamp--self { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 7; overflow: hidden; }
  .m-clamp.is-open .elementor-widget-container, .m-clamp--self.is-open { display: block; -webkit-line-clamp: unset; }
  .m-more { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: 6px 0 0; padding: 0; border: 0; border-bottom: 1px solid currentColor;
    background: none; color: inherit; font: 400 11px/1 var(--ab-font, Montserrat, sans-serif); letter-spacing: .2em; text-transform: uppercase; cursor: pointer; }
  .m-more:focus-visible { outline: 2px solid var(--ab-navy); outline-offset: 4px; }

  /* ---------- Footer: tap-to-open groups ---------- */
  .elementor-element-12234d19 .elementor-column { padding-bottom: 0 !important; margin-bottom: 0 !important; }
  .elementor-element-12234d19 .elementor-widget-wrap { padding-top: 0 !important; padding-bottom: 0 !important; }
  .m-acc { border-top: 1px solid rgba(255, 255, 255, .14); }
  .m-acc > .elementor-widget-wrap > .elementor-widget:not(.m-acc__head) { margin-bottom: 0 !important; }
  .m-acc.is-shut > .elementor-widget-wrap > .elementor-widget:not(.m-acc__head) { display: none !important; }
  .m-acc__head { margin: 0 !important; }
  .m-acc__head > .elementor-widget-container { padding: 0 !important; margin: 0 !important; }
  .m-acc > .elementor-widget-wrap { margin: 0 !important; }
  .m-acc__btn { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 56px; padding: 0; border: 0; background: none;
    color: #fff; font: 300 18px/1.3 var(--ab-font, Montserrat, sans-serif); letter-spacing: .01em; text-align: left; cursor: pointer; }
  .m-acc__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  .m-acc__icon { display: block; position: relative; width: 14px; height: 14px; flex: none; }
  .m-acc__icon::before, .m-acc__icon::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: currentColor; transition: transform .25s ease; }
  .m-acc__icon::after { transform: rotate(90deg); }
  .m-acc:not(.is-shut) .m-acc__icon::after { transform: rotate(0); }
  .m-acc:not(.is-shut) > .elementor-widget-wrap { padding-bottom: 18px !important; }

  @media (prefers-reduced-motion: reduce) { .m-bar > span, .m-acc__icon::before, .m-acc__icon::after { transition: none; } .m-rail { scroll-behavior: auto; } }
}
