/* NorCal CARB Mobile — shared brand system
   Navy/red · high-contrast buttons & chips · proof gallery
   Load after page fonts; pair with Montserrat + Source Sans 3 */

:root {
  --navy: #0D2349;
  --navy-2: #163163;
  --navy-deep: #081735;
  --red: #b22234;
  --red-dark: #8c1623;
  --red-soft: #fdecef;
  --white: #ffffff;
  --ink: #1a1f2b;
  --muted: #5c6473;
  --bg: #f5f7fa;
  --line: #e3e8ef;
  --chip-bg: #e8eef8;
  --chip-border: #9fb2d4;
  --gold-focus: #ffd34d;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(13, 35, 73, 0.12);
  --shadow-red: 0 8px 22px rgba(178, 34, 52, 0.4);
}

/* ---------- Buttons (hierarchy + contrast) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.9rem 1.65rem;
  min-height: 48px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid transparent;
  font-size: 1rem;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible,
.chip:focus-visible,
.chip-filter:focus-visible,
.blog-search:focus-visible {
  outline: 3px solid var(--gold-focus);
  outline-offset: 2px;
}

/* Primary — max pop */
.btn-red {
  background: var(--red);
  color: #fff !important;
  border-color: var(--red);
  box-shadow: var(--shadow-red);
}
.btn-red:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff !important; }

/* Secondary solid on light */
.btn-navy {
  background: var(--navy);
  color: #fff !important;
  border-color: var(--navy);
  box-shadow: 0 6px 18px rgba(13, 35, 73, 0.28);
}
.btn-navy:hover { background: var(--navy-2); border-color: var(--navy-2); }

/* Outline on light */
.btn-outline {
  background: #fff;
  color: var(--navy) !important;
  border: 2px solid var(--navy);
  box-shadow: 0 2px 10px rgba(13, 35, 73, 0.08);
}
.btn-outline:hover {
  background: var(--navy);
  color: #fff !important;
}

/* Solid white on dark bands (higher contrast than ghost) */
.btn-white {
  background: #fff;
  color: var(--navy) !important;
  border-color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  font-weight: 800;
}
.btn-white:hover { background: #f0f4fa; color: var(--navy) !important; }

/* Ghost on dark — stronger white edge */
.btn-ghost {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.95);
  color: #fff !important;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: #fff;
  color: #fff !important;
}

/* ---------- Chips (controls, not pale body text) ---------- */
.chip,
.chip-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  background: var(--chip-bg);
  color: var(--navy);
  border: 2px solid var(--chip-border);
  box-shadow: 0 2px 8px rgba(13, 35, 73, 0.06);
  cursor: default;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  text-decoration: none;
  line-height: 1.2;
}
a.chip { cursor: pointer; }
.chip:hover,
.chip-filter:hover {
  border-color: var(--navy);
  background: #dce6f5;
  color: var(--navy);
}
.chip-active,
.chip-filter.is-active,
.chip-filter[aria-pressed="true"] {
  background: var(--navy) !important;
  border-color: var(--navy) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(13, 35, 73, 0.25);
}
.chip-accent {
  background: var(--red);
  border-color: var(--red);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(178, 34, 52, 0.3);
}
.chip-filter { cursor: pointer; user-select: none; }

/* ---------- Proof gallery ---------- */
.proof { background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.proof-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #0a1528;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}
.proof-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.proof-card:hover img { transform: scale(1.04); }
.proof-card figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.6rem 0.85rem 0.75rem;
  background: linear-gradient(transparent, rgba(8, 23, 53, 0.92));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

/* Hero split with real photo */
.hero-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
}
.hero-photo {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  border: 3px solid rgba(255, 255, 255, 0.18);
  aspect-ratio: 4 / 3;
  background: #0a1528;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-photo-badge {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #c3d0e6;
}
@media (max-width: 820px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-photo { max-width: 480px; }
}

