/* ============================================================
   ATLAS GUIDE  ·  SCAM HUB  ·  v5 "The Scam Index"
   scams-hub.css  (/resources/scams/ only)
   Load AFTER travel-scams.css. It adds the destinations-style
   browser: hero ledger, sticky search + filter deck, and photo
   cards for every country. Everything else on the page (risk
   legend, tips, closing CTA) still comes from travel-scams.css.
   ============================================================ */

html { overflow-x: clip; }
body { overflow-x: clip; }

/* ============================================================
   HERO  ·  plate with a risk ledger
   ============================================================ */
.sh-hero { padding-bottom: clamp(56px, 8vh, 84px); }
.sh-hero-inner {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 40px;
}
.sh-hero-copy { flex: 1; min-width: 0; }
.sh-hero .page-hero-desc { margin-bottom: 0; }

.sh-ledger {
  display: flex; flex-shrink: 0;
  border: 1px solid rgba(201,168,92,.35); border-radius: 16px; overflow: hidden;
  background: rgba(13,33,24,.55);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px -24px rgba(0,0,0,.7);
  animation: vac-fade-up .7s var(--ease) .3s both;
}
.sh-stat {
  appearance: none; font: inherit; cursor: pointer; text-align: left;
  background: none; border: 0; border-right: 1px dashed rgba(201,168,92,.35);
  padding: 18px 24px 16px; min-width: 112px; color: inherit;
  transition: background .25s;
}
.sh-stat:last-child { border-right: 0; }
.sh-stat:hover { background: rgba(244,246,244,.07); }
.sh-stat:focus-visible { outline: 2px solid var(--accent-lt); outline-offset: -4px; }
.sh-stat-num {
  display: block; font-family: var(--display); font-size: 2.3rem; font-weight: 700;
  line-height: 1; color: #fff; font-variant-numeric: tabular-nums;
}
.sh-stat-label {
  display: flex; align-items: center; gap: 7px; margin-top: 7px;
  font-family: var(--display); font-style: italic; font-size: .9rem; color: var(--accent-lt);
}
.sh-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sh-dot.low  { background: #43b793; }
.sh-dot.med  { background: #e3a43b; }
.sh-dot.high { background: #e2584a; }

/* ============================================================
   CONTROL DECK  ·  search + filters, sticky under the header
   ============================================================ */
.sh-deck {
  position: sticky; top: 68px; z-index: 100;
  background: rgba(244,246,244,.95);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--hair-2);
}
.sh-deck-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 14px clamp(16px, 4vw, 48px) 12px;
}
.sh-search { position: relative; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sh-search-icon {
  position: absolute; left: 18px; top: 22px; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--accent-ink); pointer-events: none;
}
.sh-search input {
  flex: 1 1 260px; min-width: 0; height: 44px; padding: 0 18px 0 46px;
  border: 1px solid var(--hair-2); border-radius: 999px; background: #fff;
  font-family: var(--display); font-size: 1.08rem; font-weight: 600; letter-spacing: -.005em;
  color: var(--text); outline: 0; box-shadow: inset 0 1px 2px rgba(26,36,32,.04);
  transition: border-color .2s, box-shadow .25s;
}
.sh-search input::placeholder { color: rgba(78,90,84,.6); font-weight: 400; font-style: italic; }
.sh-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(201,168,92,.18); }

