/*
Theme Name: East Coast Millwork
Theme URI:
Author: AM Web Design
Author URI:
Description: Custom WordPress theme for East Coast Millwork — bespoke cabinetry, furniture, and architectural millwork in Naples, FL. Ported from the East Coast Millwork Design System (Fraunces + Hanken Grotesk, brass-on-espresso, square corners). This is a faithful port of the static design export; it is intentionally not yet responsive.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: east-coast-millwork
*/

/* ============================================================
   DESIGN TOKENS  — ported verbatim from the design system's
   tokens/colors.css, typography.css, spacing.css, elevation.css.
   (The Google Fonts @import is handled in functions.php so it
   loads as a normal stylesheet rather than a CSS @import.)
   ============================================================ */

:root {
  /* --- COLORS ----------------------------------------------- */
  /* Wood darks */
  --espresso: #241C16;   /* darkest — dark bands, footer, headlines on light */
  --walnut:   #4A382A;   /* rich brown — secondary dark, wood tone */

  /* Brass (the single accent) */
  --brass:       #A9823F; /* primary accent — eyebrows, links, CTA fill, rules */
  --brass-light: #C2A36B; /* hover / lighter accent, fine lines on dark */
  --brass-deep:  #8A6A30; /* pressed / active accent */

  /* Warm neutral backgrounds */
  --linen: #F7F3EC;  /* primary page background */
  --ivory: #FBF8F2;  /* lighter surface, cards on linen */
  --sand:  #ECE4D6;  /* alt section background, subtle blocks */
  --white: #FFFFFF;  /* image cards, contrast surfaces */

  /* Text */
  --ink:        #2A211B; /* body headlines */
  --text:       #5A5048; /* body copy */
  --text-muted: #8A8077; /* captions, meta, footer secondary */

  /* Semantic aliases — surfaces */
  --surface-page:    var(--linen);
  --surface-card:    var(--ivory);
  --surface-alt:     var(--sand);
  --surface-dark:    var(--espresso);
  --surface-dark-2:  var(--walnut);
  --surface-image:   var(--white);

  /* Text roles */
  --text-heading:    var(--ink);
  --text-body:       var(--text);
  --text-meta:       var(--text-muted);
  --text-on-dark:    #F2EBDD;        /* warm off-white for copy on espresso */
  --text-on-dark-muted: #B9AC97;

  /* Accent roles */
  --accent:          var(--brass);
  --accent-hover:    var(--brass-light);
  --accent-active:   var(--brass-deep);
  --link:            var(--brass);

  /* Lines & borders */
  --border-hairline: rgba(36, 28, 22, 0.14);   /* thin divider on light */
  --border-strong:   var(--espresso);
  --border-on-dark:  rgba(194, 163, 107, 0.32); /* brass hairline on dark */
  --rule-brass:      var(--brass);              /* the short eyebrow rule */

  /* --- TYPOGRAPHY ------------------------------------------- */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Hanken Grotesk", system-ui, Arial, sans-serif;
  --font-utility: "Hanken Grotesk", system-ui, Arial, sans-serif; /* eyebrows/labels */

  --weight-display:  400;
  --weight-card:     500;
  --weight-body:     400;
  --weight-medium:   500;
  --weight-eyebrow:  600;

  --fs-hero:    72px;
  --fs-h2:      44px;
  --fs-h3:      22px;
  --fs-lede:    20px;
  --fs-body:    17px;
  --fs-small:   13px;
  --fs-eyebrow: 13px;

  --lh-hero:  1.05;
  --lh-h2:    1.1;
  --lh-h3:    1.2;
  --lh-body:  1.6;
  --lh-meta:  1.4;

  --ls-hero:    -0.01em;
  --ls-tight:   -0.005em;
  --ls-body:     0;
  --ls-meta:     0.04em;
  --ls-eyebrow:  0.18em;

  --type-hero:    var(--weight-display) var(--fs-hero)/var(--lh-hero) var(--font-display);
  --type-h2:      var(--weight-display) var(--fs-h2)/var(--lh-h2) var(--font-display);
  --type-h3:      var(--weight-card) var(--fs-h3)/var(--lh-h3) var(--font-display);
  --type-body:    var(--weight-body) var(--fs-body)/var(--lh-body) var(--font-body);

  /* --- SPACING & LAYOUT ------------------------------------- */
  --space-0:   0px;
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   24px;
  --space-6:   32px;
  --space-7:   48px;
  --space-8:   64px;
  --space-9:   96px;
  --space-10: 128px;

  --section-y:        96px;
  --section-y-mobile: 56px;

  --container-max: 1240px;
  --gutter:        24px;
  --grid-cols:     12;

  --rule-len: 32px;   /* signature brass eyebrow rule */
  --radius: 0px;      /* square everywhere — architectural, deliberate */
  --border-width: 1px;

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast:  200ms;
  --dur-base:  400ms;
  --dur-slow:  600ms;
  --reveal-rise: 20px;

  /* --- ELEVATION (shadows are essentially absent) ----------- */
  --shadow-none: none;
  --shadow-hairline: 0 1px 2px rgba(36, 28, 22, 0.06);
  --shadow-image:    0 1px 3px rgba(36, 28, 22, 0.08);
  --elevation-card: var(--shadow-none);
}

/* ============================================================
   BASE RESET — ported from the inline <style> block that was
   in the head of every exported page.
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  background: var(--linen);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; }

/* Lucide swaps each <i data-lucide> for an <svg>; keep icons inline-centered
   and flat, matching the DS Icon primitive. */
.ecm-icon svg { display: inline-block; }

/* ============================================================
   HEADER / PRIMARY NAV
   Shared chrome (header.php). The header is fixed and transparent over the
   dark hero, then becomes a blurred solid linen bar once scrolled past the
   hero — ecm-site.js toggles .ecm-header--solid. Mirrors InnerHeader in
   the design system's site.jsx. Colour states are handled here; layout
   stays inline in header.php.
   ============================================================ */

.ecm-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 300ms var(--ease-out), border-color 300ms var(--ease-out);
}
.ecm-header--solid {
  background: rgba(247, 243, 236, 0.86);
  -webkit-backdrop-filter: saturate(118%) blur(8px);
  backdrop-filter: saturate(118%) blur(8px);
  border-bottom: 1px solid var(--border-hairline);
}

/* Header legibility scrim — a subtle dark gradient behind the header content so
   the white wordmark + hamburger stay readable over photo heroes. It sits in
   the header's own stacking context at z-index:-1, so it's ABOVE the hero image
   but BELOW the logo/nav (which it must not dim). Only on pages that actually
   have a hero (body.ecm-has-hero), and it fades out the moment the header turns
   into the solid scrolled bar — so the scrolled state is unchanged. */
.ecm-has-hero .ecm-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 130px;
  background: linear-gradient(to bottom, rgba(36, 28, 22, 0.55) 0%, rgba(36, 28, 22, 0) 100%);
  pointer-events: none;
  z-index: -1;
  transition: opacity 300ms var(--ease-out);
}
.ecm-has-hero .ecm-header--solid::before { opacity: 0; }

/* Pages WITHOUT a photo hero (body:not(.ecm-has-hero), e.g. a plain page.php or
   404) have no dark backdrop for the transparent header to sit over, so the header
   renders in its solid, legible state from the very top — no JS required. This
   mirrors the .ecm-header--solid colours; the JS scroll toggle then simply keeps
   it solid. Scoped by body class, so hero pages are completely unaffected. */
body:not(.ecm-has-hero) .ecm-header {
  background: rgba(247, 243, 236, 0.86);
  -webkit-backdrop-filter: saturate(118%) blur(8px);
  backdrop-filter: saturate(118%) blur(8px);
  border-bottom: 1px solid var(--border-hairline);
}
body:not(.ecm-has-hero) .ecm-wordmark { color: var(--ink); }
body:not(.ecm-has-hero) .ecm-nav a { color: var(--text); }
body:not(.ecm-has-hero) .ecm-nav a:hover { color: var(--ink); }
body:not(.ecm-has-hero) .ecm-nav .current-menu-item > a,
body:not(.ecm-has-hero) .ecm-nav .current_page_item > a,
body:not(.ecm-has-hero) .ecm-nav .ecm-current > a {
  color: var(--ink);
  border-bottom: 2px solid var(--brass);
}
body:not(.ecm-has-hero) .ecm-header__cta {
  background: var(--espresso);
  color: var(--text-on-dark);
  border: 1px solid var(--espresso);
}
body:not(.ecm-has-hero) .ecm-header__cta:hover { background: var(--walnut); border-color: var(--walnut); }
body:not(.ecm-has-hero) .ecm-nav-toggle__line { background: var(--ink); }

