/* ============================================================
   HomeRiskMap — public stylesheet
   ============================================================ */

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #16243a;
  --ink-soft: #4b5b73;
  --ink-faint: #7d8ba1;
  --line: #e3e9f2;
  --brand: #0f4c81;
  --brand-dark: #0b3a63;
  --accent: #e8693a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 36, 58, .05), 0 8px 24px -12px rgba(22, 36, 58, .12);
  --shadow-hover: 0 2px 4px rgba(22, 36, 58, .06), 0 16px 32px -12px rgba(22, 36, 58, .18);
  /* risk level scale */
  --lvl1: #2e9e5b;
  --lvl2: #8fbf3f;
  --lvl3: #f0b429;
  --lvl4: #e8693a;
  --lvl5: #d23f31;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ----------------------------------------------------------- header --- */
.site-header {
  background: linear-gradient(135deg, #102a43 0%, #0f4c81 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(16, 42, 67, .25);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.2px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .12);
  color: #ffd08a;
}
.main-nav { display: flex; gap: 4px; margin-left: 6px; }
.main-nav a {
  color: rgba(255, 255, 255, .85);
  padding: 8px 13px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
}
.main-nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }

.header-search { margin-left: auto; display: flex; align-items: center; position: relative; }
.header-search input {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fff;
  border-radius: 999px;
  padding: 8px 38px 8px 16px;
  font-size: 14px;
  width: 220px;
  outline: none;
  transition: background .15s, width .2s;
}
.header-search input::placeholder { color: rgba(255, 255, 255, .65); }
.header-search input:focus { background: rgba(255, 255, 255, .22); width: 260px; }
.header-search button {
  position: absolute;
  right: 6px;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, .8);
  cursor: pointer;
  padding: 6px;
  display: grid;
  place-items: center;
}

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* ------------------------------------------------------------- hero --- */
.hero {
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(232, 105, 58, .14), transparent 60%),
    linear-gradient(180deg, #102a43 0%, #16385c 70%, #1d4570 100%);
  color: #fff;
  padding: 56px 0 64px;
}
.hero h1 {
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.12;
  margin: 0 0 14px;
  letter-spacing: -.8px;
  max-width: 720px;
}
.hero-sub {
  font-size: 18px;
  color: rgba(255, 255, 255, .82);
  max-width: 640px;
  margin: 0 0 36px;
}

