:root {
  --readability-paper-text: #202522;
  --readability-paper-copy: #454d47;
  --readability-paper-accent: #8f4022;
}

body[data-hero-family="article"] .page-hero h1 em,
body[data-hero-family="journal"] .page-hero h1 em,
body[data-hero-family="contact"] .page-hero h1 em,
body[data-hero-family="utility"] .page-hero h1 em {
  color: var(--readability-paper-accent);
}

body[data-hero-family="contact"] .page-hero-copy > p:not(.breadcrumb):not(.eyebrow) {
  color: var(--readability-paper-copy);
}

body[data-hero-family="article"] .page-hero::after,
body[data-hero-family="journal"] .page-hero::after,
body[data-hero-family="contact"] .page-hero::after,
body[data-hero-family="utility"] .page-hero::after {
  color: var(--readability-paper-copy);
}

/* The footer legal/planned-domain line is useful information, not a decorative fade. */
.footer-bottom {
  color: rgba(244, 240, 232, .62);
}

/* Give the shared service mark its own row on the three-column desktop footer. */
@media (min-width: 781px) {
  .footer-sen-badge {
    grid-column: 1 / -1;
  }

  /* Make hero evidence captions read as useful context, not a faint overlay. */
  body[data-hero-family="service-detail"] .page-hero figure figcaption {
    padding: 10px 13px !important;
    border-color: rgba(240, 191, 124, .7) !important;
    background: rgba(22, 27, 24, .95) !important;
    color: #fffdf8 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    letter-spacing: .01em !important;
    text-transform: none !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .24) !important;
    text-shadow: none !important;
    opacity: 1 !important;
  }

  /* Keep the Moddershall before/after label at its intended larger size.
     Preserve its stronger plaque styling after the shared desktop rule. */
  body[data-page-slug="services-hedge-removal"] .page-hero figure figcaption {
    padding: 11px 14px !important;
    border-color: rgba(240, 191, 124, .76) !important;
    background: rgba(22, 27, 24, .95) !important;
    color: #fffdf8 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    letter-spacing: .01em !important;
    text-transform: none !important;
  }
}

/* These longer hero labels sit beneath the always-visible phone contact strip
   on the first viewport. Keep the page readable on a phone: image alt text
   remains available, and the supplemental figure text stays in the SR tree. */
@media (max-width: 719px) {
  body[data-page-slug="discounts"] .page-hero figure figcaption,
  body[data-page-slug="fencing-stoke-on-trent"] .page-hero figure figcaption,
  body[data-page-slug="guarantee"] .page-hero figure figcaption,
  body[data-page-slug="how-we-install"] .page-hero figure figcaption,
  body[data-page-slug="privacy"] .page-hero figure figcaption {
    position: absolute !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 1px !important;
    max-width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
}

/* Short phone viewports cannot show the service-photo label without covering
   the trust proof row or the fixed contact strip. Preserve it for assistive
   technology and keep the larger phone/desktop/tablet composition unchanged. */
@media (max-width: 719px) and (max-height: 820px) {
  body[data-hero-family="service-detail"] .page-hero figure figcaption {
    position: absolute !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 1px !important;
    max-width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
}

/* Keep service-photo labels above the shared image shade while leaving the
   hero copy above the photo. A z-indexed figure trapped the caption below the
   hero's darkening layer, making white text look washed out. */
body[data-hero-family="service-detail"] .page-hero figure {
  z-index: auto !important;
}

@media (max-width: 780px) {
  body[data-hero-family="service-detail"] .page-hero figure figcaption {
    padding: 10px 12px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    letter-spacing: .01em !important;
    text-transform: none !important;
  }

  /* Keep this label clear of the last row of trust badges and phone actions. */
  body[data-page-slug="services-feather-edge"] .page-hero figure figcaption {
    bottom: 72px !important;
  }
}

/* Use the same professional gold medallion in the full Guarantee certificate
   as in the permanent rail and offer card. The written terms stay live text. */
body[data-hero-family="trust"] .certificate-mark {
  position: relative;
  display: block;
  width: clamp(150px, 18vw, 220px);
  min-height: clamp(150px, 18vw, 220px);
  margin: 48px 0 36px;
  background: url("https://pub-1d542a98f8394fe2b5659d7da04262d1.r2.dev/images/gold-guarantee-seal-v1.png") center / contain no-repeat;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .28));
}

