/* ── Premier Windows & Doors — public site ───────────────────────────────────
   Light + dark themes. The theme follows the visitor's system setting unless
   they pick one with the toggle in the top bar (stored as data-theme on <html>).
   --theme / --theme-text come from Dash → Settings → Accent Color.
   The header, the black bands and the projects grid stay dark in both themes;
   the theme changes the content areas between them.                           */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --theme: #b08d57;
  --theme-text: #111111;
  --grid-cols: 4;
  --grid-cols-mobile: 1;

  /* light */
  --bg: #ffffff;
  --bg-alt: #f3f3f1;
  --text: #111111;
  --text-muted: #5c5c5c;
  --border: #d9d9d9;
  --link: color-mix(in srgb, var(--theme) 72%, black);

  /* header + bands. --secondary comes from Dash → Settings → Header Color. */
  --ink: var(--secondary, #000000);
  --ink-text: #f1f1f1;
  --ink-strong: #ffffff;
  --ink-muted: #b4b4b4;
  --ink-border: rgba(255,255,255,.14);
  --ink-hover: rgba(255,255,255,.1);
  --tile-border: #3d3d3d;

  --container: 1080px;
  --logo-drop: 2.75rem;   /* how far the logo hangs below the header */
  --font: Georgia, 'Times New Roman', Times, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #101010;
  --bg-alt: #1a1a1a;
  --text: #f2f2f2;
  --text-muted: #a9a9a9;
  --border: #353535;
  --link: color-mix(in srgb, var(--theme) 70%, white);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #101010;
    --bg-alt: #1a1a1a;
    --text: #f2f2f2;
    --text-muted: #a9a9a9;
    --border: #353535;
    --link: color-mix(in srgb, var(--theme) 70%, white);
    color-scheme: dark;
  }
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--link); }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 700; line-height: 1.1; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
:focus-visible { outline: 3px solid var(--theme); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.container.narrow { max-width: 800px; }
.site-main { flex: 1; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--theme); color: var(--theme-text); padding: .6rem 1rem; z-index: 400; }
.skip-link:focus { left: 0; }

.admin-bar {
  background: #222; color: #ddd; font-family: var(--font-sans); font-size: .8rem; padding: .4rem 1.25rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.admin-bar a { color: #fff; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .75rem 1.5rem; border-radius: 2px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--theme); color: var(--theme-text); border-color: var(--theme); }
.btn-primary:hover { background: color-mix(in srgb, var(--theme) 84%, black); border-color: color-mix(in srgb, var(--theme) 84%, black); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--text); }
.btn-outline:hover { background: var(--text); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--ink-strong); border-color: var(--ink-strong); }
.btn-ghost:hover { background: var(--ink-strong); color: var(--ink); }
.btn-light { background: var(--ink-strong); color: var(--ink); border-color: var(--ink-strong); }
.btn-light:hover { background: transparent; color: var(--ink-strong); }
.btn-sm { padding: .45rem .95rem; font-size: .88rem; }
.btn-lg { padding: .95rem 1.8rem; font-size: 1.08rem; }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ── Announcement bar ────────────────────────────────────────────────────── */
.announcement { font-family: var(--font-sans); font-size: .9rem; font-weight: 600; line-height: 1.4; }
.announcement-inner { display: flex; align-items: center; gap: .75rem; padding-top: .3rem; padding-bottom: .3rem; }
.announcement p { flex: 1; margin: 0; text-align: center; overflow-wrap: anywhere; }
.announcement a { color: inherit; text-decoration: underline; }
.announcement-close { flex: none; width: 1.6rem; height: 1.6rem; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer; opacity: .8; }
.announcement-close:hover, .announcement-close:focus-visible { opacity: 1; background: rgba(127,127,127,.25); }

