/* Abermaw Decorating — final responsive optimisation layer
   Loaded last by the build so phone/tablet behaviour cannot be undone by older
   page-specific styles. Desktop composition is intentionally left intact. */

:root{
  --ad-mobile-gutter:20px;
  --ad-tablet-gutter:28px;
}

html,body{max-width:100%;overflow-x:clip}
:is(img,video,iframe,svg,canvas){max-width:100%}
:is(button,a,input,select,textarea){touch-action:manipulation}

/* --------------------------------------------------------------------------
   Tablet / small laptop: preserve the design, reduce density before it breaks.
   -------------------------------------------------------------------------- */
@media (max-width:1100px){
  .wrap{width:min(var(--max,1280px),calc(100% - 48px))!important}

  body.ad-homepage .hero h1{font-size:clamp(3.5rem,7.6vw,5.7rem)!important;line-height:.9!important}
  body.ad-homepage .hero-content{width:min(760px,calc(100vw - 56px))!important}
  body.ad-homepage .split-intro{grid-template-columns:1fr!important;gap:22px!important}
  body.ad-homepage .promise-layout,
  body.ad-homepage .criteria-layout,
  body.ad-homepage .faq-layout,
  body.ad-homepage .about-layout,
  body.ad-homepage .quote-layout,
  body.ad-homepage .guide-layout{grid-template-columns:1fr!important;gap:44px!important}
  body.ad-homepage :is(.promise-lead,.criteria-lead,.faq-intro){position:static!important}
  body.ad-homepage .services-stage{grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:auto!important}
  body.ad-homepage .services-stage .service{grid-column:auto!important;grid-row:auto!important;min-height:340px!important}
  body.ad-homepage .services-stage .service:first-child{grid-column:1/-1!important;min-height:460px!important}
  body.ad-homepage .project-gallery{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.ad-homepage .price-grid{grid-template-columns:1fr!important}
  body.ad-homepage .price-card,
  body.ad-homepage .price-card:first-child,
  body.ad-homepage .price-card:last-child,
  body.ad-homepage .price-card.featured{padding:30px 0!important;border-right:0!important;border-bottom:1px solid rgba(21,25,29,.14)!important}
  body.ad-homepage .price-card:last-child{border-bottom:0!important}
  body.ad-homepage .price-card>p{min-height:0!important}

  body.ad-content-page .section-head{grid-template-columns:1fr!important;gap:22px!important}
  body.ad-content-page .outcome-grid,
  body.ad-content-page .process-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:0 28px!important}
  body.ad-content-page .case-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.ad-content-page .case-card.featured{grid-column:1/-1!important}
  body.ad-content-page .cost-grid{grid-template-columns:1fr!important}
  body.ad-content-page .cost-card,
  body.ad-content-page .cost-card.featured{border-right:0!important;border-bottom:1px solid var(--ad-editorial-line,rgba(7,26,48,.13))!important;padding:26px 0!important}
  body.ad-content-page .cost-card:last-child{border-bottom:0!important}
  body.ad-content-page .decision-panel,
  body.ad-content-page .local-banner{grid-template-columns:1fr!important;gap:24px!important}
  body.ad-content-page .route-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}

  body.ad-advice-hub .advice-grid{grid-template-columns:1fr!important}
  body.ad-case-hub .grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}

  .ad-footer-main{grid-template-columns:1.2fr 1fr 1fr!important}
  .ad-footer-brand{grid-column:1/-1!important}
}

/* --------------------------------------------------------------------------
   Phone + portrait tablet: a deliberately recomposed interface.
   -------------------------------------------------------------------------- */
