/* Abermaw Decorating — unified non-homepage mastheads.
   One calm editorial pattern across Services, Areas, Costs, About, Contact,
   Advice and Case Studies. Homepage and Colour Guide deliberately retain their
   own immersive identities. */

body.ad-unified-masthead{
  --ad-masthead-paper:#F7F5F0;
  --ad-masthead-ink:#071A30;
  --ad-masthead-muted:#59656e;
  --ad-masthead-gold:#a87943;
  --ad-masthead-line:rgba(18,24,32,.13);
  --ad-masthead-radius:14px;
  --ad-masthead-width:1180px;
}

/* Shared visual language */
body.ad-unified-masthead :is(
  .hero,
  .hub-hero,
  .advice-hub-hero,
  .article-hero,
  .gv-hero
){
  background:var(--ad-masthead-paper)!important;
  color:var(--ad-masthead-ink)!important;
  border-bottom:1px solid var(--ad-masthead-line)!important;
}

body.ad-unified-masthead :is(
  .hero,
  .hub-hero,
  .advice-hub-hero,
  .article-hero
){
  min-height:0!important;
  padding-top:clamp(48px,5vw,66px)!important;
  padding-bottom:clamp(48px,5vw,66px)!important;
}

body.ad-unified-masthead :is(
  .hero h1,
  .hub-hero h1,
  .advice-hub-hero h1,
  .article-hero h1,
  .gv-hero h1
){
  max-width:820px!important;
  margin:13px 0 18px!important;
  font-size:clamp(3rem,4.7vw,4.65rem)!important;
  line-height:.98!important;
  letter-spacing:-.052em!important;
  text-wrap:balance;
  color:var(--ad-masthead-ink)!important;
}

body.ad-unified-masthead :is(
  .hero p,
  .hub-hero p,
  .advice-hub-hero p,
  .article-hero .article-dek,
  .gv-hero .gv-hero-intro
){
  max-width:680px!important;
  margin-bottom:0!important;
  font-size:clamp(1rem,1.15vw,1.1rem)!important;
  line-height:1.72!important;
  color:var(--ad-masthead-muted)!important;
}

body.ad-unified-masthead :is(.crumb,.ad-unified-crumb){
  margin:0 0 20px!important;
  color:#6c777f!important;
  font-size:.72rem!important;
  line-height:1.4!important;
}
body.ad-unified-masthead :is(.crumb,.ad-unified-crumb) a{
  color:#34414a!important;
  text-decoration:none!important;
  border-bottom:1px solid rgba(18,24,32,.28)!important;
}
body.ad-unified-masthead :is(.kicker,.gv-kicker){
  color:var(--ad-masthead-gold)!important;
}

/* Standard content/detail pages already have a real hero image. */
body.ad-unified-masthead.ad-content-page .hero-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(360px,.82fr)!important;
  gap:clamp(40px,5vw,64px)!important;
  align-items:center!important;
}
body.ad-unified-masthead.ad-content-page .hero-media{
  width:100%!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  aspect-ratio:4/3!important;
  margin:0!important;
  overflow:hidden!important;
  border-radius:var(--ad-masthead-radius)!important;
  background:#dedbd4!important;
}
body.ad-unified-masthead.ad-content-page .hero-media img{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  object-fit:cover!important;
}
body.ad-unified-masthead.ad-content-page .hero-actions{
  margin-top:24px!important;
}