.sh-row { padding-top: 10px; }
.sh-pills {
  list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
}
.sh-pills::-webkit-scrollbar { display: none; }
.sh-pills li { flex-shrink: 0; }
.sh-pill {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; cursor: pointer;
  padding: 7px 14px 7px 10px; border: 1px solid var(--hair); border-radius: 999px; background: #fff;
  font-family: var(--body); font-size: .82rem; font-weight: 600; color: var(--text-mid);
  transition: background .2s, color .2s, border-color .2s;
}
.sh-pill:hover { border-color: var(--border-warm); color: var(--primary); }
.sh-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.sh-pill:focus-visible, .sh-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sh-pill-icon { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.sh-pill.active img.sh-pill-icon { filter: brightness(0) invert(.92); }
.sh-pill-all { font-size: .9rem; line-height: 1; }
.sh-pill-count { font-family: var(--display); font-style: italic; font-size: .82rem; font-weight: 600; color: var(--accent-ink); }
.sh-pill.active .sh-pill-count { color: var(--accent-lt); }

.sh-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sh-seg {
  display: flex; gap: 2px; padding: 3px;
  background: rgba(26,58,43,.06); border: 1px solid var(--hair); border-radius: 999px;
}
.sh-seg button {
  border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; font-family: var(--body); font-size: .76rem; font-weight: 600; color: var(--text-mid);
  transition: background .2s, color .2s;
}
.sh-seg button:hover { color: var(--primary); background: rgba(255,255,255,.7); }
.sh-seg button.active { background: var(--primary); color: var(--accent-lt); }
.sh-seg .sh-dot { width: 7px; height: 7px; }
.sh-view button { width: 32px; padding: 6px 0; justify-content: center; font-size: .9rem; }

/* ============================================================
   RESULTS
   ============================================================ */
.sh-results { background: var(--bg-warm); }
.sh-results-inner { max-width: 1440px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 48px) 72px; }
.sh-info {
  display: flex; align-items: center; gap: 12px; margin: 0 0 20px;
  font-family: var(--display); font-style: italic; font-size: 1.02rem; color: var(--text-mid);
}
.sh-info::before { content: ''; width: 28px; height: 1px; background: var(--accent); }
.sh-info strong { font-style: normal; font-weight: 700; color: var(--primary); font-size: 1.1rem; }

.sh-grid {
  display: grid; align-items: stretch; list-style: none; margin: 0; padding: 0;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 18px;
}
.sh-grid.view-list { grid-template-columns: 1fr; gap: 8px; }

.sc-card {
  --tone: var(--risk-low);
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--hair); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(26,36,32,.04), 0 10px 26px -16px rgba(26,36,32,.22);
  transition: border-color .25s, box-shadow .3s var(--ease);
}
.sc-card[data-risk="medium"] { --tone: var(--risk-med); }
.sc-card[data-risk="high"]   { --tone: var(--risk-high); }
.sc-card[hidden] { display: none; }
.sc-card:hover {
  border-color: var(--border-warm);
  box-shadow: 0 1px 2px rgba(26,36,32,.05), 0 18px 36px -20px rgba(26,58,43,.45);
}
.sc-card:focus-within { border-color: var(--accent); }
.sc-link { display: flex; flex-direction: column; flex: 1; text-decoration: none; color: inherit; }
.sc-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 14px; }

.sc-img { position: relative; height: 150px; overflow: hidden; background: var(--bg-warm); }
.sc-img > img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(.9); transition: transform .8s var(--ease), filter .6s;
}
.sc-card:hover .sc-img > img { transform: scale(1.05); filter: saturate(1.02); }
.sc-img::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(13,33,24,.5) 0%, rgba(13,33,24,.08) 45%, transparent 70%);
}
.sc-fallback {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(201,168,92,.06) 18px 19px),
    linear-gradient(150deg, var(--primary), var(--primary-dark));
  font-family: var(--display); font-style: italic; font-size: 3rem; font-weight: 600;
  color: var(--accent-lt);
}
.sc-flag {
  position: absolute; left: 14px; bottom: 12px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; overflow: hidden;
  background: #fff; border: 2.5px solid #fff; box-shadow: 0 4px 12px rgba(13,33,24,.35);
}
.sc-flag img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sc-body { flex: 1; padding: 14px 18px 16px; }
.sc-cap { margin: 0 0 2px; font-family: var(--display); font-style: italic; font-size: .88rem; color: var(--accent-ink); }
.sc-name {
  margin: 0 0 12px; font-family: var(--display); font-size: 1.32rem; font-weight: 700;
  line-height: 1.12; letter-spacing: -.015em; color: var(--primary);
}

