:root {
  --bg: #0f4ca8;
  --surface: #f4f7ff;
  --surface-strong: #e7efff;
  --ink: #0d2e67;
  --muted: #3b5688;
  --teal: #0f4ca8;
  --teal-soft: #dce7ff;
  --orange: #ff2338;
  --red: #ba2c43;
  --blue: #2c58ba;
  --line: #c5d3ef;
  --shadow: 0 16px 36px rgba(17, 48, 45, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Sora", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -15%, #1a67d3 0%, transparent 34%),
    radial-gradient(circle at 100% 10%, #0b3d8a 0%, transparent 36%),
    var(--bg);
  min-height: 100vh;
}

.page-glow {
  position: fixed;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(44px);
  opacity: 0.32;
  pointer-events: none;
  z-index: 0;
}

.page-glow-one {
  background: rgba(255, 44, 65, 0.55);
  left: -9rem;
  top: -9rem;
}

.page-glow-two {
  background: rgba(67, 132, 232, 0.72);
  right: -11rem;
  bottom: -9rem;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(8, 45, 105, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5vw;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.brand-logo {
  width: 226px;
  height: 62px;
  object-fit: cover;
  object-position: center;
  border-radius: 0.45rem;
}

.site-nav {
  display: flex;
  gap: 1.1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.site-nav a,
.site-footer a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover,
.site-footer a:hover {
  color: #ff9ba4;
}

.header-cta {
  text-decoration: none;
  color: #ffffff;
  background: var(--orange);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.header-auth,
.header-auth-secondary {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0.7rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: #ffffff;
}

.header-auth {
  background: rgba(255, 255, 255, 0.12);
}

.header-auth-secondary {
  background: transparent;
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  padding: 0.25rem;
}

.menu-toggle span {
  display: block;
  width: 1.4rem;
  height: 2px;
  background: #ffffff;
  margin: 0.22rem 0;
}

main {
  width: min(1120px, 92vw);
  margin: 1.2rem auto 0;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 1.2rem;
  padding: 0 1.2rem 1.2rem;
  box-shadow: 0 22px 50px rgba(6, 31, 76, 0.28);
}

.hero {
  padding: 5.3rem 0 3.3rem;
}

.eyebrow {
  margin: 0 0 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--orange);
  font-size: 0.76rem;
  font-weight: 600;
}

h1,
h2,
h3 {
  font-family: "Fraunces", serif;
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4.7rem);
  max-width: 14ch;
}

h1 span {
  color: var(--teal);
}

.hero-copy {
  max-width: 62ch;
  margin: 1.35rem 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  margin: 1.8rem 0 2.5rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.82rem 1.22rem;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, #1b5ec4, #0f4ca8);
  box-shadow: var(--shadow);
}

.btn-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(31, 42, 42, 0.08);
}

.stat-card h2 {
  color: var(--teal);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.stat-card p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.section {
  padding: 3.3rem 0;
}

.section-head {
  max-width: 62ch;
}

.section-head h2,
.mission h2,
.action h2 {
  font-size: clamp(1.45rem, 4vw, 2.6rem);
}

.mission {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  align-items: end;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.mission p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.feed-controls {
  margin-top: 1.3rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.85rem;
  align-items: end;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  color: var(--ink);
}

.chip.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(125deg, #1b5ec4, #0f4ca8);
}

.feed-controls label,
.join-form label {
  display: grid;
  gap: 0.38rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.feed-controls input,
.feed-controls select,
.join-form input,
.join-form select {
  width: 100%;
  border: 1px solid #c2d1c7;
  border-radius: 0.62rem;
  padding: 0.68rem;
  background: #fff;
  font: inherit;
}

.file-upload-wrap {
  position: relative;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.file-upload-wrap input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 12rem;
  border-radius: 999px;
  background: linear-gradient(120deg, #1b5ec4, #0f4ca8);
  color: #ffffff;
  border: 1px solid transparent;
  padding: 0.78rem 1rem;
  cursor: pointer;
}

.file-upload-button:hover {
  transform: translateY(-1px);
}

.file-upload-hint {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.address-assist-row {
  display: grid;
  gap: 0.45rem;
}

.address-locate-button {
  width: fit-content;
  min-width: 14rem;
}

.address-status {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  min-height: 1.2em;
}

.address-status[data-state='success'] {
  color: #256947;
}

.address-status[data-state='error'] {
  color: #92253a;
}

.feed-stats {
  margin-top: 0.9rem;
  display: flex;
  gap: 1.1rem;
  color: var(--muted);
}

.feed-stats p {
  margin: 0;
}

.feed-stats strong {
  color: var(--ink);
}

.event-grid {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.pagination {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.page-button {
  min-width: 2.6rem;
  padding: 0.58rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.page-button.active {
  border-color: transparent;
  background: linear-gradient(125deg, #1b5ec4, #0f4ca8);
  color: #ffffff;
}

.page-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.event-card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(31, 42, 42, 0.08);
}

.event-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-police {
  background: #e5edff;
  color: #213f8e;
}

.badge-ice {
  background: #ffebef;
  color: #8f1f35;
}

.badge-medical {
  background: #d8f5ef;
  color: #0f705e;
}

.badge-fire {
  background: #ffe8dd;
  color: #9b461f;
}

.badge-community {
  background: #f0edff;
  color: #4a3d8f;
}

.event-card h3 {
  font-size: 1.3rem;
}

.event-location {
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.event-media {
  position: relative;
  margin: 0.8rem 0 0.75rem;
  border-radius: 0.9rem;
  overflow: hidden;
  background: var(--surface-strong);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.event-media-track {
  width: 100%;
  aspect-ratio: 16 / 10;
}

.event-slide {
  width: 100%;
  height: 100%;
  display: none;
}

.event-slide.active {
  display: block;
}

.event-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-media video,
.event-media iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.event-media img,
.event-media video {
  cursor: zoom-in;
}

.event-media video {
  background: #081d46;
  object-fit: cover;
}

.media-zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(4, 18, 60, 0.88);
  backdrop-filter: blur(10px);
  padding: 1rem;
}

.media-zoom-modal[hidden] {
  display: none;
}

.media-zoom-panel {
  position: relative;
  width: min(100%, 92rem);
  max-width: 92rem;
  max-height: 95vh;
  border-radius: 1rem;
  overflow: hidden;
  background: #091f4f;
  box-shadow: 0 30px 70px rgba(2, 11, 44, 0.42);
}

.media-zoom-content {
  width: 100%;
  max-height: calc(95vh - 4.5rem);
  background: #081d46;
}

.media-zoom-image,
.media-zoom-video,
.media-zoom-iframe {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #081d46;
}

.media-zoom-video {
  max-height: calc(95vh - 4.5rem);
}

.media-zoom-iframe {
  min-height: 60vh;
}

.media-zoom-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.media-zoom-caption {
  margin: 0;
  padding: 0.95rem 1rem;
  color: #f5f7ff;
  background: rgba(0, 0, 0, 0.24);
  font-size: 0.95rem;
  line-height: 1.5;
}

.event-media-controls {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  pointer-events: auto;
  padding: 0.25rem 0.5rem;
}

.media-nav,
.media-dot {
  pointer-events: auto;
}

.media-nav {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(13, 46, 103, 0.86);
  color: #ffffff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.media-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.media-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.media-dot.active {
  background: #ffffff;
}

.attachment-note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.event-details {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.source {
  margin-top: 0.78rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.source strong {
  color: var(--ink);
}

.source-official {
  color: #2c58ba;
}

.source-verified {
  color: var(--teal);
}

.source-tip {
  color: #8b5f1d;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 0.9rem;
  padding: 1rem;
  color: var(--muted);
  background: var(--surface);
}

.timeline {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.75rem;
}

.timeline article {
  border-left: 4px solid #1c5ec3;
  padding: 0.68rem 0.95rem;
  background: #edf3ff;
}

.timeline p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.action {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  align-items: start;
}

.join-form {
  display: grid;
  gap: 0.85rem;
  border-radius: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  background: var(--surface);
}

.auth-inline-message {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  border-radius: 0.9rem;
  border: 1px dashed var(--line);
  background: #edf3ff;
}

.report-auth-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-inline-button {
  width: fit-content;
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 26, 61, 0.58);
  backdrop-filter: blur(10px);
}

.auth-panel {
  position: relative;
  width: min(100%, 30rem);
  padding: 1.4rem;
  border-radius: 1.1rem;
  background: #f8fbff;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 26px 60px rgba(7, 24, 58, 0.28);
}

.auth-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.auth-status {
  margin: 1rem 0 0;
  padding: 0.82rem 0.9rem;
  border-radius: 0.8rem;
  border: 1px solid #f0c0c6;
  background: #fff1f3;
  color: #92253a;
}

.auth-status[data-state='success'] {
  border-color: #b7dbcb;
  background: #edf9f2;
  color: #256947;
}

.auth-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.auth-form label {
  display: grid;
  gap: 0.38rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-form input {
  width: 100%;
  border: 1px solid #c2d1c7;
  border-radius: 0.62rem;
  padding: 0.68rem;
  background: #fff;
  font: inherit;
}

.auth-switch {
  margin-top: 0.9rem;
  border: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.site-footer {
  width: min(1120px, 92vw);
  margin: 1.4rem auto 2.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #deebff;
}

.floating-donate {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.45rem;
  background: rgba(8, 45, 105, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 16px 38px rgba(7, 28, 74, 0.36);
}

.floating-donate-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.46rem 0.8rem;
  color: #ffffff;
  background: linear-gradient(125deg, #ff4b5d, #cf2f46);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

.floating-donate-hint {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  transition: max-width 0.22s ease, opacity 0.22s ease;
}

.floating-donate:hover .floating-donate-hint,
.floating-donate:focus-visible .floating-donate-hint {
  max-width: 8rem;
  opacity: 1;
}

.footer-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

@media (max-width: 900px) {
  .brand-logo {
    width: 186px;
    height: 52px;
  }

  .site-nav,
  .header-actions {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .site-header.menu-open {
    align-items: start;
  }

  .site-header.menu-open .site-nav {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 5vw;
    right: 5vw;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    padding: 0.75rem;
    display: grid;
    background: #0f4ca8;
    box-shadow: var(--shadow);
  }

  .stat-grid,
  .mission,
  .feed-controls,
  .event-grid,
  .action {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 3.8rem;
  }

  .feed-stats,
  .site-footer {
    flex-direction: column;
    align-items: start;
    gap: 0.4rem;
  }

  .event-media-controls {
    gap: 0.55rem;
  }

  .media-nav {
    padding: 0.38rem 0.65rem;
  }

  .media-dots {
    max-width: 100%;
  }

  .auth-panel {
    padding: 1.2rem;
  }

  .floating-donate {
    right: 0.8rem;
    bottom: 0.8rem;
  }

  .floating-donate-hint {
    max-width: 7.5rem;
    opacity: 1;
  }
}