/* Hub pages: the same split composition, using a representative project image. */
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{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(360px,.82fr)!important;
  grid-auto-rows:auto!important;
  column-gap:clamp(40px,5vw,64px)!important;
  align-items:center!important;
}
body.ad-unified-masthead:is(.ad-services-hub,.ad-area-hub) .hub-hero>.wrap>*:not(.topic-nav):not(.filters),
body.ad-unified-masthead.ad-advice-hub .advice-hub-hero>.wrap>*:not(.topic-nav),
body.ad-unified-masthead.ad-case-hub .hero>.wrap>*:not(.filters){
  grid-column:1!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{
  content:"";
  grid-column:2!important;
  grid-row:1 / span 5!important;
  align-self:stretch!important;
  min-height:360px!important;
  aspect-ratio:4/3!important;
  border-radius:var(--ad-masthead-radius)!important;
  background-position:center!important;
  background-size:cover!important;
  background-repeat:no-repeat!important;
}
body.ad-unified-masthead.ad-services-hub .hub-hero>.wrap::after{
  background-image:url('/assets/projects/tywyn-living-after.webp')!important;
}
body.ad-unified-masthead.ad-area-hub .hub-hero>.wrap::after{
  background-image:url('/assets/projects/harlech-bungalow-after.webp')!important;
}
body.ad-unified-masthead.ad-advice-hub .advice-hub-hero>.wrap::after{
  background-image:url('/assets/projects/tywyn-living-after.webp')!important;
}
body.ad-unified-masthead.ad-case-hub .hero>.wrap::after{
  background-image:url('/assets/projects/dolgellau-exterior-after.webp')!important;
}
body.ad-unified-masthead.ad-advice-hub .topic-nav,
body.ad-unified-masthead.ad-case-hub .filters{
  grid-column:1 / -1!important;
  margin-top:26px!important;
}
body.ad-unified-masthead.ad-case-hub .hero p{
  max-width:690px!important;
}

/* Advice articles keep their editorial metadata, but now use the same dimensions. */
body.ad-unified-masthead.ad-advice-page .article-hero.article-hero--editorial{
  padding-top:clamp(48px,5vw,66px)!important;
  padding-bottom:clamp(48px,5vw,66px)!important;
}
body.ad-unified-masthead.ad-advice-page .article-hero-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(360px,.82fr)!important;
  gap:clamp(40px,5vw,64px)!important;
  align-items:center!important;
}
body.ad-unified-masthead.ad-advice-page .article-hero-grid>div:first-child{
  width:auto!important;
  padding-bottom:0!important;
}
body.ad-unified-masthead.ad-advice-page .article-hero figure{
  width:100%!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  aspect-ratio:4/3!important;
  margin:0!important;
  border-radius:var(--ad-masthead-radius)!important;
  overflow:hidden!important;
}
body.ad-unified-masthead.ad-advice-page .article-hero figure img{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  object-fit:cover!important;
}
body.ad-unified-masthead.ad-advice-page .article-meta{
  margin:24px 0 0!important;
  padding:12px 0!important;
  border-top:1px solid var(--ad-masthead-line)!important;
  border-bottom:1px solid var(--ad-masthead-line)!important;
}