/* ── Header: contact bar, then the menu split around the centered logo ───── */
.site-header { background: var(--ink); color: var(--ink-strong); position: relative; z-index: 50; }
.topbar { position: relative; padding: .85rem 3.75rem 0; }
.topbar-contact { display: flex; flex-direction: column; align-items: center; font-weight: 700; font-size: .95rem; line-height: 1.25; letter-spacing: .01em; }
.topbar-contact a { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink-text); text-decoration: none; overflow-wrap: anywhere; }
.topbar-contact a:hover { color: var(--ink-strong); text-decoration: underline; }
.topbar-contact svg { width: .95em; height: .95em; flex: none; }
.theme-toggle {
  position: absolute; right: 1rem; top: .7rem; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; background: none; border: 1px solid var(--ink-border); border-radius: 50%; color: var(--ink-text); cursor: pointer;
}
.theme-toggle:hover { background: var(--ink-hover); color: var(--ink-strong); }
.theme-toggle svg { width: 17px; height: 17px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .icon-sun { display: block; }
  :root:not([data-theme]) .icon-moon { display: none; }
}

.header-inner {
  position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  column-gap: clamp(1.25rem, 4vw, 3.25rem); padding: 1rem 1.25rem 0;
}
.nav-group { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem clamp(.5rem, 2vw, 1.6rem); padding-bottom: 1.6rem; }
.nav-left { justify-content: flex-end; }
.nav-right { justify-content: flex-start; }
.nav-link {
  display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .2rem;
  color: var(--ink-strong); text-decoration: none; font: inherit; font-size: clamp(1.02rem, 1.55vw, 1.22rem); font-weight: 700;
  background: none; border: 0; cursor: pointer; white-space: nowrap; transition: color .15s;
}
.nav-link:hover, .nav-link.active { color: var(--ink-muted); }
.caret { width: .7em; height: .7em; flex: none; margin-top: .15em; }

/* The logo keeps the header's color behind it and hangs over what follows. */
.site-brand {
  position: relative; z-index: 2; display: block; text-decoration: none; color: var(--ink-strong);
  background: var(--ink); padding: 0 1rem .9rem; border-radius: 0 0 8px 8px; margin-bottom: calc(-1 * var(--logo-drop));
}
.site-logo { height: clamp(84px, 9.4vw, 116px); width: auto; }
.site-name { display: flex; flex-direction: column; align-items: center; font-family: var(--font-sans); text-transform: uppercase; line-height: 1.1; padding: .9rem 0 .3rem; }
.site-name-main { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 300; letter-spacing: .14em; margin-right: -.14em; }
.site-name-sub { font-size: clamp(.58rem, .95vw, .74rem); font-weight: 500; letter-spacing: .22em; margin: .25rem -.22em 0 0; }

.nav-dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: -.8rem; min-width: 240px; z-index: 60;
  background: color-mix(in srgb, var(--ink) 90%, var(--ink-strong)); border: 1px solid var(--ink-border);
  padding: .4rem; box-shadow: 0 14px 34px rgba(0,0,0,.45);
}
.nav-right .nav-dropdown:last-child .dropdown-menu { left: auto; right: -.8rem; }
.nav-dropdown.open .dropdown-menu { display: block; }
.dropdown-item { display: block; padding: .5rem .8rem; color: var(--ink-text); text-decoration: none; font-size: 1rem; }
.dropdown-item:hover { background: var(--ink-hover); color: var(--ink-strong); }
.dropdown-item-all { font-weight: 700; border-bottom: 1px solid var(--ink-border); margin-bottom: .3rem; padding-bottom: .6rem; }
.nav-hamburger {
  display: none; position: absolute; right: 1rem; top: 1.25rem; align-items: center; justify-content: center;
  width: 44px; height: 44px; background: none; border: 1px solid var(--ink-border); border-radius: 4px; color: var(--ink-strong); cursor: pointer;
}
.nav-hamburger svg { width: 22px; height: 22px; }
@media (hover: hover) and (min-width: 901px) {
  .nav-dropdown:hover .dropdown-menu, .nav-dropdown:focus-within .dropdown-menu { display: block; }
}