@media (max-width:760px){
  :root{--ad-mobile-gutter:20px}
  html{scroll-padding-top:88px!important}
  body{font-size:16px!important}
  .wrap{width:calc(100% - (var(--ad-mobile-gutter) * 2))!important;max-width:none!important}

  h2{font-size:clamp(2.15rem,10vw,3.2rem)!important;line-height:1.02!important;letter-spacing:-.045em!important}
  h3{overflow-wrap:anywhere}
  p{overflow-wrap:break-word}
  .section-kicker{font-size:.67rem!important;letter-spacing:.13em!important}
  .btn,.ad-site-cta,.submit-btn{min-height:50px!important}

  /* Canonical header */
  :root{--ad-header-open:76px;--ad-header-closed:66px}
  html.ad-chrome-ready body{padding-top:var(--ad-header-open)!important}
  .ad-site-header__inner{width:calc(100% - 22px)!important;gap:10px!important}
  .ad-site-logo{width:190px!important;height:63px!important}
  .ad-site-header.is-scrolled .ad-site-logo{width:168px!important;height:56px!important}
  .ad-site-nav,.ad-site-header>.ad-site-header__inner>.ad-site-cta{display:none!important}
  .ad-menu-button{display:block!important;width:44px!important;height:44px!important;margin-left:auto!important}
  .ad-mobile-menu{padding:calc(var(--ad-header-open) + 16px) var(--ad-mobile-gutter) 30px!important}
  .ad-mobile-menu__inner>a:not(.ad-mobile-contact){padding:14px 0!important;font-size:clamp(1.55rem,7vw,2.2rem)!important}

  /* Legacy homepage header fallback, for pages before chrome hydration. */
  .site-header .header-cta{display:none!important}
  .site-header .menu-button{display:block!important}
  .mobile-menu.open{display:block!important}

  /* Homepage hero — exact approved three-line mobile headline. */
  body.ad-homepage main#top>.hero,
  main#top>.hero{
    height:auto!important;
    min-height:calc(100svh - var(--ad-header-open,76px))!important;
    padding:clamp(30px,5svh,48px) var(--ad-mobile-gutter) 28px!important;
    display:block!important;
    overflow:hidden!important;
  }
  body.ad-homepage main#top>.hero .hero-content,
  main#top>.hero .hero-content{
    position:relative!important;
    z-index:3!important;
    left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
    width:min(100%,560px)!important;
    margin:0!important;
  }
  body.ad-homepage main#top>.hero .hero-kicker,
  main#top>.hero .hero-kicker{
    display:block!important;
    margin:0 0 13px!important;
    font-size:.67rem!important;
    line-height:1.35!important;
    letter-spacing:.12em!important;
  }
  body.ad-homepage main#top>.hero h1,
  main#top>.hero h1{
    width:100%!important;
    max-width:none!important;
    margin:0 0 18px!important;
    font-size:clamp(1.8rem,8vw,2.2rem)!important;
    line-height:1.02!important;
    letter-spacing:-.052em!important;
    text-wrap:initial!important;
    overflow:visible!important;
  }
  body.ad-homepage main#top>.hero h1 .hero-word-your,
  body.ad-homepage main#top>.hero h1 .hero-word-home,
  main#top>.hero h1 .hero-word-your,
  main#top>.hero h1 .hero-word-home{display:inline!important;white-space:nowrap!important}
  body.ad-homepage main#top>.hero h1 .hero-word-home::after,
  main#top>.hero h1 .hero-word-home::after{content:""!important;display:block!important}
  body.ad-homepage main#top>.hero h1 .hero-line-rest,
  main#top>.hero h1 .hero-line-rest{display:block!important;white-space:nowrap!important}
  body.ad-homepage main#top>.hero h1 .hero-line-rest strong,
  main#top>.hero h1 .hero-line-rest strong{display:block!important;white-space:nowrap!important}
  body.ad-homepage main#top>.hero .hero-intro,
  main#top>.hero .hero-intro{
    max-width:36ch!important;
    margin:0 0 20px!important;
    font-size:clamp(.94rem,4.2vw,1.04rem)!important;
    line-height:1.52!important;
    color:rgba(255,255,255,.82)!important;
  }
  body.ad-homepage main#top>.hero .hero-actions,
  main#top>.hero .hero-actions{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;width:min(100%,440px)!important}
  body.ad-homepage main#top>.hero .hero-actions .btn,
  main#top>.hero .hero-actions .btn{width:100%!important;justify-content:space-between!important;min-height:54px!important;padding-inline:18px!important}
  body.ad-homepage main#top>.hero .quiet-link,
  main#top>.hero .quiet-link{width:max-content!important;padding:7px 0 4px!important;font-size:.9rem!important}
  body.ad-homepage main#top>.hero .hero-foot,
  main#top>.hero .hero-foot{
    position:relative!important;z-index:3!important;
    left:auto!important;right:auto!important;bottom:auto!important;
    width:min(100%,560px)!important;
    margin:24px 0 0!important;padding:13px 0 0!important;
    display:block!important;
  }
  body.ad-homepage main#top>.hero .hero-proof,
  main#top>.hero .hero-proof{display:flex!important;gap:7px 14px!important;flex-wrap:wrap!important;font-size:.61rem!important;line-height:1.35!important}
  body.ad-homepage main#top>.hero .hero-caption,
  main#top>.hero .hero-caption{display:none!important}
  body.ad-homepage main#top>.hero .hero-wash,
  main#top>.hero .hero-wash{background:linear-gradient(90deg,rgba(7,14,24,.91) 0%,rgba(7,14,24,.76) 56%,rgba(7,14,24,.40) 100%),linear-gradient(0deg,rgba(7,14,24,.54),transparent 58%)!important}
  body.ad-homepage main#top>.hero .hero-media img,
  main#top>.hero .hero-media img{object-position:62% 50%!important}

  /* Homepage chapter rhythm */
  body.ad-homepage :is(.services-section,.promise-section,.projects-section,.costs-section,.criteria-section,.areas-section,.reviews-section,.about-section,.faq-section,.buying-section,.fit-section){padding-top:70px!important;padding-bottom:70px!important}
  body.ad-homepage .section-intro{margin-bottom:30px!important}
  body.ad-homepage .split-intro{display:grid!important;grid-template-columns:1fr!important;gap:16px!important}
  body.ad-homepage .split-intro p{font-size:.96rem!important;line-height:1.62!important}
  body.ad-homepage .availability-row{padding:18px 0!important;display:block!important;min-height:0!important}
  body.ad-homepage .availability-row>div{display:block!important}
  body.ad-homepage .availability-row strong{display:block!important;margin-top:5px!important;font-size:1rem!important}
  body.ad-homepage .availability-row p{margin:8px 0 0!important;font-size:.82rem!important}

  body.ad-homepage .services-stage{display:grid!important;grid-template-columns:1fr!important;grid-template-rows:none!important;gap:12px!important}
  body.ad-homepage .services-stage .service,
  body.ad-homepage .services-stage .service:first-child{grid-column:auto!important;grid-row:auto!important;min-height:0!important;height:340px!important}
  body.ad-homepage .service-copy{left:18px!important;right:18px!important;bottom:18px!important}
  body.ad-homepage .service-copy h3{font-size:2rem!important;line-height:1.03!important}
  body.ad-homepage .service-copy p{font-size:.82rem!important;line-height:1.5!important}

  body.ad-homepage .promise-layout,
  body.ad-homepage .criteria-layout,
  body.ad-homepage .faq-layout,
  body.ad-homepage .about-layout,
  body.ad-homepage .quote-layout,
  body.ad-homepage .guide-layout{display:grid!important;grid-template-columns:1fr!important;gap:32px!important}
  body.ad-homepage :is(.promise-lead,.criteria-lead,.faq-intro){position:static!important}
  body.ad-homepage .principles article{grid-template-columns:1fr!important;gap:6px!important;padding:22px 0!important}
  body.ad-homepage .principles h3{font-size:1.35rem!important}

  body.ad-homepage .story-intro{padding:70px 0 28px!important}
  body.ad-homepage .story-scroll{height:220vh!important}
  body.ad-homepage .story-ui{left:var(--ad-mobile-gutter)!important;right:var(--ad-mobile-gutter)!important;bottom:7svh!important;width:auto!important}
  body.ad-homepage .story-ui h3{font-size:clamp(2.5rem,12vw,3.6rem)!important;line-height:.95!important}
  body.ad-homepage .story-ui p{font-size:.9rem!important;line-height:1.55!important}

  body.ad-homepage .project-gallery{width:calc(100% - (var(--ad-mobile-gutter) * 2))!important;grid-template-columns:1fr!important;gap:38px!important}
  body.ad-homepage .project-feature,
  body.ad-homepage .project-pair{display:block!important}
  body.ad-homepage .project-secondary{display:block!important;margin-top:38px!important}
  body.ad-homepage .project-offset{margin-top:38px!important}
  body.ad-homepage :is(.project-feature figure,.project-secondary figure,.project-offset figure){height:auto!important;min-height:0!important;aspect-ratio:4/3!important}
  body.ad-homepage .project-copy,
  body.ad-homepage .project-feature .project-copy,
  body.ad-homepage .project-secondary .project-copy{padding:18px 0 0!important}
  body.ad-homepage .project-copy h3,
  body.ad-homepage .project-feature .project-copy h3,
  body.ad-homepage .project-secondary .project-copy h3{font-size:1.55rem!important;line-height:1.08!important}

  body.ad-homepage .price-grid{display:grid!important;grid-template-columns:1fr!important;margin-top:20px!important}
  body.ad-homepage .price-card,
  body.ad-homepage .price-card:first-child,
  body.ad-homepage .price-card:last-child,
  body.ad-homepage .price-card.featured{padding:26px 0!important;border-right:0!important;border-bottom:1px solid rgba(21,25,29,.14)!important;background:transparent!important;color:inherit!important}
  body.ad-homepage .price-card:last-child{border-bottom:0!important}
  body.ad-homepage .price-card h3{font-size:2.85rem!important}
  body.ad-homepage .price-top{display:flex!important;align-items:end!important;justify-content:space-between!important;gap:12px!important}
  body.ad-homepage .price-top strong{margin:0!important}

  body.ad-homepage .quote-section{min-height:0!important}
  body.ad-homepage .quote-layout{padding-block:68px!important}
  body.ad-homepage .quote-copy h2{font-size:clamp(2.45rem,11vw,3.35rem)!important}
  body.ad-homepage .proposal-card{width:100%!important;max-width:none!important;padding:22px 18px!important}

  body.ad-homepage .map-box{height:360px!important}
  body.ad-homepage .map-panel{padding:20px 16px!important}
  body.ad-homepage .area-projects{grid-template-columns:1fr!important}
  body.ad-homepage .area-project{grid-template-columns:84px 1fr!important}

  body.ad-homepage .reviews-head-upgraded{grid-template-columns:1fr!important;gap:22px!important;margin-bottom:28px!important}
  body.ad-homepage .review-carousel-card{flex-basis:calc(100vw - 40px)!important;min-height:350px!important;padding:22px 18px!important}
  body.ad-homepage .review-carousel-card blockquote{font-size:1.2rem!important;line-height:1.45!important;margin:28px 0 24px!important}

  body.ad-homepage .about-photo{height:auto!important;aspect-ratio:4/5!important}
  body.ad-homepage .guide-section{min-height:0!important}
  body.ad-homepage .guide-layout{padding-block:68px!important}
  body.ad-homepage .guide-copy h2{font-size:clamp(2.4rem,11vw,3.35rem)!important}
  body.ad-homepage .guide-inline-form{grid-template-columns:1fr!important;width:100%!important}
  body.ad-homepage .guide-submit,
  body.ad-homepage .guide-consent,
  body.ad-homepage .guide-status{grid-column:1!important}
  body.ad-homepage .guide-cover{width:min(330px,86vw)!important;margin-inline:auto!important}
  body.ad-homepage .faq-q{min-height:70px!important;padding:19px 0!important;font-size:.95rem!important}
  body.ad-homepage .final-section{min-height:0!important;padding-block:70px!important}
  body.ad-homepage .final-copy{padding-block:0!important}
  body.ad-homepage .final-copy h2{font-size:clamp(2.5rem,11vw,3.5rem)!important}

  /* Shared content pages */
  body.ad-content-page .hero,
  body.ad-unified-masthead :is(.hero,.hub-hero,.advice-hub-hero,.article-hero){padding-top:34px!important;padding-bottom:38px!important}
  body.ad-unified-masthead :is(.hero h1,.hub-hero h1,.advice-hub-hero h1,.article-hero h1,.gv-hero h1),
  body.ad-content-page .hero h1{font-size:clamp(2.35rem,10.7vw,3.2rem)!important;line-height:1.01!important;letter-spacing:-.048em!important;text-wrap:balance!important}
  body.ad-content-page .hero-grid,
  body.ad-unified-masthead.ad-content-page .hero-grid,
  body.ad-unified-masthead.ad-advice-page .article-hero-grid,
  body.ad-unified-masthead:is(.ad-services-hub,.ad-area-hub) .hub-hero>.wrap,
  body.ad-unified-masthead.ad-advice-hub .advice-hub-hero>.wrap,
  body.ad-unified-masthead.ad-case-hub .hero>.wrap{grid-template-columns:1fr!important;gap:24px!important}
  body.ad-content-page .hero-media,
  body.ad-unified-masthead.ad-content-page .hero-media,
  body.ad-unified-masthead.ad-advice-page .article-hero figure{min-height:0!important;height:auto!important;aspect-ratio:4/3!important;border-radius:14px!important;transform:none!important}
  body.ad-content-page .hero-media img,
  body.ad-unified-masthead.ad-content-page .hero-media img,
  body.ad-unified-masthead.ad-advice-page .article-hero figure img{min-height:0!important;height:100%!important}

  body.ad-content-page .section{padding-top:64px!important;padding-bottom:64px!important}
  body.ad-content-page .section-head{grid-template-columns:1fr!important;gap:16px!important}
  body.ad-content-page .outcome-grid,
  body.ad-content-page .process-grid,
  body.ad-content-page .case-grid,
  body.ad-content-page .faq-grid,
  body.ad-content-page .route-grid{grid-template-columns:1fr!important;gap:0!important}
  body.ad-content-page .case-card.featured{grid-column:auto!important;display:flex!important;flex-direction:column!important}
  body.ad-content-page .case-card.featured .case-copy{padding:18px!important}
  body.ad-content-page .cost-grid{grid-template-columns:1fr!important}
  body.ad-content-page :is(.outcome-card,.process-card,.faq-card,.route){padding:20px 0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
  body.ad-content-page .decision-panel,
  body.ad-content-page .local-banner{grid-template-columns:1fr!important;gap:18px!important;padding:24px 0!important;border-left:0!important;border-right:0!important;border-radius:0!important;background:transparent!important}
  body.ad-content-page .service-list article{grid-template-columns:42px 1fr!important;gap:12px!important;padding:20px 0!important}
  body.ad-content-page .service-list article>*:last-child{grid-column:2!important}

  /* Hubs, Advice and Case Studies */
  body.ad-services-hub .hub-grid,
  body.ad-area-hub .hub-grid,
  body.ad-case-hub .grid,
  body.ad-advice-hub .advice-grid{grid-template-columns:1fr!important;gap:18px!important}
  body.ad-advice-hub .advice-card,
  body.ad-advice-hub .advice-topic:nth-child(even) .advice-card{grid-template-columns:112px 1fr!important;gap:14px!important;padding:17px 0!important}
  body.ad-advice-hub .advice-card img{height:100px!important}
  body.ad-advice-hub .advice-card h3{font-size:1.05rem!important}

  body.ad-unified-masthead:is(.ad-services-hub,.ad-area-hub) .hub-hero>.wrap::after,
  body.ad-unified-masthead.ad-advice-hub .advice-hub-hero>.wrap::after,
  body.ad-unified-masthead.ad-case-hub .hero>.wrap::after{grid-column:1!important;grid-row:auto!important;width:100%!important;min-height:0!important;aspect-ratio:4/3!important;margin-top:0!important;border-radius:14px!important}

  body.ad-unified-masthead.ad-case-page .gv-hero{display:flex!important;flex-direction:column!important}
  body.ad-unified-masthead.ad-case-page .gv-hero-inner{order:1!important;min-height:0!important;padding-top:34px!important;padding-bottom:24px!important}
  body.ad-unified-masthead.ad-case-page .gv-hero-copy{width:100%!important;max-width:none!important}
  body.ad-unified-masthead.ad-case-page .gv-hero-photo{position:relative!important;order:2!important;inset:auto!important;width:calc(100% - (var(--ad-mobile-gutter) * 2))!important;min-height:0!important;aspect-ratio:4/3!important;margin:0 var(--ad-mobile-gutter) 40px!important;border-radius:14px!important}
  body.ad-unified-masthead.ad-case-page .gv-facts{grid-template-columns:1fr!important}
  body.ad-unified-masthead.ad-case-page .gv-fact{padding:10px 0!important;border-bottom:1px solid var(--ad-masthead-line)!important}
  body.ad-unified-masthead.ad-case-page .gv-fact:last-child{border-bottom:0!important}

  body.ad-advice-page .article-body,
  body.ad-advice-page .article-content,
  body.ad-case-page .case-copy,
  body.ad-case-page .case-body{max-width:100%!important}
  body.ad-launch-finished .ad-context__grid,
  body.ad-advice-page .related-grid,
  body.ad-case-page .case-proof__grid{grid-template-columns:1fr!important;gap:0!important}

  /* Forms / tables / utility content */
  .field-row{grid-template-columns:1fr!important}
  .drawer-panel{width:100%!important}
  .drawer-top{height:64px!important;padding-inline:18px!important}
  .drawer-content{padding:34px var(--ad-mobile-gutter) 48px!important}
  table{max-width:100%!important}
  .table-wrap,.responsive-table{max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch}

  /* Footer */
  .ad-footer-inner{width:calc(100% - 36px)!important;padding-top:48px!important}
  .ad-footer-main{grid-template-columns:1fr 1fr!important;gap:32px 22px!important;padding-bottom:38px!important}
  .ad-footer-brand,.ad-footer-contact{grid-column:1/-1!important}
  .ad-footer-brand img{width:min(260px,84vw)!important}
  .ad-footer-bottom{flex-direction:column-reverse!important;align-items:flex-start!important;gap:12px!important}
}

