/* ==========================================================================
   1. GLOBAL VARIABLES & BASE STYLES
   ========================================================================== */
   :root {
    --primary-color: #2563eb;    /* Royal Blue */
    --primary-hover: #1d4ed8;
    --accent-gold: #f59e0b;      /* Emas Prestasi */
    --secondary-color: #0f172a;  /* Dark Slate Footer */
    --bg-light: #f8fafc;
    --font-main: 'Plus Jakarta Sans', sans-serif;
  }
  
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    font-family: var(--font-main);
    background-color: var(--bg-light);
    color: #334155;
  }
  
  img {
    max-width: 100%;
    height: auto;
  }
  
  .section-padding { 
    padding: 90px 0; 
  }
  
  /* ==========================================================================
     2. BUTTONS & UTILITIES
     ========================================================================== */
  .btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s ease;
  }
  
  .btn-primary-custom:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
  }
  
  .btn-gold-custom {
    background: linear-gradient(135deg, var(--accent-gold), #d97706);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s ease;
  }
  
  .btn-gold-custom:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
  }
  
  .backdrop-blur {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  
  /* ==========================================================================
     3. NAVBAR
     ========================================================================== */
  .navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  }
  .navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--secondary-color);
  }
  .navbar-brand span { color: var(--primary-color); }
  .nav-link {
    font-weight: 600;
    color: #475569;
    margin: 0 8px;
  }
  .nav-link:hover, .nav-link.active { color: var(--primary-color); }
  
/* ==========================================================================
   4. HERO CAROUSEL
   Banner asli: 1600 x 600 px
   Rasio: 8 : 3
   ========================================================================== */

#home {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   CAROUSEL UTAMA
   -------------------------------------------------------------------------- */

.hero-carousel {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background-color: #f8fafc;
}

.hero-carousel .carousel-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 1600 / 600;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   SETIAP SLIDE
   -------------------------------------------------------------------------- */

.hero-carousel .carousel-item {
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background-color: #f8fafc;
}

/* Bootstrap membutuhkan slide active tetap terlihat */
.hero-carousel .carousel-item.active {
    position: relative;
}

/* --------------------------------------------------------------------------
   GAMBAR BANNER
   -------------------------------------------------------------------------- */

.hero-carousel .carousel-item img {
    display: block;

    width: 100%;
    height: 100%;
    max-width: 100%;

    /*
       contain = gambar tidak akan dipotong.
       Karena container juga 1600:600,
       gambar akan memenuhi area secara sempurna.
    */
    object-fit: contain;
    object-position: center center;
}


/* ==========================================================================
   CAROUSEL CONTROL
   ========================================================================== */

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    position: absolute;

    top: 0;
    bottom: 0;

    width: 7%;

    z-index: 10;

    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Tombol muncul saat mouse masuk */
.hero-carousel:hover .carousel-control-prev,
.hero-carousel:hover .carousel-control-next {
    opacity: 1;
}

/* Tetap nyaman digunakan di perangkat touch */
.hero-carousel .carousel-control-prev:focus,
.hero-carousel .carousel-control-next:focus {
    opacity: 1;
}

/* Icon tombol */
.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
    width: 35px;
    height: 35px;

    filter: drop-shadow(
        0 2px 5px rgba(0, 0, 0, 0.45)
    );
}


/* ==========================================================================
   WAVE HERO
   Wave hanya sebagai dekorasi.
   Tidak mempengaruhi ukuran carousel.
   Tidak mengganggu klik/touch.
   ========================================================================== */

.wave-container {
    position: absolute;

    left: 0;
    right: 0;
    bottom: -1px;

    width: 100%;
    max-width: 100%;

    /*
       Tinggi otomatis menyesuaikan ukuran layar.
       Desktop maksimal 70px.
       HP sekitar 22-30px.
    */
    height: clamp(22px, 4vw, 70px);

    z-index: 3;

    overflow: hidden;

    /*
       Wave tidak pernah menangkap klik/touch.
       Sangat penting untuk HP.
    */
    pointer-events: none;

    line-height: 0;
}

/* SVG wave */
.wave-container svg {
    display: block;

    width: 100%;
    height: 100%;

    max-width: 100%;

    overflow: hidden;
}

/* Layer wave */
.wave-container .parallax {
    width: 100%;
}




/* ==========================================================================
   LAPTOP
   ========================================================================== */