/* tile map */
.map-wrap {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 20px;
  padding: 26px;
  backdrop-filter: blur(4px);
}
.tile-map {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  max-width: 860px;
  margin: 0 auto;
}
.tile {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-weight: 800;
  font-size: clamp(10px, 1.5vw, 14px);
  color: #fff;
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.tile:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 10px 22px -8px rgba(0, 0, 0, .5);
  text-decoration: none;
  filter: brightness(1.12);
  z-index: 2;
}
.map-lvl-0 { background: #5b6b81; }
.map-lvl-1 { background: var(--lvl1); }
.map-lvl-2 { background: var(--lvl2); }
.map-lvl-3 { background: var(--lvl3); color: #4a3a06; }
.map-lvl-4 { background: var(--lvl4); }
.map-lvl-5 { background: var(--lvl5); }

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 22px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .8);
}
.legend-label { font-weight: 700; color: #fff; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}

/* --------------------------------------------------------- sections --- */
.section { padding: 56px 0; }
.section-alt { background: #eef2f8; }
.section-title {
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -.5px;
  margin: 36px 0 8px;
}
.section > .container > .section-title:first-child,
.section-title:first-child { margin-top: 0; }
.section-sub { color: var(--ink-soft); margin: 0 0 26px; }

.section-trust { background: linear-gradient(135deg, #102a43, #0f4c81); color: #fff; }
.section-trust .section-title { color: #fff; }
.trust-inner { max-width: 760px; }
.trust-inner p { color: rgba(255, 255, 255, .85); font-size: 17px; }

/* ------------------------------------------------------------ cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  color: var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); text-decoration: none; }
.card-title { font-weight: 750; font-size: 16.5px; letter-spacing: -.2px; }
.card-text { color: var(--ink-soft); font-size: 14.5px; }
.card-more { color: var(--brand); font-weight: 650; font-size: 14px; margin-top: auto; }
.risk-card { align-items: flex-start; }
.risk-icon { font-size: 30px; line-height: 1; }
.hotspot-card .badge { align-self: flex-start; }

/* ----------------------------------------------------------- badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 750;
  color: #fff;
  white-space: nowrap;
}
.badge-sm { padding: 2px 9px; font-size: 11.5px; }
.lvl-0 { background: #5b6b81; }
.lvl-1 { background: var(--lvl1); }
.lvl-2 { background: var(--lvl2); }
.lvl-3 { background: var(--lvl3); color: #4a3a06; }
.lvl-4 { background: var(--lvl4); }
.lvl-5 { background: var(--lvl5); }

.level-bar {
  display: block;
  width: 110px;
  height: 7px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.level-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lvl1), var(--lvl3), var(--lvl5));
}
.level-bar-lg { width: min(360px, 100%); height: 10px; margin-top: 10px; }

/* -------------------------------------------------------- risk rows --- */
.risk-rows { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 36px; }
.risk-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.risk-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); text-decoration: none; }
.risk-row-icon { font-size: 26px; width: 36px; text-align: center; flex-shrink: 0; }
.risk-row-code {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #eef2f8;
  color: var(--brand-dark);
  border-radius: 10px;
  font-weight: 800;
}
.risk-row-body { flex: 1; min-width: 0; }
.risk-row-title { display: block; font-weight: 750; }
.risk-row-text { display: block; color: var(--ink-soft); font-size: 14px; }
.risk-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  flex-shrink: 0;
}

/* ------------------------------------------------------- page layout --- */
.page-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  padding-top: 32px;
  padding-bottom: 64px;
}
.page-narrow { max-width: 880px; padding-top: 32px; padding-bottom: 64px; }
.center-page { text-align: center; padding-top: 80px; padding-bottom: 100px; }

.breadcrumbs { font-size: 13.5px; color: var(--ink-faint); margin-bottom: 18px; }
.breadcrumbs a { color: var(--ink-faint); }
.breadcrumbs span { color: var(--ink-soft); }

.page-header { margin-bottom: 26px; }
.page-header h1 {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: -.6px;
  margin: 6px 0 12px;
}
.kicker {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12.5px;
  font-weight: 750;
  color: var(--accent);
  margin: 0;
}
.page-lede { font-size: 17px; color: var(--ink-soft); margin: 0; }
.prose-lede {
  font-size: 18px;
  color: var(--ink-soft);
  border-left: 4px solid var(--accent);
  padding-left: 16px;
  margin: 22px 0;
}

/* ------------------------------------------------------------ prose --- */
.prose { max-width: 74ch; }
.prose h2 {
  font-size: 24px;
  letter-spacing: -.4px;
  margin: 38px 0 12px;
}
.prose h3 { font-size: 19px; margin: 26px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 24px; margin: 0 0 18px; }
.prose li { margin-bottom: 7px; }
.prose a { font-weight: 600; }
.prose blockquote {
  border-left: 4px solid var(--brand);
  margin: 20px 0;
  padding: 6px 0 6px 18px;
  color: var(--ink-soft);
}
.prose table { border-collapse: collapse; width: 100%; margin: 20px 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose th { background: #eef2f8; }

.updated-note {
  font-size: 13.5px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 40px;
}
.article-date { font-size: 14.5px; }

/* ---------------------------------------------------------- sidebar --- */
.page-sidebar { display: flex; flex-direction: column; gap: 18px; }
.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  font-size: 14.5px;
}
.side-title {
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-faint);
  margin: 0 0 10px;
}
.side-note { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 0; }
.side-links { list-style: none; padding: 0; margin: 0; }
.side-links li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.side-links li:last-child { border-bottom: 0; }

/* ------------------------------------------------------- state grid --- */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.state-cell {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 15px;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.state-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); text-decoration: none; }
.state-cell-code {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.state-cell-name { display: block; font-weight: 750; }
.state-cell-meta { display: block; font-size: 12.5px; color: var(--ink-faint); }

/* ------------------------------------------------------------ forms --- */
.search-form { display: flex; gap: 10px; margin: 8px 0 34px; }
.search-form input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  background: var(--surface);
}
.contact-form { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.contact-form label { font-weight: 650; font-size: 14.5px; display: flex; flex-direction: column; gap: 6px; }
.contact-form input, .contact-form textarea {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15.5px;
  font-family: inherit;
  background: var(--surface);
}
.contact-form input:focus, .contact-form textarea:focus, .search-form input:focus {
  outline: 2px solid rgba(15, 76, 129, .35);
  border-color: var(--brand);
}
.hp-field { position: absolute; left: -9999px; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: filter .12s, transform .12s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }

.alert { border-radius: 10px; padding: 14px 18px; margin: 0 0 22px; font-weight: 600; }
.alert-success { background: #e5f6ec; color: #176b3a; border: 1px solid #b7e4c8; }
.alert-error { background: #fdecea; color: #a02018; border: 1px solid #f6c8c3; }

/* ------------------------------------------------------- pagination --- */
.pagination { display: flex; gap: 8px; justify-content: center; margin: 30px 0; }
.page-num {
  min-width: 38px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
}
.page-num.current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* --------------------------------------------------------- ad slots --- */
.ad-slot {
  display: flex;
  justify-content: center;
  margin: 22px auto;
  max-width: 1140px;
  padding: 0 20px;
  overflow: hidden;
}

/* ----------------------------------------------------------- footer --- */
.site-footer {
  background: #102a43;
  color: rgba(255, 255, 255, .75);
  margin-top: 40px;
  font-size: 14.5px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
  padding: 48px 20px 28px;
}
.footer-brand { color: #fff; font-weight: 800; font-size: 18px; margin: 0 0 8px; }
.footer-tagline { margin: 0; font-size: 13.5px; line-height: 1.6; }
.footer-heading {
  color: #fff;
  font-weight: 750;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .1em;
  margin: 0 0 12px;
}
.footer-grid a { display: block; color: rgba(255, 255, 255, .75); padding: 3.5px 0; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 18px 20px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .55);
}
.footer-bottom p { margin: 0; }

/* ------------------------------------------------------- responsive --- */
@media (max-width: 900px) {
  .page-with-sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .header-search { display: none; }
}
@media (max-width: 700px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #102a43;
    padding: 10px 16px 16px;
    box-shadow: 0 14px 24px rgba(0, 0, 0, .25);
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; margin-left: auto; }
  .risk-row { flex-wrap: wrap; }
  .risk-row-meta { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero { padding: 40px 0 46px; }
  .map-wrap { padding: 14px; }
}