body[data-hero-family="trust"] .certificate-mark span,
body[data-hero-family="trust"] .certificate-mark i {
  opacity: 0;
}

body[data-hero-family="trust"] .certificate-mark span {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0 !important;
  color: #4b3616 !important;
  font-size: 0 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .52);
  opacity: 1;
}

body[data-hero-family="trust"] .certificate-mark span::before {
  content: "5";
  display: block;
  font: 700 clamp(3.2rem, 6vw, 4.8rem) / .78 Arial, "Helvetica Neue", sans-serif;
  letter-spacing: -.08em;
}

body[data-hero-family="trust"] .certificate-mark span::after {
  content: "YEAR\A GUARANTEE";
  display: block;
  margin-top: 7px;
  white-space: pre;
  font: 700 8px / 1.18 Arial, "Helvetica Neue", sans-serif;
  letter-spacing: .1em;
}

@media (max-width: 780px) {
  body[data-hero-family="trust"] .certificate-mark {
    width: 154px;
    min-height: 154px;
    margin: 34px 0 28px;
  }
}

/* The offers route has five cards. On a wide desktop, let the final
   workmanship card close the grid as an intentional full-width panel rather
   than leaving a large, empty half-column beside it. Tablet and phone already
   collapse the grid to one column in the base stylesheet. */
@media (min-width: 1051px) {
  .discount-card-grid > .discount-card-dark:last-child {
    grid-column: 1 / -1;
    grid-template-columns: 116px minmax(0, 1fr);
    align-items: center;
    padding: 34px 42px;
  }
}

/* The About pillars use a light card surface in the refined route treatment;
   override the older dark-section copy colour so the supporting explanation
   remains comfortable for older readers. */
body[data-hero-family="about"] .about-pillar p {
  color: #4a514b !important;
}

/* Bring the article pages' truthful author/date metadata onto the Journal
   cards without making the category and reading-time line harder to scan. */
body[data-hero-family="journal"] .blog-card .blog-card-date {
  display: block;
  margin-top: 6px;
  color: #59615b;
  font-size: 9px;
  font-style: normal;
  letter-spacing: .08em;
  line-height: 1.35;
  text-transform: uppercase;
}

/* Give the Services hub a second, plain-English route into the catalogue:
   visitors can begin with the job they need to solve rather than guessing a
   material name. Keep the cards dark and quiet so this acts as a useful
   decision bridge between the full service list and the quote CTA. */
body[data-hero-family="services"] .service-choice-section {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
  gap: clamp(42px, 7vw, 110px);
  align-items: start;
  max-width: none;
  background: var(--white);
}

body[data-hero-family="services"] .service-choice-intro {
  max-width: 520px;
}

body[data-hero-family="services"] .service-choice-intro h2 {
  margin-bottom: 28px;
}

body[data-hero-family="services"] .service-choice-intro > p:last-child {
  max-width: 430px;
  font-size: 18px;
  line-height: 1.5;
}

body[data-hero-family="services"] .service-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body[data-hero-family="services"] .service-choice-card {
  position: relative;
  display: flex;
  min-height: 190px;
  flex-direction: column;
  gap: 9px;
  padding: 24px 26px 22px;
  border-top: 3px solid var(--amber);
  background: var(--ink);
  color: var(--paper);
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}

body[data-hero-family="services"] .service-choice-card:hover,
body[data-hero-family="services"] .service-choice-card:focus-visible {
  background: #2b332e;
  box-shadow: 0 16px 34px rgba(20, 28, 24, .16);
  transform: translateY(-3px);
}

body[data-hero-family="services"] .service-choice-label {
  color: var(--amber);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.3;
  text-transform: uppercase;
}

body[data-hero-family="services"] .service-choice-card strong {
  max-width: 260px;
  color: var(--white);
  font-size: 23px;
  letter-spacing: -.05em;
  line-height: 1.02;
}

body[data-hero-family="services"] .service-choice-card > span:not(.service-choice-label) {
  max-width: 300px;
  color: rgba(244, 240, 232, .76);
  font-size: 14px;
  line-height: 1.45;
}

body[data-hero-family="services"] .service-choice-card b {
  position: absolute;
  right: 20px;
  bottom: 17px;
  color: var(--amber);
  font-size: 22px;
  font-weight: 400;
}

/* Keep homeowner decision cards readable beside the permanent rail, and avoid
   stacking two full section paddings into an oversized gap on wide screens. */
