/* Custom additions — carousel, skills grid, gallery. Loaded after main.css. */

/* ---- Carousel ---- */
.carousel {
  position: relative;
  margin: 0 0 2rem 0;
  outline: none;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  gap: 0;
  border-radius: 6px;
  /* Hide scrollbar but keep scroll. */
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar {
  display: none;
}

.slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  margin: 0;
  position: relative;
}

.slide img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

.slide figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 1.25em 1em 0.75em;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #fff;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75),
    rgba(0, 0, 0, 0)
  );
  border-radius: 0 0 6px 6px;
}

.carousel-btn {
  position: absolute;
  top: calc(50% - 1.5rem);
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.1rem;
  line-height: 3rem;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s ease;
  z-index: 2;
}
.carousel-btn:hover,
.carousel-btn:focus-visible {
  background: rgba(0, 0, 0, 0.85);
  outline: none;
}
.carousel-btn.prev {
  left: 0.5rem;
}
.carousel-btn.next {
  right: 0.5rem;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.carousel-dot {
  width: 0.6rem;
  height: 0.6rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.carousel-dot.is-active {
  background: #ffffff;
  transform: scale(1.25);
}

/* ---- About photo pair ---- */
.photo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.photo-pair figure {
  margin: 0;
}
.photo-pair img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 6px;
}
.photo-pair figcaption {
  margin-top: 0.45rem;
  font-size: 0.75rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}
@media screen and (max-width: 480px) {
  .photo-pair {
    grid-template-columns: 1fr;
  }
}

/* ---- Skills grid ---- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 1rem 0 0 0;
}
.skills-grid .skill-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 1rem 1.15rem;
}
.skills-grid .skill-card h4 {
  margin: 0 0 0.4rem 0;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
}
.skills-grid .skill-card p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}

@media screen and (max-width: 736px) {
  .slide figcaption {
    font-size: 0.72rem;
  }
  .carousel-btn {
    width: 2.4rem;
    height: 2.4rem;
    line-height: 2.4rem;
  }
}
