/* ==========================================================================
   Galaxy project gallery — SSR public styles
   Self-contained stylesheet for server-rendered /gallery/ pages. Uses Galaxy
   brand tokens directly so it never depends on the Astro Tailwind build.
   ========================================================================== */

:root {
  --gx-navy-900: #061a3f;
  --gx-navy-800: #08284f;
  --gx-navy-700: #122b59;
  --gx-blue-700: #0a3a7d;
  --gx-blue-600: #134685;
  --gx-blue-500: #004eaf;
  --gx-sky: #8bd3ed;
  --gx-tint: #eff3fb;
  --gx-red: #ef4444;
  --gx-red-600: #dc2626;
  --gx-ink: #1f2937;
  --gx-ink-soft: #4b5563;
  --gx-muted: #6b7280;
  --gx-border: #e5e7eb;
  --gx-white: #ffffff;
  --gx-radius: 10px;
  --gx-radius-lg: 16px;
  --gx-shadow: 0 1px 3px rgba(6, 26, 63, 0.12), 0 1px 2px rgba(6, 26, 63, 0.08);
  --gx-shadow-lg: 0 10px 30px rgba(6, 26, 63, 0.14);
  --gx-font: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.gx-page {
  margin: 0;
  font-family: var(--gx-font);
  color: var(--gx-ink);
  background: var(--gx-white);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.gx-page main { flex: 1 0 auto; }

img { max-width: 100%; display: block; }

a { color: inherit; }

.gx-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */
.gx-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--gx-navy-900);
  color: var(--gx-white);
}
.gx-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.gx-logo img { height: 48px; width: auto; }
.gx-header-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}
.gx-header-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.gx-header-nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.gx-header-nav a[aria-current="page"] { color: var(--gx-sky); }
.gx-header-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  font-size: 16px;
}
.gx-header-phone svg { color: var(--gx-red); }

@media (max-width: 640px) {
  .gx-header-nav { width: 100%; margin-left: 0; order: 3; }
  .gx-header-phone { margin-left: auto; }
}

/* ---------- Hero ---------- */
.gx-hero {
  background: linear-gradient(135deg, var(--gx-navy-800), var(--gx-blue-600));
  color: #fff;
  padding: 40px 0 48px;
}
.gx-breadcrumb {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 12px;
}
.gx-breadcrumb a { color: rgba(255, 255, 255, 0.9); text-decoration: none; }
.gx-breadcrumb a:hover { text-decoration: underline; }
.gx-hero-title {
  margin: 0 0 12px;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  line-height: 1.1;
}
.gx-hero-intro {
  margin: 0;
  max-width: none;
  font-size: clamp(16px, 2.2vw, 18px);
  color: rgba(255, 255, 255, 0.9);
}

/* ---------- Filters ---------- */
.gx-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  background: var(--gx-tint);
  border: 1px solid var(--gx-border);
  border-radius: var(--gx-radius);
  padding: 16px;
  margin: 28px 0;
}
.gx-filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 180px; flex: 1 1 180px; }
.gx-filter-field label { font-size: 13px; font-weight: 700; color: var(--gx-navy-700); }
.gx-filter-field select {
  appearance: none;
  font: inherit;
  font-size: 15px;
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--gx-border);
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134685' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--gx-ink);
}
.gx-filter-field select:focus-visible { outline: 2px solid var(--gx-blue-600); outline-offset: 1px; }
.gx-filter-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Buttons ---------- */
.gx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
}
.gx-btn:active { transform: translateY(1px); }
.gx-btn--primary { background: var(--gx-red); color: #fff; border-color: var(--gx-red); }
.gx-btn--primary:hover { background: var(--gx-red-600); border-color: var(--gx-red-600); }
.gx-btn--outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.6); }
.gx-btn--outline:hover { background: rgba(255, 255, 255, 0.15); }
.gx-btn--ghost { background: transparent; color: var(--gx-blue-600); border-color: var(--gx-border); }
.gx-btn--ghost:hover { background: #fff; border-color: var(--gx-blue-600); }
.gx-btn:focus-visible { outline: 2px solid var(--gx-navy-700); outline-offset: 2px; }

/* ---------- Map (prominent, always visible) ---------- */
.gx-map-section { margin: 20px 0 44px; scroll-margin-top: 90px; }
.gx-map-header { margin: 0 0 14px; }
.gx-map-header h2 { margin: 0 0 6px; font-size: 26px; line-height: 1.2; color: var(--gx-navy-700); }
.gx-map-note { margin: 0; font-size: 14px; color: var(--gx-muted); }
.gx-map-summary {
  display: inline-block;
  margin-left: 4px;
  font-weight: 600;
  color: var(--gx-navy-700);
}
.gx-map-wrap {
  /* Contain Leaflet's high-z-index panes beneath the site's sticky navigation. */
  position: relative;
  z-index: 0;
  isolation: isolate;
  border: 1px solid var(--gx-border);
  border-radius: var(--gx-radius-lg);
  overflow: hidden;
  box-shadow: var(--gx-shadow);
}
.gx-map {
  position: relative;
  height: 520px;
  width: 100%;
  background: var(--gx-tint);
}
.gx-map-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  color: var(--gx-ink-soft);
}
.gx-map-fallback p { margin: 0; font-weight: 600; }
.gx-map-fallback-note { margin: 6px 0 0; max-width: 42ch; font-weight: 500; }
.gx-map-fallback-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  font-size: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2px 20px;
  text-align: left;
  max-width: 640px;
}
.gx-map-fallback-list li { padding: 3px 0; }
.gx-map-fallback-list a { color: var(--gx-blue-600); font-weight: 600; text-decoration: none; }
.gx-map-fallback-list a:hover { text-decoration: underline; }
.gx-map .leaflet-container { height: 100%; width: 100%; font-family: var(--gx-font); }

