html { scroll-behavior: smooth; scroll-padding-top: 110px; }
html.dark { color-scheme: dark; }

/* Section tones */
.c0, .c1, .c3, .c6 { --a: #00486f; }
.c2, .c4, .c5      { --a: #6f0028; }
.c0, .c1, .c2, .c3, .c4, .c5, .c6 { --at: var(--a); }
.dark .c0, .dark .c1, .dark .c2, .dark .c3, .dark .c4, .dark .c5, .dark .c6 { --at: #ffffff; }
.dark .tone-line { border-color: rgba(255,255,255,.4) !important; }

:focus-visible { outline: 3px solid #6f0028; outline-offset: 2px; border-radius: 3px; }
.dark :focus-visible, #siteHeader :focus-visible { outline-color: #ffffff; }

.navlink { padding: .4rem .75rem; font-size: .95rem; font-weight: 600; color: rgba(255,255,255,.92);
  border-bottom: 3px solid transparent; transition: .2s; }
.navlink:hover, .navlink.active { color: #ffffff; border-bottom-color: #ffffff; }

.ph { position: relative; display: grid; place-items: center; height: 180px; overflow: hidden; color: var(--at);
  background: linear-gradient(135deg, color-mix(in srgb, var(--a) 15%, transparent), color-mix(in srgb, var(--a) 40%, transparent)); }
.ph svg { width: 44px; height: 44px; opacity: .8; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pill { background: var(--a); color: #ffffff; }

.inp { width: 100%; border: 1px solid rgba(0,25,39,.35); border-radius: 2px; background: rgba(0,25,39,.05);
  padding: .6rem .75rem; font: inherit; font-weight: 400; color: #001927; }
.inp::placeholder { color: rgba(0,25,39,.5); }
.dark .inp { background: #001927; border-color: rgba(255,255,255,.35); color: #ffffff; }
.dark .inp::placeholder { color: rgba(255,255,255,.5); }
.inp[aria-invalid="true"] { border-color: #6f0028; box-shadow: 0 0 0 2px #6f0028; }
.dark .inp[aria-invalid="true"] { border-color: #ffffff; }
.err { font-size: .8rem; font-weight: 600; color: #6f0028; }
.err:empty { display: none; }
.dark .err { color: #ffffff; background: #6f0028; padding: 2px 8px; width: fit-content; border-radius: 4px; }

#reader { animation: rd .22s ease-out; }
@keyframes rd { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
#readerBody p + p { margin-top: 1.1rem; }

/* Filter Chips/Buttons */
.filter-chip {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid rgba(0,25,39,.2);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}
.filter-chip:hover { border-color: #6f0028; background: rgba(111,0,40, 0.05); }
.filter-chip.active { background: #6f0028; color: #ffffff; border-color: #6f0028; }
.dark .filter-chip { border-color: rgba(255,255,255,.2); }
.dark .filter-chip:hover { background: rgba(255,255,255,.05); }
.dark .filter-chip.active { background: #ffffff; color: #6f0028; border-color: #ffffff; }

/* Hide scrollbar for horizontal scrolling */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
.hide-scrollbar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Force the cards inside the horizontal scroll to specific widths */
#hyperlocalGrid .article-card {
  flex: 0 0 calc(50% - 0.5rem); /* 50% width minus half the gap (shows exactly 2 columns on mobile) */
  scroll-snap-align: start; /* Makes the cards snap nicely when scrolling */
}

@media (min-width: 640px) {
  #hyperlocalGrid .article-card {
    flex: 0 0 300px; /* Fixed width on tablets/desktops so you see multiple at a time */
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; } #reader { animation: none; } * { transition-duration: .001ms !important; }
}