/* Flood map — wash on the map, filters on the graphic, not a dashboard. */
body.flood-page .g-head,
body.flood-page .crumbs,
body.flood-page .g-main,
body.flood-page .g-foot {
  max-width: 1120px;
}

body.flood-page .g-main {
  padding-bottom: 56px;
}

.flood-lede {
  max-width: 42rem;
  margin: 0 0 18px;
}

.flood-lede p {
  margin: 0 0 10px;
  font-size: 17.5px;
  line-height: 1.5;
}

.flood-search {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  max-width: 40rem;
}

.flood-search input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--ink);
  font: 16px var(--font-ui);
  box-shadow: var(--ios-shadow, 0 1px 2px rgba(21, 32, 28, .06));
}

.flood-search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.flood-search button {
  flex: 0 0 auto;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: #2a6f97;
  color: #fff;
  font: 650 15px var(--font-ui);
  cursor: pointer;
}

.flood-search button:hover { background: #245f81; }

.flood-towns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

@media (max-width: 879px) {
  .flood-lede {
    margin-bottom: 12px;
  }
  .flood-lede p {
    font-size: 16px;
  }
  .flood-towns {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin-bottom: 10px;
  }
  .flood-towns li { flex: 0 0 auto; }
}

.flood-towns button {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--ink-2);
  font: 600 13.5px var(--font-ui);
  cursor: pointer;
}

.flood-towns button:hover { border-color: #2a6f97; color: #2a6f97; }

.flood-towns button[aria-pressed="true"] {
  background: #2a6f97;
  border-color: #2a6f97;
  color: #fff;
}

.flood-theater {
  position: relative;
}

.flood-layout {
  display: grid;
  gap: 16px;
}

.flood-desk {
  position: relative;
  isolation: isolate;
}

@media (min-width: 880px) {
  .flood-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .85fr);
    align-items: stretch;
    gap: 16px;
  }
}

.flood-stage {
  position: relative;
  isolation: isolate;
  z-index: 0;
  min-height: min(56vh, 560px);
  height: min(56vh, 560px);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 110%, rgba(42, 111, 151, .22), transparent 55%),
    #c9dbe4;
  box-shadow: 0 4px 16px rgba(21, 50, 64, .07);
}

.flood-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 28%,
    rgba(255, 255, 255, .16) 46%,
    transparent 62%
  );
  background-size: 220% 100%;
  animation: flood-shimmer 9s ease-in-out infinite;
  mix-blend-mode: soft-light;
}

@keyframes flood-shimmer {
  0% { background-position: 100% 0; }
  50% { background-position: 0 0; }
  100% { background-position: 100% 0; }
}

#floodMap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.flood-stage .leaflet-container {
  height: 100%;
  width: 100%;
  background: transparent;
  font-family: var(--font-ui);
  touch-action: none;
}

.flood-stage .leaflet-control-zoom {
  border: 0;
  box-shadow: 0 2px 10px rgba(21, 50, 64, .12);
}

.flood-stage .leaflet-control-zoom a {
  width: 34px;
  height: 34px;
  line-height: 34px;
  color: #1e3a4a;
  background: rgba(247, 250, 248, .94);
}

.flood-stage .leaflet-control-attribution {
  font-size: 10.5px;
  background: rgba(247, 250, 248, .86);
  margin: 0;
  max-width: 46vw;
}

.flood-stage .leaflet-top.leaflet-right {
  top: 8px;
  right: 8px;
  z-index: 5;
}

/* Never fade or clip the flood pane — that is what wiped the wash on phones. */
.leaflet-flood-pane,
.leaflet-flood-pane.is-in {
  opacity: 1 !important;
  visibility: visible !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
}

.flood-fema-img {
  mix-blend-mode: multiply;
  pointer-events: none;
}

.flood-waves {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.flood-waves svg {
  position: absolute;
  left: -10%;
  width: 120%;
  bottom: -6px;
  height: 86px;
}

.flood-waves .w1 { animation: wave-drift 9s linear infinite; opacity: .5; }
.flood-waves .w2 { animation: wave-drift 13s linear infinite reverse; opacity: .36; }
.flood-waves .w3 { animation: wave-drift 7s linear infinite; opacity: .24; }

@keyframes wave-drift {
  from { transform: translateX(0); }
  to { transform: translateX(-8%); }
}

.flood-hint,
.flood-float {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 5;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(247, 250, 248, .94);
  border: 1px solid rgba(42, 111, 151, .22);
  color: #1e3a4a;
  font: 650 13px var(--font-ui);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(21, 50, 64, .08);
  max-width: calc(100% - 88px);
}

.flood-float.is-sfha {
  background: #1d4f78;
  border-color: #1d4f78;
  color: #fff;
}
.flood-float.is-wave {
  background: #8a3a4e;
  border-color: #8a3a4e;
  color: #fff;
}

.flood-toolbar {
  position: relative;
  z-index: 8;
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px 10px;
  border-radius: 16px;
  background: #f7faf8;
  border: 1px solid rgba(42, 111, 151, .2);
  box-shadow: 0 6px 18px rgba(21, 50, 64, .08);
}

.flood-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1px;
}

.flood-filters button {
  flex: 1 0 auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #1e3a4a;
  font: 650 12.5px var(--font-ui);
  cursor: pointer;
  white-space: nowrap;
}

.flood-filters button[aria-pressed="true"] {
  color: #fff;
}
.flood-filters button[data-layer="A"][aria-pressed="true"] {
  background: #2a6f97;
  border-color: #2a6f97;
}
.flood-filters button[data-layer="V"][aria-pressed="true"] {
  background: #8a3a4e;
  border-color: #8a3a4e;
}
.flood-filters button[data-layer="X02"][aria-pressed="true"] {
  background: #a4843c;
  border-color: #a4843c;
}

