:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --ink: #1f2a2b;
  --muted: #4a5d59;
  --accent: #0e7a6c;
  --accent-soft: #d7efe9;
  --edge: #d9d2c2;
  --radius: 14px;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Outfit", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.hero {
  width: min(1100px, 92vw);
  margin: 36px auto 14px;
  display: flex;
  justify-content: center;
}

.hero-banner {
  width: min(760px, 100%);
  height: auto;
  display: block;
}

.section {
  width: min(1100px, 92vw);
  margin: 0 auto 26px;
  background: var(--paper);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-head {
  padding: 18px 18px 6px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.3rem;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.flags-grid {
  padding: 12px 18px 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.flag-card {
  border: 1px solid var(--edge);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(160deg, #ffffff 0%, #fffaf0 100%);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
}

.flag-card:nth-child(4n + 1) {
  background: linear-gradient(160deg, #ffffff 0%, #f7faf0 100%);
}

.flag-card:nth-child(4n + 2) {
  background: linear-gradient(160deg, #ffffff 0%, #f0f8fa 100%);
}

.flag-card:nth-child(4n + 3) {
  background: linear-gradient(160deg, #ffffff 0%, #f9f1f7 100%);
}

.flag-card:nth-child(4n + 4) {
  background: linear-gradient(160deg, #ffffff 0%, #fef3ed 100%);
}

.flag-card:hover,
.flag-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.flag-thumb {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: contain;
  display: block;
  background: linear-gradient(140deg, #dce8e3, #f6efde);
}

.flag-meta {
  padding: 10px 12px 12px;
  flex: 1;
}

.flag-name {
  margin: 0;
  font-weight: 600;
  font-size: 0.96rem;
}

.flag-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.map-section {
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.map-section .section-head {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
}

.map {
  width: 100%;
  height: min(72vh, 720px);
  min-height: 420px;
  border-top: 1px solid var(--edge);
}

.popup {
  width: 220px;
}

.popup img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 8px;
}

.popup h3 {
  margin: 0;
  font-size: 1rem;
}

.popup p {
  margin: 6px 0 10px;
  font-size: 0.9rem;
  color: #2f3f3e;
}

.popup a {
  display: inline-block;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.85rem;
}

.popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-footer {
  text-align: center;
  padding: 28px 20px 36px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-credit a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--edge);
  font-weight: 500;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.footer-credit a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.footer-cookie-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--edge);
  transition: color 0.15s ease;
}

.footer-cookie-btn:hover {
  color: var(--accent);
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--ink);
  color: #f0ece0;
  padding: 18px 20px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-text {
  flex: 1;
  min-width: 200px;
}

.cookie-title {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 1rem;
}

.cookie-body {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #c8c2b0;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn {
  border: none;
  border-radius: 999px;
  padding: 9px 22px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.cookie-btn:hover {
  opacity: 0.85;
}

.cookie-btn--accept {
  background: var(--accent);
  color: #fff;
}

.cookie-btn--decline {
  background: rgba(255, 255, 255, 0.12);
  color: #f0ece0;
}

.cookie-map-notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  gap: 16px;
  padding: 24px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

@media (max-width: 980px) {
  .flags-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .hero {
    margin: 20px auto 12px;
  }

  .flags-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 12px 14px;
  }

  .map {
    min-height: 360px;
    height: 60vh;
  }

  .section-head {
    padding: 14px 12px 6px;
  }
}

@media (max-width: 420px) {
  .flags-grid {
    grid-template-columns: 1fr;
  }
}