@media (min-width: 1161px) {
  body[data-hero-family="services"] .service-choice-section {
    padding-bottom: clamp(64px, 6vw, 88px);
  }

  body[data-hero-family="services"] .service-comparison-section {
    padding-top: clamp(64px, 6vw, 88px);
  }
}

@media (min-width: 781px) and (max-width: 1160px) {
  body[data-hero-family="services"] .service-choice-section,
  body[data-hero-family="services"] .service-comparison-section {
    display: block;
    padding: clamp(64px, 7vw, 82px) clamp(24px, 4vw, 46px);
  }

  body[data-hero-family="services"] .service-choice-intro {
    max-width: 680px;
    margin-bottom: 32px;
  }

  body[data-hero-family="services"] .service-choice-grid,
  body[data-hero-family="services"] .service-comparison-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-hero-family="services"] .service-comparison-intro {
    max-width: 760px;
    margin-bottom: 32px;
  }

  body[data-hero-family="services"] .service-comparison-grid {
    margin-top: 0;
  }

  body[data-hero-family="services"] .service-comparison-card {
    min-height: 190px;
    padding: 20px;
  }
}

@media (max-width: 780px) {
  body[data-hero-family="services"] .service-choice-section {
    display: block;
  }

  body[data-hero-family="services"] .service-choice-intro {
    margin-bottom: 38px;
  }

  body[data-hero-family="services"] .service-choice-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body[data-hero-family="services"] .service-choice-card {
    min-height: 164px;
    padding: 22px 22px 21px;
  }
}

/* Keep the fixed picture-led footer behind Home content throughout the tablet rail band. */
@media (min-width: 781px) and (max-width: 980px) {
  body[data-hero-family="home"] main {
    position: relative;
    z-index: 1;
  }

  /* Give long gallery provenance captions a stable reading band at tablet rail widths. */
  body[data-hero-family="work"] .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  body[data-hero-family="work"] .gallery-grid figure,
  body[data-hero-family="work"] .gallery-grid figure:nth-child(3n),
  body[data-hero-family="work"] .gallery-grid figure:nth-child(4n) {
    display: flex;
    flex-direction: column;
    aspect-ratio: auto;
    height: auto;
  }

  body[data-hero-family="work"] .gallery-grid figure img {
    flex: 0 0 auto;
    aspect-ratio: 1.08;
    height: auto;
  }

  body[data-hero-family="work"] .gallery-grid figcaption {
    position: static;
    display: block;
    min-height: 76px;
    padding: 11px 10px 12px;
    background: #202522;
    font-size: 10px;
    line-height: 1.35;
    letter-spacing: .07em;
  }

  body[data-hero-family="work"] .gallery-grid figcaption b,
  body[data-hero-family="work"] .gallery-grid figcaption span {
    display: block;
    text-align: left;
  }

  body[data-hero-family="work"] .gallery-grid figcaption span {
    margin-top: 5px;
    color: rgba(244, 240, 232, .78);
  }

  /* Keep service evidence captions readable beside the permanent rail. */
  body[data-hero-family="service-detail"] .page-hero figure figcaption {
    right: 26px !important;
    bottom: 78px !important;
    max-width: min(340px, 38vw) !important;
    padding: 10px 13px !important;
    border-color: rgba(240, 191, 124, .7) !important;
    background: rgba(22, 27, 24, .95) !important;
    color: #fffdf8 !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    letter-spacing: .06em !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .24) !important;
    text-shadow: none !important;
    opacity: 1 !important;
  }
}

/* Keep revealed content visible as it moves so it cannot expose the fixed
   scenic footer during section-to-section scrolling. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal-item {
    opacity: 1;
    transform: translateY(8px);
    transition: transform .24s cubic-bezier(.22, .8, .2, 1);
    transition-delay: min(var(--reveal-delay, 0ms), 80ms);
  }

  .js .reveal-item.is-visible {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
}

/* Cover the fixed Home footer behind page sections, leaving only the deliberate
   bottom padding transparent for the picture-led close. */
@media (min-width: 761px) {
  body[data-hero-family="home"] main {
    background-color: var(--paper) !important;
    background-clip: content-box !important;
  }
}

/* Keep the fixed Home footer completely out of the scroll stack until the
   page reaches its reserved closing space. This preserves the picture-led
   finish without letting it flicker through earlier photographs. */
