.project-countries {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 28px;
}

.country-card {
  position: relative;
  min-height: 170px;
  margin-left: -1px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  color: #fff;
  background: #fff;
  transition: transform .3s ease, filter .3s ease;
}

.country-card:first-child {
  margin-left: 0;
}

.country-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 17, 30, .08), rgba(4, 17, 30, .78));
}

.country-card > * {
  position: relative;
  z-index: 1;
}

.flag-estonia {
  background: linear-gradient(
    to bottom,
    #0072ce 0 33.333%,
    #000 33.333% 66.666%,
    #fff 66.666% 100%
  );
}

.flag-norway {
  background: url("assets/norway-flag.png") center / cover no-repeat;
}

.flag-spain {
  background: url("assets/spain-flag.png") center / cover no-repeat;
}

.country-card > span {
  display: inline-block;
  color: #fff;
  font: 700 10px Manrope, sans-serif;
  letter-spacing: .18em;
}

.country-card strong {
  display: block;
  margin-top: 42px;
  font: 700 24px Manrope, sans-serif;
}

.country-card small {
  display: block;
  margin-top: 7px;
  color: rgba(255, 255, 255, .82);
  font-size: 11px;
}

.country-card:hover {
  z-index: 1;
  transform: translateY(-6px);
  filter: saturate(1.12) brightness(1.05);
}

.country-card:hover > span,
.country-card:hover small {
  color: #fff;
}

.work-gallery-section {
  scroll-margin-top: 40px;
  margin-top: 70px;
}

.work-gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 28px;
}

.gallery-kicker {
  color: var(--blue);
  font: 700 10px Manrope, sans-serif;
  letter-spacing: .2em;
}

.work-gallery-heading h3 {
  margin: 10px 0 0;
  color: var(--navy);
  font: 700 clamp(30px, 4vw, 48px) Manrope, sans-serif;
  letter-spacing: -.04em;
}

.work-gallery-heading p {
  max-width: 430px;
  margin: 0;
  color: var(--gray);
  line-height: 1.7;
}

.work-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.work-item {
  grid-column: span 4;
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--navy);
  cursor: zoom-in;
  color: #fff;
  text-align: left;
}

.work-item--wide {
  grid-column: span 6;
  aspect-ratio: 16 / 10;
}

.work-item::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(4, 17, 30, .78));
}

.work-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}

.work-item:hover img,
.work-item:focus-visible img {
  transform: scale(1.04);
}

.work-item:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.work-item span {
  position: absolute;
  z-index: 1;
  right: 20px;
  bottom: 18px;
  left: 20px;
  font: 700 12px Manrope, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.project-lightbox {
  width: min(1100px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  background: #050505;
  color: #fff;
}

.project-lightbox::backdrop {
  background: rgba(3, 12, 21, .88);
  backdrop-filter: blur(5px);
}

.project-lightbox img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
}

.project-lightbox p {
  margin: 0;
  padding: 18px 64px 20px 24px;
  font-size: 13px;
}

.lightbox-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(5, 5, 5, .72);
  color: #fff;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}

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

  .work-item,
  .work-item--wide {
    grid-column: span 6;
  }
}

@media (max-width: 560px) {
  .project-countries {
    grid-template-columns: 1fr;
  }

  .country-card {
    min-height: 145px;
  }

  .country-card strong {
    margin-top: 28px;
  }

  .work-gallery-heading {
    display: block;
  }

  .work-gallery-heading p {
    margin-top: 15px;
  }

  .work-item,
  .work-item--wide {
    grid-column: 1 / -1;
    aspect-ratio: 4 / 3;
  }
}