.ecm-header__bar {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Wordmark */
.ecm-wordmark {
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 23px;
  letter-spacing: 0.01em;
  line-height: 1.05;
  text-decoration: none;
  color: #FBF8F2;
  transition: color 250ms ease;
}
.ecm-header--solid .ecm-wordmark { color: var(--ink); }
.ecm-wordmark__name { display: inline-flex; flex-direction: column; line-height: 1.05; }
.ecm-wordmark__sub { letter-spacing: 0.16em; }
/* EC mark sits left of the live-text wordmark, vertically centred with it. */
.ecm-wordmark { display: inline-flex; align-items: center; gap: 14px; }
.ecm-wordmark__mark { height: 44px; width: auto; }

/* Nav list */
.ecm-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 30px;
  align-items: center;
}
.ecm-nav li { margin: 0; }
.ecm-nav a {
  display: inline-block;
  padding: 4px 0;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: rgba(251, 248, 242, 0.86);
  border-bottom: 2px solid transparent;
  transition: color 250ms ease;
}
.ecm-nav a:hover { color: #FBF8F2; }
.ecm-nav .current-menu-item > a,
.ecm-nav .current_page_item > a,
.ecm-nav .ecm-current > a {
  color: #FBF8F2;
  border-bottom: 2px solid var(--brass);
}
.ecm-header--solid .ecm-nav a { color: var(--text); }
.ecm-header--solid .ecm-nav a:hover { color: var(--ink); }
.ecm-header--solid .ecm-nav .current-menu-item > a,
.ecm-header--solid .ecm-nav .current_page_item > a,
.ecm-header--solid .ecm-nav .ecm-current > a {
  color: var(--ink);
  border-bottom: 2px solid var(--brass);
}

/* "Book a Consultation" — outline-on-hero, then solid espresso button. */
.ecm-header__cta {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  border: 1px solid rgba(251, 248, 242, 0.55);
  background: transparent;
  color: #FBF8F2;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0;
  transition: background var(--dur-fast,200ms) var(--ease-out), color var(--dur-fast,200ms) var(--ease-out), border-color var(--dur-fast,200ms) var(--ease-out);
}
.ecm-header--solid .ecm-header__cta {
  background: var(--espresso);
  color: var(--text-on-dark);
  border: 1px solid var(--espresso);
  padding: 11px 22px;
}
.ecm-header--solid .ecm-header__cta:hover { background: var(--walnut); border-color: var(--walnut); }
/* Transparent-on-hero state (header not yet solid): fill softly + brighten border on hover. */
.ecm-has-hero .ecm-header:not(.ecm-header--solid) .ecm-header__cta:hover {
  background: rgba(251, 248, 242, 0.14);
  border-color: rgba(251, 248, 242, 0.9);
}

/* ============================================================
   BUTTON / LINK HOVER STATES
   Idle styling is INLINE (ecm_button helper), which outranks a plain :hover
   selector — so the colour changes below are scoped-!important to win over the
   inline background/border/color, and the transition is re-declared to include
   transform (the inline transition omits it) so the lift animates. Idle
   appearance is untouched. Filled buttons deepen + lift; ghost buttons fill +
   lift.
   ============================================================ */
.ecm-btn-primary,
.ecm-btn-secondary {
  transition: background var(--dur-fast,200ms) var(--ease-out), color var(--dur-fast,200ms) var(--ease-out), border-color var(--dur-fast,200ms) var(--ease-out), transform var(--dur-fast,200ms) var(--ease-out) !important;
}
.ecm-btn-primary:not(.ecm-btn-ondark):hover {
  background: var(--walnut) !important;
  border-color: var(--walnut) !important;
  transform: translateY(-2px);
}
.ecm-btn-primary.ecm-btn-ondark:hover {
  background: var(--brass-deep) !important;
  border-color: var(--brass-deep) !important;
  transform: translateY(-2px);
}
.ecm-btn-secondary:not(.ecm-btn-ondark):hover {
  background: var(--espresso) !important;
  color: var(--text-on-dark) !important;
  border-color: var(--espresso) !important;
  transform: translateY(-2px);
}
.ecm-btn-secondary.ecm-btn-ondark:hover {
  background: var(--brass) !important;
  color: #fff !important;
  border-color: var(--brass) !important;
  transform: translateY(-2px);
}

/* Brass text links (e.g. "View Full Portfolio →") nudge their arrow on hover. */
.ecm-brass-link { cursor: pointer; }
.ecm-brass-link .ecm-arrow { display: inline-block; transition: transform var(--dur-fast,200ms) var(--ease-out); }
.ecm-brass-link:hover .ecm-arrow { transform: translateX(4px); }

/* Project / expertise card image + arrow hover behaviour. */
.ecm-card-img { overflow: hidden; }
.ecm-card-img img { transition: transform var(--dur-slow,600ms) var(--ease-out), opacity var(--dur-base,400ms) var(--ease-out); }
.ecm-project-card:hover .ecm-card-img img { transform: scale(1.03); opacity: 0.96; }
.ecm-project-card .ecm-arrow,
.ecm-expertise-card .ecm-arrow { display: inline-block; transition: transform var(--dur-fast,200ms) var(--ease-out); }
.ecm-project-card:hover .ecm-arrow,
.ecm-expertise-card:hover .ecm-arrow { transform: translateX(5px); }
.ecm-expertise-card:hover .ecm-exp-img img { opacity: 0.9; }
.ecm-exp-img img { transition: opacity var(--dur-base,400ms) var(--ease-out); }

/* ============================================================
   HERO SLIDESHOW (homepage) — crossfade + indicator dots.
   Reproduces the React slideshow from home.jsx with vanilla JS.
   ============================================================ */
.ecm-hero-slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 1500ms ease;
}
.ecm-hero-slide.is-active { opacity: 1; }
.ecm-hero-dot {
  width: 10px; height: 3px;
  padding: 0; border: none; border-radius: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.5);
  transition: width 400ms ease, background 400ms ease;
}
.ecm-hero-dot.is-active { width: 30px; background: var(--brass); }

/* ============================================================
   RESPONSIVE  — tablet & mobile only.
   The static port is desktop-only and lays everything out with INLINE
   styles, which beat normal selectors on the cascade. So every override
   below either (a) lives inside a max-width media query and uses
   !important to win over the inline value, or (b) targets an element that
   is hidden on desktop. Desktop (>=1025px) therefore renders byte-for-byte
   as before — nothing here applies at that width.

   Breakpoints:  tablet <=1024px   mobile <=767px   small phone <=480px
   ============================================================ */

/* --- Global safety nets (no-ops at desktop widths) ---------------------- */
/* overflow-x:clip (not hidden) stops sideways scroll WITHOUT creating a
   scroll container; `hidden` here silently broke position:sticky on the
   services cards. clip is the targeted fix — keeps the global safety net. */
html, body { overflow-x: clip; }              /* kill any sideways scroll  */
img { max-width: 100%; height: auto; }        /* inline w/h still win where set */

/* --- Hamburger toggle: present in markup at all widths, but only shown
       below 1025px. display:none keeps it out of the desktop flex bar. --- */
.ecm-nav-toggle {
  display: none;
  width: 44px; height: 44px;
  padding: 0; margin: 0;
  border: none; background: transparent; cursor: pointer;
  align-items: center; justify-content: center;
}
.ecm-nav-toggle__box { position: relative; display: block; width: 26px; height: 18px; }
.ecm-nav-toggle__line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: #FBF8F2;                          /* legible over the dark hero */
  transition: background 250ms ease;
}
.ecm-nav-toggle__line:nth-child(1) { top: 0; }
.ecm-nav-toggle__line:nth-child(2) { top: 50%; transform: translateY(-50%); }
.ecm-nav-toggle__line:nth-child(3) { bottom: 0; }
.ecm-header--solid .ecm-nav-toggle__line { background: var(--ink); } /* legible on linen */

/* --- Full-screen mobile overlay: hidden (and inert) until .is-open. ------ */
.ecm-mobile-nav {
  position: fixed; inset: 0; z-index: 60;       /* above the fixed header (50) */
  background: var(--espresso);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 300ms var(--ease-out), visibility 300ms var(--ease-out);
}
.ecm-mobile-nav.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.ecm-mobile-nav__close {
  position: absolute; top: 16px; right: 16px;
  width: 48px; height: 48px;                     /* >=48px tap target */
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--brass-light); font-size: 36px; line-height: 1;
}
.ecm-mobile-nav__inner { display: flex; flex-direction: column; align-items: center; }
.ecm-mobile-nav__list { list-style: none; margin: 0; padding: 0; text-align: center; }
.ecm-mobile-nav__list li { margin: 0; }
.ecm-mobile-nav__list a {
  display: flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 4px 16px;           /* generous tap target */
  font-family: var(--font-display); font-weight: 400;
  font-size: 30px; line-height: 1.2;
  color: var(--text-on-dark); text-decoration: none;
  transition: color 200ms ease;
}
.ecm-mobile-nav__list a:hover,
.ecm-mobile-nav__list .ecm-current > a { color: var(--brass-light); }
.ecm-mobile-nav__cta {
  margin-top: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 14px 38px;
  background: var(--brass); color: #fff;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  border: 1px solid var(--brass);
  transition: background var(--dur-fast,200ms) var(--ease-out), border-color var(--dur-fast,200ms) var(--ease-out);
}
.ecm-mobile-nav__cta:hover { background: var(--brass-deep); border-color: var(--brass-deep); }