@media (min-width: 781px) {
  body[data-hero-family="home"]:not(.home-footer-reveal-active) .site-footer {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: none !important;
  }

  body[data-hero-family="home"].home-footer-reveal-active .site-footer,
  body[data-hero-family="home"] .site-footer:focus-within {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: opacity .24s ease !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-hero-family="home"].home-footer-reveal-active .site-footer,
  body[data-hero-family="home"] .site-footer:focus-within {
    transition: none !important;
  }
}

/* Reflow service-detail cards around the remaining reading width beside the fixed rail. */
@media (min-width: 821px) and (max-width: 1100px) {
  body[data-hero-family="service-detail"] .service-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 761px) and (max-width: 820px) {
  body[data-hero-family="service-detail"] .service-feature-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Keep the service story image and heading readable in the narrow space beside the rail. */
@media (min-width: 761px) and (max-width: 840px) {
  body[data-hero-family="service-detail"] .service-detail-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 32px !important;
  }
}

@media (min-width: 841px) and (max-width: 920px) {
  body[data-hero-family="service-detail"] .service-detail-grid {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) !important;
    gap: clamp(22px, 3vw, 28px) !important;
  }

  body[data-hero-family="service-detail"] .service-detail-grid h2 {
    font-size: clamp(2.1rem, 4vw, 2.6rem) !important;
    line-height: .98 !important;
  }
}

@media (min-width: 781px) and (max-width: 920px) {
  body[data-hero-family="service-detail"] .service-photo-checklist-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 26px !important;
  }
}

/* Keep the SEN hero headline inside its reading column beside the photo on desktop. */
@media (min-width: 1051px) {
  body[data-hero-family="sen"] .page-hero figure {
    width: 50% !important;
  }

  body[data-hero-family="sen"] .page-hero h1 {
    font-size: clamp(3.1rem, 4.4vw, 4.1rem) !important;
  }
}

/* Keep the Stoke local-area hero copy clear of its full-height photograph on desktop. */
@media (min-width: 981px) {
  body[data-hero-family="local"] .page-hero figure {
    width: 52% !important;
  }

  body[data-hero-family="local"] .page-hero-copy {
    width: min(350px, 100%) !important;
    max-width: 100% !important;
  }

  body[data-hero-family="local"] .page-hero-copy > p:not(.breadcrumb):not(.eyebrow) {
    max-width: 100% !important;
  }

  body[data-hero-family="local"] .page-hero-copy .hero-actions {
    flex-wrap: wrap !important;
  }

  body[data-hero-family="local"] .page-hero h1 {
    font-size: clamp(3rem, 4.4vw, 4.1rem) !important;
    line-height: .94 !important;
  }
}

/* Let the whole phone-assistant prompt fit without making Send a tall column. */
@media (max-width: 780px) {
  body[data-site-panel="true"] .kieran-assistant .assistant-form textarea {
    min-height: 88px !important;
  }

  body[data-site-panel="true"] .kieran-assistant .assistant-form .assistant-send {
    align-self: end !important;
    height: 52px !important;
    min-height: 52px !important;
  }
}

/* Separate each Our Work photo's category from its plain-English caption. */
body[data-hero-family="work"] .work-library .gallery-grid figcaption {
  display: grid !important;
  justify-items: start !important;
  align-content: end !important;
  gap: 4px !important;
  padding: 34px 14px 12px !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
  letter-spacing: .01em !important;
  text-align: left !important;
  text-transform: none !important;
}

body[data-hero-family="work"] .work-library .gallery-grid figcaption b {
  display: block !important;
  color: var(--amber) !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  letter-spacing: .08em !important;
  text-align: left !important;
  text-transform: uppercase !important;
}

body[data-hero-family="work"] .work-library .gallery-grid figcaption span {
  display: block !important;
  color: rgba(244, 240, 232, .92) !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
  letter-spacing: .01em !important;
  text-align: left !important;
  text-transform: none !important;
}

/* Break the privacy explanation into clear, roomy reading cards beside the permanent rail. */
.privacy-control-heading {
  max-width: 760px;
}

.privacy-control-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 40px;
}

.privacy-control-grid .service-feature {
  min-height: 0;
}

.privacy-control-grid .service-feature p {
  color: var(--muted-text);
  font-size: 16px;
  line-height: 1.55;
}

.privacy-contact-note {
  max-width: 850px;
  margin-top: 28px;
}

@media (min-width: 841px) and (max-width: 1100px) {
  .privacy-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 781px) and (max-width: 840px) {
  .privacy-control-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
