/* ==========================================================================
   Site chrome: header, navigation, footer.
   Markup for both is generated by tools/sync-layout.mjs so every page is
   identical; style changes here apply to all five pages.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-normal) var(--ease-out-quart),
              box-shadow var(--duration-normal) var(--ease-out-quart);
}
/* Frosted backdrop lives on a pseudo-element: a backdrop-filter on the header
   itself would become the containing block for the position:fixed mobile
   panel and size it to the header instead of the viewport. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -1px; /* also under the 1px border, so no white seam shows */
  z-index: -1;
  background: rgba(7, 13, 31, 0.95); /* --color-navy-950: the logo's own ground */
  backdrop-filter: saturate(180%) blur(14px);
  transition: background-color var(--duration-normal) var(--ease-out-quart);
}
.site-header.is-scrolled {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px -18px rgba(7, 13, 31, 0.6);
}
.site-header.is-scrolled::before { background: rgba(7, 13, 31, 0.99); }

/* The header row runs a little wider than page content so the full nav,
   phone, and CTA fit on one line at common laptop widths. */
.header-bar {
  max-width: 1400px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--header-h);
}

/* Brand lockup — identical size on every page. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex-shrink: 0;
}
/* The logo's white lettering and glow sit directly on the navy header. */
.brand--logo {
  border-radius: var(--radius-sm);
  transition: transform var(--duration-fast) var(--ease-out-quart);
}
.brand--logo:hover { transform: translateY(-1px); }
.brand--logo:focus-visible { outline: 3px solid var(--color-orange-400); outline-offset: 4px; }
.brand--logo picture { display: block; }
.brand-logo {
  display: block;
  height: 54px;
  width: auto;
}
@media (max-width: 1120px) {
  .brand-logo { height: 48px; }
}
@media (max-width: 420px) {
  .brand-logo { height: 40px; }
}
.brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--color-navy-900);
}
.brand-tag {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-strong);
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 1.6vw, 1.75rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding-block: 0.4rem;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-navy-800);
  transition: color var(--duration-fast) var(--ease-out-quart);
}
.nav-links a:hover { color: var(--color-navy-950); }
.nav-links a[aria-current="page"] { color: var(--color-navy-950); }
/* Underline draws in from the left; it sits on the current page. */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 300ms var(--ease-out-expo);
}
.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

/* Division link: set apart by a hairline and the accent color so it reads
   as part of the company family, not just another page. */
.nav-division {
  padding-left: clamp(1rem, 1.6vw, 1.75rem);
  border-left: 1px solid var(--color-mist);
}
.nav-links .nav-division a { color: var(--color-accent-strong); }
.nav-links .nav-division a:hover { color: var(--color-accent-deep); }
.ext-icon { transition: transform var(--duration-normal) var(--ease-out-expo); }
.nav-division a:hover .ext-icon { transform: translate(2px, -2px); }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.header-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-navy-900);
  text-decoration: none;
  white-space: nowrap;
}
.header-phone svg { color: var(--color-accent-strong); }
.header-phone:hover { color: var(--color-accent-strong); }
.header-actions .btn { white-space: nowrap; }

/* Social icons — same official links as the footer, sized to match the
   collapsed phone icon so the bar keeps one visual rhythm. */
.header-social {
  list-style: none;
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}
.header-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-mist);
  color: var(--color-navy-900);
  transition: border-color var(--duration-fast) var(--ease-out-quart),
              color var(--duration-fast) var(--ease-out-quart),
              transform var(--duration-fast) var(--ease-out-quart);
}
.header-social svg { width: 18px; height: 18px; }
.header-social a:hover { color: var(--color-accent-strong); border-color: var(--color-accent-strong); transform: translateY(-2px); }
.header-social a:focus-visible { outline: 3px solid var(--color-orange-400); outline-offset: 3px; }

/* Between the mobile breakpoint and wide desktops the phone collapses to
   an icon (still a 44px tap target with an accessible name). */
@media (min-width: 1121px) and (max-width: 1340px) {
  .main-nav { gap: var(--space-md); }
  .header-phone {
    width: 44px;
    height: 44px;
    justify-content: center;
    border: 1px solid var(--color-mist);
    border-radius: 50%;
    font-size: 0;
    gap: 0;
  }
  .header-phone svg { width: 18px; height: 18px; }
  /* No room for icons here; they stay in the footer and mobile menu. */
  .header-social { display: none; }
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.nav-toggle .bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  margin: 3px 0;
  transition: transform var(--duration-normal) var(--ease-out-expo), opacity var(--duration-fast);
}
.nav-open .nav-toggle .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-open .nav-toggle .bar:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile / tablet: full-height panel beneath the header. The breakpoint is
   wide enough that the desktop bar never has to squeeze. */
