/* ==========================================================================
   Homepage locations
   ========================================================================== */

.home-locations {
  position: relative;
  overflow: hidden;
  padding: clamp(5rem, 9vw, 9rem) 0;
  background: var(--mh-dark-teal, #00595d);
}

.home-locations::before,
.home-locations::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.home-locations::before {
  top: -12rem;
  left: -10rem;
  width: 31rem;
  height: 31rem;
  border-radius: 43% 57% 61% 39% / 46% 39% 61% 54%;
  background: var(--mh-yellow, #e6e766);
  opacity: 0.12;
  transform: rotate(-18deg);
}

.home-locations::after {
  right: -10rem;
  bottom: -14rem;
  width: 34rem;
  height: 34rem;
  border-radius: 57% 43% 38% 62% / 42% 58% 42% 58%;
  background: #ffffff;
  opacity: 0.06;
  transform: rotate(15deg);
}

.home-locations__inner {
  position: relative;
  z-index: 1;
  width: min(100% - 3rem, 1140px);
  margin-inline: auto;
}

/* Section heading */

.home-locations__header {
  max-width: 760px;
  margin: 0 auto clamp(3rem, 6vw, 5rem);
  text-align: center;
}

.home-locations__eyebrow {
  display: inline-flex;
  margin: 0 0 1.25rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--mh-yellow, #e6e766);
  color: var(--mh-dark-teal, #00595d);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.home-locations__title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 0.98;
}

.home-locations__intro {
  max-width: 650px;
  margin: 1.75rem auto 0;
  color: rgb(255 255 255 / 78%);
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  line-height: 1.65;
}

/* Card grid */

.home-locations__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.4vw, 2rem);
}

.location-card {
  grid-column: span 2;
  min-width: 0;
  overflow: hidden;
  border-radius: 2rem 2rem 0.65rem 2rem;
  background: #ffffff;
  box-shadow: 0 22px 55px rgb(0 35 38 / 24%);
}

.location-card:nth-child(2) {
  border-radius: 0.65rem 2rem 2rem 2rem;
}

.location-card:nth-child(3) {
  border-radius: 2rem 0.65rem 2rem 2rem;
}

.location-card:nth-child(4),
.location-card:nth-child(5) {
  grid-column: span 3;
}

.location-card:nth-child(4) {
  border-radius: 2rem 2rem 2rem 0.65rem;
}

.location-card:nth-child(5) {
  border-radius: 2rem 0.65rem 2rem 2rem;
}

/* Card image */

.location-card__media {
  position: relative;
  height: clamp(230px, 25vw, 315px);
  margin: 0;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    rgb(230 231 102 / 85%),
    rgb(0 121 128 / 55%)
  );
}

.location-card:nth-child(4) .location-card__media,
.location-card:nth-child(5) .location-card__media {
  height: clamp(250px, 30vw, 360px);
}

.location-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.location-card:hover .location-card__image {
  transform: scale(1.035);
}

.location-card__media::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 28%;
  background: linear-gradient(to top, rgb(0 0 0 / 16%), transparent);
  content: "";
  pointer-events: none;
}

.location-card__media--placeholder::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5rem;
  height: 5rem;
  border: 3px solid rgb(255 255 255 / 65%);
  border-radius: 48% 52% 56% 44% / 45% 42% 58% 55%;
  content: "";
  transform: translate(-50%, -50%) rotate(10deg);
}

/* Card content */

.location-card__content {
  min-height: 190px;
  padding: clamp(1.5rem, 2.5vw, 2rem);
}

.location-card__district {
  display: inline-flex;
  margin: 0 0 1rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: #eef5f3;
  color: var(--mh-medium-teal, #007980);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.location-card__title {
  margin: 0 0 0.9rem;
  color: var(--mh-dark-teal, #00595d);
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  line-height: 1.15;
}

.location-card__care {
  margin: 0;
  color: #536464;
  font-size: 0.98rem;
  line-height: 1.6;
}

/* Give each card a subtle individual accent */

.location-card--kaetnermoor .location-card__district {
  background: #f3f3ce;
}

.location-card--imstedt .location-card__district {
  background: #dceff0;
}

.location-card--marckmannstrasse .location-card__district {
  background: #f5eadf;
}

.location-card--montessori .location-card__district {
  background: #e2f1ee;
}

.location-card--life .location-card__district {
  background: #f3f3ce;
}

/* Tablet */

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

  .location-card,
  .location-card:nth-child(4),
  .location-card:nth-child(5) {
    grid-column: span 1;
  }

  .location-card:last-child {
    grid-column: 1 / -1;
    width: calc(50% - 0.75rem);
    justify-self: center;
  }

  .location-card__media,
  .location-card:nth-child(4) .location-card__media,
  .location-card:nth-child(5) .location-card__media {
    height: 290px;
  }
}

/* Mobile */

@media (max-width: 620px) {
  .home-locations {
    padding-block: 4.5rem;
  }

  .home-locations__inner {
    width: min(100% - 2rem, 1140px);
  }

  .home-locations__header {
    text-align: left;
  }

  .home-locations__intro {
    margin-left: 0;
  }

  .home-locations__grid {
    grid-template-columns: 1fr;
  }

  .location-card,
  .location-card:last-child {
    grid-column: auto;
    width: auto;
  }

  .location-card__media,
  .location-card:nth-child(4) .location-card__media,
  .location-card:nth-child(5) .location-card__media {
    height: 260px;
  }

  .location-card__content {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .location-card__image {
    transition: none;
  }
}

.location-card {
  position: relative;
}

.location-card__link {
  position: absolute;
  z-index: 2;
  inset: 0;

  border-radius: inherit;
}

.location-card__link:focus-visible {
  outline: 4px solid var(--mh-yellow);
  outline-offset: 4px;
}