/* Case-study detail pages: replace the full-bleed poster hero with the same split masthead. */
body.ad-unified-masthead.ad-case-page .gv-hero{
  position:relative!important;
  min-height:0!important;
  overflow:hidden!important;
  background:var(--ad-masthead-paper)!important;
}
body.ad-unified-masthead.ad-case-page .gv-hero-photo{
  position:absolute!important;
  z-index:1!important;
  top:clamp(48px,5vw,66px)!important;
  right:max(24px,calc((100vw - min(var(--ad-masthead-width),calc(100vw - 48px)))/2))!important;
  bottom:clamp(48px,5vw,66px)!important;
  left:auto!important;
  width:min(42vw,500px)!important;
  min-height:360px!important;
  opacity:1!important;
  border-radius:var(--ad-masthead-radius)!important;
  overflow:hidden!important;
  background-image:var(--case-hero)!important;
  background-size:cover!important;
  background-position:center!important;
  box-shadow:none!important;
}
body.ad-unified-masthead.ad-case-page .gv-hero-photo::before,
body.ad-unified-masthead.ad-case-page .gv-hero-photo::after{
  display:none!important;
  content:none!important;
}
body.ad-unified-masthead.ad-case-page .gv-hero-inner{
  position:relative!important;
  z-index:2!important;
  min-height:520px!important;
  padding-top:clamp(48px,5vw,66px)!important;
  padding-bottom:clamp(48px,5vw,66px)!important;
  display:flex!important;
  align-items:center!important;
}
body.ad-unified-masthead.ad-case-page .gv-hero-copy{
  width:min(54%,650px)!important;
  max-width:650px!important;
  color:var(--ad-masthead-ink)!important;
}
body.ad-unified-masthead.ad-case-page .gv-hero-sub{
  color:#59656e!important;
  font-size:.82rem!important;
  font-weight:750!important;
  letter-spacing:.04em!important;
  text-transform:uppercase!important;
}
body.ad-unified-masthead.ad-case-page .gv-facts{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:0!important;
  margin:24px 0 0!important;
  border-top:1px solid var(--ad-masthead-line)!important;
  border-bottom:1px solid var(--ad-masthead-line)!important;
}
body.ad-unified-masthead.ad-case-page .gv-fact{
  padding:11px 14px 11px 0!important;
  border:0!important;
  background:transparent!important;
}
body.ad-unified-masthead.ad-case-page .gv-fact-label{
  color:#788189!important;
}
body.ad-unified-masthead.ad-case-page .gv-fact-value{
  color:var(--ad-masthead-ink)!important;
}
body.ad-unified-masthead.ad-case-page .gv-hero-link{
  margin-top:22px!important;
  color:var(--ad-masthead-ink)!important;
  border-color:rgba(18,24,32,.25)!important;
}

/* Utility pages should follow the same compact text hierarchy even when they
   deliberately have no decorative project photograph. */
body.ad-unified-masthead.ad-utility-page .hero{
  padding-top:clamp(48px,5vw,66px)!important;
  padding-bottom:clamp(48px,5vw,66px)!important;
}

@media(max-width:980px){
  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:minmax(0,1fr) minmax(300px,.72fr)!important;
    gap:34px!important;
  }
  body.ad-unified-masthead :is(.hero h1,.hub-hero h1,.advice-hub-hero h1,.article-hero h1,.gv-hero h1){
    font-size:clamp(2.8rem,6vw,4rem)!important;
  }
  body.ad-unified-masthead.ad-case-page .gv-hero-photo{
    width:40vw!important;
  }
}

@media(max-width:760px){
  body.ad-unified-masthead :is(.hero,.hub-hero,.advice-hub-hero,.article-hero){
    padding-top:40px!important;
    padding-bottom:40px!important;
  }
  body.ad-unified-masthead :is(.hero h1,.hub-hero h1,.advice-hub-hero h1,.article-hero h1,.gv-hero h1){
    margin-top:11px!important;
    font-size:clamp(2.55rem,12vw,3.55rem)!important;
    line-height:.99!important;
  }
  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{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:26px!important;
  }
  body.ad-unified-masthead:is(.ad-services-hub,.ad-area-hub) .hub-hero>.wrap>*:not(.topic-nav):not(.filters),
  body.ad-unified-masthead.ad-advice-hub .advice-hub-hero>.wrap>*:not(.topic-nav),
  body.ad-unified-masthead.ad-case-hub .hero>.wrap>*:not(.filters),
  body.ad-unified-masthead.ad-advice-hub .topic-nav,
  body.ad-unified-masthead.ad-case-hub .filters{
    grid-column:1!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:2px!important;
  }
  body.ad-unified-masthead.ad-advice-hub .topic-nav,
  body.ad-unified-masthead.ad-case-hub .filters{
    margin-top:2px!important;
  }
  body.ad-unified-masthead.ad-content-page .hero-media,
  body.ad-unified-masthead.ad-advice-page .article-hero figure{
    aspect-ratio:4/3!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:40px!important;
    padding-bottom:26px!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;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    width:calc(100% - 28px)!important;
    min-height:0!important;
    aspect-ratio:4/3!important;
    margin:0 14px 40px!important;
  }
  body.ad-unified-masthead.ad-case-page .gv-facts{
    grid-template-columns:1fr 1fr!important;
  }
}