/* ============================================================
   TABLET and below  (<= 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  /* Header: swap the inline 7-item nav + CTA for the hamburger. */
  .ecm-nav,
  .ecm-header__cta { display: none !important; }
  .ecm-nav-toggle  { display: inline-flex; }

  /* Hero: svh height (so mobile browser chrome can't crop it) + fluid type.
     At 1024px clamp() resolves close to the desktop size, so the jump across
     the breakpoint is small; it then scales down on smaller screens. */
  [data-ecm-slideshow] { min-height: 100svh !important; }
  #about-hero          { min-height: 70svh  !important; }
  .ecm-hero-title { font-size: clamp(2.25rem, 6vw, 3.5rem) !important; }
  .ecm-hero-sub   { font-size: clamp(1rem, 2.4vw, 1.125rem) !important; }

  /* ----------------------------------------------------------------------
     NEW MOBILE/TABLET HERO (<=1024px): "image top, espresso text band below".
     The section becomes a vertical flex column filling the viewport; the image
     area shows the WHOLE landscape slide (no crop), and the hero text moves
     into a solid espresso band beneath it. Desktop (>=1025px) is untouched.
     ---------------------------------------------------------------------- */
  [data-ecm-slideshow] {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  /* Image area: sized to the slides' aspect (~1.55:1) so the whole image shows
     with no letterbox; capped so wide/landscape screens still leave room for
     the band. Espresso backing blends any sliver into the band seamlessly. */
  .ecm-hero-media {
    position: relative !important;
    inset: auto !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    aspect-ratio: 1800 / 1162;
    max-height: 62svh;
    background: var(--espresso);
    overflow: hidden;
    z-index: 0;
  }
  /* Show the complete image (contain) rather than the desktop cover-crop. */
  .ecm-hero-slide { object-fit: contain !important; object-position: center !important; }

  /* No scrim on mobile — the text lives in the solid band, not over the image. */
  .ecm-hero-scrim { display: none !important; }

  /* Text band: solid espresso, fills the rest of the height, content centered. */
  .ecm-hero-content {
    position: relative !important;
    z-index: 2;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 32px var(--gutter) !important;
    background: var(--espresso) !important;
  }
  .ecm-hero-content > div { max-width: 100% !important; width: 100%; }

  /* Indicator dots float over the bottom of the image strip. */
  .ecm-hero-dots {
    bottom: auto !important;
    top: calc((100vw / 1.549) - 30px) !important;
  }

  /* Section grids step down one level. */
  .ecm-grid-4,            /* Expertise / Values: 4 -> 2 */
  .ecm-grid-3,            /* Featured projects: 3 -> 2 */
  .ecm-grid-process {     /* Process band: 4 -> 2x2 */
    grid-template-columns: 1fr 1fr !important;
  }

  /* About values (page-about.php §3): on desktop the first card is flush-left with
     no rule (leftmost of four columns); items 2-4 are indented against a hairline
     rule. Once the grid reflows the first card no longer leads a row, so its flush
     style makes it stick out. Give it the same rule + indent as the other three so
     all four align. !important overrides the inline PHP styles; scoped to
     .ecm-values-grid so the front-page Expertise grid is untouched. */
  .ecm-values-grid > div:first-child {
    border-left: 1px solid var(--border-hairline) !important;
    padding-left: 28px !important;
  }

  /* Two-column splits stack; the first child (image, or quote in the
     testimonial) ends up on top, as required. */
  .ecm-split     { grid-template-columns: 1fr !important; }
  .ecm-split-img { min-height: 340px !important; }

  /* About story (page-about.php §2): opt this one split OUT of image-first so the
     origin-story TEXT stacks above its photo. Without this the hero image and the
     story photo sit back-to-back on phones; the text now separates them. Scoped to
     the .ecm-split--rev-mobile modifier so every other .ecm-split is unaffected. */
  .ecm-split--rev-mobile .ecm-split-img { order: 2 !important; }

  /* Services alternating rows: force image on top regardless of DOM order. */
  .ecm-svc-row { grid-template-columns: 1fr !important; }
  .ecm-svc-img { order: -1; min-height: 320px !important; }

  /* Footer 4 -> 2. */
  .ecm-footer-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ============================================================
   MOBILE  (<= 767px)
   ============================================================ */
@media (max-width: 767px) {
  /* Roughly halve vertical rhythm: this token is consumed by the
     "padding: var(--section-y) 0" sections inline, so overriding it here
     reflows them all at once. Fixed-px bands use .ecm-pad-band below. */
  :root { --section-y: 48px; }

  /* Everything collapses to a single column... */
  .ecm-grid-4,
  .ecm-grid-3,
  .ecm-grid-process,
  .ecm-vp-grid,
  .ecm-footer-grid { grid-template-columns: 1fr !important; }

  /* ...except the by-the-numbers strip and material swatches: 2 x 2. */
  .ecm-grid-half { grid-template-columns: 1fr 1fr !important; }

  /* Halve the fixed-padding bands (process, CTAs, testimonial, services
     teaser). Only top/bottom are touched, so inline side gutters survive. */
  .ecm-pad-band { padding-top: 48px !important; padding-bottom: 48px !important; }
  .ecm-footer-grid { padding-top: 48px !important; }

  /* Closing CTA: heading over a full-width button. */
  .ecm-cta-band { flex-direction: column !important; align-items: flex-start !important; }
  .ecm-cta-band .ecm-button { width: 100% !important; }

  /* Footer legal strip: stack copyright over the links. */
  .ecm-footer-legal {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  /* Stronger, top-to-bottom scrim keeps white hero text legible when the
     headline column spans most of a narrow screen. */
  .ecm-hero-scrim {
    background: linear-gradient(180deg,
      rgba(20,15,11,0.55) 0%,
      rgba(20,15,11,0.55) 45%,
      rgba(20,15,11,0.82) 100%) !important;
  }

  /* Homepage hero (front-page.php) — phone fixes:
     1. Full-height hero again: 100dvh fills the phone viewport edge-to-edge (no
        next-section peek as browser chrome shows/hides). The 100svh rule in the
        <=1024 block above is the fallback for browsers without dvh. With a
        portrait mobile_image the full-height fill no longer crops tightly. */
  [data-ecm-slideshow] { min-height: 100dvh !important; }

  /* 2. Hero eyebrow: the long "·"-separated label was a single nowrap line with
        wide tracking and ran off the right edge. Let it wrap and tighten its
        size/tracking so it fits with no cutoff and no horizontal scroll. */
  [data-ecm-slideshow] .ecm-eyebrow > span:last-child {
    white-space: normal !important;
    letter-spacing: 0.1em !important;
    font-size: 11px !important;
  }

  /* 3. The two hero buttons stack full-width and tappable inside the band. */
  .ecm-hero-actions { flex-direction: column !important; align-items: stretch !important; }
  .ecm-hero-actions .ecm-button { width: 100% !important; }

  /* Comfortable controls + tighter stacked imagery on phones. */
  .ecm-button   { min-height: 48px !important; }
  .ecm-split-img { min-height: 240px !important; }
  .ecm-svc-img   { min-height: 220px !important; }
}

/* ============================================================
   SMALL PHONE  (<= 480px)
   ============================================================ */
@media (max-width: 480px) {
  :root { --gutter: 18px; }

  /* Hero buttons stack and go full-width. */
  .ecm-hero-actions { flex-direction: column !important; align-items: stretch !important; }
  .ecm-hero-actions .ecm-button { width: 100% !important; }
}

/* ============================================================
   GALLERY  (page-gallery.php)
   NET-NEW, responsive from the start. Unlike the ported pages this
   template uses real classes (not inline styles), so these rules style
   the desktop base directly and the tablet/mobile steps live in the
   media queries at the end of this block.

   Grid is a CSS multi-column "masonry": 3 cols desktop, 2 tablet, 1
   mobile. Portrait/landscape images keep their natural height, which is
   what gives the grid its staggered rhythm. Filtering toggles [hidden]
   on items and cross-fades the whole grid (initGallery). Square corners,
   brass active state, tight even gutters — all on-brand.
   ============================================================ */

/* --- Filter bar ---------------------------------------------------------- */
.ecm-filterbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 44px;
}
.ecm-filter-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  padding: 12px 22px;
  background: transparent;
  color: var(--text-body);
  border: 1px solid var(--border-hairline);
  border-radius: 0;            /* square — architectural */
  cursor: pointer;
  transition: background var(--dur-fast,200ms) var(--ease-out),
              color var(--dur-fast,200ms) var(--ease-out),
              border-color var(--dur-fast,200ms) var(--ease-out);
}
.ecm-filter-btn:hover { border-color: var(--espresso); color: var(--ink); }
.ecm-filter-btn.is-active {
  background: var(--brass);
  border-color: var(--brass);
  color: #fff;
}

