/* ==========================================================================
   Block: site footer (template-parts/site/footer.php)
   Navy band. Same container, side padding, column gap and breakpoints as the rest of the site.
   Grid: 1 column on phones; 2 columns from 768px (link groups from 576px); the link row has 4 equal columns
   from 1025px. The top row joins the same 4 columns from 1280px (brand | contact across 2 | brochures), so its
   edges line up with the link row; between 1025 and 1279px it keeps the 2-column layout so the numbers fit.
   Contrast on Midnight: white 16.9:1, Lilac 10.9:1.
   ========================================================================== */

.site-footer {
  background: var(--color-midnight);
  color: var(--color-white);
}
.site-footer :focus-visible { outline-color: var(--color-lilac); } /* the default Midnight ring would vanish on navy */

.site-footer__inner {
  display: grid;
  gap: var(--space-fluid-sm);
  padding-block: var(--space-fluid-md) var(--space-fluid-sm); /* room between the last row and the rooftops */
}

/* Rows ------------------------------------------------------------------ */
.site-footer__top,
.site-footer__middle {
  display: grid;
  gap: var(--space-3);
  column-gap: var(--column-gap);
}
.site-footer__middle {
  padding-top: var(--space-fluid-sm);
  border-top: 1px solid color-mix(in srgb, var(--color-white) 20%, transparent);
}
.site-footer__top > *,
.site-footer__middle > * { min-width: 0; }
.site-footer__nav { display: contents; } /* link groups sit directly in the middle row's grid */

/* Section headings: small caps label in Lilac */
.site-footer__heading {
  margin: 0 0 12px;
  color: var(--color-lilac);
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: var(--font-weight-strong);
  letter-spacing: var(--tracking-eyebrow);
  line-height: var(--lh-tight);
  text-transform: uppercase;
}

/* Brand: logo + approved line -------------------------------------------- */
.site-footer__logo { display: block; width: 224px; max-width: 100%; border-radius: 4px; }
.site-footer__line {
  margin-top: var(--space-2);
  font-family: var(--font-heading);
  font-weight: var(--font-weight-heading);
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); /* each sentence fits one line in the 1025px+ column */
  line-height: 1.25;
  text-wrap: balance;
}
.site-footer__line-accent {
  display: block;
  color: var(--color-lilac);
  font-style: var(--font-heading-style-accent);
}

/* Contact: numbers (components/phone-list, dark theme) + email ------------------- */
.site-footer__email {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--fs-support);
  font-weight: var(--font-weight-strong);
  line-height: 1.3;
  text-align: start;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
  overflow-wrap: anywhere;
}
.site-footer__email { margin-top: var(--space-1); }
.site-footer__email:hover { text-decoration-thickness: 2.5px; }
.site-footer__email .icon { width: 1.3em; height: 1.3em; color: var(--color-lilac); stroke-width: 1.8; }

/* Brochures: components/brochure-links (dark theme) */

/* Link groups -------------------------------------------------------------- */
.site-footer__links { display: grid; gap: 0; }
.site-footer__link {
  display: inline-block;
  padding-block: 5px; /* about 34px per link: above the 24px WCAG 2.2 minimum */
  color: var(--color-white);
  font-size: 1rem;
  line-height: 1.4;
  text-decoration: none;
}
.site-footer__link[href]:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.site-footer__link[aria-disabled="true"] { cursor: default; }

/* CQC widget: CQC's own markup, kept at its natural size */
.site-footer__cqc-widget { max-width: 100%; overflow-x: auto; }

/* Bottom bar: on the white base below the skyline, Midnight text (16.9:1) ------- */
.site-footer__bottom {
  background: var(--color-canvas);
  color: var(--color-midnight);
}
.site-footer__bottom :focus-visible { outline-color: var(--color-focus); } /* back to the Midnight ring on white */
.site-footer__bottom-inner {
  display: grid;
  gap: var(--space-2);
  padding-block: var(--space-fluid-sm) var(--space-3); /* 30-50px clear space under the houses (client request, 13 Nov 2026) */
  font-size: 0.875rem;
  line-height: 1.5;
}
.site-footer__legal-text { display: grid; gap: 4px; }
.site-footer__legal-links { display: flex; flex-wrap: wrap; column-gap: var(--space-2); }
.site-footer__bottom .site-footer__link { color: var(--color-midnight); font-size: 0.875rem; padding-block: 8px; }
.site-footer__social { display: flex; gap: var(--space-1); }
.site-footer__social-link {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 1.5px solid var(--color-midnight);
  border-radius: 50%;
  color: var(--color-midnight);
}
.site-footer__social-link:hover { background: color-mix(in srgb, var(--color-lilac) 35%, var(--color-white)); }
.site-footer__social-link .icon { width: 22px; height: 22px; }

/* Village skyline ("Long Row"), as on the current website: the navy stops 19% above the bottom of the houses,
   so their steps and doorsteps stand on the white base where the bottom bar sits.
   Tiles rendered from the supplied vector (assets/source/illustrations/long-row.svg) at 1202 × 380 (2× the tallest
   display height): AVIF 52 KB, WebP 64 KB, PNG 74 KB, against 1.5 MB for the SVG. 100px tall at 375px, 170px at 1440px, 190px max. */
.site-footer__skyline {
  --skyline-base: 19%; /* share of the houses below the navy (current site: 32px of 168px) */
  height: clamp(100px, 6.5vw + 76px, 190px);
  background:
    url("../../assets/img/skyline-long-row.png") left bottom / auto 100% repeat-x,
    linear-gradient(var(--color-midnight) calc(100% - var(--skyline-base)), var(--color-canvas) 0);
  background:
    image-set(
      url("../../assets/img/skyline-long-row.avif") type("image/avif"),
      url("../../assets/img/skyline-long-row.webp") type("image/webp"),
      url("../../assets/img/skyline-long-row.png") type("image/png")
    ) left bottom / auto 100% repeat-x,
    linear-gradient(var(--color-midnight) calc(100% - var(--skyline-base)), var(--color-canvas) 0);
}

/* Responsive ----------------------------------------------------------------- */
/* Small phones: 16px email so the address stays on one line at 320px */
@media (max-width: 374.98px) {
  .site-footer__email { font-size: 1rem; }
}

@media (min-width: 576px) {
  .site-footer__middle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .site-footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__brand { grid-column: 1 / -1; }
  .site-footer__logo { width: 262px; }
}

@media (min-width: 1025px) {
  /* The CQC widget has a fixed width of about 202px, so its column never goes narrower than that */
  .site-footer__middle { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(210px, 1fr); }
  .site-footer__bottom-inner {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: var(--column-gap);
  }
}

@media (min-width: 1280px) {
  .site-footer__top { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .site-footer__brand { grid-column: auto; }
  .site-footer__contact { grid-column: span 2; }
}
