/* ---------------------------------------------------
   Container for the application cards
   --------------------------------------------------- */
.appcontainer {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 240px));
  justify-content: center;
  grid-auto-flow: row;
  justify-items: stretch;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto 14px;
  padding: 4px 2px 10px;
  box-sizing: border-box;
}

/* ---------------------------------------------------
   Card Container: the clickable button
   --------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  width: 240px;
  border: 1px solid rgba(13, 125, 189, 0.18);
  border-radius: var(--radius-sm, 12px);
  overflow: hidden;
  text-decoration: none;
  color: var(--text, #0f1a2a);
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease;
  background-color: var(--panel, #fff);
  box-shadow: 0 10px 24px rgba(13, 125, 189, 0.12);
}

/* ---------------------------------------------------
   Card Image Container
   --------------------------------------------------- */
.card-image {
  position: relative;
}

/* Main image style: fixed height and full width */
.card-image img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

/* ---------------------------------------------------
   Gradient & Text Overlay
   --------------------------------------------------- */
.card-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(34, 40, 49, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* align text to top of the tinted area */
  gap: 6px;
  padding: 10px 12px 10px;
  box-sizing: border-box;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  height: 96px; /* fixed height for consistent overlay */
  overflow: hidden;
}

/* Text styling inside the overlay */
.card-text h2 {
  margin: 0;
  font-size: 0.95rem;
  color: #f5f7fb;
  font-family: "Arial Narrow", Arial, sans-serif;
}

.card-text p {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: rgba(245, 247, 251, 0.9);
  line-height: 1.4;
  font-family: "Arial Narrow", Arial, sans-serif;
}

/* ---------------------------------------------------
   Flag Icon: small flag with a shadow in the corner
   --------------------------------------------------- */
.card-flag {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(13, 125, 189, 0.4);
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
  z-index: 2;
}

/* ---------------------------------------------------
   Hover Effect: lifts the card and adds a shadow
   --------------------------------------------------- */
.card:hover,
.card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(13, 125, 189, 0.2);
  border-color: rgba(13, 125, 189, 0.4);
}

.card.is-hidden {
  display: none;
}

@media (max-width: 640px) {
  .card-image img {
    height: 160px;
  }

  .card-text h2 {
    font-size: 0.98rem;
  }

  .card-text p {
    font-size: 0.82rem;
  }
}