/* --- Masonry grid -------------------------------------------------------- */
.ecm-gallery-grid {
  column-count: 3;
  column-gap: 20px;
  transition: opacity var(--dur-base,400ms) var(--ease-out);
}
/* Cross-fade target for the shared filter JS (Gallery grid + Portfolio grid). */
.ecm-filter-grid { transition: opacity var(--dur-base,400ms) var(--ease-out); }
.is-fading { opacity: 0; }

.ecm-gallery-item {
  display: block;
  width: 100%;
  margin: 0 0 20px;            /* even vertical gutter to match column-gap */
  padding: 0;
  border: none;
  border-radius: 0;
  background: var(--sand);     /* warm placeholder while the image loads */
  cursor: pointer;
  position: relative;
  overflow: hidden;
  break-inside: avoid;         /* never split a card across columns */
  -webkit-column-break-inside: avoid;
  font: inherit;
  text-align: left;
  color: inherit;
}
.ecm-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--dur-slow,600ms) var(--ease-out);
}
.ecm-gallery-item:hover img,
.ecm-gallery-item:focus-visible img { transform: scale(1.04); }

/* Brass-tinted overlay with project name + location, revealed on hover/focus. */
.ecm-gallery-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 18px;
  background: linear-gradient(0deg,
    rgba(36, 28, 22, 0.82) 0%,
    rgba(36, 28, 22, 0.30) 48%,
    rgba(36, 28, 22, 0) 100%);
  opacity: 0;
  transition: opacity var(--dur-base,400ms) var(--ease-out);
}
.ecm-gallery-item:hover .ecm-gallery-overlay,
.ecm-gallery-item:focus-visible .ecm-gallery-overlay { opacity: 1; }
.ecm-gallery-overlay__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.2;
  color: #FBF8F2;
}
.ecm-gallery-overlay__loc {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-light);
}
.ecm-gallery-item[hidden] { display: none; }

.ecm-gallery-item:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* --- Lightbox ------------------------------------------------------------ */
.ecm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;                         /* above header (50) and mobile nav (60) */
  background: rgba(22, 16, 12, 0.96);  /* dark espresso backdrop */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 6vw;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 280ms var(--ease-out), visibility 280ms var(--ease-out);
}
.ecm-lightbox.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

.ecm-lightbox__figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.ecm-lightbox__img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: var(--espresso);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
.ecm-lightbox__caption {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ecm-lightbox__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
  color: #FBF8F2;
}
.ecm-lightbox__loc {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-light);
}

/* Lightbox controls — brass, square, minimal. */
.ecm-lightbox__close,
.ecm-lightbox__nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--brass-light);
  cursor: pointer;
  line-height: 1;
  transition: color var(--dur-fast,200ms) var(--ease-out),
              border-color var(--dur-fast,200ms) var(--ease-out),
              background var(--dur-fast,200ms) var(--ease-out);
}
.ecm-lightbox__close {
  top: 18px;
  right: 22px;
  width: 48px;
  height: 48px;
  font-size: 34px;
}
.ecm-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  font-size: 40px;
}
.ecm-lightbox__prev { left: 20px; }
.ecm-lightbox__next { right: 20px; }
.ecm-lightbox__close:hover,
.ecm-lightbox__nav:hover {
  color: #FBF8F2;
  border-color: var(--border-on-dark);
  background: rgba(194, 163, 107, 0.10);
}

/* --- Gallery: TABLET (<= 1024px) — 2 columns, nav arrows ride the edges -- */
@media (max-width: 1024px) {
  .ecm-gallery-grid { column-count: 2; }
}

/* --- Gallery: MOBILE (<= 767px) — single column + compact lightbox UI ---- */
@media (max-width: 767px) {
  .ecm-gallery-grid { column-count: 1; }
  .ecm-filterbar { gap: 8px; margin-bottom: 32px; }
  /* Comfortable tap target for the filter chips (Gallery + Portfolio archive
     share .ecm-filter-btn); flex-centers the label within the min-height. */
  .ecm-filter-btn {
    padding: 10px 16px;
    font-size: 11px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .ecm-lightbox { padding: 4vh 4vw; }
  .ecm-lightbox__img { max-height: 64vh; }
  /* Arrows drop below the image so they don't crowd a narrow frame. */
  .ecm-lightbox__nav {
    top: auto;
    bottom: 18px;
    transform: none;
    width: 48px;
    height: 48px;
    font-size: 32px;
  }
  .ecm-lightbox__prev { left: 24px; }
  .ecm-lightbox__next { right: 24px; }
}

/* ============================================================
   PORTFOLIO  (archive-portfolio.php + single-portfolio.php)
   CPT-driven. The archive uses a uniform card grid (reuses the
   .ecm-grid-3 responsive steps: 3 -> 2 -> 1). The single project reuses
   the gallery masonry + lightbox above, so only the archive cards, the
   meta strip, the narrative, and the Next-Project footer need rules.
   Square corners, brass accents, warm tones — all on-brand.
   ============================================================ */

/* --- Archive: project cards --------------------------------------------- */
.ecm-portfolio-card {
  display: block;
  text-decoration: none;
  position: relative;
}
.ecm-portfolio-card__img {
  overflow: hidden;
  background: var(--sand);          /* warm placeholder while loading */
  position: relative;
}
.ecm-portfolio-card__img img {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform var(--dur-slow,600ms) var(--ease-out),
              opacity var(--dur-base,400ms) var(--ease-out);
}
.ecm-portfolio-card:hover .ecm-portfolio-card__img img { transform: scale(1.04); opacity: 0.96; }

/* Brass category tag, top-left over the image. */
.ecm-portfolio-card__tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 6px 12px;
  background: rgba(36, 28, 22, 0.74);
  color: var(--brass-light);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.ecm-portfolio-card__body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
}
.ecm-portfolio-card__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.2;
  color: var(--text-heading);
}
.ecm-portfolio-card__loc {
  margin-top: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-meta);
}
.ecm-portfolio-card .ecm-arrow {
  display: inline-block;
  font-size: 18px;
  color: var(--brass);
  line-height: 1.4;
  transition: transform var(--dur-fast,200ms) var(--ease-out);
}
.ecm-portfolio-card:hover .ecm-arrow { transform: translateX(5px); }
.ecm-portfolio-card[hidden] { display: none; }

/* --- Single: project-meta strip ----------------------------------------- */
.ecm-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.ecm-meta-strip__cell {
  padding: 40px 28px;
  border-left: 1px solid var(--border-hairline);
}
.ecm-meta-strip__cell:first-child { border-left: none; }
.ecm-meta-strip__label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-meta);
}
.ecm-meta-strip__value {
  margin-top: 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.ecm-meta-strip__value small {
  display: block;
  margin-top: 4px;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--text-body);
}

/* --- Single: narrative prose -------------------------------------------- */
.ecm-narrative p {
  margin: 0 0 18px;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.66;
  color: var(--text);
}
.ecm-narrative p:last-child { margin-bottom: 0; }

/* --- Single: case-study gallery = 2 columns on desktop ------------------- */
/* Scoped to the single-project context only: the case-study gallery sits
   inside the .ecm-split narrative/gallery row, while the main Gallery page
   (page-gallery.php) is NOT inside .ecm-split — so it keeps the shared
   .ecm-gallery-grid base of 3 columns. Desktop-only (>=1025px) so the
   existing tablet/mobile collapse (2 -> 1) is left untouched. */
@media (min-width: 1025px) {
  .ecm-split .ecm-gallery-grid { column-count: 2; }
}

/* --- Single: Next-Project footer link ----------------------------------- */
.ecm-next-project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  text-decoration: none;
  padding: 36px 0;
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
}
.ecm-next-project .ecm-arrow {
  display: inline-block;
  transition: transform var(--dur-fast,200ms) var(--ease-out);
}
.ecm-next-project:hover .ecm-arrow { transform: translateX(5px); }
.ecm-next-project__name { transition: color var(--dur-fast,200ms) var(--ease-out); }
.ecm-next-project:hover .ecm-next-project__name { color: var(--brass); }

/* --- Portfolio: TABLET (<= 1024px) -------------------------------------- */
@media (max-width: 1024px) {
  .ecm-portfolio-card__img img { height: 260px; }
  /* Meta strip 4 -> 2 x 2; restore left borders sensibly. */
  .ecm-meta-strip { grid-template-columns: 1fr 1fr !important; }
  .ecm-meta-strip__cell:nth-child(odd) { border-left: none; }

  /* Single project: once the .ecm-split stacks, the gallery is below the
     narrative — turn OFF the desktop sticky so it never clips or overlaps
     (the inline position:sticky/top is overridden here). */
  .ecm-sticky-gallery { position: static !important; top: auto !important; }
}

/* --- Portfolio: MOBILE (<= 767px) --------------------------------------- */
@media (max-width: 767px) {
  .ecm-portfolio-card__img img { height: 240px; }
  /* Meta strip stacks to a single column; drop all left borders. */
  .ecm-meta-strip { grid-template-columns: 1fr !important; }
  .ecm-meta-strip__cell { border-left: none !important; padding: 26px 0; border-top: 1px solid var(--border-hairline); }
  .ecm-meta-strip__cell:first-child { border-top: none; }
  .ecm-next-project { flex-wrap: wrap; }
}