/* three-step risk meter */
.sc-risk { display: flex; align-items: center; gap: 10px; }
.sc-meter { display: flex; gap: 3px; }
.sc-meter i { width: 18px; height: 5px; border-radius: 3px; background: var(--hair-2); }
.sc-card[data-risk="low"]    .sc-meter i:nth-child(-n+1),
.sc-card[data-risk="medium"] .sc-meter i:nth-child(-n+2),
.sc-card[data-risk="high"]   .sc-meter i:nth-child(-n+3) { background: var(--tone); }
.sc-risk-label { font-size: .78rem; font-weight: 700; color: var(--tone); }
.sc-card[data-risk="medium"] .sc-risk-label { color: #9a6618; }

.sc-cta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding: 11px 18px 13px; border-top: 1px dashed var(--hair-2);
  background: #f9fbf9; font-size: .8rem; font-weight: 700; color: var(--primary);
}
.sc-cta::after { content: '\2192'; color: var(--accent-ink); transition: transform .3s var(--ease); }
.sc-card:hover .sc-cta::after { transform: translateX(4px); }

/* list view: a compact manifest */
.view-list .sc-card { border-radius: 10px; box-shadow: none; }
.view-list .sc-link { flex-direction: row; align-items: center; }
.view-list .sc-img { width: 96px; height: 62px; flex-shrink: 0; }
.view-list .sc-img::after, .view-list .sc-cap { display: none; }
.view-list .sc-flag { width: 28px; height: 28px; left: 8px; bottom: 6px; border-width: 2px; }
.view-list .sc-body { display: flex; align-items: center; gap: 18px; padding: 10px 18px; }
.view-list .sc-name { margin: 0; font-size: 1.02rem; min-width: 170px; }
.view-list .sc-cta { margin: 0; padding: 0 18px; border: 0; background: none; align-self: center; gap: 10px; white-space: nowrap; }

.sh-empty {
  display: none; text-align: center; padding: 56px 24px;
  background: #fff; border: 1px dashed var(--hair-2); border-radius: 18px;
}
.sh-empty.show { display: block; }
.sh-empty h3 { margin: 0 0 6px; font-family: var(--display); font-size: 1.45rem; color: var(--primary); }
.sh-empty p { margin: 0 0 16px; color: var(--text-mid); font-size: .95rem; }
.sh-empty button {
  padding: 10px 20px; border-radius: 999px; border: 1px solid var(--hair-2); background: var(--primary);
  color: var(--accent-lt); font: 700 .85rem var(--body); cursor: pointer;
}

/* the legend now sits below the browser: tighter, on the plain background */
.risk-legend-section { background: var(--bg); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sh-hero-inner { flex-direction: column; align-items: flex-start; gap: 28px; }
  .sh-ledger { width: 100%; }
  .sh-stat { flex: 1; min-width: 0; padding: 14px 14px 12px; }
  .sh-stat-num { font-size: 1.8rem; }
}
@media (max-width: 768px) {
  .sh-deck { position: static; }
  .sh-controls { width: 100%; }
  .sh-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .sh-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .sc-img { height: 110px; }
  .sc-body { padding: 12px 14px 14px; }
  .sc-name { font-size: 1.1rem; }
  .sc-meter i { width: 14px; }
  .view-list .sc-name { min-width: 0; }
  .view-list .sc-cta { display: none; }
}
@media (max-width: 400px) {
  .sh-grid:not(.view-list) { grid-template-columns: 1fr 1fr; }
  .sc-risk-label { font-size: .72rem; }
}
[dir="rtl"] .sh-search-icon { left: auto; right: 18px; }
[dir="rtl"] .sh-search input { padding: 0 46px 0 18px; }

@media (prefers-reduced-motion: reduce) {
  .sh-ledger { animation: none !important; }
  .sc-card, .sc-img > img, .sc-cta::after { transition: none !important; }
}
