*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #051215;
  font-family: Arial, sans-serif;
  color: #ffffff;
}

.container {
  width: 100%;
  max-width: 1200px;
  height: 500px;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 1.25rem;
  transition: all 400ms;
}

.card {
  flex: 1;
  height: 100%;
  transition: all 400ms;
  cursor: pointer;
  overflow: hidden;
  border-radius: 10px;
  background-color: #0d1b1e;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  position: relative;
}

.card > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 400ms;
}

.card > p {
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: justify;
  opacity: 0;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: auto;
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  transition: opacity 400ms;
}

.card:hover > img {
  opacity: 0.6;
}

.card:hover > p {
  opacity: 1;
}

.card:nth-child(odd) {
  translate: 0 -20px;
}

.card:nth-child(even) {
  translate: 0 20px;
}

.container:hover .card:not(:hover) {
  filter: grayscale(100%);
}

.card:hover {
  flex: 3;
}

/* Full Screen Overlay */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.overlay img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

button {
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 2rem;
  border: none;
  padding: 10px;
  cursor: pointer;
  z-index: 1001;
}

button:focus {
  outline: none;
}

.prev {
  position: absolute;
  left: 20px;
}

.next {
  position: absolute;
  right: 20px;
}
