/* Global - minimal, fast, SEO-friendly */
:root {
  --bg: #fafafa;
  --surface: #fff;
  --text: #1a1a1a;
  --text-muted: #555;
  --accent: #1a73e8;
  --border: #e0e0e0;
  --ad-bg: #f5f5f5;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.wrap { max-width: 900px; margin: 0 auto; padding: 0 1rem; }
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.site-header .header-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex: 1 1 auto; min-width: 0; }
.site-header .nav-wrap { display: flex; align-items: center; gap: 1rem; flex: 1 1 auto; min-width: 0; }
.site-header .nav { flex-shrink: 0; }
.logo { font-weight: 700; font-size: 1.25rem; color: var(--text); white-space: nowrap; }
.logo:hover { text-decoration: none; color: var(--accent); }

/* Hamburger - hidden on desktop */
.nav-toggle { display: none; background: none; border: none; padding: 0.5rem; cursor: pointer; color: var(--text); }
.nav-toggle-icon { display: block; width: 22px; height: 2px; background: currentColor; box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor; border-radius: 1px; }

/* Search bar (below navbar) */
.search-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}
.search-bar .wrap { position: relative; }
.search-bar .search-form-wrap { position: relative; max-width: 400px; margin: 0 auto; }
.search-bar .search-form {
  display: flex;
  gap: 0.25rem;
  width: 100%;
}
.search-results { position: absolute; top: 100%; left: 0; right: 0; margin-top: 0.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); max-height: 280px; overflow-y: auto; z-index: 20; }
.search-results:not([hidden]) { display: block; }
.search-results a { display: block; padding: 0.6rem 1rem; color: var(--text); border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--bg); color: var(--accent); text-decoration: none; }
.search-results .search-results-empty { padding: 0.75rem 1rem; color: var(--text-muted); font-size: 0.9rem; }
.search-form input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
}
.search-form button {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}
.search-form button:hover { opacity: 0.9; }

/* Nav */
.nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.nav a { color: var(--text-muted); font-size: 0.95rem; }
.nav a:hover { color: var(--accent); }

/* Main */
main { padding: 1.5rem 0 2rem; }
h1 { font-size: 1.75rem; margin: 0 0 1rem; line-height: 1.3; }
h2 { font-size: 1.35rem; margin: 1.5rem 0 0.5rem; }
h3 { font-size: 1.1rem; margin: 1rem 0 0.4rem; }
p { margin: 0 0 0.75rem; color: var(--text-muted); }
.lead { font-size: 1.1rem; color: var(--text); }

/* Ad slots */
.ad-slot {
  background: var(--ad-bg);
  border: 1px dashed var(--border);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.ad-slot.inline { min-height: 250px; }
.ad-slot.footer { min-height: 100px; margin: 2rem 0 0; }

/* Cards / sections */
.card {
  background: var(--surface);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.card h2 { margin-top: 0; }
.page-list { list-style: none; padding: 0; margin: 0; }
.page-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.page-list li:last-child { border-bottom: none; }
.page-list a { color: var(--text); font-weight: 500; }
.page-list a:hover { color: var(--accent); }

/* Country list */
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; margin-top: 1rem; }
.country-link { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-weight: 500; }
.country-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
/* Country status dot: green = very good, yellow = medium, red = bad */
.status-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: status-blink-green 1.5s ease-in-out infinite;
}
.status-dot.status-good { background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
.status-dot.status-medium { background: #eab308; box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.6); animation-name: status-blink-yellow; }
.status-dot.status-bad { background: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); animation-name: status-blink-red; }
@keyframes status-blink-green {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  50% { opacity: 0.5; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}
@keyframes status-blink-yellow {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.5); }
  50% { opacity: 0.5; box-shadow: 0 0 0 6px rgba(234, 179, 8, 0); }
}
@keyframes status-blink-red {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { opacity: 0.5; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.country-status-wrap { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
.country-status-wrap .status-dot { width: 12px; height: 12px; }
.country-status-legend { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; font-size: 0.9rem; color: var(--text-muted); }
.country-status-legend .status-dot { width: 10px; height: 10px; }

/* Stat table */
.stat-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.stat-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.stat-table td:first-child { font-weight: 500; color: var(--text); width: 55%; }
.stat-table tr:last-child td { border-bottom: none; }

.breadcrumb { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 2rem;
  background: var(--surface);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.site-footer a { color: var(--text-muted); }

/* Mobile navbar */
@media (max-width: 768px) {
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .site-header .wrap { flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem 1rem; }
  .site-header .nav-wrap {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem 0 0;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
  }
  .site-header.menu-open .nav-wrap { display: flex; }
  .site-header .nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .site-header .nav a {
    display: block;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
    color: var(--text);
    border-radius: 6px;
    transition: background 0.15s;
  }
  .site-header .nav a:hover { background: var(--bg); color: var(--accent); text-decoration: none; }
  .search-results { left: 0; right: 0; margin: 0.25rem 0 0; }
}

@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
}
