/* ============================================
   Find Certified Installers
   Design system — clean, editorial, generous
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  /* Neutral palette — warm grays, not blue-gray */
  --black: #111111;
  --gray-900: #222222;
  --gray-800: #333333;
  --gray-700: #484848;
  --gray-600: #717171;
  --gray-500: #929292;
  --gray-400: #b0b0b0;
  --gray-300: #dddddd;
  --gray-200: #ebebeb;
  --gray-100: #f5f5f5;
  --gray-50: #fafafa;
  --white: #ffffff;

  /* Accent — teal: clean energy meets trust */
  --accent: #0D9488;
  --accent-hover: #0F766E;
  --accent-light: #F0FDFA;

  /* Functional */
  --green-dark: #008A05;
  --green: #00A807;
  --green-light: #E8F8E8;
  --blue: #0077CC;
  --blue-light: #E8F4FD;

  /* Shadows — layered, soft */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.12);
  --shadow-xl: 0 12px 48px rgba(0,0,0,0.16);
  --shadow-border: 0 0 0 1px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.06);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --max-width: 1120px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --transition: 0.2s cubic-bezier(0.2, 0, 0, 1);
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--gray-900); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--black); }

h1, h2, h3, h4, h5 { line-height: 1.25; color: var(--black); font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }

p { margin-bottom: 1rem; color: var(--gray-700); }
p:last-child { margin-bottom: 0; }

::selection { background: var(--accent-light); color: var(--black); }


/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

.section { padding: 48px 0; }
.section + .section { border-top: 1px solid var(--gray-200); }

.section-header { margin-bottom: 24px; }
.section-header h2 { margin-bottom: 4px; }
.section-header p { color: var(--gray-600); }


/* --- Header --- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--black);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.site-logo:hover { color: var(--black); text-decoration: none; }

.logo-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.site-nav { display: flex; gap: 4px; align-items: center; }

.site-nav a {
  color: var(--gray-700);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.site-nav a:hover { background: var(--gray-100); color: var(--black); }
.site-nav a.active { background: var(--gray-100); color: var(--black); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--black);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 1.25rem;
  transition: background var(--transition);
}
.nav-toggle:hover { background: var(--gray-100); }


/* --- Hero --- */
.hero {
  padding: 64px 0 56px;
  background: var(--white);
}

.hero-content {
  max-width: 680px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--gray-600);
  line-height: 1.5;
  margin-bottom: 32px;
  max-width: 520px;
}


/* --- Search Bar --- */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-full);
  padding: 6px 6px 6px 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
  max-width: 580px;
}

.search-bar:focus-within {
  border-color: var(--black);
  box-shadow: var(--shadow-md);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9375rem;
  font-family: var(--font);
  color: var(--gray-900);
  background: transparent;
  min-width: 0;
}

.search-bar input::placeholder { color: var(--gray-500); }

.search-divider {
  width: 1px;
  height: 24px;
  background: var(--gray-300);
  margin: 0 12px;
  flex-shrink: 0;
}

.search-bar select {
  border: none;
  outline: none;
  font-size: 0.9375rem;
  font-family: var(--font);
  color: var(--gray-700);
  background: transparent;
  cursor: pointer;
  appearance: none;
  padding-right: 8px;
}

.search-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--accent);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
  font-size: 1.1rem;
}

.search-btn:hover { background: var(--accent-hover); transform: scale(1.04); }


/* --- Stats Row --- */
.stats-row {
  display: flex;
  gap: 32px;
  margin-top: 32px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.stat-pill strong {
  color: var(--black);
  font-weight: 600;
}


/* --- Breadcrumbs --- */
.breadcrumbs {
  padding: 16px 24px;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.breadcrumbs a { color: var(--gray-500); text-decoration: none; }
.breadcrumbs a:hover { color: var(--black); text-decoration: underline; }
.breadcrumbs .sep { margin: 0 6px; }
.breadcrumbs .current { color: var(--gray-700); }


/* --- Page Header --- */
.page-header { padding: 32px 0 24px; }
.page-header h1 { margin-bottom: 8px; }
.page-header .lead { font-size: 1.0625rem; color: var(--gray-600); max-width: 640px; line-height: 1.6; }


/* --- Info Bar (replaces stats-bar) --- */
.info-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--gray-200);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
}