/* ── Home: full-width slider ─────────────────────────────────────────────── */
.slider { position: relative; height: clamp(260px, 43.6vw, 86vh); background: #161616; overflow: hidden; }
.slider-empty { background: linear-gradient(135deg, #2c2c2c, #0f0f0f); }
.slide { position: absolute; inset: 0; display: block; opacity: 0; transition: opacity 1.1s ease; }
.slide.active { opacity: 1; z-index: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-caption {
  position: absolute; left: 0; bottom: 0; padding: .55rem 1.1rem; background: rgba(0,0,0,.6); color: #fff;
  font-size: .95rem; font-style: italic; border-top-right-radius: 4px;
}
.slider-arrow {
  position: absolute; top: 50%; z-index: 3; width: 46px; height: 46px; margin-top: -23px; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); color: #fff; cursor: pointer;
  opacity: 0; transition: opacity .2s, background .2s;
}
.slider-arrow svg { width: 22px; height: 22px; }
.slider-prev { left: 1rem; }
.slider-next { right: 1rem; }
.slider:hover .slider-arrow, .slider-arrow:focus-visible { opacity: 1; }
.slider-arrow:hover { background: rgba(0,0,0,.75); }
.slider-dots { position: absolute; left: 0; right: 0; bottom: .9rem; z-index: 3; display: flex; justify-content: center; gap: .5rem; }
.slider-dot { width: 11px; height: 11px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: transparent; cursor: pointer; box-shadow: 0 0 4px rgba(0,0,0,.5); }
.slider-dot.active { background: #fff; }
.slider-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .4em; padding: 4rem 1.25rem 1rem; color: #ccc; text-align: center; flex-wrap: wrap; }
.slider-hint a { color: #fff; }
@media (hover: none) { .slider-arrow { opacity: 1; } }

/* ── Bands (always dark) ─────────────────────────────────────────────────── */
.band { background: var(--ink); color: var(--ink-strong); }
.band a:not(.btn) { color: inherit; }
.band-headline { text-align: center; padding: clamp(2.25rem, 5.5vw, 4rem) 0 clamp(2.75rem, 7vw, 5.5rem); }
.band-headline h1 { font-size: clamp(1.45rem, 2.85vw, 2.3rem); line-height: 1.08; max-width: 27em; margin: 0 auto; }

.page-hero { position: relative; text-align: center; padding: calc(var(--logo-drop) + clamp(1.75rem, 4vw, 2.75rem)) 0 clamp(1.75rem, 4vw, 2.5rem); isolation: isolate; overflow: hidden; }
.page-hero-short { padding-bottom: clamp(2.25rem, 5vw, 3.5rem); }
.page-hero-intro { font-size: clamp(1.02rem, 1.5vw, 1.2rem); max-width: 46em; margin: .9rem auto 0; color: var(--ink-text); }
.page-hero-logo { display: block; width: auto; height: auto; max-width: min(340px, 80%); max-height: 180px; margin: 0 auto 1.1rem; }
.page-hero.has-image { color: #fff; }
.page-hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.page-hero.has-image::after { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(0,0,0,.55); }
.scroll-cue { display: inline-flex; align-items: center; justify-content: center; color: #fff; text-decoration: none; transition: transform .2s; }
.scroll-cue:hover { transform: translateY(4px); }
.scroll-cue-circle { width: 54px; height: 54px; margin-top: 1rem; border: 3px solid currentColor; border-radius: 50%; }
.scroll-cue-circle svg { width: 30px; height: 30px; }
.empty-state { padding: 3rem 1.25rem 5rem; text-align: center; color: var(--ink-muted); font-style: italic; }

/* ── Home body + brand grid ──────────────────────────────────────────────── */
.home-body { padding: clamp(2rem, 4.5vw, 3rem) 0 clamp(3.5rem, 9vw, 7rem); }
.home-mark { height: clamp(60px, 7vw, 84px); width: auto; margin: 0 auto clamp(1.75rem, 4vw, 2.75rem); }
:root[data-theme="dark"] .home-mark { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .home-mark { filter: invert(1); } }
.home-prose { text-align: center; font-size: clamp(1.05rem, 1.75vw, 1.38rem); line-height: 1.5; }
.home-prose > * + * { margin-top: 1.5em; }
.brand-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3.4vw, 2.6rem) clamp(1.25rem, 4.4vw, 3.5rem); margin-top: clamp(2.5rem, 6vw, 4.5rem);
}
.products-outro { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.brand-tile {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 2.8 / 1; padding: .5rem .9rem;
  border: 6px solid var(--tile-border); text-decoration: none; overflow: hidden; transition: border-color .2s;
}
a.brand-tile:hover { border-color: var(--theme); }
.brand-tile img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-name { font-size: clamp(1rem, 1.9vw, 1.45rem); font-weight: 700; text-align: center; line-height: 1.15; }

/* ── Projects grid ───────────────────────────────────────────────────────── */
.projects-band { padding: clamp(.75rem, 2.5vw, 1.75rem) clamp(.6rem, 1.6vw, 1.25rem) clamp(2.5rem, 6vw, 4.5rem); }
.project-grid { display: grid; grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr)); gap: .5rem; }
.project-tile { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #1c1c1c; color: #fff; text-decoration: none; }
.project-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.project-tile-empty { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #303030, #161616); }
.project-tile-label {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  padding: 1rem; text-align: center; background: rgba(0,0,0,.62); opacity: 0; transition: opacity .25s;
}
.project-tile-label strong { font-size: clamp(1.1rem, 1.7vw, 1.5rem); line-height: 1.15; }
.project-tile-label span { font-size: .95rem; color: #ddd; }
.project-tile:hover img, .project-tile:focus-visible img { transform: scale(1.05); }
.project-tile:hover .project-tile-label, .project-tile:focus-visible .project-tile-label { opacity: 1; }
/* A tile with no photo yet always shows its name. */
.project-tile-empty + .project-tile-label { opacity: 1; background: none; }
@media (hover: none) {
  .project-tile-label { opacity: 1; inset: auto 0 0 0; align-items: flex-start; text-align: left; padding: 2rem .8rem .6rem; background: linear-gradient(transparent, rgba(0,0,0,.8)); }
}

/* ── Single project ──────────────────────────────────────────────────────── */
.project-hero {
  position: relative; display: flex; align-items: center; justify-content: center; isolation: isolate; overflow: hidden;
  min-height: max(380px, min(100vh, 66vw)); padding: calc(var(--logo-drop) + 2rem) 1.25rem 5.5rem; background: #1a1a1a; color: #fff;
}
.project-hero-empty { min-height: max(300px, min(60vh, 40vw)); background: linear-gradient(135deg, #2c2c2c, #0f0f0f); }
.project-hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.project-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(0,0,0,.3); }
.project-hero-text { text-align: center; max-width: 1100px; margin-top: 12vw; text-shadow: 0 2px 22px rgba(0,0,0,.45); }
.project-hero-empty .project-hero-text { margin-top: 0; }
.project-hero h1 { font-size: clamp(2.5rem, 8.6vw, 6.6rem); line-height: .96; }
.project-hero p { font-size: clamp(1.2rem, 3.1vw, 2.4rem); line-height: 1.2; margin-top: .55em; }
.scroll-cue-double { position: absolute; left: 50%; bottom: 1.6rem; width: 46px; height: 46px; margin-left: -23px; }
.scroll-cue-double svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 6px rgba(0,0,0,.6)); }

.project-facts { padding: clamp(2.25rem, 5vw, 3.25rem) 0 clamp(2.75rem, 6vw, 4.5rem); }
.project-facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2.25rem 2rem; text-align: center; }
.project-facts dt { font-size: clamp(1.3rem, 2vw, 1.55rem); font-weight: 700; }
.project-facts dd { margin-top: .7rem; font-size: 1.08rem; line-height: 1.75; color: var(--ink-text); }
.project-body { padding: clamp(2rem, 5vw, 3.25rem) 0 clamp(1.75rem, 4vw, 2.75rem); }
.project-prose { max-width: 800px; margin: 0 auto; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-top: clamp(1.75rem, 4vw, 2.75rem); }
.photo-grid:first-child { margin-top: 0; }
.photo-item { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--bg-alt); cursor: zoom-in; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.photo-item:hover img { transform: scale(1.04); }
.project-rule { border: 0; border-top: 1px solid var(--border); margin-top: clamp(2rem, 5vw, 3.25rem); }
.project-rule-only { margin-top: 0; }
.more-projects { text-align: center; padding: clamp(1.75rem, 4vw, 2.5rem) clamp(.6rem, 1.6vw, 1.25rem) clamp(2.5rem, 6vw, 4.5rem); }
.more-projects h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); margin-bottom: clamp(1.5rem, 3.5vw, 2.5rem); }

/* Photo lightbox */
.lightbox { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.95); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 88vh; object-fit: contain; }
.lightbox button {
  position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff;
  font-size: 1.6rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lightbox button:hover { background: rgba(255,255,255,.28); }
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev { left: 1rem; top: 50%; margin-top: -24px; }
.lightbox-next { right: 1rem; top: 50%; margin-top: -24px; }
.lightbox-count { position: absolute; bottom: 1rem; left: 0; right: 0; text-align: center; color: #bbb; font-family: var(--font-sans); font-size: .85rem; }

/* ── Forms ({form: name} in content) ─────────────────────────────────────── */
.site-form-wrap { font-family: var(--font-sans); font-size: 1rem; text-align: left; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.25rem; }
.form-field { grid-column: 1 / -1; min-width: 0; }
.form-field.form-half { grid-column: auto; }
.form-field > label, .form-field legend { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; padding: 0; }
.form-field fieldset { border: 0; min-width: 0; }
.form-req { color: #c0392b; }
.site-form input[type="text"], .site-form input[type="email"], .site-form input[type="tel"], .site-form select, .site-form textarea {
  width: 100%; padding: .7rem .8rem; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--text) 38%, var(--bg)); border-radius: 2px;
}
.site-form textarea { resize: vertical; min-height: 8rem; }
.site-form input:focus-visible, .site-form select:focus-visible, .site-form textarea:focus-visible { outline: 2px solid var(--theme); outline-offset: 1px; border-color: var(--theme); }
.form-choice { display: flex; align-items: flex-start; gap: .55rem; padding: .2rem 0; font-weight: 400; cursor: pointer; }
.form-choice input { width: 1.1rem; height: 1.1rem; margin-top: .22rem; flex: none; accent-color: var(--theme); }
.form-help { display: block; margin-top: .3rem; font-size: .85rem; color: var(--text-muted); }
.form-field-error { display: block; font-size: .85rem; font-weight: 600; color: #c0392b; }
.form-field-error:not(:empty) { margin-top: .3rem; }
.form-field.has-error input:not([type="checkbox"]):not([type="radio"]), .form-field.has-error select, .form-field.has-error textarea { border-color: #c0392b; }
:root[data-theme="dark"] .form-req, :root[data-theme="dark"] .form-field-error, :root[data-theme="dark"] .form-error { color: #ff8a7a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .form-req, :root:not([data-theme]) .form-field-error, :root:not([data-theme]) .form-error { color: #ff8a7a; } }
.form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { margin-top: 1rem; font-weight: 600; color: #c0392b; }
.form-submit { margin-top: 1.25rem; font-family: var(--font); }
.form-submit[disabled] { opacity: .6; cursor: wait; }
.form-success { padding: 1.5rem 1.25rem; border: 1px solid var(--border); border-left: 4px solid var(--theme); background: var(--bg-alt); font-size: 1.05rem; }
.site-form[hidden], .form-success[hidden], .form-error[hidden] { display: none; }
@media (max-width: 600px) { .form-field.form-half { grid-column: 1 / -1; } }

/* ── CMS pages + prose ───────────────────────────────────────────────────── */
.cms-page-body { padding-top: 28px; padding-bottom: clamp(3rem, 8vw, 6rem); }
/* Heading hidden on this page: clear the logo that hangs below the header. */
.cms-page-body.no-heading { padding-top: calc(var(--logo-drop) + 28px); }
/* Page with its own background color (page editor → Page Background). The text
   turns black or white to suit the color, whichever theme the visitor uses. */
.site-main:has(> .page-bg) { display: flex; flex-direction: column; }
.cms-page.page-bg { flex: 1; background: var(--bg); color: var(--text); }
.page-bg-dark  { --text: #ffffff; --text-muted: rgba(255,255,255,.74); --border: rgba(255,255,255,.26); --bg-alt: color-mix(in srgb, var(--bg) 88%, white); --link: color-mix(in srgb, var(--theme) 55%, white); color-scheme: dark; }
.page-bg-light { --text: #111111; --text-muted: rgba(0,0,0,.68); --border: rgba(0,0,0,.22); --bg-alt: color-mix(in srgb, var(--bg) 93%, black); --link: color-mix(in srgb, var(--theme) 60%, black); color-scheme: light; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.prose { font-size: 1.12rem; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1em; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin-top: 1.7em; }
.prose > :first-child { margin-top: 0; }
/* A centered or right-aligned heading that opens the page sits in a wrapper; drop its top margin too. */
.prose > :first-child > :first-child { margin-top: 0; }
.prose h3 { font-size: 1.35rem; }
.prose h4 { font-size: 1.1rem; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose blockquote { border-left: 4px solid var(--theme); padding: .4rem 0 .4rem 1.1rem; color: var(--text-muted); font-style: italic; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose img, .prose .md-img { height: auto; }
.prose iframe { max-width: 100%; border: 0; }
.prose code { background: var(--bg-alt); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.columns { display: grid; grid-template-columns: var(--col-template, repeat(var(--cols, 2), minmax(0, 1fr))); gap: 1.5rem var(--col-gap, clamp(1.5rem, 4vw, 3rem)); align-items: start; }
.column > * + * { margin-top: 1.1em; }
.column > :first-child { margin-top: 0; }
.spacer { margin: 0; }
.column img { display: block; max-width: 100%; height: auto; }
.map-canvas { width: 100%; border: 1px solid var(--border); background: var(--bg-alt); z-index: 0; font-family: var(--font-sans); }
.map-canvas .leaflet-control-attribution { font-size: 10px; line-height: 1.4; padding: 0 4px; }
.prose .map-canvas img { border-radius: 0; }
.map-embed figcaption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .4rem; font-size: .9rem; color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-center .cta-button { margin-left: .3rem; margin-right: .3rem; }
.text-right .cta-button { margin-left: .6rem; margin-right: 0; }
.prose .cta-button { margin: .35rem .6rem .35rem 0; }
.prose pre { background: var(--bg-alt); padding: 1rem; border-radius: 4px; overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--border); padding: .5rem .7rem; text-align: left; }
.page-404 { padding-bottom: clamp(4rem, 12vw, 9rem); }
.page-404 .btn-row { justify-content: center; margin-top: 2rem; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer { background: #171717; color: var(--footer-text, #b5b5b5); font-style: italic; font-size: .98rem; padding: 1.5rem 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .9rem 2rem; }
.footer-address { display: block; font-size: .88rem; margin-top: .2rem; }
.site-footer a { color: var(--footer-link, #dcdcdc); }
.site-footer a:hover { text-decoration-thickness: 2px; }
.footer-icons { display: flex; flex-wrap: wrap; gap: .5rem; font-style: normal; }
.footer-icon-link { color: var(--footer-link, #dcdcdc); display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; text-decoration: none; }
.footer-icon-link:hover { background: rgba(255,255,255,.1); }
.footer-icon-text { width: auto; padding: 0 .9rem; border-radius: 999px; font-size: .82rem; }
.link-icon { width: 17px; height: 17px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --logo-drop: 0rem; }
  .header-inner { grid-template-columns: 1fr; padding-top: .6rem; }
  .site-brand { order: -1; justify-self: center; margin-bottom: 0; padding-bottom: .9rem; }
  .nav-hamburger { display: inline-flex; }
  .nav-group { display: none; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0; padding-bottom: 0; }
  .site-header.nav-open .nav-group { display: flex; }
  .site-header.nav-open .nav-right { padding-bottom: 1rem; }
  .nav-link { width: 100%; justify-content: space-between; padding: .8rem .25rem; font-size: 1.15rem; border-top: 1px solid var(--ink-border); }
  .dropdown-menu, .nav-right .nav-dropdown:last-child .dropdown-menu { position: static; box-shadow: none; border: 0; background: var(--ink-hover); margin-bottom: .5rem; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-tile { border-width: 5px; }
  .columns[style*="--cols:4"], .columns[style*="--cols:5"], .columns[style*="--cols:6"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-hero-text { margin-top: 0; }
}
@media (max-width: 760px) {
  .columns { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar { padding-right: 3.5rem; padding-left: 1rem; }
  .topbar-contact { align-items: flex-start; font-size: .85rem; }
  .project-grid { grid-template-columns: repeat(var(--grid-cols-mobile), minmax(0, 1fr)); }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-grid { grid-template-columns: 1fr; }
  .brand-tile { max-width: 340px; width: 100%; margin: 0 auto; }
  .footer-inner { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