/* Overlay badge for empty / no-filter-match states (no fake markers). */
.gx-map-empty-badge {
  max-width: 220px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--gx-border);
  border-radius: var(--gx-radius-sm, 8px);
  box-shadow: var(--gx-shadow);
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--gx-navy-700);
}

/* Popup content */
.gx-map-popup h4 { margin: 0 0 4px; font-size: 15px; color: var(--gx-navy-700); }
.gx-map-popup .gx-map-approx { margin: 0 0 8px; font-size: 11px; color: var(--gx-muted); }
.gx-map-popup .gx-map-list { list-style: none; margin: 0 0 6px; padding: 0; }
.gx-map-popup .gx-map-list:last-child { margin-bottom: 0; }
.gx-map-popup .gx-map-list li { margin: 3px 0; }
.gx-map-popup .gx-map-project {
  color: var(--gx-blue-600);
  font-weight: 600;
  text-decoration: none;
}
.gx-map-popup .gx-map-project:hover { text-decoration: underline; }
.gx-map-popup .gx-map-photo {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--gx-border);
  border-radius: var(--gx-radius-sm, 8px);
  background: #fff;
  color: var(--gx-navy-700);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.gx-map-popup .gx-map-photo:hover { border-color: var(--gx-blue-600); background: var(--gx-tint); }
.gx-map-popup .gx-map-photo:focus-visible { outline: 2px solid var(--gx-navy-700); outline-offset: 1px; }
.gx-map-popup .gx-map-photo-tag {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--gx-tint);
  color: var(--gx-muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .gx-map-section { margin: 12px 0 32px; }
  .gx-map-header h2 { font-size: 21px; }
  .gx-map { height: 380px; }
  .gx-map-summary { display: block; margin-left: 0; margin-top: 4px; }
}