.info-item {
  background: var(--white);
  padding: 20px 24px;
  text-align: center;
}

.info-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.02em;
  display: block;
}

.info-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-top: 2px;
}


/* --- Card Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}


/* --- Installer Card --- */
.installer-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}

.installer-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.installer-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.installer-card__name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
  line-height: 1.3;
}

.installer-card__name a { color: var(--black); text-decoration: none; }
.installer-card__name a:hover { text-decoration: underline; }

.installer-card__distance {
  font-size: 0.8125rem;
  color: var(--gray-500);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}

.installer-card__address {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 4px;
  line-height: 1.5;
}

.installer-card__cert {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.installer-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.tag--solar { background: #FFF8E1; color: #B8860B; border-color: #FFE082; }
.tag--battery { background: #E8F5E9; color: #2E7D32; border-color: #A5D6A7; }
.tag--heat { background: #F3E5F5; color: #7B1FA2; border-color: #CE93D8; }
.tag--bus { background: var(--green-light); color: var(--green-dark); border-color: var(--green); font-weight: 600; }

.installer-card__actions {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 16px;
}

.installer-card__actions a {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-900);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.installer-card__actions a:hover { color: var(--black); }


/* --- Technology Cards (Hub/Home) --- */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.tech-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: left;
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  display: block;
}

.tech-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.tech-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.tech-card__icon--solar { background: #FFF8E1; }
.tech-card__icon--battery { background: #E8F5E9; }
.tech-card__icon--heat { background: #F3E5F5; }
.tech-card__icon--biomass { background: #FFF3E0; }
.tech-card__icon--water { background: #E3F2FD; }
.tech-card__icon--thermal { background: #FFF8E1; }

.tech-card__name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 4px;
}

.tech-card__count {
  font-size: 0.8125rem;
  color: var(--gray-500);
}


/* --- Town Grid --- */
.town-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.town-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--gray-900);
  text-decoration: none;
  transition: background var(--transition);
}

.town-link:hover { background: var(--gray-100); text-decoration: none; }
.town-link__count { color: var(--gray-400); font-size: 0.8125rem; font-weight: 500; }


/* --- Installer Detail --- */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 48px;
  align-items: start;
}

.detail-main { min-width: 0; }

.detail-sidebar {
  position: sticky;
  top: 88px;
}

.contact-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-border);
}

.contact-card h3 { margin-bottom: 16px; font-size: 1rem; }

.contact-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9375rem;
  font-family: var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  border: none;
  text-align: center;
}

.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--accent);
  color: var(--white);
}
.btn--primary:hover { background: var(--accent-hover); color: var(--white); transform: scale(1.02); }

.btn--secondary {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--gray-300);
}
.btn--secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }

.detail-section { margin-bottom: 40px; }
.detail-section h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
}

.detail-table { width: 100%; }
.detail-table tr + tr td, .detail-table tr + tr th { padding-top: 12px; }
.detail-table th {
  text-align: left;
  color: var(--gray-500);
  font-weight: 500;
  font-size: 0.875rem;
  width: 40%;
  vertical-align: top;
  padding-right: 16px;
}
.detail-table td {
  font-size: 0.9375rem;
  color: var(--gray-800);
}


/* --- CTA Banner --- */
.cta-banner {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin: 48px 0;
}

.cta-banner__content { max-width: 480px; }

.cta-banner h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.cta-banner p {
  font-size: 0.9375rem;
  color: var(--gray-600);
  margin-bottom: 0;
}

.cta-banner .btn { flex-shrink: 0; }


/* --- FAQ --- */
.faq-list { margin-top: 16px; }

.faq-item {
  border-bottom: 1px solid var(--gray-200);
}

.faq-item:first-child { border-top: 1px solid var(--gray-200); }

.faq-question {
  width: 100%;
  text-align: left;
  padding: 20px 0;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--black);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font);
  gap: 16px;
}

.faq-toggle {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.125rem;
  line-height: 1;
  color: var(--gray-600);
  transition: transform var(--transition), background var(--transition);
}