@media (min-width: 992px) and (max-width: 1199.98px) {

    .wave-container {
        height: 45px;
    }

    #home {
      padding-top: 80px;
  }

}


/* ==========================================================================
   DESKTOP
   ========================================================================== */

@media (min-width: 1200px) {

    .wave-container {
        height: 60px;
    }

    #home {
      padding-top: 80px;
  }

}


/* ==========================================================================
   EXTRA SMALL DEVICE
   ========================================================================== */

@media (max-width: 375px) {

    .wave-container {
        height: 18px;
    }

    .hero-carousel .carousel-control-prev-icon,
    .hero-carousel .carousel-control-next-icon {
        width: 18px;
        height: 18px;
    }

}

/* ==========================================================================
   HERO CAROUSEL
   Banner: 1600 x 600 px
   Rasio: 8 : 3
   ========================================================================== */

   #home {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;

    /*
     * Memberikan ruang untuk navbar fixed.
     */
    padding-top: 80px;
}


.hero-carousel {
    position: relative;

    width: 100%;
    max-width: 100%;

    overflow: hidden;

    background-color: #f8fafc;
}


/*
 * Carousel mengikuti rasio gambar 1600 x 600.
 */
.hero-carousel .carousel-inner {
    position: relative;

    width: 100%;

    aspect-ratio: 1600 / 600;

    overflow: hidden;
}


.hero-carousel .carousel-item {
    width: 100%;
    height: 100%;

    background-color: #f8fafc;
}


.hero-carousel .carousel-item img {
    display: block;

    width: 100%;
    height: 100%;

    max-width: 100%;

    /*
     * Tidak memotong gambar.
     */
    object-fit: contain;
    object-position: center center;
}


/* ==========================================================================
   CAROUSEL CONTROL
   ========================================================================== */

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    width: 7%;

    z-index: 5;

    opacity: 0;

    transition: opacity 0.3s ease;
}


.hero-carousel:hover .carousel-control-prev,
.hero-carousel:hover .carousel-control-next {
    opacity: 1;
}


.hero-carousel .carousel-control-prev:focus,
.hero-carousel .carousel-control-next:focus {
    opacity: 1;
}


