/* Build Support - Modern UI 2026 */

:root {
  /* --- Tokens --- */
  --font-main: "Work Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  /* Colors - Clean & Trustworthy */
  --c-primary: #4f46e5;       /* Indigo 600 */
  --c-primary-dark: #4338ca;  /* Indigo 700 */
  --c-primary-light: #e0e7ff; /* Indigo 100 */
  
  --c-text-main: #0f172a;     /* Slate 900 */
  --c-text-light: #64748b;    /* Slate 500 */
  --c-text-faint: #94a3b8;    /* Slate 400 */

  --c-bg-body: #f8fafc;       /* Slate 50 */
  --c-bg-card: #ffffff;
  --c-bg-input: #ffffff;
  
  --c-border: #e2e8f0;        /* Slate 200 */
  --c-border-hover: #cbd5e1;  /* Slate 300 */

  --c-success: #10b981;
  --c-success-bg: #ecfdf5;
  --c-danger: #ef4444;
  --c-danger-bg: #fef2f2;
  --c-warn: #f59e0b;
  --c-warn-bg: #fffbeb;

  /* Spacing & Layout */
  --gap: 1.5rem;
  --radius: 0.75rem;
  --radius-sm: 0.375rem;
  --container-width: 1100px;
  
  /* Shadows - Soft & Diffuse */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-main);
  background-color: var(--c-bg-body);
  color: var(--c-text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p { margin: 0 0 1rem; color: var(--c-text-light); max-width: 65ch; }
a { color: var(--c-primary); text-decoration: none; transition: 0.2s; font-weight: 500; }
a:hover { color: var(--c-primary-dark); }

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

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.main-content { flex: 1; padding: 2rem 0 4rem; }

/* --- Header --- */
.site-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.75rem 0;
}

.nav-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--c-text-main);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-brand span:first-child { color: var(--c-text-main); }
.nav-brand span:last-child { color: var(--c-primary); }

.main-nav { display: flex; gap: 0.5rem; align-items: center; }

/* --- Buttons & Inputs --- */
.button, button, .input-control {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: 0.2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-decoration: none;
}

.input-control {
  background: var(--c-bg-input);
  border-color: var(--c-border);
  color: var(--c-text-main);
  width: 100%;
  cursor: text;
}
.input-control:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-light);
}

.button-primary {
  background: var(--c-primary);
  color: white;
}
.button-primary:hover { background: var(--c-primary-dark); transform: translateY(-1px); }

.button-outline {
  background: white;
  border-color: var(--c-border);
  color: var(--c-text-main);
}
.button-outline:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.width-full { width: 100%; }

/* --- Nav Search --- */
.nav-search {
  position: relative;
  flex: 1;
  max-width: 300px;
}
.nav-search input {
  padding-left: 2.25rem;
  border-radius: 99px;
  background: var(--c-bg-body);
  border: 1px solid transparent;
}
.nav-search input:focus { background: white; border-color: var(--c-primary); }
.nav-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-faint);
  font-size: 0.9rem;
}

/* --- Dropdowns (Robust) --- */
.nav-dropdown { position: relative; }

.nav-dropbtn {
  background: transparent;
  color: var(--c-text-light);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.nav-dropbtn:hover, .nav-dropdown:focus-within .nav-dropbtn {
  color: var(--c-primary);
  background: var(--c-primary-light);
}

.nav-dropdown-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 100%;
  right: 0; /* Align right edge with button */
  min-width: 240px;
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  z-index: 100;
  
  /* The Bridge: move it up slightly to overlap button bottom padding, 
     preventing mouse-slip gaps */
  transform: translateY(0.5rem); 
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Show state */
.nav-dropdown:hover .nav-dropdown-content,
.nav-dropdown:focus-within .nav-dropdown-content {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.nav-dropdown-content a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--c-text-light);
  font-weight: 500;
}
.nav-dropdown-content a:hover {
  background: var(--c-bg-body);
  color: var(--c-primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--c-border);
  margin: 0.5rem 0;
}
.dropdown-header {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--c-text-faint);
  display: block;
}

@media (max-width: 768px) {
  /* On mobile, full-width menu anchored to the header */
  .nav-dropdown { position: static; /* Allows content to be full width relative to nav-flex */ }
  
  .nav-dropdown-content {
    left: 1rem;
    right: 1rem;
    width: auto;
    top: 3.5rem; /* Below header row */
    min-width: 0;
    text-align: center;
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.2);
  }
  
  .nav-dropdown:hover .nav-dropdown-content,
  .nav-dropdown:focus-within .nav-dropdown-content {
    transform: translateY(5px);
  }
}

@keyframes slideDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* --- Hero --- */
.hero-section-new { padding: 3rem 0; text-align: center; }
.hero-header { max-width: 700px; margin: 0 auto 3rem; }
.hero-header .subtitle { font-size: 1.125rem; margin-top: 1rem; }

