/* ===== GLOBAL THEME ===== */
body {
  background: linear-gradient(to bottom right, #0b3d2e, #1a472a);
  color: #f4f4f4;
  font-family: "Segoe UI", sans-serif;
}

html {
  scroll-behavior: smooth;
}

/* ===== HEADER ===== */
header {
  background: #14532d;
  border-radius: 12px;
  padding: 12px 20px;
}

header .nav-link {
  color: #d9f99d !important;
  transition: all 0.3s ease;
  padding: 8px 16px;
  margin: 0 4px;
  border-radius: 6px;
}

header .nav-link:hover {
  color: #facc15 !important;
  background: rgba(34, 197, 94, 0.1);
}

header .nav-link.active {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

header .btn-primary {
  background: #22c55e;
  border: none;
  transition: 0.3s ease;
}
header .btn-primary:hover {
  background: #16a34a;
  transform: scale(1.05);
}

/* ========== CAROUSEL ========= */
.carousel-control-prev,
.carousel-control-next {
  width: 45px;
  height: 45px;
  background-color: white;
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.carousel-control-prev {
  left: 10px;
}
.carousel-control-next {
  right: 10px;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  filter: invert(0.3);
  width: 20px;
  height: 20px;
}

/* ========== CARD COMPONENT (Container Query) ========= */
.card {
  background: #1e3a34;
  color: #f4f4f4;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card img {
  height: 200px;
  object-fit: cover;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.card .btn-primary {
  background: #22c55e;
  border: none;
}
.card .btn-primary:hover {
  background: #16a34a;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ====== CONTAINER QUERY: Card shrink ====== */
@container (max-width: 500px) {
  .card img {
    height: 150px;
  }
  .card-title {
    font-size: 1rem;
  }
  .card-text {
    font-size: 0.85rem;
  }
  .card .btn-primary {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
}

/* ===== HERO TEXT ===== */
.display-5 {
  color: #d9f99d;
}
.lead {
  color: #fef9c3;
}
.btn-outline-secondary {
  border-color: #facc15;
  color: #facc15;
}
.btn-outline-secondary:hover {
  background: #facc15;
  color: #14532d;
}

/* ===== FOOTER ===== */
footer {
  background: #14532d;
  border-radius: 12px;
  padding: 20px;
  margin-top: 40px;
}

footer .nav-link {
  color: #d9f99d !important;
}
footer .nav-link:hover {
  color: #facc15 !important;
}
footer p {
  color: #fef9c3;
}

/* ============================================= */
/* ===== MEDIA QUERIES (Global Screen-Based) ==== */
/* ============================================= */

@media (max-width: 991.98px) {
  /* Navbar collapses */
  .navbar-collapse .navbar-nav {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(250, 204, 21, 0.3);
  }

  .navbar-collapse .d-flex {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(250, 204, 21, 0.3);
  }
}

@media (max-width: 768px) {
  header {
    padding: 10px;
  }

  header img {
    width: 40px;
    height: 25px;
  }

  .carousel-item img {
    height: 250px;
    object-fit: cover;
  }
}

/* ============================================= */
/* ===== HERO SECTION CONTAINER QUERY ===== */
/* ============================================= */

.hero-container {
  container-type: inline-size;
}

/* Kalau parent hero sempit → stack layout lebih rapat */
@container (max-width: 700px) {
  .hero-container h1 {
    font-size: 1.8rem;
  }
  .hero-container .lead {
    font-size: 1rem;
  }
  .hero-container .btn-lg {
    padding: 8px 16px;
    font-size: 0.95rem;
  }
}

/* ============================
   SCROLL SNAP — MOBILE ONLY
============================ */
@media (max-width: 768px) {

  /* ---- CAROUSEL SNAP ---- */
  #carouselExample .carousel-inner {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
  }

  #carouselExample .carousel-item {
    flex: 0 0 100%;
    scroll-snap-align: center;
  }

  /* Nonaktifkan auto-slide di mobile */
  #carouselExample {
    touch-action: pan-y;
  }

  /* Hide scroll bar biar clean */
  #carouselExample .carousel-inner::-webkit-scrollbar {
    display: none;
  }



  /* ---- CARD SNAP (Explore Section) ---- */
  #explore-section .row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 16px;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
  }

  #explore-section .col-12.col-sm-6.col-lg-3 {
    flex: 0 0 80%;
    max-width: 80%;
    scroll-snap-align: start;
  }

  #explore-section .row::-webkit-scrollbar {
    display: none;
  }
}