.faq-item.open .faq-toggle { transform: rotate(45deg); background: var(--gray-200); }

.faq-answer {
  padding: 0 0 20px;
  color: var(--gray-600);
  font-size: 0.9375rem;
  line-height: 1.7;
  display: none;
}

.faq-item.open .faq-answer { display: block; }


/* --- Related Tags --- */
.related-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-tag {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  background: var(--white);
  border: 1px solid var(--gray-300);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}

.related-tag:hover { background: var(--gray-100); border-color: var(--gray-400); text-decoration: none; }


/* --- Footer --- */
.site-footer {
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  padding: 48px 0 32px;
  margin-top: 64px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.footer-col p { font-size: 0.875rem; color: var(--gray-600); margin-bottom: 8px; }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { font-size: 0.875rem; color: var(--gray-700); text-decoration: none; }
.footer-links a:hover { color: var(--black); text-decoration: underline; }

.footer-bottom {
  border-top: 1px solid var(--gray-200);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.footer-bottom a { color: var(--gray-500); text-decoration: none; }
.footer-bottom a:hover { color: var(--black); text-decoration: underline; }


/* --- Article / Guide Content --- */
.article {
  max-width: 680px;
}

.article h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.article .lead {
  font-size: 1.125rem;
  color: var(--gray-600);
  margin-bottom: 40px;
  line-height: 1.6;
}

.article-body { font-size: 1.0625rem; line-height: 1.8; color: var(--gray-700); }
.article-body h2 { margin: 40px 0 16px; font-size: 1.375rem; color: var(--black); }
.article-body h3 { margin: 32px 0 12px; font-size: 1.125rem; }
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { margin: 0 0 16px 24px; }
.article-body li { margin-bottom: 8px; }
.article-body a { color: var(--accent); }
.article-body a:hover { color: var(--accent-hover); }
.article-body strong { color: var(--gray-900); font-weight: 600; }


/* --- Utility --- */
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.8125rem; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-24 { margin-bottom: 24px; }
.mb-40 { margin-bottom: 40px; }

.divider { border: none; border-top: 1px solid var(--gray-200); margin: 40px 0; }

.filter-input {
  display: block;
  width: 100%;
  max-width: 400px;
  padding: 10px 16px;
  border: 1px solid var(--gray-300) !important;
  border-radius: var(--radius-full) !important;
  font-size: 0.9375rem;
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--white);
  margin-bottom: 20px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.filter-input::placeholder { color: var(--gray-400); }
.filter-input:focus { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(13,148,136,0.12); }

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-row .filter-input { margin-bottom: 0; flex: 1; }

.sort-select {
  margin-left: auto;
  padding: 10px 32px 10px 16px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font);
  color: var(--gray-700);
  background: var(--white) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23717171' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--transition);
}
.sort-select:focus { outline: none; border-color: var(--accent); }
.sort-select:hover { border-color: var(--gray-400); }


/* --- Responsive --- */
@media (max-width: 768px) {
  .hero { padding: 40px 0 32px; }
  .hero h1 { font-size: 1.75rem; }

  .search-bar { flex-wrap: wrap; padding: 8px; border-radius: var(--radius-lg); }
  .search-bar input { width: 100%; padding: 8px 12px; }
  .search-divider { display: none; }
  .search-bar select { width: 100%; padding: 8px 12px; }
  .search-btn { width: 100%; height: 44px; border-radius: var(--radius-md); margin-top: 4px; }

  .stats-row { gap: 16px; flex-wrap: wrap; }

  .card-grid { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .town-grid { grid-template-columns: 1fr 1fr; }

  .detail-layout { grid-template-columns: 1fr; gap: 24px; }
  .detail-sidebar { position: static; }

  .cta-banner { flex-direction: column; text-align: center; padding: 32px 24px; }
  .cta-banner__content { max-width: 100%; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }

  .info-bar { grid-template-columns: repeat(2, 1fr); }

  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 8px 16px 16px;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
  }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }

  .section { padding: 32px 0; }
}

@media (max-width: 480px) {
  .tech-grid { grid-template-columns: 1fr; }
  .town-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .info-bar { grid-template-columns: 1fr 1fr; }
}