/* Journey strip (homepage) */
.journey-strip {
  background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.journey-strip__head h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
}
.journey-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-primary);
}
.journey-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}
.journey-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1px solid var(--c-border);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 0.9rem;
}
.journey-step__num {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  background: var(--c-primary);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.journey-step__body h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}
.journey-step__body p {
  margin: 0;
  font-size: 0.92rem;
}

/* Action Grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.action-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: 0.2s;
  box-shadow: var(--shadow-sm);
}
.action-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--c-primary); }

.action-card--primary {
  border-color: var(--c-primary);
  background: linear-gradient(to bottom right, #fff, #f5f3ff);
}

.action-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.action-form { width: 100%; margin-top: auto; display: flex; flex-direction: column; gap: 0.75rem; }
.action-links { margin-top: 1rem; font-size: 0.85rem; }

/* --- Key Facts --- */
.key-facts-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  padding: 2rem;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  margin-bottom: 2rem;
}

.support-section {
  text-align: left;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.support-section h2 { margin-bottom: 0.9rem; }
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.support-tip {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  background: #fff;
}
.support-tip h3 {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
}
.support-tip p {
  margin: 0;
  font-size: 0.9rem;
}
.key-fact { display: flex; gap: 1rem; align-items: flex-start; text-align: left; }
.fact-icon { font-size: 1.5rem; background: var(--c-bg-body); padding: 0.75rem; border-radius: 50%; line-height: 1; }

/* --- Cards & Results --- */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.result-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0; /* Changed from 1.5rem to 0 for image support */
  display: flex;
  flex-direction: column;
  gap: 0; /* Reset gap */
  box-shadow: var(--shadow-sm);
  transition: 0.2s;
  overflow: hidden; /* For image corners */
}
.result-card:hover { border-color: var(--c-primary); box-shadow: var(--shadow); }

.card-image {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--c-bg-body);
  object-fit: cover;
  display: block;
}
/* Prevent icons like checkmarks/emojis from blowing up if they sneak into img tags or fallback divs */
.card-image[src$=".svg"],
.card-image[src*="icon"] {
  object-fit: contain;
  padding: 2rem;
  background: var(--c-bg-body);
}
.card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.result-header { display: flex; justify-content: space-between; align-items: start; }
.result-title { font-weight: 700; font-size: 1.1rem; color: var(--c-text-main); line-height: 1.3; }
.result-meta { font-size: 0.85rem; color: var(--c-text-light); margin-top: 0.25rem; }

.result-stats {
  display: flex;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--c-border);
  font-size: 0.8rem;
  color: var(--c-text-light);
}
.stat-item { display: flex; flex-direction: column; }
.stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-text-faint); }

/* --- Badges --- */
.badge {
  display: inline-flex;
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-major { background: var(--c-warn-bg); color: var(--c-warn); }
.badge-success { background: var(--c-success-bg); color: var(--c-success); }
.badge-neutral { background: var(--c-bg-body); color: var(--c-text-light); border: 1px solid var(--c-border); }

/* --- Map --- */
.hero-map-section { margin-bottom: 3rem; }
.hero-map-container {
  height: 500px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--c-border);
  position: relative;
  background: #dbeafe;
}
.hero-map-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1rem; }

/* --- Footer --- */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--c-border);
  color: var(--c-text-faint);
  font-size: 0.875rem;
  background: white;
  margin-top: auto;
}

/* --- Mobile Optimizations --- */
@media (max-width: 768px) {
  .site-header { padding: 0.5rem 0; }
  .nav-flex { justify-content: center; gap: 0.5rem; }
  .nav-brand { width: 100%; justify-content: center; margin-bottom: 0.5rem; }
  .main-nav { width: 100%; justify-content: center; order: 3; overflow-x: auto; padding-bottom: 0.5rem; }
  .nav-search { order: 2; width: 100%; max-width: none; margin-bottom: 0.5rem; }
  
  .hero-title-large { font-size: 2.25rem; }
  .action-grid { grid-template-columns: 1fr; }
  .key-facts-section { grid-template-columns: 1fr; gap: 1.5rem; }
  
  .hero-map-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .hero-map-header .button { width: 100%; }
}

/* --- JS Type Filter --- */
.type-filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1.5rem; }
.type-filter-label { font-size: 0.85rem; color: var(--c-text-light); margin-right: 0.5rem; }
.type-filter-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.type-filter-pill {
  background: white;
  border: 1px solid var(--c-border);
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: 0.2s;
  color: var(--c-text-main);
  display: inline-flex;
  align-items: center;
}
.type-filter-pill:hover { border-color: var(--c-primary); color: var(--c-primary); }
.type-filter-pill.active { background: var(--c-primary); color: white; border-color: var(--c-primary); }
.type-filter-count { font-size: 0.7rem; opacity: 0.7; margin-left: 0.35rem; }
.type-filter-showing { font-size: 0.8rem; color: var(--c-text-light); margin-left: auto; }