.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
    width: 35px;
    height: 35px;

    filter: drop-shadow(
        0 2px 5px rgba(0, 0, 0, 0.45)
    );
}

  
  /* ==========================================================================
     5. PROFILE & TIMELINE
     ========================================================================== */
  .profile-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .timeLine {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .timeLine img {
    max-width: 100%;
    height: auto;
  }
  
  /* ==========================================================================
     6. SPONSOR SLIDER (Diperbaiki agar tidak merusak viewport hp)
     ========================================================================== */
  .sponsor-section {
    background: #fff;
    overflow: hidden;
    width: 100%;
  }
  .sponsor-slider {
    display: flex;
    width: max-content;
    animation: scrollSponsors 25s linear infinite;
  }
  .sponsor-item {
    width: 180px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .sponsor-item img {
    max-width: 100px;
    height: auto;
    filter: grayscale(100%);
    opacity: 0.5;
    transition: all 0.3s ease;
  }
  .sponsor-item img:hover {
    filter: grayscale(0%);
    opacity: 1;
  }
  
  /* ==========================================================================
   7. PERLOMBAAN SECTION & BERITA (RESPONSIVE OPTIMIZED)
   ========================================================================== */

/* Header Perlombaan Responsif */
.header-lomba-wrapper {
  gap: 1.5rem;
}

.btn-nav-lomba {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.btn-nav-lomba:hover {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.3);
}

/* --- CABANG OLIMPIADE CARD --- */
.lomba-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  height: 100%; /* Menyamakan tinggi kartu */
  display: flex;
  flex-column: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lomba-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.lomba-img-container {
  position: relative;
  width: 100%;
  height: 200px; /* Default height */
  overflow: hidden;
}

.lomba-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.lomba-card:hover .lomba-img-container img {
  transform: scale(1.05);
}

.badge-category {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--accent-gold);
  color: #fff;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 800;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.lomba-card .p-4 {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

/* --- BERITA CARD --- */
.news-card {
  background: #fff;
  border-radius: 20px;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
}

.news-card img {
  border-radius: 14px;
  height: 200px;
  width: 100%;
  object-fit: cover;
}

.news-card h5 {
  margin-top: 0.5rem;
  line-height: 1.4;
}

.news-card p {
  margin-top: auto; /* Memaksa deskripsi sejajar di bawah */
}


/* ==========================================================================
   9. MEDIA QUERIES (Breakpoints Responsif Khusus)
   ========================================================================== */

/* Tablet & Mobile Breakpoints */
@media (max-width: 991.98px) {
  .lomba-img-container,
  .news-card img {
    height: 180px;
  }
}

@media (max-width: 767.98px) {
  .section-padding {
    padding: 50px 0;
  }

  /* Responsif Header Perlombaan */
  .header-lomba-wrapper {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }

  /* Responsif Gambar Kartu di HP */
  .lomba-img-container {
    height: 160px;
  }

  .news-card img {
    height: 160px;
  }

  .sponsor-item {
    width: 140px;
  }
}

/* HP Layar Kecil (iPhone SE / Samsung Galaxy Fold) */
@media (max-width: 375px) {
  .lomba-img-container,
  .news-card img {
    height: 140px;
  }

  .badge-category {
    font-size: 0.68rem;
    padding: 4px 12px;
  }
}
  
  /* ==========================================================================
     8. FOOTER
     ========================================================================== */
  .footer {
    background-color: var(--secondary-color);
    color: #94a3b8;
    margin-top: 0;
  }
  .footer-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
  }
  .footer-link {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
  }
  .footer-link:hover { color: #fff; }
  .social-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-right: 8px;
    transition: background 0.3s ease;
  }
  .social-btn:hover { background: var(--primary-color); }
  
  /* ==========================================================================
     9. MEDIA QUERIES (Mobile & Tablet Responsiveness)
     ========================================================================== */
  @media (max-width: 767.98px) {
    .section-padding {
      padding: 50px 0;
    }
  
  
    .identity-img-wrapper {
      max-width: 100%;
    }
  
    .lomba-card {
      margin-bottom: 15px;
    }
  
    .sponsor-item {
      width: 140px;
    }

    #home {
      padding-top: 90px;
  }


  .hero-carousel .carousel-inner {
      aspect-ratio: 1600 / 600;
  }


  .hero-carousel .carousel-control-prev,
  .hero-carousel .carousel-control-next {
      width: 12%;
  }


  .hero-carousel .carousel-control-prev-icon,
  .hero-carousel .carousel-control-next-icon {
      width: 22px;
      height: 22px;
  }


  .wave-container {
    /*
       Wave dibuat lebih kecil di HP
       supaya tidak menutupi banner.
    */
    height: 22px;

    bottom: -1px;
}

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    width: 12%;
}

.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
    width: 22px;
    height: 22px;
}

  }


/* ==========================================================================
 HP KECIL
 ========================================================================== */

@media (max-width: 375px) {

  #home {
      padding-top: 90px;
  }


  .hero-carousel .carousel-control-prev-icon,
  .hero-carousel .carousel-control-next-icon {
      width: 18px;
      height: 18px;
  }

}


/* ==========================================================================
 TABLET
 ========================================================================== */

@media (min-width: 768px) and (max-width: 991.98px) {

  #home {
      padding-top: 80px;
  }

  .wave-container {
    height: 35px;
}

}

/* ==========================================================================
   PURE CSS SCROLL SNAP TRACK & ITEMS (NO EXTERNAL PACKAGE)
   ========================================================================== */

   .snap-wrapper {
    position: relative;
    width: 100%;
  }
  
  .snap-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 10px 5px 20px 5px; /* Margin bawah untuk shadow */
  }
  
  /* Menyembunyikan scrollbar native agar tampilan bersih */
  .snap-track::-webkit-scrollbar {
    display: none;
  }
  .snap-track {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  
  .snap-item {
    scroll-snap-align: start;
    flex: 0 0 calc(33.333% - 1rem); /* 3 Kolom di Desktop */
    min-width: 280px;
  }
  
  /* Adjustments untuk tampilan responsif */
  @media (max-width: 991.98px) {
    .snap-item {
      flex: 0 0 calc(50% - 0.75rem); /* 2 Kolom di Tablet */
    }
  }
  
  @media (max-width: 575.98px) {
    .snap-item {
      flex: 0 0 85%; /* Single card dengan sedikit intipan kartu selanjutnya di HP */
    }
  }

  