.flood-bfe {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-areas:
    "label rise out"
    "range range range";
  gap: 4px 8px;
  align-items: center;
}

.flood-bfe label {
  grid-area: label;
  font: 650 12px var(--font-ui);
  color: #1e3a4a;
}

.flood-bfe output {
  grid-area: out;
  font: 650 12px var(--font-ui);
  color: #2a6f97;
  text-align: right;
}

.flood-bfe input[type="range"] {
  grid-area: range;
  width: 100%;
  accent-color: #2a6f97;
  height: 28px;
}

.flood-rise {
  grid-area: rise;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: #1d4f78;
  color: #fff;
  font: 650 13px var(--font-ui);
  cursor: pointer;
}

.flood-rise[aria-pressed="true"] { background: #8a3a4e; }

.flood-edition {
  margin: 0;
  font: 500 11.5px var(--font-ui);
  color: var(--ink-muted);
}

.flood-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-raised);
  box-shadow: 0 10px 28px rgba(21, 50, 64, .06);
  scroll-margin-top: 16px;
}

@media (max-width: 879px) {
  body.flood-page .g-main {
    display: flex;
    flex-direction: column;
  }
  body.flood-page .g-main > h1 { order: 0; }
  body.flood-page .flood-theater { order: 1; }
  body.flood-page .flood-fine { order: 1; }
  body.flood-page .flood-search { order: 2; }
  body.flood-page .flood-towns { order: 3; }
  body.flood-page .flood-lede { order: 4; }
  body.flood-page .g-main > h2,
  body.flood-page .g-main > p:not(.flood-fine),
  body.flood-page .flood-stats,
  body.flood-page .faq,
  body.flood-page .cta { order: 5; }

  .flood-theater {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 8px 0 10px;
    background: var(--bg, #eef3f1);
  }
  .flood-layout {
    gap: 0;
  }
  .flood-stage {
    min-height: 220px;
    height: min(52dvh, 440px);
    box-shadow: none;
    border-radius: 16px 16px 0 0;
  }
  .flood-waves {
    height: 36px;
  }
  .flood-waves svg {
    height: 42px;
    bottom: -4px;
  }
  .flood-toolbar {
    margin: 0 0 8px;
    padding: 8px 8px 8px;
    gap: 6px;
    border-radius: 14px;
  }
  .flood-edition {
    display: none;
  }
  .flood-filters button {
    padding: 9px 11px;
    font-size: 12px;
  }
  .flood-bfe input[type="range"] {
    height: 32px;
  }
  .flood-rise {
    min-height: 36px;
    padding: 8px 14px;
  }
  .flood-hint,
  .flood-float {
    left: 8px;
    top: 8px;
    font-size: 12px;
    padding: 6px 10px;
  }
  .flood-stage .leaflet-control-zoom a {
    width: 44px;
    height: 44px;
    line-height: 44px;
  }
  .flood-panel {
    background: #f7faf8;
    padding: 12px 14px 12px;
    gap: 8px;
    border-radius: 0 0 16px 16px;
    border-top: 0;
    box-shadow: none;
  }
  .flood-panel h2 {
    font-size: 18px;
  }
  .flood-panel #floodBody {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 15px;
  }
  .flood-legend {
    display: none;
  }
}

.flood-panel h2 {
  margin: 0;
  font-size: 22px;
}

.flood-panel p { margin: 0; }

.flood-gauge {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: #e4ece8;
  overflow: hidden;
}

.flood-gauge > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #7eb8c9, #2a6f97);
  transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.flood-panel.is-sfha .flood-gauge > span {
  background: linear-gradient(90deg, #5aa0c4, #1d4f78);
}
.flood-panel.is-wave .flood-gauge > span {
  background: linear-gradient(90deg, #c47a8a, #8a3a4e);
}

.flood-meta {
  font-size: 14px;
  color: var(--ink-muted);
}

.flood-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.flood-actions a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font: 650 13.5px var(--font-ui);
}

.flood-actions a.primary {
  background: #2a6f97;
  color: #fff;
}
.flood-actions a.ghost {
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.flood-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--ink-2);
}

.flood-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 3px;
  vertical-align: -1px;
}

.flood-legend .sfha { background: #6aa7c4; }
.flood-legend .wave { background: #c47a8a; }
.flood-legend .x { background: #e6d9b8; }

.flood-stats {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

@media (min-width: 640px) {
  .flood-stats { grid-template-columns: 1fr 1fr; }
}

.flood-stats a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: var(--surface-raised);
}

.flood-stats a:hover { border-color: #2a6f97; }

.flood-stats .n {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: #1e3a4a;
}

.flood-stats .t { font-weight: 700; }
.flood-stats .s { font-size: 13.5px; color: var(--ink-muted); margin-top: 2px; }

.flood-fine {
  margin: 12px 0 0;
  padding: 10px 2px 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-muted);
  border-top: 1px solid var(--line, #d5ddd9);
}

.leaflet-div-icon.flood-pin {
  background: none;
  border: 0;
}

.flood-pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2a6f97;
  border: 2px solid #fff;
  box-shadow: 0 0 0 6px rgba(42, 111, 151, .22);
}

@media (prefers-reduced-motion: reduce) {
  .leaflet-flood-pane,
  .leaflet-flood-pane.is-in {
    opacity: 1 !important;
    visibility: visible !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
  }
  .flood-stage::after,
  .flood-waves .w1,
  .flood-waves .w2,
  .flood-waves .w3 { animation: none; }
  .flood-gauge > span { transition: none; }
}
