* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, sans-serif;
}

body {
  background: linear-gradient(135deg, #111, #333);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
}

.wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  height: 450px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.card {
  width: 100px;
  border-radius: 1.5rem;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  transition: all 0.6s cubic-bezier(0.28, -0.03, 0, 0.99);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent 60%);
  opacity: 0.8;
  transition: 0.3s;
}

.card > .row {
  color: #fff;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  position: relative;
  z-index: 2;
  padding: 20px;
}

.card > .row > .icon {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 55px;
  height: 55px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  margin-right: 15px;
}

.card > .row > .description {
  display: flex;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  height: 100px;
  width: 400px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.description h4 {
  text-transform: uppercase;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.description p {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #ddd;
}

input {
  display: none;
}

input:checked + label {
  width: 550px;
}

input:checked + label .description {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* --- Unsplash background images --- */
label[for="c1"] {
  background-image: url("../assets/1.avif");
}

label[for="c2"] {
  background-image: url("../assets/2.avif");
}

label[for="c3"] {
  background-image: url("../assets/3.avif");
}

label[for="c4"] {
  background-image: url("../assets/4.avif");
}

/* --- Responsive behavior --- */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
    height: auto;
  }

  .card {
    width: 90%;
    height: 250px;
  }

  input:checked + label {
    width: 90%;
  }

  .description {
    width: 100%;
  }
}
