/* =========================================
   BASE
========================================= */

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont;
  background: #fff;
  color: #111;
}

.tm-main-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

/* =========================================
   COUNTRY GRID
========================================= */

.country-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

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

.country-card {
  display: block;
  position: relative;
  height: 280px;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
}

.country-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.country-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.25),
    rgba(0,0,0,0.65)
  );
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  z-index: 2;
}

.country-overlay h2 {
  margin: 0 0 4px;   /* pienempi väli alaspäin */
  font-size: 22px;
  font-weight: 700;
}

.country-overlay p {
  margin: 0;         /* poista oletusmargini */
  font-size: 14px;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .country-card {
    height: 180px;   /* kokeile 160–200px oman fiiliksen mukaan */
  }

  .country-overlay {
    padding: 16px;   /* vähän tiiviimpi */
  }

  .country-overlay h2 {
    font-size: 20px;
  }

  .country-overlay p {
    font-size: 13px;
  }
}

.country-card-wrapper {
  position: relative;
}

.country-card-credit {
  position: absolute;
  top: 10px;
  right: 10px;

  font-size: 6px;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.45);
  padding: 4px 6px;
  border-radius: 6px;

  backdrop-filter: blur(4px);
  z-index: 3;
}

.country-card-credit a {
  color: #fff;
  text-decoration: underline;
}

.az-index {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 28px;
}

.az-index button {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
}

.az-index button.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.continent-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.continent-filters button {
  border: 1px solid rgba(0,0,0,0.15);
  background: transparent;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
}

.continent-filters button.active {
  background: rgba(42,178,198,0.18);
  color: black;
  border-color: rgba(42,178,198,0.18);
}

/* =========================================================
   SIGNAL & BUDGET FILTERS (RESPONSIVE, MOBILE-FIRST)
========================================================= */

.signal-filters {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 12px 0 24px;
}

/* ---------------------------------------------------------
   FILTER GROUP
--------------------------------------------------------- */

.signal-filters .filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;            /* 🔑 tämä */
}

/* ---------------------------------------------------------
   LABEL
--------------------------------------------------------- */

.signal-filters .filter-label {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.8;
  margin-right: 6px;
  white-space: nowrap;
}

/* ---------------------------------------------------------
   BUTTONS (same as continent filters)
--------------------------------------------------------- */

.signal-filters button {
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: transparent;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.signal-filters button.active {
  background: rgba(42, 178, 198, 0.18);
  color: black;
  border-color: rgba(42, 178, 198, 0.18);
}

/* ---------------------------------------------------------
   MOBILE TWEAKS
--------------------------------------------------------- */

@media (max-width: 640px) {
  .signal-filters {
    gap: 14px;
  }

  .signal-filters .filter-group {
    gap: 8px 6px;             /* tiiviimpi mobiilissa */
  }

  .signal-filters button {
    padding: 6px 10px;        /* vähän pienempi */
    font-size: 13px;
  }
}