/* ---------- Interactive blog hub ---------- */
.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  align-items: center;
  margin: 1.6rem 0 1.2rem;
}
.blog-search-wrap {
  flex: 1 1 240px;
  min-width: 200px;
  position: relative;
}
.blog-search {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  border: 2px solid var(--chip-border);
  border-radius: 999px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 10px rgba(13, 35, 73, 0.06);
}
.blog-search::placeholder { color: #7a8494; }
.blog-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--navy);
  font-weight: 800;
  pointer-events: none;
}
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}
.blog-meta-count {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0.4rem 0 1.2rem;
}
.blog-meta-count b { color: var(--navy); }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  color: inherit;
  text-decoration: none;
  min-height: 100%;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(13, 35, 73, 0.16);
  border-color: var(--chip-border);
}
.blog-card-img {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  overflow: hidden;
}
.blog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.blog-card-body { padding: 1.15rem 1.25rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.blog-card-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.65rem; }
.blog-card-tags span {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
}
.blog-card h3 {
  font-size: 1.12rem;
  color: var(--navy);
  margin: 0 0 0.5rem;
  line-height: 1.25;
}
.blog-card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1rem;
  flex: 1;
}
.blog-card-cta {
  font-weight: 800;
  color: var(--red);
  font-size: 0.95rem;
}
.blog-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  background: var(--bg);
  border: 2px dashed var(--chip-border);
  border-radius: var(--radius);
  color: var(--muted);
}
.blog-empty b { color: var(--navy); display: block; margin-bottom: 0.4rem; font-size: 1.1rem; }

/* Blog hub extras (Squarespace-class) */
.blog-card-meta {
  font-size: 0.82rem !important;
  font-weight: 700;
  color: var(--navy) !important;
  opacity: 0.75;
  margin: 0 0 0.55rem !important;
  flex: 0 0 auto !important;
}
.blog-toolbar-row2 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  margin: 0 0 0.5rem;
}
.blog-sort {
  min-height: 44px;
  border: 2px solid var(--chip-border, #c5cdd9);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--navy);
  background: #fff;
}
.blog-rss-link {
  font-weight: 800;
  color: var(--red);
  font-size: 0.95rem;
  text-decoration: underline;
}
.blog-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  justify-content: center;
  margin: 2rem 0 0.5rem;
}
.blog-page-status { font-weight: 700; color: var(--muted); }
.blog-page-status b { color: var(--navy); }
.blog-page-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* Share bar on posts */
.blog-share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 2rem 0 0.5rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line, #e3e8ef);
}
.blog-share-label {
  font-weight: 800;
  color: var(--navy);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 0.35rem;
}
.blog-share-btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 2px solid var(--line, #e3e8ef);
  background: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--navy);
  cursor: pointer;
  text-decoration: none;
}
.blog-share-btn:hover { border-color: var(--red); color: var(--red); }

/* Related + prev/next */
.blog-related {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 20px 1rem;
}
.blog-related-title {
  font-size: 1.45rem;
  color: var(--navy);
  margin: 0 0 1.1rem;
}
.blog-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.blog-related-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.15rem 1.2rem;
  border: 2px solid var(--line, #e3e8ef);
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 24px rgba(13, 35, 73, 0.08);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.blog-related-card:hover {
  transform: translateY(-3px);
  border-color: var(--red);
}
.blog-related-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--red);
}
.blog-related-card strong {
  color: var(--navy);
  font-size: 1.02rem;
  line-height: 1.3;
}
.blog-prevnext {
  background: var(--bg, #f5f7fa);
  border-top: 1px solid var(--line, #e3e8ef);
  border-bottom: 1px solid var(--line, #e3e8ef);
  padding: 1.6rem 0;
}
.blog-prevnext-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}
@media (max-width: 640px) {
  .blog-prevnext-inner { grid-template-columns: 1fr; }
}
.blog-pn {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line, #e3e8ef);
  text-decoration: none;
  color: inherit;
}
.blog-pn span {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #5c6473);
}
.blog-pn strong {
  color: var(--navy);
  font-size: 0.98rem;
  line-height: 1.3;
}
.blog-pn.newer { text-align: right; }
.blog-subscribe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg, #f5f7fa);
  border: 2px solid var(--line, #e3e8ef);
  border-radius: 14px;
}
.blog-subscribe b { color: var(--navy); }
.chip-filter {
  min-height: 40px;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 2px solid var(--chip-border, #c5cdd9);
  background: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
  cursor: pointer;
}
.chip-filter.is-active,
.chip-filter[aria-pressed="true"] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  border: 2px solid var(--navy);
  color: var(--navy);
  background: #fff;
  cursor: pointer;
  font: inherit;
}
.btn-outline:hover { background: var(--bg, #f5f7fa); }

.sticky-cta-bar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  background: rgba(8, 23, 53, 0.96);
  backdrop-filter: blur(8px);
  border-top: 2px solid rgba(255, 255, 255, 0.12);
  padding: 0.85rem 0;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.2);
}
.sticky-cta-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
}
.sticky-cta-inner p {
  color: #d3deef;
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}
.sticky-cta-inner p b { color: #fff; }
.sticky-cta-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

@media (max-width: 640px) {
  .btn { width: 100%; }
  .hero-cta .btn { width: auto; }
  .sticky-cta-inner { flex-direction: column; align-items: stretch; text-align: center; }
}
