/* ArchiTechDesign — phone & tablet layer for the static Wix export.
   Desktop (>= 1024px) is untouched: every layout rule below sits inside a max-width media query.
   The m-* classes and --mo/--ar/--mh/--fs variables are written into the pages by build-folder/make_responsive.py,
   which measures each page's desktop layout and records how every block should reflow on small screens. */

/* ---- outside media queries: only things that are invisible on desktop ---- */
.atd-burger, .atd-navpanel { display: none; }
a.atd-tel { color: inherit; text-decoration: inherit; font: inherit; letter-spacing: inherit; }

/* =====================================================================
   Phones + tablets (< 1024px): reflow the fixed 980px desktop grid
   ===================================================================== */
@media (max-width: 1023px) {
  html, body { min-width: 0 !important; }
  body { overflow-x: hidden !important; }   /* propagates to the viewport (html stays visible) */
  body { -webkit-text-size-adjust: 100%; }
  #SITE_CONTAINER, #SITE_CONTAINER * { min-width: 0 !important; }
  #site-root, #masterPage, #SITE_CONTAINER, #main_MF { width: 100% !important; }

  /* sections, strips and columns grow with their content */
  #PAGES_CONTAINER section, #SITE_FOOTER section,
  [data-mesh-id$="inlineContent"], [data-testid="columns"] { height: auto !important; min-height: 0 !important; }
  [data-mesh-id$="inlineContent"] { width: 100% !important; max-width: 100% !important; }
  .m-flow, .m-stack { min-height: 0 !important; }
  section[id^="comp-"], section[id^="comp-"] > [data-testid="columns"] { width: 100% !important; max-width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; left: 0 !important; }

  /* column strips: columns stack */
  .m-cols, .m-cols > [data-testid="columns"] { display: flex !important; flex-direction: column !important; }
  .m-cols > [data-testid="columns"] > [id], .m-cols > [id] { width: 100% !important; flex: none !important; height: auto !important; margin: 0 !important; }
  .m-bgcol { aspect-ratio: var(--ar, 4 / 3); height: auto !important; max-height: 70vh; }

  /* a block with a background photo keeps a sensible height (hero, image strips) */
  .m-bgimg { min-height: min(var(--mh, 420px), 64vh) !important; display: flex !important; flex-direction: column; }
  .m-bgimg > [data-mesh-id$="inlineContent"] { flex: 1 0 auto; display: flex !important; flex-direction: column; }

  /* ---- flowing mesh containers: one column, desktop order, consistent spacing ---- */
  .m-flow {
    display: flex !important; flex-flow: row wrap !important; justify-content: center; align-items: flex-start; align-content: flex-start;
    column-gap: 14px; width: 100% !important; height: auto !important; box-sizing: border-box; padding: 0 !important;
  }
  .m-flow.m-pad { padding: 24px 20px !important; }            /* content columns get the page gutter */
  .m-flow > * {
    position: relative !important; grid-area: auto !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important;
    margin: 0 !important; order: var(--mo, 0); flex: 0 0 100%; max-width: 100% !important; box-sizing: border-box;
  }
  .m-flow > .m-full { width: 100% !important; }
  .m-flow > .m-inl { flex: 0 0 auto; width: auto !important; white-space: nowrap; }
  /* small standalone blocks keep their size and sit on their own line (margins fill the rest of the row) */
  .m-flow > .m-hc, .m-flow > .m-hl, .m-flow > .m-hr { flex: 0 0 auto; width: var(--w) !important; }
  .m-flow > .m-hc { margin-left: max(0px, calc((100% - var(--w)) / 2)) !important; margin-right: max(0px, calc((100% - var(--w)) / 2)) !important; }
  .m-flow > .m-hl { margin-right: max(0px, calc(100% - var(--w))) !important; }
  .m-flow > .m-hr { margin-left: max(0px, calc(100% - var(--w))) !important; }
  .m-flow > .m-g1 { margin-top: 10px !important; }
  .m-flow > .m-g2 { margin-top: 20px !important; }
  .m-flow > .m-g3 { margin-top: 32px !important; }

  /* ---- overlapping blocks (photo cards with a caption on top): keep the overlay, scale proportionally ---- */
  .m-stack { display: grid !important; grid-template: minmax(0, 1fr) / minmax(0, 1fr) !important; width: 100% !important; height: auto !important; aspect-ratio: var(--ar); padding: 0 !important; }
  .m-stack > * { grid-area: 1 / 1 / 2 / 2 !important; position: relative !important; left: auto !important; top: auto !important; margin: 0 !important; max-width: 100% !important; }
  .m-stack > .m-fill { width: 100% !important; height: 100% !important; z-index: 0; }
  .m-stack > :not(.m-fill) { z-index: 2; padding-left: 20px !important; padding-right: 20px !important; box-sizing: border-box; }
  .m-stack.m-hero > .m-vt { margin-top: 28px !important; }
  .m-stack.m-hero { aspect-ratio: auto; min-height: min(var(--mh), 75vh) !important; }
  #PAGES_CONTAINER .m-stack > section.m-fill { height: auto !important; align-self: stretch !important; }   /* full-bleed photo fills the whole hero */
  #PAGES_CONTAINER .m-stack > section.m-fill > [data-testid="columns"],
  #PAGES_CONTAINER .m-stack > section.m-fill > [data-testid="columns"] > [id] { flex: 1 1 auto !important; }
  .m-stack > .m-full { width: 100% !important; }
  .m-stack > .m-vt { align-self: start !important; } .m-stack > .m-vm { align-self: center !important; } .m-stack > .m-vb { align-self: end !important; }
  .m-stack > .m-hl { justify-self: start !important; } .m-stack > .m-hc { justify-self: center !important; } .m-stack > .m-hr { justify-self: end !important; }
  .m-stack > .m-vb { margin-bottom: 6% !important; } .m-stack > .m-vt { margin-top: 6% !important; }
  .m-stack > [id] > [data-testid="linkElement"], .m-stack > .m-fill wow-image, .m-stack > .m-fill img { width: 100% !important; height: 100% !important; }

  /* ---- images scale to the column, keeping their desktop crop (width/height attributes give the ratio) ---- */
  .m-flow > .m-full.wixui-image, .m-flow > .m-full[class*="wixui-image"] { height: auto !important; }
  .m-flow > .m-full.wixui-image > [data-testid="linkElement"], .m-flow > .m-full.wixui-image wow-image { position: relative !important; width: 100% !important; height: auto !important; display: block; }
  .m-flow > .m-full.wixui-image img { position: relative !important; width: 100% !important; height: auto !important; display: block; }
  img { max-width: 100%; }


  /* decorative graphics that sit behind text on desktop (big outline letters) stay behind it, faintly */
  .m-flow { position: relative; }
  .m-flow > .m-deco { position: absolute !important; left: var(--dx) !important; top: var(--dy) !important; width: min(var(--dw), 60%) !important; height: auto !important; aspect-ratio: var(--dar); flex: none; z-index: 0; opacity: .45; pointer-events: none; }
  .m-flow > .m-deco img, .m-flow > .m-deco wow-image, .m-flow > .m-deco > [data-testid="linkElement"] { position: relative !important; width: 100% !important; height: 100% !important; display: block; }
  .m-flow > :not(.m-deco) { z-index: 1; }

  /* where the content sits on a background photo (bottom-aligned hero etc.) */
  .m-bgimg.m-cbot > [data-mesh-id$="inlineContent"] { justify-content: flex-end; }
  .m-bgimg.m-cmid > [data-mesh-id$="inlineContent"] { justify-content: center; }
  .m-bgimg.m-cbot > [data-mesh-id$="inlineContent"] > .m-pad { padding-bottom: 40px !important; }

  /* ---- header: logo left, menu right ---- */
  #SITE_HEADER .m-cols, #SITE_HEADER .m-cols > [data-testid="columns"] { flex-direction: row !important; align-items: center; }
  #SITE_HEADER .m-cols > [data-testid="columns"] > [id] { width: auto !important; }
  #SITE_HEADER .m-pad { padding: 8px 20px !important; }
  #SITE_HEADER .wixui-image { width: 170px !important; height: auto !important; }
  #SITE_HEADER .wixui-image wow-image, #SITE_HEADER .wixui-image > [data-testid="linkElement"], #SITE_HEADER .wixui-image img { position: relative !important; width: 100% !important; height: auto !important; display: block; }

  /* ---- project grid (home + portfolio) and its category filter ---- */
  #SITE_CONTAINER fluid-columns-repeater { grid-template-columns: 1fr !important; gap: 14px; width: 100% !important; }
  #SITE_CONTAINER fluid-columns-repeater > * { width: 100% !important; height: auto !important; margin: 0 !important; }
  [id$="_wrapper"]:has(> fluid-columns-repeater) { margin: 0 !important; width: 100% !important; left: 0 !important; }
  [id$="_wrapper"] > fluid-columns-repeater { padding: 0 !important; }
  .wixui-selection-tags__option { min-height: 44px; display: inline-flex !important; align-items: center; box-sizing: border-box; }
  [data-testid="tags-list-tag"] { margin: 4px !important; }


  /* ---- Services page (custom layout, .atd-svc) ---- */
  .atd-svc { min-width: 0 !important; }
  .atd-svc .wrap { padding: 0 20px; }
  .atd-hero { height: clamp(300px, 62vw, 560px) !important; }
  .atd-hero img { object-position: 50% 40% !important; }
  .atd-hero h1 { font-size: clamp(30px, 8vw, 35px) !important; }
  .atd-svc h2, .atd-svc h3 { line-height: 1.15 !important; }
  .atd-intro { padding: 60px 0 52px !important; }
  .atd-intro h2 { font-size: clamp(26px, 6.6vw, 38px) !important; }
  .atd-intro p { font-size: 16px !important; }
  .atd-process, .atd-cards, .atd-why, .atd-faq { padding: 56px 0 !important; }
  .atd-process h2, .atd-cards h2 { font-size: clamp(28px, 7vw, 40px) !important; margin-bottom: 32px !important; }
  .atd-why h2, .atd-faq h2, .atd-cta h2 { font-size: clamp(26px, 6.6vw, 36px) !important; }
  .atd-steps { grid-template-columns: 1fr !important; }
  .atd-step, .atd-step + .atd-step { border-right: 0 !important; border-bottom: 1px solid #333; padding: 28px 0 18px !important; }
  .atd-step:last-child { border-bottom: 0; }
  .atd-num { font-size: 56px !important; }
  .atd-grid { grid-template-columns: 1fr !important; gap: 36px !important; }
  .atd-card h3 { min-height: 0 !important; }
  .atd-card p { font-size: 16px !important; }
  .atd-card a { padding: 12px 0 8px !important; }
  .atd-why .g3 { grid-template-columns: 1fr !important; gap: 28px !important; }
  .atd-quote { grid-template-columns: 1fr !important; min-height: 0 !important; }
  .atd-quote img { height: 340px !important; }
  .atd-quote .q { padding: 44px 20px 52px !important; }
  .atd-quote blockquote { font-size: clamp(24px, 6.4vw, 34px) !important; }
  .atd-faq .cols { grid-template-columns: 1fr !important; gap: 20px !important; }
  .atd-faq summary { font-size: 19px !important; min-height: 44px; align-items: center; }
  .atd-faq details p { font-size: 16px !important; }
  .atd-cta { padding: 56px 0 72px !important; }

  /* ---- project pages: prev/next + call to action ---- */
  .atd-more { padding: 48px 20px 64px !important; }
  .atd-pn { grid-template-columns: 1fr !important; gap: 20px !important; }
  .atd-pn a.next { flex-direction: row !important; text-align: left !important; }
  .atd-pn img { width: 120px !important; height: 84px !important; }
  .atd-pn .name { font-size: 20px !important; }
  .atd-cta { margin-top: 40px !important; padding-top: 40px !important; }
  .atd-cta h2 { font-size: clamp(26px, 6.6vw, 32px) !important; }


  /* ---- project galleries: full-width photos in one column (two on tablets), natural proportions ---- */
  [id^="comp-"]:has(> [data-hook="tpa-components-provider"] .pro-gallery), [id^="gallery-wrapper-"],
  .pro-gallery, .pro-gallery-parent-container, [id^="pro-gallery-container-"] { height: auto !important; width: 100% !important; }
  .pro-gallery-margin-container {
    width: 100% !important; height: auto !important; position: relative !important;
    display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 12px;
  }
  .pro-gallery-margin-container > .item-link-wrapper { display: block; min-width: 0; }
  .pro-gallery-margin-container [data-hook="item-container"] { position: relative !important; inset: auto !important; width: 100% !important; height: auto !important; }
  .pro-gallery-margin-container [data-hook="item-wrapper"], .pro-gallery-margin-container [data-hook="image-item"] { position: relative !important; width: 100% !important; height: auto !important; }
  .pro-gallery-margin-container [data-hook="gallery-item-image-img"] { position: relative !important; width: 100% !important; height: auto !important; display: block; object-fit: cover; }


  /* ---- touch targets (>= 44px) and readable small print ---- */
  #SITE_FOOTER a[href^="mailto:"], #SITE_FOOTER a.atd-tel, #PAGES_CONTAINER a.atd-tel { display: inline-block; min-height: 44px; line-height: 44px; }
  #SITE_FOOTER .m-inl a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; }
  #SITE_FOOTER .m-flow { column-gap: 10px; }
  .m-flow > [id]:has(> [aria-label="Social Bar"]) { --item-size: 44px !important; --item-margin-inline: 0 4px !important; flex: 0 0 100%; width: 100% !important; height: 44px !important; margin-left: -8px !important; margin-right: 0 !important; }
  [aria-label="Social Bar"] a { display: flex !important; align-items: center; justify-content: center; width: 44px; height: 44px; }
  [aria-label="Social Bar"] img { width: 28px !important; height: 28px !important; }
  form input:not([type="checkbox"]):not([type="radio"]), form textarea { min-height: 44px; font-size: 16px !important; }
  form button[type="submit"], form [data-hook="submit-button"] { min-height: 48px; }
  form label { font-size: 16px !important; }
  .atd-card a { min-height: 44px; display: inline-flex !important; align-items: center; }
  .atd-step li { font-size: 16px !important; }
  #comp-md4m31ed a, #comp-md4m31ed [data-testid="linkElement"] { min-height: 44px; display: flex; align-items: center; }
  #SITE_FOOTER [data-testid="richTextElement"] p span[style*="font-size:12px"], #SITE_FOOTER [data-testid="richTextElement"] p[style*="font-size:12px"] { font-size: 14px !important; }

  /* ---- page-specific touches ---- */
  #comp-mgex11ag { display: none !important; }   /* About: the graphic "A" of "ABOUT US" - on small screens the heading shows the full word */
  #comp-md432xrh { margin-top: 48px !important; }  /* About: "ABOUT US" heading a little lower in the hero */
  /* About: the "Great design isn't just seen..." quote sits right under the heading, above the person in the photo */
  #comp-md4357y4 > [data-mesh-id$="inlineContent"] { justify-content: flex-start !important; }
  #comp-md4357y4 [data-mesh-id="comp-md4357y4inlineContent-gridContainer"] { padding-top: 80px !important; }

  /* ---- type: headings scale with the screen, body copy never below 16px ---- */
  .m-th, .m-th * { font-size: clamp(var(--fsmin, 24px), 7.2vw, var(--fs, 40px)) !important; line-height: 1.15 !important; }
  .m-stack .m-th, .m-stack .m-th * { font-size: clamp(18px, 5.6vw, var(--fs, 32px)) !important; }
  .m-t16 p, .m-t16 li, .m-t16 p *, .m-t16 li * { font-size: 16px !important; }
  [data-testid="richTextElement"] { overflow-wrap: anywhere; }
}

/* =====================================================================
   Phones (< 768px): menu button replaces the horizontal menu
   ===================================================================== */
@media (max-width: 767px) {
  #SITE_HEADER [aria-label="Site"], #SITE_HEADER .wixui-horizontal-menu { display: none !important; }
  .atd-burger {
    display: flex; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); z-index: 5;
    width: 48px; height: 48px; align-items: center; justify-content: center; padding: 0; border: 0; background: none; color: #fff; cursor: pointer;
  }
  .atd-burger:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  .atd-burger-box { position: relative; width: 26px; height: 18px; display: block; }
  .atd-burger-box span { position: absolute; left: 0; width: 100%; height: 2px; background: currentColor; transition: transform .2s, opacity .2s, top .2s; }
  .atd-burger-box span:nth-child(1) { top: 0; } .atd-burger-box span:nth-child(2) { top: 8px; } .atd-burger-box span:nth-child(3) { top: 16px; }
  .atd-burger[aria-expanded="true"] .atd-burger-box span:nth-child(1) { top: 8px; transform: rotate(45deg); }
  .atd-burger[aria-expanded="true"] .atd-burger-box span:nth-child(2) { opacity: 0; }
  .atd-burger[aria-expanded="true"] .atd-burger-box span:nth-child(3) { top: 8px; transform: rotate(-45deg); }
  .atd-navpanel:not([hidden]) {
    display: block; position: absolute; left: 0; right: 0; top: 100%; z-index: 4; background: #000;
    border-top: 1px solid #333; padding: 6px 0 18px; box-shadow: 0 12px 24px rgba(0,0,0,.25);
  }
  .atd-navpanel ul { list-style: none; margin: 0; padding: 0; }
  .atd-navpanel a {
    display: flex; align-items: center; min-height: 52px; padding: 0 24px; color: #fff; text-decoration: none;
    font: 400 17px/1.2 avenir-lt-w01_35-light1475496, Helvetica, Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase;
  }
  .atd-navpanel a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
  .atd-navpanel a:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
}

