/* ══════════════════════════════════════
   COUNTRY PARTNERS SECTION
   ══════════════════════════════════════ */
.partners {
  background: #F7F7F7;
  padding: 80px 0 80px;
}
/* ══════════════════════════════════════
   GRID — 4 columns
   ══════════════════════════════════════ */

.country-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  width: 100%;
  align-items: stretch;
}


/* ══════════════════════════════════════
   CARD BASE
   ══════════════════════════════════════ */

.country-card {
  border-radius: 18px;
  padding: 24px;
  border: 2px dashed #ccc;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  height: 100%;

  display: grid;
  grid-template-columns: 64px 1fr;
  grid-template-rows: 80px auto auto;
  column-gap: 14px;
  row-gap: 0;
  align-content: start;
}

.country-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}


/* ══════════════════════════════════════
   CARD HEADER — fixed 80px row
   ══════════════════════════════════════ */

.country-card .views-field-field-flag {
  grid-column: 1;
  grid-row: 1;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.country-card .views-field-field-flag img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.country-card .views-field-field-country-name {
  grid-column: 2;
  grid-row: 1;
  height: 80px;
  display: flex;
  align-items: center;
}

.country-card .views-field-field-country-name .field-content {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.2;
}


/* ══════════════════════════════════════
   PARTNER ORGS + NCC — span both columns
   ══════════════════════════════════════ */

.country-card .views-field-field-partner-organizations,
.country-card .views-field-field-national-competence-center {
  grid-column: 1 / -1;
  width: 100%;
}

.country-card .views-field-field-partner-organizations {
  border-top: 1.5px solid rgba(0, 0, 0, 0.09);
  margin-top: 16px;
  padding-top: 16px;
}


/* ══════════════════════════════════════
   HIDE ENTIRE BLOCK WHEN NO LINKS PRESENT
   ══════════════════════════════════════ */

.country-card .views-field-field-partner-organizations:not(:has(a)) {
  display: none;
}

.country-card .views-field-field-national-competence-center:not(:has(a)) {
  display: none;
}


/* ══════════════════════════════════════
   SECTION LABELS (shown via ::before)
   ══════════════════════════════════════ */

.country-card .views-field-field-partner-organizations::before {
  content: "Partner Organizations";
  display: block;
  font-weight: 700;
  font-size: 16px;
  color: #1a1a2e;
  margin-bottom: 12px;
  text-align: left;
}

.country-card .views-field-field-national-competence-center::before {
  content: "National Competence Center";
  display: block;
  font-weight: 700;
  font-size: 16px;
  color: #2B7D91;
  margin-bottom: 12px;
  padding-top: 16px;
  margin-top: 8px;
  border-top: 1.5px solid rgba(0, 0, 0, 0.09);
  text-align: left;
}


/* ══════════════════════════════════════
   LINKS — hide commas, stack as rows
   ══════════════════════════════════════ */

.country-card .views-field-field-partner-organizations .field-content,
.country-card .views-field-field-national-competence-center .field-content {
  font-size: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.country-card .views-field-field-partner-organizations a,
.country-card .views-field-field-national-competence-center a {
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #333;
  text-decoration: none;
  line-height: 1.4;
  text-align: left;
}

.country-card .views-field-field-partner-organizations a:hover,
.country-card .views-field-field-national-competence-center a:hover {
   color: var(--card-accent, #2bb5b8);
}

/* Bullet dot — matches card border color */
.country-card .views-field-field-partner-organizations a::before,
.country-card .views-field-field-national-competence-center a::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  min-width: 9px;
  border-radius: 50%;
  background: var(--card-accent, #2bb5b8);
  margin-top: 4px;
  flex-shrink: 0;
}

/* External link icon */
.country-card .views-field-field-partner-organizations a::after,
.country-card .views-field-field-national-competence-center a::after {
  content: "\f35d";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 12px;
  margin-left: auto;
  color: #6694f9;
  flex-shrink: 0;
  padding-left: 8px;
  align-self: center;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════
   AUTO COLOR SYSTEM
   ══════════════════════════════════════ */

.country-card:nth-child(8n+1) {
  --card-accent: #ff6b6b;
  border-color: #ff6b6b;
  background: #fff3f3;
}

.country-card:nth-child(8n+2) {
  --card-accent: #5fd38d;
  border-color: #5fd38d;
  background: #effdf5;
}

.country-card:nth-child(8n+3) {
  --card-accent: #6aa7ff;
  border-color: #6aa7ff;
  background: #f0f6ff;
}

.country-card:nth-child(8n+4) {
  --card-accent: #57c3c2;
  border-color: #57c3c2;
  background: #edfafa;
}

.country-card:nth-child(8n+5) {
  --card-accent: #3b6db3;
  border-color: #3b6db3;
  background: #eef3fb;
}

.country-card:nth-child(8n+6) {
  --card-accent: #ffb74d;
  border-color: #ffb74d;
  background: #fff7e8;
}

.country-card:nth-child(8n+7) {
  --card-accent: #d37fff;
  border-color: #d37fff;
  background: #faf0ff;
}

.country-card:nth-child(8n+8) {
  --card-accent: #ff80bf;
  border-color: #ff80bf;
  background: #fff0f7;
}


/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (max-width: 1200px) {
  .country-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .country-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ══════════════════════════════════════
   EUROPEAN LEVEL SECTION
   ══════════════════════════════════════ */

.european-partners-section {
  background: #FFFFFF;
  width: 100%;
  margin-top: 20px;
}


.european-partners-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
  width: 100%;
}


.european-partner-item {
  margin: 20px 0;
  flex: 1 1 180px;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}


.european-partner-item .views-field-field-org-logo img {
  max-width: 180px;
  max-height: 80px;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Org name */
.european-partner-item .views-field-field-org-name {
  font-size: 14px;
  color: #444;
  line-height: 1.5;
  text-align: center;
  max-width: 200px;
}

/* Make full card clickable */
.european-partner-item a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.european-partner-item a:hover img {
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (max-width: 900px) {
  .european-partners-grid {
    justify-content: center;
    gap: 28px;
  }

  .european-partner-item {
    flex: 1 1 160px;
    max-width: 180px;
  }

  .european-partner-item .views-field-field-org-logo img {
    max-width: 150px;
    max-height: 70px;
  }
}

@media (max-width: 580px) {
  .european-partners-grid {
    gap: 20px;
  }

  .european-partner-item {
    flex: 1 1 120px;
    max-width: 140px;
  }

  .european-partner-item .views-field-field-org-logo img {
    max-width: 120px;
    max-height: 60px;
  }
}
