:root {
  --navy: #1A2535;
  --navy-deep: #141D2B;
  --gold: #C9A84C;
  --gold-soft: #E8D9A8;
  --linen: #F3F2EE;
  --white: #FFFFFF;
  --mist: #8A9BAD;
  --slate: #667080;
  --line: #E1DDD2;
  --alert: #B11226;
  --flag: #FFF4E5;
  --flag-line: #E0A458;
  --radius: 14px;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--linen);
  color: var(--navy-deep);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 16px; height: 16px; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* ---------- Home: hero ---------- */
.hero {
  position: relative;
  color: var(--white);
  background: var(--navy) center / cover no-repeat;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 0 64px;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,29,43,.55) 0%, rgba(20,29,43,.72) 55%, rgba(26,37,53,.96) 100%);
}
.hero > * { position: relative; }
.hero-logo { width: 92px; height: auto; display: block; margin: 0 auto 10px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); }
.hero h1 { font-family: var(--serif); font-weight: 700; font-size: 34px; line-height: 1.12; margin: 0 0 10px; }
.hero p { margin: 0 auto; max-width: 30ch; font-size: 16.5px; color: #F3F2EE; }
.hero .address { margin-top: 14px; font-size: 13.5px; color: var(--gold-soft); }
.lang-switch { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 14px; }
.lang-switch select { background: rgba(20,29,43,.6); color: var(--white); border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 14px; }

/* ---------- Home: emergency banner ---------- */
.urgent-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -38px 0 18px;
  padding: 14px 16px;
  background: var(--white);
  border-left: 6px solid var(--alert);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(20,29,43,.18);
  text-decoration: none;
  position: relative;
}
.urgent-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--alert); color: var(--white); display: grid; place-items: center; flex: none; }
.urgent-icon .icon { width: 24px; height: 24px; stroke-width: 2.4; }
.urgent-text { flex: 1; min-width: 0; }
.urgent-title { font-family: var(--serif); font-weight: 700; font-size: 19px; line-height: 1.2; display: block; }
.urgent-sub { font-size: 14px; color: var(--slate); display: block; margin-top: 2px; }
.urgent-banner > .icon { color: var(--slate); }

/* ---------- Home: tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1 / 1.02;
  padding: 14px;
  border-radius: 16px;
  overflow: hidden;
  color: var(--white);
  text-decoration: none;
  background: linear-gradient(160deg, var(--tile, var(--navy)) 0%, var(--navy-deep) 140%);
  isolation: isolate;
}
.tile-photo { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: var(--pos, center); }
.tile.has-photo::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(20,29,43,.18) 0%, rgba(20,29,43,.88) 100%); }
.tile-icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.14); color: var(--gold); display: grid; place-items: center; backdrop-filter: blur(4px); }
.tile-label { font-family: var(--serif); font-weight: 600; font-size: 20px; line-height: 1.15; display: block; }
.tile-count { display: block; margin-top: 4px; font-size: 13.5px; color: var(--gold-soft); }

/* ---------- Home: wide cards ---------- */
.wide-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
}
.wide-icon { width: 42px; height: 42px; border-radius: 50%; background: var(--linen); color: var(--navy); display: grid; place-items: center; flex: none; }
.wide-title { font-weight: 700; display: block; }
.wide-sub { font-size: 14px; color: var(--slate); display: block; }
.wide-card > .icon:last-child { margin-left: auto; color: var(--slate); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 28px; background: var(--navy); color: var(--white); text-align: center; padding: 30px 16px calc(env(safe-area-inset-bottom, 0px) + 30px); }
.site-footer h2 { font-family: var(--serif); font-size: 24px; margin: 0 0 6px; font-weight: 700; }
.site-footer p { margin: 0 auto 16px; max-width: 34ch; color: #D5DBE3; font-size: 15px; }
.social { margin-top: 18px; display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; font-size: 14.5px; }
.social a { color: var(--gold-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--navy);
  background: var(--white);
  color: var(--navy);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--navy-deep); }
.btn-alert { background: var(--alert); border-color: var(--alert); color: var(--white); }
.btn:active { transform: translateY(1px); }

/* ---------- Category view ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--navy);
  color: var(--white);
  padding: env(safe-area-inset-top, 0px) 0 0;
}
.topbar-inner { display: flex; align-items: center; gap: 6px; max-width: 640px; margin: 0 auto; padding: 0 10px; min-height: 54px; }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 10px 0 4px; color: var(--gold-soft); text-decoration: none; font-weight: 500; }
.topbar-title { font-family: var(--serif); font-weight: 600; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cat-intro { background: var(--navy); color: #E5E9EE; padding: 4px 0 20px; }
.cat-intro p { margin: 0; font-size: 16px; max-width: 46ch; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px 4px; max-width: 640px; margin: 0 auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-btn { flex: none; min-height: 40px; padding: 6px 16px; border-radius: 999px; border: 1.5px solid var(--mist); background: var(--white); color: var(--navy); font-weight: 500; cursor: pointer; }
.chip-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }

.group-title { font-family: var(--serif); font-weight: 700; font-size: 21px; margin: 26px 0 12px; }
.group-title:first-child { margin-top: 20px; }

/* ---------- Entry cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  scroll-margin-top: 70px;
}
.card.urgent { border-left: 6px solid var(--alert); }
.card.target { outline: 3px solid var(--gold); outline-offset: -3px; }
.card-photo { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; background: var(--linen); }
.card-body { padding: 16px; }
.card h3 { font-family: var(--serif); font-weight: 700; font-size: 21px; line-height: 1.2; margin: 0 0 8px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.fact { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--linen); font-size: 13.5px; font-weight: 500; color: var(--navy); }
.fact.tag { background: #F6EFD6; }
.card p { margin: 0 0 14px; font-size: 15.5px; line-height: 1.55; }
.our-take { margin: 0 0 14px; padding: 2px 0 2px 14px; border-left: 3px solid var(--gold); font-size: 15.5px; line-height: 1.55; }
.our-take cite { display: block; margin-top: 4px; font-style: normal; font-size: 13.5px; color: var(--slate); }
.visited { display: inline-block; margin: 0 0 8px; font-size: 13.5px; font-weight: 700; color: #1F4E5F; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card.urgent .actions .btn-alert { flex: 1 1 100%; min-height: 50px; font-size: 17px; }

.verify { margin-top: 14px; padding: 10px 12px; background: var(--flag); border: 1px dashed var(--flag-line); border-radius: 10px; font-size: 13.5px; line-height: 1.45; color: #5A3B0A; }
.edit-banner { background: var(--flag); border-bottom: 2px solid var(--flag-line); padding: 8px 16px; font-size: 13.5px; color: #5A3B0A; text-align: center; }

.empty { padding: 40px 16px; text-align: center; color: var(--slate); }
.page-end { padding: 8px 0 40px; }
.page-end .btn { width: 100%; }

@media (min-width: 700px) {
  .hero { padding-bottom: 76px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .wrap { padding: 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:active { transform: none; }
}