/* Narrow phones: keep the approved three lines intact down to 320px. */
@media (max-width:380px){
  :root{--ad-mobile-gutter:16px}
  .ad-site-logo{width:164px!important;height:55px!important}
  .ad-site-header.is-scrolled .ad-site-logo{width:152px!important;height:51px!important}
  .ad-menu-button{width:42px!important;height:42px!important}
  body.ad-homepage main#top>.hero h1,
  main#top>.hero h1{font-size:clamp(1.62rem,7.9vw,1.86rem)!important}
  body.ad-homepage main#top>.hero .hero-intro,
  main#top>.hero .hero-intro{font-size:.92rem!important;line-height:1.5!important}
  body.ad-homepage main#top>.hero .hero-proof,
  main#top>.hero .hero-proof{font-size:.57rem!important;gap:6px 10px!important}
  body.ad-advice-hub .advice-card,
  body.ad-advice-hub .advice-topic:nth-child(even) .advice-card{grid-template-columns:92px 1fr!important}
  body.ad-advice-hub .advice-card img{height:84px!important}
  .ad-footer-main{grid-template-columns:1fr!important}
  .ad-footer-col,.ad-footer-contact{grid-column:1!important}
}

/* Landscape phones: keep controls usable without forcing a full-height hero. */
@media (max-width:900px) and (orientation:landscape) and (max-height:520px){
  :root{--ad-header-open:64px;--ad-header-closed:60px}
  .ad-site-logo{width:160px!important;height:53px!important}
  body.ad-homepage main#top>.hero,
  main#top>.hero{min-height:0!important;padding-top:24px!important;padding-bottom:24px!important}
  body.ad-homepage main#top>.hero h1,
  main#top>.hero h1{font-size:clamp(1.8rem,4.3vw,2.35rem)!important}
  body.ad-homepage main#top>.hero .hero-foot,
  main#top>.hero .hero-foot{margin-top:18px!important}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