/* ---------- Grid & cards ---------- */
.gx-grid-section { margin: 0 0 40px; }
.gx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.gx-card {
  background: #fff;
  border: 1px solid var(--gx-border);
  border-radius: var(--gx-radius-lg);
  overflow: hidden;
  box-shadow: var(--gx-shadow);
  transition: box-shadow 0.15s, transform 0.15s;
}
.gx-card:hover { box-shadow: var(--gx-shadow-lg); transform: translateY(-2px); }
.gx-card-link { display: block; text-decoration: none; color: inherit; height: 100%; }
.gx-card-media { position: relative; aspect-ratio: 4 / 3; background: var(--gx-tint); overflow: hidden; }
.gx-card-media img { width: 100%; height: 100%; object-fit: cover; }
.gx-card-media--empty { display: flex; align-items: center; justify-content: center; color: #9db4d6; }
.gx-card-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--gx-navy-700);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 6px;
}
.gx-card-body { padding: 16px 18px 20px; }
.gx-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.gx-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gx-blue-600);
  color: #fff;
  text-decoration: none;
}
.gx-badge--muted { background: var(--gx-tint); color: var(--gx-blue-600); }
.gx-badge--link:hover { filter: brightness(0.95); text-decoration: none; }
.gx-card-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--gx-navy-700); }
.gx-card-summary {
  margin: 0 0 12px;
  color: var(--gx-ink-soft);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gx-card-date { margin: 0 0 12px; font-size: 12px; color: var(--gx-muted); }
.gx-card-cta { font-weight: 700; font-size: 14px; color: var(--gx-red); }

/* ---------- Empty states ---------- */
.gx-empty {
  text-align: center;
  max-width: 560px;
  margin: 24px auto 56px;
  padding: 40px 20px;
  background: var(--gx-tint);
  border-radius: var(--gx-radius-lg);
}
.gx-empty-icon { color: var(--gx-blue-600); display: flex; justify-content: center; margin-bottom: 12px; }
.gx-empty h2 { margin: 0 0 10px; color: var(--gx-navy-700); font-size: 22px; }
.gx-empty p { margin: 0 auto 20px; color: var(--gx-ink-soft); max-width: 460px; }
.gx-empty-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.gx-empty--filtered { background: #fff; border: 1px solid var(--gx-border); }

/* ---------- Project detail ---------- */
.gx-project { padding: 32px 0 0; }
.gx-project .gx-breadcrumb { color: var(--gx-ink-soft); }
.gx-project .gx-breadcrumb a {
  color: var(--gx-blue-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gx-project .gx-breadcrumb a:hover { color: var(--gx-navy-900); }
.gx-back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 2px 0 18px;
  color: var(--gx-blue-700);
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.gx-back-link:hover { color: var(--gx-navy-900); }
.gx-back-link:focus-visible {
  outline: 3px solid var(--gx-blue-500);
  outline-offset: 4px;
  border-radius: 2px;
}
.gx-project-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.gx-project-title { margin: 0 0 8px; font-size: clamp(26px, 4vw, 38px); font-weight: 800; color: var(--gx-navy-700); }
.gx-project-date { margin: 0 0 14px; color: var(--gx-muted); font-size: 14px; }
.gx-project-summary { margin: 0 0 8px; font-size: 18px; color: var(--gx-ink-soft); }
.gx-project-content { margin: 28px auto; }

.gx-gallery { margin: 0 0 32px; }
.gx-gallery-group { margin-bottom: 28px; }
.gx-gallery-label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gx-blue-600);
}
.gx-gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.gx-gallery-item { margin: 0; border-radius: var(--gx-radius); overflow: hidden; border: 1px solid var(--gx-border); background: var(--gx-tint); }
.gx-gallery-item img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.gx-prose { max-width: 760px; font-size: 17px; color: var(--gx-ink); }
.gx-prose p { margin: 0 0 16px; }
.gx-story-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.gx-story-layout .gx-gallery { margin: 0; }
.gx-story-layout .gx-gallery-grid { grid-template-columns: minmax(0, 1fr); }
.gx-story-layout .gx-gallery-item img { height: auto; max-height: 540px; aspect-ratio: auto; object-fit: contain; }
.gx-story-layout .gx-prose { max-width: none; }
@media (max-width: 767px) {
  .gx-story-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

.gx-related { margin: 40px 0; }
.gx-related h2 { margin: 0 0 18px; font-size: 24px; color: var(--gx-navy-700); }

/* ---------- CTA band ---------- */
.gx-cta-band { background: var(--gx-navy-700); color: #fff; margin-top: 24px; padding: 36px 0; }
.gx-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.gx-cta-band h2 { margin: 0 0 6px; font-size: 24px; }
.gx-cta-band p { margin: 0; color: rgba(255, 255, 255, 0.85); }
.gx-cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- 404 ---------- */
.gx-notfound { text-align: center; padding: 60px 0 80px; }
.gx-notfound-code { font-size: 64px; font-weight: 800; color: var(--gx-sky); margin: 0 0 8px; }
.gx-notfound h1 { margin: 0 0 12px; color: var(--gx-navy-700); }
.gx-notfound p { margin: 0 auto 24px; color: var(--gx-ink-soft); max-width: 520px; }

/* ---------- Curated installation photo gallery ---------- */
.gx-published-work,
.gx-legacy-gallery { padding: 40px 0 16px; }
.gx-legacy-gallery { border-top: 1px solid var(--gx-border); margin-top: 40px; padding-top: 48px; padding-bottom: 56px; }
.gx-section-heading { max-width: 760px; margin-bottom: 24px; }
.gx-section-heading h2 { color: var(--gx-navy-700); font-size: clamp(24px, 3vw, 32px); margin: 0 0 8px; }
.gx-section-heading p { color: var(--gx-ink-soft); line-height: 1.65; margin: 0; }
.gx-gallery-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; }
.gx-gallery-filter { appearance: none; background: #fff; border: 1px solid var(--gx-border); border-radius: 6px; color: var(--gx-navy-700); cursor: pointer; font: inherit; font-size: 14px; font-weight: 700; padding: 9px 14px; }
.gx-gallery-filter:hover,
.gx-gallery-filter:focus-visible { border-color: var(--gx-blue-600); outline: none; }
.gx-gallery-filter.is-active { background: var(--gx-navy-700); border-color: var(--gx-navy-700); color: #fff; }
.gx-legacy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.gx-legacy-card { background: #fff; border: 1px solid var(--gx-border); border-radius: 12px; box-shadow: 0 2px 10px rgba(6, 26, 63, 0.06); overflow: hidden; }
.gx-legacy-photo { appearance: none; background: #eef2f6; border: 0; cursor: zoom-in; display: block; padding: 0; width: 100%; }
.gx-legacy-photo:focus-visible { outline: 3px solid var(--gx-blue-600); outline-offset: -3px; }
.gx-legacy-photo img { aspect-ratio: 4 / 3; display: block; height: auto; object-fit: cover; width: 100%; }
.gx-legacy-card-body { padding: 18px; }
.gx-legacy-card-body h3 { color: var(--gx-navy-700); font-size: 18px; margin: 12px 0 3px; }
.gx-legacy-card-body > p:last-child { color: var(--gx-ink-soft); font-size: 14px; line-height: 1.55; margin: 12px 0 0; }
.gx-gallery-empty { color: var(--gx-ink-soft); padding: 36px 0; text-align: center; }
.gx-lightbox { align-items: center; background: rgba(0, 0, 0, 0.88); inset: 0; justify-content: center; padding: 24px; position: fixed; z-index: 1000; }
.gx-lightbox:not([hidden]) { display: flex; }
.gx-lightbox figure { margin: 0; max-width: 1100px; text-align: center; width: 100%; }
.gx-lightbox img { border-radius: 8px; display: block; margin: 0 auto; max-height: 82vh; max-width: 100%; }
.gx-lightbox figcaption { color: #fff; margin-top: 12px; }
.gx-lightbox-close { appearance: none; background: transparent; border: 0; color: #fff; cursor: pointer; font-size: 40px; line-height: 1; padding: 8px; position: absolute; right: 18px; top: 12px; }

/* ---------- Footer ---------- */
.gx-footer { background: var(--gx-navy-900); color: #fff; margin-top: auto; }
.gx-footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.gx-footer-top { background: var(--gx-navy-700); padding: 10px 0; }
.gx-footer-top-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.gx-footer-top p { margin: 0; font-size: 14px; }
.gx-footer-phone { color: #fff; font-weight: 700; text-decoration: none; }
.gx-footer-phone:hover { color: #fbbf24; }
.gx-footer-main { padding: 32px 0 24px; }
.gx-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.gx-footer-brand img { height: 64px; width: auto; margin-bottom: 12px; }
.gx-footer-meta { margin: 2px 0; font-size: 14px; color: rgba(255, 255, 255, 0.8); }
.gx-footer-meta a { color: rgba(255, 255, 255, 0.9); }
.gx-footer-col h3 { margin: 0 0 12px; font-size: 15px; }
.gx-footer-col ul { list-style: none; margin: 0; padding: 0; }
.gx-footer-col li { margin: 6px 0; }
.gx-footer-col a { color: rgba(255, 255, 255, 0.7); text-decoration: none; font-size: 14px; }
.gx-footer-col a:hover { color: #fff; }
.gx-footer-legal { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.gx-footer-legal p { margin: 0; text-align: center; color: rgba(255, 255, 255, 0.6); font-size: 13px; }

@media (max-width: 768px) {
  .gx-legacy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gx-footer-grid { grid-template-columns: 1fr 1fr; }
  .gx-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .gx-legacy-grid { grid-template-columns: 1fr; }
  .gx-footer-grid { grid-template-columns: 1fr; }
  .gx-cta-inner { flex-direction: column; align-items: flex-start; }
}