/* ============================================================
   CONTACT  (page-contact.php)
   The two-column layout reuses the .ecm-split hook (stacks <=1024px).
   This block (a) styles the contact-detail labels/links and the
   responsive map, and (b) restyles Contact Form 7's default markup to
   the brand. CF7 emits its own classes (.wpcf7-form, .wpcf7-form-control,
   .wpcf7-submit, .wpcf7-response-output, .wpcf7-not-valid-tip); we scope
   every override under .ecm-contact-form so it never leaks elsewhere and
   so the extra class out-specifies CF7's own (and the plugin's) rules.
   Square corners, espresso/walnut/brass/linen palette, Hanken Grotesk.
   ============================================================ */

/* --- Contact details (right column) ------------------------------------- */
.ecm-contact-label {
  font-family: var(--font-utility);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 14px;
}
.ecm-contact-link {
  font-family: var(--font-body);
  font-size: 15.5px;
  color: var(--ink);
  text-decoration: none;
  width: fit-content;
  transition: color var(--dur-fast,200ms) var(--ease-out);
}
.ecm-contact-link:hover { color: var(--brass); }

/* --- Responsive Google Map ---------------------------------------------- */
.ecm-map {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--sand);
  border: 1px solid var(--border-hairline);
  border-radius: 0;            /* square — architectural */
  overflow: hidden;
}
.ecm-map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Desktop only: the right column becomes a flex column so the map grows to
   fill the height beneath the contact details, balancing it against the tall
   form on the left. Below 1025px the layout stacks (the .ecm-split hook) and
   the map reverts to its fixed aspect ratio (16/9, then 4/3 on phones). */
@media (min-width: 1025px) {
  .ecm-contact-aside { display: flex; flex-direction: column; height: 100%; }
  .ecm-contact-mapwrap { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 320px; }
  .ecm-map--fill { flex: 1 1 auto; aspect-ratio: auto; min-height: 0; }
}

/* --- Contact Form 7: brand restyle (scoped) ----------------------------- */
/* Field rows: CF7 wraps each control in <label>label-text [control]</label>.
   Make the label a stacked block so the text sits above a full-width field. */
.ecm-contact-form .wpcf7-form p { margin: 0; }
.ecm-contact-form .wpcf7-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 20px;
  font-family: var(--font-utility);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-meta);
}
.ecm-contact-form .wpcf7-form-control-wrap { display: block; width: 100%; }

/* Inputs / select / textarea — full-width, square, warm surface. */
.ecm-contact-form .wpcf7-form-control:not(.wpcf7-submit) {
  width: 100%;
  display: block;
  box-sizing: border-box;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--border-hairline);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
  color: var(--ink);
  transition: border-color var(--dur-fast,200ms) var(--ease-out),
              box-shadow var(--dur-fast,200ms) var(--ease-out);
}
.ecm-contact-form .wpcf7-form-control:not(.wpcf7-submit)::placeholder {
  color: var(--text-meta);
  opacity: 1;
}
.ecm-contact-form .wpcf7-form-control:not(.wpcf7-submit):focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: inset 0 0 0 1px var(--brass);
}
.ecm-contact-form textarea.wpcf7-form-control {
  min-height: 160px;
  resize: vertical;
}

/* Select — drop the native chrome, add a brass caret. */
.ecm-contact-form select.wpcf7-form-control {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A9823F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px 14px;
  cursor: pointer;
}

/* Submit — matches the site's primary button (espresso -> walnut on hover). */
.ecm-contact-form .wpcf7-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 17px 38px;
  background: var(--espresso);
  color: var(--text-on-dark);
  border: 1px solid var(--espresso);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur-fast,200ms) var(--ease-out),
              border-color var(--dur-fast,200ms) var(--ease-out);
}
.ecm-contact-form .wpcf7-submit:hover {
  background: var(--walnut);
  border-color: var(--walnut);
}

/* Response + validation states — palette-matched (no plugin red/green). */
.ecm-contact-form .wpcf7-response-output {
  margin: 24px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--border-hairline);
  border-left: 3px solid var(--brass);
  border-radius: 0;
  background: var(--ivory);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
.ecm-contact-form .wpcf7 form.invalid .wpcf7-response-output,
.ecm-contact-form .wpcf7 form.unaccepted .wpcf7-response-output,
.ecm-contact-form .wpcf7 form.failed .wpcf7-response-output,
.ecm-contact-form .wpcf7 form.spam .wpcf7-response-output {
  border-color: var(--walnut);
  border-left-color: var(--walnut);
  background: rgba(74, 56, 42, 0.06);
  color: var(--walnut);
}
.ecm-contact-form .wpcf7 form.sent .wpcf7-response-output {
  border-color: var(--brass);
  border-left-color: var(--brass);
  background: var(--ivory);
  color: var(--ink);
}
.ecm-contact-form .wpcf7-not-valid-tip {
  margin-top: 7px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--walnut);
}
.ecm-contact-form .wpcf7-form-control.wpcf7-not-valid {
  border-color: var(--walnut);
}
.ecm-contact-form .wpcf7-spinner { background-color: var(--brass-light); }

/* --- Contact: MOBILE (<= 767px) ----------------------------------------- */
@media (max-width: 767px) {
  .ecm-map { aspect-ratio: 4 / 3; }
  .ecm-contact-form .wpcf7-submit { width: 100%; min-height: 48px; }
  /* 16px inputs prevent the iOS focus-zoom and keep fields tappable. */
  .ecm-contact-form .wpcf7-form-control:not(.wpcf7-submit) { font-size: 16px; }
}

/* ============================================================
   FOOTER LINK HOVER / FOCUS STATES (footer.php)
   Restrained colour-shift only — no underline, motion, scale, or background.
   Footer links set their idle colour inline (style="color:..."), so the
   hover/focus colour needs !important to beat that inline value; the transition
   lives on the BASE rule so it eases both in and out. Social icons carry an
   aria-label and render in brass (SVG stroke=currentColor); text links have no
   aria-label — that split gives each group its own cue. Scoped to the site
   <footer>, so nothing else is affected.
   ============================================================ */
footer a { transition: color 0.2s ease; }

/* Text links — Navigation, Services, phone/email, legal: muted -> brass. */
footer a:not([aria-label]):hover,
footer a:not([aria-label]):focus-visible { color: var(--brass) !important; }

/* Social icons — already brass, lift to linen so the shift reads on espresso. */
footer a[aria-label]:hover,
footer a[aria-label]:focus-visible { color: var(--linen) !important; }

/* Keyboard focus — same colour cue plus a visible brass ring. */
footer a:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* ============================================================
   LEGAL PAGES (Terms of Service, Privacy Policy) — the_content()
   Long-form legal copy rendered through the generic page.php. The content
   is wrapped in .ecm-legal so headings/lists/links pick up brand typography
   without a per-element inline style. Scoped, so ordinary page content is
   untouched. Inherits body font/size/colour from the page.php content div.
   ============================================================ */
.ecm-legal { max-width: 760px; }
.ecm-legal > *:first-child { margin-top: 0; }
.ecm-legal__updated { color: var(--text-meta); font-size: 15px; margin: 0 0 32px; }
.ecm-legal h2 {
  font: var(--type-h3); color: var(--text-heading);
  margin: 40px 0 14px; letter-spacing: -0.01em;
}
.ecm-legal p { margin: 0 0 18px; }
.ecm-legal ul { margin: 0 0 18px; padding-left: 22px; }
.ecm-legal li { margin: 0 0 8px; }
.ecm-legal a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.ecm-legal a:hover, .ecm-legal a:focus-visible { color: var(--brass-deep); }

/* ============================================================
   TESTIMONIALS — borderless three-up snap slider (front-page.php §6)
   Horizontal scroll is scoped to .ecm-testimonials__viewport ONLY.
   Do NOT add overflow-x:hidden to html/body — the global
   `html, body { overflow-x: clip; }` above must stay untouched.
   Quotes use Fraunces italic 300 (italic 300 axis added to the
   Google Fonts URL in functions.php).
   ============================================================ */