@media (max-width: 1120px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: var(--space-lg);
    padding: var(--space-lg) var(--gutter) var(--space-xl);
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    visibility: hidden;
    transition: opacity var(--duration-normal) var(--ease-out-quart),
                transform var(--duration-normal) var(--ease-out-quart),
                visibility 0s linear var(--duration-normal);
  }
  .nav-open .main-nav {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
    transition-delay: 0s;
  }
  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-links li { border-bottom: 1px solid var(--color-mist); }
  .nav-links a {
    display: flex;
    padding-block: 1rem;
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
  }
  .nav-links a::after { display: none; }
  /* Current page: an accent bar, not accent text — orange text is reserved
     for the Dominio Painting division link. */
  .nav-links a[aria-current="page"] {
    padding-left: 0.85rem;
    box-shadow: inset 3px 0 0 var(--color-accent);
  }
  .nav-division {
    padding-left: 0;
    border-left: none;
  }
  .header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }
  .header-phone {
    justify-content: center;
    min-height: 48px;
    border: 1px solid var(--color-mist);
    border-radius: var(--radius-sm);
  }
  .header-actions .btn { justify-content: center; min-height: 48px; }
  .header-social {
    justify-content: center;
    gap: var(--space-sm);
  }
  .header-social a { width: 48px; height: 48px; }
  .header-social svg { width: 20px; height: 20px; }
}
@media (max-width: 420px) {
  .brand-tag { display: none; }
}

/* Desktop bar on the navy header: light text. (The mobile menu panel keeps
   its white background and dark text, so these stay desktop-only.) */
@media (min-width: 1121px) {
  .nav-links a { color: rgba(231, 233, 240, 0.82); }
  .nav-links a:hover,
  .nav-links a[aria-current="page"] { color: var(--color-white); }
  .nav-division { border-left-color: rgba(255, 255, 255, 0.14); }
  .nav-links .nav-division a { color: var(--color-orange-400); }
  .nav-links .nav-division a:hover { color: var(--color-white); }
  .header-phone { color: var(--color-white); }
  .header-phone svg { color: var(--color-orange-400); }
  .header-phone:hover { color: var(--color-orange-400); }
  .header-social a { color: var(--color-white); border-color: rgba(255, 255, 255, 0.18); }
  .header-social a:hover { color: var(--color-orange-400); border-color: var(--color-orange-400); }
}
@media (min-width: 1121px) and (max-width: 1340px) {
  .header-phone { border-color: rgba(255, 255, 255, 0.18); }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--color-navy-950);
  color: rgba(231, 233, 240, 0.72);
  padding-block: var(--space-xl) var(--space-lg);
}
.site-footer a { color: inherit; }

/* Division band — the painting division presented as part of the family. */
.footer-division {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr auto;
  align-items: center;
  gap: var(--space-lg);
  padding-bottom: var(--space-xl);
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-division-logo {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color var(--duration-normal) var(--ease-out-quart);
}
.footer-division-logo:hover { border-color: rgba(239, 108, 26, 0.6); }
.footer-division-logo img { width: 100%; height: auto; }
.footer-division-kicker {
  margin: 0 0 var(--space-3xs);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-orange-400);
}
.footer-division h2 {
  margin: 0 0 var(--space-2xs);
  font-size: var(--text-lg);
  color: var(--color-white);
}
.footer-division-copy p:last-child {
  margin: 0;
  max-width: 34rem;
  font-size: var(--text-sm);
  color: rgba(231, 233, 240, 0.72);
}
@media (max-width: 900px) {
  .footer-division { grid-template-columns: 1fr; }
  .footer-division-logo { max-width: 300px; }
  .footer-division .btn { justify-self: start; }
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(2, 1fr) 1.3fr;
  gap: var(--space-lg);
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
.brand--footer { margin-bottom: var(--space-sm); }
.brand--footer picture { display: block; }
/* The footer is already dark, so the logo needs no plate here. */
.brand-logo--footer { height: 64px; }
.footer-brand p {
  max-width: 24rem;
  font-size: var(--text-sm);
  color: rgba(231, 233, 240, 0.72);
}
.footer-grid h3 {
  margin-bottom: var(--space-sm);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-white);
}
.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
  font-size: var(--text-sm);
}
.footer-grid a {
  text-decoration: none;
  /* Long unbroken strings (the email address) must not widen the column. */
  overflow-wrap: anywhere;
  transition: color var(--duration-fast) var(--ease-out-quart);
}
.footer-grid a:hover { color: var(--color-white); }

.footer-bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: var(--text-xs);
}
.footer-legal { display: flex; gap: var(--space-md); }
.footer-legal a {
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-out-quart),
              text-decoration-color var(--duration-fast) var(--ease-out-quart);
}
.footer-legal a:hover { color: var(--color-white); text-decoration-color: var(--color-accent); }

/* Social icons — rendered only for verified official accounts. */
.footer-social {
  list-style: none;
  display: flex;
  gap: var(--space-2xs);
  margin: var(--space-sm) 0 0;
  padding: 0;
}
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: border-color var(--duration-fast) var(--ease-out-quart),
              color var(--duration-fast) var(--ease-out-quart),
              transform var(--duration-fast) var(--ease-out-quart);
}
.footer-social a:hover { color: var(--color-white); border-color: var(--color-gold-400); transform: translateY(-2px); }
.footer-social a:focus-visible { outline: 3px solid var(--color-orange-400); outline-offset: 3px; }