/* =====================================================================
   Tablets (768–1023px): wider gutters, two-up grids
   ===================================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  .m-flow.m-pad { padding: 32px 40px !important; }
  #SITE_HEADER .m-pad { padding: 8px 24px !important; }
  #SITE_HEADER .m-cols > [data-testid="columns"] > [id]:last-child { flex: 1 1 auto !important; }
  #SITE_CONTAINER fluid-columns-repeater { grid-template-columns: repeat(2, 1fr) !important; }
  .m-stack .m-th, .m-stack .m-th * { font-size: clamp(18px, 3.3vw, var(--fs, 32px)) !important; }
  .atd-svc .wrap { padding: 0 40px; }
  .atd-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 40px 24px !important; }
  .atd-steps { grid-template-columns: repeat(3, 1fr) !important; }
  .atd-step { border-bottom: 0 !important; border-right: 1px solid #333 !important; padding: 28px 18px 10px 0 !important; }
  .atd-step + .atd-step { padding-left: 18px !important; }
  .atd-step:last-child { border-right: 0 !important; }
  .atd-why .g3 { grid-template-columns: repeat(3, 1fr) !important; gap: 24px !important; }
  .atd-quote { grid-template-columns: 1fr 1fr !important; }
  .atd-quote img { height: 100% !important; }
  .atd-pn { grid-template-columns: 1fr 1fr !important; }
  .pro-gallery-margin-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m-th, .m-th * { font-size: clamp(var(--fsmin, 24px), 4.6vw, var(--fs, 40px)) !important; }
}