.ecm-testimonials { background:#F7F3EC; padding:96px 0; }
.ecm-testimonials__inner { max-width:1200px; margin:0 auto; padding:0 32px; }
.ecm-testimonials__head { text-align:center; margin-bottom:56px; }
.ecm-testimonials__eyebrow { font-size:11px; letter-spacing:.28em; text-transform:uppercase; color:#A9823F; margin:0 0 16px; }
.ecm-testimonials__heading { font-family:'Fraunces',serif; font-weight:400; color:#241C16; font-size:clamp(28px,4vw,40px); line-height:1.05; margin:0; }
.ecm-testimonials__heading em { font-style:italic; font-weight:300; }

.ecm-testimonials__viewport { overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; -ms-overflow-style:none; }
.ecm-testimonials__viewport::-webkit-scrollbar { display:none; }
.ecm-testimonials__track { display:flex; gap:0; }

.ecm-testimonial { flex:0 0 33.3333%; box-sizing:border-box; padding:0 32px; scroll-snap-align:start; text-align:left; }
.ecm-testimonial__stars { display:flex; gap:5px; margin-bottom:18px; }
.ecm-star { display:block; }
.ecm-star.is-on { fill:#A9823F; }
.ecm-star.is-off { fill:#E0D4BF; }
.ecm-testimonial__quote { font-family:'Fraunces',serif; font-style:italic; font-weight:300; color:#3A2F24; font-size:18px; line-height:1.55; margin:0 0 26px; }
.ecm-testimonial__by { display:flex; flex-direction:column; gap:4px; }
.ecm-testimonial__name { font-size:12px; letter-spacing:.14em; text-transform:uppercase; color:#241C16; font-weight:500; }
.ecm-testimonial__loc { font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:#A9823F; }

.ecm-testimonials__nav { display:flex; align-items:center; justify-content:center; gap:20px; margin-top:48px; }
.ecm-testimonials__arrow { background:none; border:0.5px solid #C9B48A; color:#A9823F; width:44px; height:44px; border-radius:50%; cursor:pointer; font-size:16px; line-height:1; transition:background .3s, color .3s; }
.ecm-testimonials__arrow:hover { background:#A9823F; color:#F7F3EC; }
.ecm-testimonials__dots { display:flex; gap:9px; }
.ecm-dot { width:22px; height:2px; background:#E0D4BF; border:0; padding:0; cursor:pointer; transition:background .3s; }
.ecm-dot.is-active { background:#A9823F; }

@media (max-width:1024px) { .ecm-testimonial { flex-basis:50%; } }
@media (max-width:680px)  { .ecm-testimonial { flex-basis:100%; } .ecm-testimonials { padding:64px 0; } }

/* ============================================================
   HOMEPAGE GALLERY (§3.5) — three-up image tiles auto-pulled from the
   Gallery page. Ivory background so it reads distinct from the linen
   Featured Projects section beneath. Captioned tiles (title + location);
   the caption block only renders when a title/location is present.
   ============================================================ */
.ecm-gallery { background:#FBF8F2; padding:96px 0; }
.ecm-gallery__inner { max-width:1200px; margin:0 auto; padding:0 32px; }
.ecm-gallery__head { display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:44px; }
.ecm-gallery__eyebrow { flex-basis:100%; font-size:11px; letter-spacing:.28em; text-transform:uppercase; color:#A9823F; margin:0 0 14px; }
.ecm-gallery__heading { font-family:'Fraunces',serif; font-weight:400; color:#241C16; font-size:clamp(28px,4vw,40px); line-height:1.05; margin:0; }
.ecm-gallery__heading em { font-style:italic; font-weight:300; }
.ecm-gallery__viewall { font-size:12px; letter-spacing:.16em; text-transform:uppercase; color:#A9823F; text-decoration:none; display:inline-flex; align-items:center; gap:8px; }
.ecm-gallery__viewall .ecm-arrow { transition:transform .25s ease; }
.ecm-gallery__viewall:hover .ecm-arrow { transform:translateX(4px); }

.ecm-gallery__grid { display:grid; grid-template-columns:repeat(3,1fr); gap:28px; }
.ecm-gallery__tile { display:block; text-decoration:none; color:inherit; }
.ecm-gallery__media { overflow:hidden; border-radius:2px; aspect-ratio:4/3; background:#ECE4D6; }
.ecm-gallery__media img { width:100%; height:100%; object-fit:cover; display:block; transition:transform .6s ease; }
.ecm-gallery__tile:hover .ecm-gallery__media img { transform:scale(1.04); }
.ecm-gallery__cap { display:flex; align-items:baseline; gap:10px; margin-top:16px; }
.ecm-gallery__title { font-family:'Fraunces',serif; font-size:20px; color:#241C16; }
.ecm-gallery__loc { font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:#8A7A63; }
.ecm-gallery__arrow { margin-left:auto; color:#A9823F; transition:transform .25s ease; }
.ecm-gallery__tile:hover .ecm-gallery__arrow { transform:translateX(4px); }

@media (max-width:1024px) { .ecm-gallery__grid { grid-template-columns:repeat(2,1fr); } }
@media (max-width:680px)  { .ecm-gallery__grid { grid-template-columns:1fr; } .ecm-gallery { padding:64px 0; } }
@media (prefers-reduced-motion: reduce) {
    .ecm-gallery__media img, .ecm-gallery__arrow, .ecm-gallery__viewall .ecm-arrow { transition:none; }
    .ecm-gallery__tile:hover .ecm-gallery__media img, .ecm-gallery__tile:hover .ecm-gallery__arrow, .ecm-gallery__viewall:hover .ecm-arrow { transform:none; }
}

/* Button + text-link hover — respect reduced-motion (colour changes still occur). */
@media (prefers-reduced-motion: reduce) {
    .ecm-btn-primary:hover, .ecm-btn-secondary:hover { transform:none; }
    .ecm-brass-link .ecm-arrow, .ecm-project-card .ecm-arrow, .ecm-expertise-card .ecm-arrow { transition:none; }
    .ecm-brass-link:hover .ecm-arrow,
    .ecm-project-card:hover .ecm-arrow, .ecm-expertise-card:hover .ecm-arrow { transform:none; }
}

/* ============================================================
   OWNERS — SHARED PHOTO + PROFILE PANEL (page-about.php §5)

   TWO LAYOUTS, not one layout collapsing.

   Desktop (>=1025px, .is-interactive):
     A steady shared photo of both owners on the left at ~2/3, an owner profile
     panel on the right at ~1/3. Percentage hotspots over the photo halves and
     text selectors above the panel both select an owner. The photo NEVER swaps,
     dims, zooms, or gets covered — only two small corner name chips sit on it,
     so both faces and the handshake stay fully visible at every width.

   Mobile (<1025px, and ALWAYS with JS off):
     Shared photo full width with its caption, then every owner profile open
     beneath it — small portrait left, name/title/biography right, a hairline
     rule between. No hover, no tabs, no accordion, no tap-to-expand. Every
     biography is readable on arrival.

   PROGRESSIVE ENHANCEMENT
   The open layout is the DEFAULT in this stylesheet; the interactive one sits
   entirely behind .ecm-owners.is-interactive, a class only initOwnerPanel()
   adds (and only at >=1025px). No JS, no class, no overlay: the section reads
   as an open list at any width. Same convention the rest of this theme uses.

   ZERO LAYOUT SHIFT ON SWITCH
   In interactive mode every .ecm-owner-card shares ONE grid cell (grid-area:
   1/1). A grid cell is as tall as its tallest item, so the panel is already
   sized to the LONGEST biography and switching owners cannot move anything.
   No JS measurement and no magic number — correct for any bio length.
   --ecm-owner-bio-min below is only a floor for very short copy.

   NO FLICKER BETWEEN PHOTO AND PANEL
   There are no mouseleave handlers anywhere. Selection is only ever set, never
   reverted, so crossing the gap between the photo and the panel cannot flip
   anything back. The persistence and the no-flicker guarantee are the same
   property, not two separate fixes.

   CALIBRATION KNOBS are the custom properties on .ecm-owners below.
   ============================================================ */
.ecm-owners {
    /* --- calibration --- */
    --ecm-owner-split:       1.75fr 1fr;  /* photo : panel on desktop (~64/36). */
    --ecm-owner-gap:         56px;        /* between photo and panel.           */
    --ecm-owner-portrait-w:  300px;       /* panel portrait cap.                */
    --ecm-owner-portrait-m:  132px;       /* mobile portrait width.             */
    --ecm-owner-bio-min:     132px;       /* floor only; the grid cell rules.   */
    --ecm-owner-crop:        50% 22%;     /* object-position. Biased UP so the  */
                                          /* wider-framed portrait is not cut   */
                                          /* across the head. See §7 notes.     */
    --ecm-owner-fade:        300ms;       /* crossfade. 250-350ms band.          */

    margin-top:48px;
}

.ecm-owners__stage { display:grid; grid-template-columns:1fr; gap:40px; }

/* ---- Shared photo -----------------------------------------------------
   Natural aspect ratio, always. The frame is only a positioning context for
   the hotspots and corner chips; it imposes no box of its own, so the photo
   is never cropped and the handshake is never clipped. */
.ecm-owners__shared { margin:0; }
.ecm-owners__frame { position:relative; background:var(--sand); line-height:0; }
.ecm-owners__shared-img { width:100%; height:auto; display:block; }

.ecm-owners__caption {
    margin-top:14px; font-family:var(--font-body); font-size:12px; font-weight:600;
    letter-spacing:0.14em; text-transform:uppercase; color:var(--text-meta);
}

/* Empty-state frame, carried over from the previous owners section: sand fill,
   hairline border, centred glyph, monospace caption. The shared placeholder
   holds a 3:2 box so the grid keeps its shape before the photo arrives. */
.ecm-owners__ph {
    width:100%; height:100%; box-sizing:border-box;
    border:1px solid var(--border-hairline); background:var(--sand);
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px;
    line-height:1.4;
}
.ecm-owners__ph--shared { aspect-ratio:3 / 2; }
.ecm-owners__ph span {
    font-family:ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size:11px; letter-spacing:0.14em; text-transform:uppercase; color:var(--text-meta);
    text-align:center; padding:0 10px;
}

/* Hotspots and corner chips exist only in interactive mode. Hidden here means
   hidden properly: display:none, so on mobile and with JS off they are not tab
   stops, not announced, and not painted. */
.ecm-owners__hot,
.ecm-owners__tag { display:none; }

/* ---- Panel + cards ----------------------------------------------------
   Default (open) mode: selectors hidden, every card visible and in flow,
   separated by a hairline rule, portrait beside the text. */
.ecm-owners__selectors { display:none; }

.ecm-owners__cards { display:flex; flex-direction:column; }

.ecm-owner-card {
    display:grid;
    grid-template-columns:var(--ecm-owner-portrait-m) minmax(0,1fr);
    gap:26px;
    align-items:start;
}
.ecm-owner-card + .ecm-owner-card {
    margin-top:32px; padding-top:32px;
    border-top:1px solid var(--border-hairline);   /* the theme's rule colour */
}

/* object-position is biased upward rather than centred, because the two
   portraits are framed differently from each other: one is shot wider, so a
   centred cover crop would sit low on it and clip the top of the head. A
   single upward bias suits both and keeps the pair looking consistent. */
.ecm-owner-card__media { aspect-ratio:4 / 5; overflow:hidden; background:var(--sand); }
.ecm-owner-card__img {
    width:100%; height:100%; display:block;
    object-fit:cover; object-position:var(--ecm-owner-crop);
}

.ecm-owner-card__body { min-width:0; }
.ecm-owner-card__name {
    margin:0; font-family:var(--font-display); font-weight:400;
    font-size:26px; line-height:1.12; letter-spacing:-0.01em; color:var(--ink);
}
.ecm-owner-card__title {
    margin-top:10px; font-family:var(--font-body); font-size:11px; font-weight:600;
    letter-spacing:0.16em; text-transform:uppercase; color:var(--brass);
}
.ecm-owner-card__text {
    margin:18px 0 0; font-family:var(--font-body);
    font-size:16px; line-height:1.66; color:var(--text); max-width:56ch;
}
.ecm-owner-card__text + .ecm-owner-card__text { margin-top:14px; }

/* ============================================================
   INTERACTIVE MODE — desktop only, JS-gated
   ============================================================ */
@media (min-width:1025px) {

    .ecm-owners.is-interactive .ecm-owners__stage {
        grid-template-columns:var(--ecm-owner-split);
        gap:var(--ecm-owner-gap);
        align-items:start;
    }

    /* --- corner name chips --------------------------------------------
       Small, at the extreme lower corners, over a localised chip rather than
       a scrim across the image: nothing dims, nothing is laid over the faces
       or the handshake. The brass underline is the active indicator. */
    .ecm-owners.is-interactive .ecm-owners__tag {
        display:block; position:absolute; bottom:18px; z-index:2;
        padding:7px 13px 6px;
        background:rgba(36, 28, 22, 0.62);
        -webkit-backdrop-filter:saturate(120%) blur(3px);
        backdrop-filter:saturate(120%) blur(3px);
        border-bottom:2px solid transparent;
        font-family:var(--font-body); font-size:11px; font-weight:600;
        letter-spacing:0.16em; text-transform:uppercase;
        line-height:1.2; color:var(--text-on-dark);
        pointer-events:none;   /* the hotspot beneath owns the pointer */
        transition:border-color var(--ecm-owner-fade) var(--ease-out),
                   color var(--ecm-owner-fade) var(--ease-out);
    }
    .ecm-owners.is-interactive .ecm-owners__tag--start { left:18px; }
    .ecm-owners.is-interactive .ecm-owners__tag--end   { right:18px; }
    .ecm-owners.is-interactive .ecm-owners__tag--mid   { left:50%; transform:translateX(-50%); }

    .ecm-owners.is-interactive .ecm-owners__tag.is-active {
        border-bottom-color:var(--brass);
        color:#FBF8F2;
    }

    /* --- hotspots -----------------------------------------------------
       Percentage left/width come from the template, so the split tracks the
       photo at every viewport width. Transparent at rest: the photo must show
       no overlay. Only the focus ring is ever visible. */
    .ecm-owners.is-interactive .ecm-owners__hot {
        display:block; position:absolute; top:0; height:100%; z-index:1;
        margin:0; padding:0; border:0; background:transparent;
        -webkit-appearance:none; appearance:none;
        cursor:pointer;
    }
    .ecm-owners.is-interactive .ecm-owners__hot:focus { outline:none; }
    .ecm-owners.is-interactive .ecm-owners__hot:focus-visible {
        outline:2px solid var(--brass);
        outline-offset:-4px;
    }

    /* --- selectors ----------------------------------------------------- */
    .ecm-owners.is-interactive .ecm-owners__selectors {
        display:flex; gap:26px; align-items:baseline;
        margin-bottom:26px; padding-bottom:0;
    }
    .ecm-owners.is-interactive .ecm-owners__sel {
        margin:0; padding:0 0 8px; border:0; border-bottom:2px solid transparent;
        background:none; -webkit-appearance:none; appearance:none; cursor:pointer;
        font-family:var(--font-body); font-size:12px; font-weight:600;
        letter-spacing:0.16em; text-transform:uppercase;
        color:var(--text-meta);
        transition:color var(--dur-fast) var(--ease-out),
                   border-color var(--dur-fast) var(--ease-out);
    }
    .ecm-owners.is-interactive .ecm-owners__sel:hover { color:var(--ink); }
    .ecm-owners.is-interactive .ecm-owners__sel.is-active {
        color:var(--ink); border-bottom-color:var(--brass);
    }
    .ecm-owners.is-interactive .ecm-owners__sel:focus { outline:none; }
    .ecm-owners.is-interactive .ecm-owners__sel:focus-visible {
        outline:2px solid var(--brass); outline-offset:3px;
    }

    /* --- cards: one shared grid cell -----------------------------------
       Every card occupies the same cell, so the cell is already as tall as the
       longest biography: switching owners cannot shift the page. The rule and
       the stacking margin from the open layout are both reset, since the cards
       no longer sit one after another. */
    .ecm-owners.is-interactive .ecm-owners__cards {
        display:grid;
        grid-template-columns:minmax(0,1fr);
    }
    .ecm-owners.is-interactive .ecm-owner-card {
        grid-area:1 / 1;
        grid-template-columns:minmax(0,1fr);   /* portrait above the text */
        gap:24px;
        margin-top:0; padding-top:0; border-top:0;
        opacity:0; visibility:hidden; pointer-events:none;
        transition:opacity var(--ecm-owner-fade) var(--ease-out),
                   visibility var(--ecm-owner-fade) var(--ease-out);
    }
    .ecm-owners.is-interactive .ecm-owner-card.is-active {
        opacity:1; visibility:visible; pointer-events:auto;
    }

    /* The portrait crossfades; the text crossfades AND lifts a little. Nothing
       scales, nothing bounces — translate and opacity only. */
    .ecm-owners.is-interactive .ecm-owner-card__media {
        max-width:var(--ecm-owner-portrait-w);
        transition:opacity var(--ecm-owner-fade) var(--ease-out);
    }
    .ecm-owners.is-interactive .ecm-owner-card__body {
        transform:translateY(8px);
        transition:transform var(--ecm-owner-fade) var(--ease-out);
    }
    .ecm-owners.is-interactive .ecm-owner-card.is-active .ecm-owner-card__body {
        transform:none;
    }

    .ecm-owners.is-interactive .ecm-owner-card__name { font-size:30px; }
    .ecm-owners.is-interactive .ecm-owner-card__bio  { min-height:var(--ecm-owner-bio-min); }
    .ecm-owners.is-interactive .ecm-owner-card__text { max-width:42ch; }
}

/* ============================================================
   OPEN-LAYOUT TIERS
   ============================================================ */

/* Below the desktop split: the open layout is already what renders, so there
   is nothing to undo — only spacing to tune. 1024px is where .ecm-split and
   the rest of this theme collapse, and where the 2/3 + 1/3 split stops having
   room for a readable panel. */
@media (max-width:1024px) {
    .ecm-owners { margin-top:36px; }
    .ecm-owners__stage { gap:36px; }
}

@media (max-width:767px) {
    .ecm-owners { margin-top:28px; --ecm-owner-portrait-m:112px; }
    .ecm-owners__stage { gap:28px; }
    .ecm-owner-card { gap:20px; }
    .ecm-owner-card__name { font-size:23px; }
    .ecm-owner-card__text { font-size:15.5px; }
}

/* Very narrow: the portrait and the text stack vertically rather than
   squeezing the copy into a column too narrow to read. */
@media (max-width:480px) {
    .ecm-owner-card { grid-template-columns:minmax(0,1fr); gap:18px; }
    .ecm-owner-card__media { max-width:210px; }
}

/* ============================================================
   REDUCED MOTION — transitions REMOVED, not shortened. The interaction
   itself still works; it simply cuts straight to the selected profile.

   These selectors deliberately repeat the full `.ecm-owners.is-interactive`
   prefix rather than the shorter `.ecm-owners`. Every transition above is
   declared at that specificity, so a one-class-shorter selector here loses the
   cascade and reduced motion silently does nothing. Matching the specificity
   and sitting later in the file is what actually makes it win.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .ecm-owners.is-interactive .ecm-owners__tag,
    .ecm-owners.is-interactive .ecm-owners__sel,
    .ecm-owners.is-interactive .ecm-owner-card,
    .ecm-owners.is-interactive .ecm-owner-card__media,
    .ecm-owners.is-interactive .ecm-owner-card__body,
    .ecm-owners .ecm-owners__tag,
    .ecm-owners .ecm-owners__sel,
    .ecm-owners .ecm-owner-card,
    .ecm-owners .ecm-owner-card__media,
    .ecm-owners .ecm-owner-card__body {
        transition:none;
    }
    /* No lift either: the text is simply already in place. */
    .ecm-owners.is-interactive .ecm-owner-card__body,
    .ecm-owners.is-interactive .ecm-owner-card.is-active .ecm-owner-card__body {
        transform:none;
    }
}

/* ============================================================
   PARTNER BANNER (template-parts/partner-banner.php)
   Rendered at the bottom of the About page and the homepage from one shared
   part. The band colour is set inline per page so it alternates against
   whatever sits above it: linen on About (ivory section above), ivory on the
   homepage (linen testimonials above).

   Designed for exactly one partner, tolerant of more, with no second code
   path. The max-width sits on the ITEM, not the list, so:
     one row   -> a single capped, centred block with the descriptor beneath
     many rows -> a centred row that wraps, each item naturally narrower
   No JavaScript. No carousel. No autoplay. No sticky.

   The logo is never greyscaled, dimmed, or filtered at rest. It is another
   firm's mark and altering it can conflict with their brand guidelines.
   ============================================================ */
.ecm-partners {
    /* --- calibration --- */
    --ecm-partner-logo-h:  64px;   /* logo cap. Height, not width, so mixed  */
                                   /* aspect ratios share a baseline.        */
    --ecm-partner-measure: 480px;  /* per-item cap. Sets the single-row feel.*/

    padding:72px 0;
}

.ecm-partners__inner {
    max-width:var(--container-max);
    margin:0 auto;
    padding:0 var(--gutter);
}

.ecm-partners__list {
    list-style:none;
    margin:0;
    padding:0;
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    align-items:flex-start;
    gap:48px 64px;
}

.ecm-partners__item {
    /* The cap lives here rather than on the list. With one child this is the
       whole single-partner treatment; with several it just stops any one item
       from hogging the row. min-width:0 keeps a long descriptor from forcing
       the flex line wider than the container. */
    flex:0 1 auto;
    min-width:0;
    max-width:var(--ecm-partner-measure);
    display:flex;
    flex-direction:column;
    align-items:center;
    text-align:center;
    gap:18px;
}

.ecm-partners__link {
    display:inline-flex;
    text-decoration:none;
    transition:opacity 200ms var(--ease-out, ease), transform 200ms var(--ease-out, ease);
}
.ecm-partners__link:hover,
.ecm-partners__link:focus-visible { opacity:0.82; transform:translateY(-2px); }

.ecm-partners__logo {
    display:block;
    height:auto;
    width:auto;
    max-height:var(--ecm-partner-logo-h);
    max-width:100%;
}

.ecm-partners__desc {
    margin:0;
    font-family:var(--font-body);
    font-size:14px;
    line-height:1.6;
    letter-spacing:0.01em;
    color:var(--text-meta);
    max-width:38ch;
}

@media (max-width:1024px) {
    .ecm-partners { padding:56px 0; }
    .ecm-partners__list { gap:40px 48px; }
}

@media (max-width:767px) {
    .ecm-partners { --ecm-partner-logo-h:56px; padding:48px 0; }
    .ecm-partners__list { gap:36px 40px; }
    .ecm-partners__desc { font-size:13.5px; }
}

@media (prefers-reduced-motion: reduce) {
    .ecm-partners__link { transition:none; }
    .ecm-partners__link:hover,
    .ecm-partners__link:focus-visible { transform:none; }
}

/* ============================================================
   SOCIAL FOLLOW BUTTON (template-parts/social-rail.php)
   Fixed bottom-right. Collapsed: one brass circle with a share glyph.
   Expanded: the list stacks upward from the toggle.

   Stacking: page content sits at 0-3, the fixed header at 50, the mobile nav
   overlay at 60, the gallery lightbox at 80. The rail takes 40 — clear of all
   page content, under every overlay. It is additionally hard-hidden while the
   mobile nav is open (.ecm-social-rail--nav-open) so it can never show through
   or steal a tap from the menu.

   DOM order is toggle-then-list, so the keyboard reaches the button before the
   links. Both the rail and the list are column-reverse, which puts the toggle
   at the bottom and stacks links upward without reordering the DOM. The list's
   first child therefore sits nearest the toggle and leads the stagger.
   ============================================================ */

.ecm-social-rail {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: flex;
  flex-direction: column-reverse;  /* toggle (first child) pins to the bottom */
  align-items: center;
  gap: 10px;
  /* The container keeps its full expanded height even when collapsed, because
     the list is hidden with visibility rather than display. Left hit-testable
     that would put an invisible ~214px column over whatever sits bottom-right —
     a footer link, the contact form's submit button, the Turnstile widget. Only
     the toggle and the open list take pointer events; the box itself never
     does. */
  pointer-events: none;
}
.ecm-social-rail__toggle { pointer-events: auto; }

/* --- Toggle ------------------------------------------------------------- */
.ecm-social-rail__toggle {
  position: relative;
  flex: none;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--brass-deep);
  border-radius: 50%;
  background: var(--brass);
  color: var(--ivory);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Both glyphs occupy the same box and crossfade. No rotation. */
.ecm-social-rail__glyph {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  display: block;
  opacity: 0;
}
.ecm-social-rail__glyph svg { display: block; width: 100%; height: 100%; }

.ecm-social-rail__glyph--share { opacity: 1; }
.ecm-social-rail.is-open .ecm-social-rail__glyph--share { opacity: 0; }
.ecm-social-rail.is-open .ecm-social-rail__glyph--close { opacity: 1; }

/* --- List --------------------------------------------------------------- */
.ecm-social-rail__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column-reverse;  /* first item sits nearest the toggle */
  align-items: center;
  gap: 10px;
  pointer-events: none;            /* collapsed items must not catch clicks */
}
.ecm-social-rail.is-open .ecm-social-rail__list { pointer-events: auto; }

.ecm-social-rail__item {
  margin: 0;
  opacity: 0;
  visibility: hidden;              /* also drops the link out of tab order */
  transform: translateY(8px);
}
.ecm-social-rail.is-open .ecm-social-rail__item {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ecm-social-rail__link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--sand);
  border-radius: 50%;
  background: var(--ivory);
  color: var(--walnut);
  text-decoration: none;
}
.ecm-social-rail__link svg { display: block; width: 21px; height: 21px; }

/* Colour-only hover — nothing scales or lifts. */
.ecm-social-rail__link:hover,
.ecm-social-rail__link:focus-visible {
  background: var(--sand);
  color: var(--espresso);
}

/* --- Focus rings -------------------------------------------------------- */
.ecm-social-rail__toggle:focus-visible {
  outline: 2px solid var(--espresso);
  outline-offset: 2px;
}
.ecm-social-rail__link:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

/* --- Suppressed while the mobile nav overlay is open -------------------- */
.ecm-social-rail--nav-open {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 767px) {
  .ecm-social-rail { right: 16px; bottom: 16px; }
  .ecm-social-rail__toggle { width: 48px; height: 48px; }
}

/* --- Motion ------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .ecm-social-rail { transition: opacity 200ms ease, visibility 200ms ease; }
  .ecm-social-rail__glyph { transition: opacity 200ms ease; }
  .ecm-social-rail__item {
    transition: opacity 200ms ease, transform 200ms ease, visibility 200ms ease;
  }
  /* Stagger runs bottom-up on open (first child is nearest the toggle). On
     close every item leaves together — a reversed out-stagger reads as lag. */
  .ecm-social-rail.is-open .ecm-social-rail__item:nth-child(1) { transition-delay: 0ms; }
  .ecm-social-rail.is-open .ecm-social-rail__item:nth-child(2) { transition-delay: 40ms; }
  .ecm-social-rail.is-open .ecm-social-rail__item:nth-child(3) { transition-delay: 80ms; }
}

@media (prefers-reduced-motion: reduce) {
  .ecm-social-rail,
  .ecm-social-rail__glyph,
  .ecm-social-rail__item { transition: none; }
  .ecm-social-rail__item { transition-delay: 0ms; }
}
