/* ==========================================================================
   ENDJOY TRAVEL — RESPONSIVE STYLESHEET
   Breakpoints: 1200 / 1024 / 992 / 900(nav) / 768 / 576 / 480 / 360
   Everything in this file only ever fires at <=1200px, so nothing here
   changes the desktop layout, colors, branding, or animations.
   ========================================================================== */

/* ---------- LAPTOP / SMALL DESKTOP (<=1200px) ---------- */
@media (max-width: 1200px) {
  .container { padding: 0 20px; }

  .services { grid-template-columns: repeat(2, 1fr); }
  /* FIX: ".services--triple" (2 classes) is more specific than ".services" (1 class),
     so on the homepage "Layanan" section (services + services--triple) the old rule
     above was silently ignored and the 3 cards stayed in 3 columns all the way down
     to phone widths — very cramped. Targeting the combo explicitly fixes it. */
  .services--triple { grid-template-columns: repeat(2, 1fr); }
  .reasons { grid-template-columns: repeat(3, 1fr); }
  .tour-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

/* ---------- TABLET (<=1024px) ---------- */
@media (max-width: 1024px) {
  :root { --nav-h: 76px; }

  .navbar__list { gap: 22px; }
  .navbar__link { font-size: 13.5px; }

  .hero__container { grid-template-columns: 1fr; text-align: center; }
  .hero__actions { justify-content: center; }
  .hero__stats { justify-content: center; }

  .footer__grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer__col--brand { grid-column: 1 / -1; }

  .about { grid-template-columns: 1fr; text-align: center; }
  .about__points li { text-align: left; }

  .route-grid,
  .info-grid { grid-template-columns: 1fr; }

  .gallery-grid { grid-template-columns: repeat(3, 1fr); }

  /* FIX: tour-grid had no step between 3 columns (1200px) and 1 column
     (768px) — on tablet widths (769-1024px) the 3 taller premium cards were
     visibly cramped. 2 columns fills that gap cleanly. */
  .tour-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }

  .package-detail,
  .package-detail:nth-child(even) { grid-template-columns: 1fr; }
  .package-detail:nth-child(even) .package-detail__media { order: 0; }

  .contact-grid { grid-template-columns: 1fr; }
}

/* ---------- 992px — small tablet / large phone landscape ---------- */
@media (max-width: 992px) {
  .section { padding: 84px 0; }
  .service-card,
  .info-card,
  .contact-card { padding: 26px 22px; } /* a touch tighter than desktop, still airy */
}

/* ---------- TABLET / MOBILE NAV BREAK (<=900px) ---------- */
@media (max-width: 900px) {
  .navbar__menu {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: #fff;
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    /* FIX: animate opacity + a tiny slide together with max-height so open/close
       feels like a smooth panel instead of a hard height-snap. */
    opacity: 0;
    transform: translateY(-6px);
    transition: max-height 0.4s ease, opacity 0.3s ease, transform 0.3s ease;
  }
  .navbar.is-scrolled .navbar__menu { top: 66px; }

  .navbar__menu.is-open {
    max-height:calc(100vh - var(--nav-h));
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0);
  }

  /* AUDIT FIX: the brand orange (--color-secondary, #F68B1F) measures only
     2.43:1 contrast against white — fails WCAG AA (needs 4.5:1 for normal
     text). This is a same-hue orange darkened until it clears AA (4.71:1),
     used ONLY as mobile-menu link text so the rest of the site — buttons,
     badges, the desktop dropdown, etc. — is completely untouched. */
  #navMenu { --menu-accent: #B25D07; }

  /* AUDIT FIX: .navbar.is-scrolled .navbar__link.active / :hover in style.css
     has 3 classes of specificity (0,3,0). The previous override here,
     `.navbar__menu .navbar__link`, was only (0,2,0) — so whenever the page
     was scrolled, that older rule won and silently reverted colors, which is
     why the fix looked inconsistent (worked on some items/states, not
     others). Scoping every state to the #navMenu ID instead guarantees this
     always wins, regardless of scroll state, with no !important needed. */
  #navMenu .navbar__link {
    color: #1E2A4A;
    text-shadow: none;
  }
  #navMenu .navbar__link:hover,
  #navMenu .navbar__link.active {
    color: var(--menu-accent);
  }

  .navbar__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 24px;
  }
  .navbar__list li { width: 100%; }
  .navbar__list li + li { border-top: 1px solid var(--color-border); } /* FIX: subtle row dividers so items read as a list, like Traveloka/Tiket.com menus, instead of floating text */
  .navbar__link {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 48px; /* FIX: guarantees the 48px minimum tap target the brief asks for, even where 14.5px text + padding fell just short */
    padding: 14px 4px;
    width: 100%;
    font-size: 16px; /* FIX: bumped from 14.5px — small body-copy sizing read cramped for a full-width tap target */
  }
  .navbar__link::after { display: none; }

  /* Dropdown becomes an in-flow accordion on mobile */
  .navbar__dropdown-toggle { width: 100%; }
  #navMenu .navbar__dropdown-caret { color: #1E2A4A; } /* FIX: same ID-scoping — caret is an <i> icon using currentColor, needs the same guaranteed-to-win color as the link text */
  #navMenu .navbar__dropdown.is-open .navbar__dropdown-caret { color: var(--menu-accent); }
 .navbar__submenu{
    position: static !important;

    display: block !important;

    opacity: 1 !important;

    visibility: visible !important;

    transform: none !important;

    translate: none !important;

    box-shadow: none !important;

    background: transparent;

    border: 0;

    overflow: hidden;

    max-height: 0;

    transition: max-height .3s ease;

    margin-left:20px;

    padding-left:0;
}

.navbar__dropdown.is-open .navbar__submenu{

    max-height:500px;

}
  #navMenu .navbar__sublink{

    display:block;

    align-items:center;

    padding:12px 0 12px 18px;

    color:#5B6472;

    border-left:2px solid var(--color-border);

    transition:.25s;
  }
  #navMenu .navbar__sublink:hover,
  #navMenu .navbar__sublink.active{

    color:var(--menu-accent);

    border-left-color:var(--menu-accent);

    background:var(--color-bg-light);

}

  .navbar__toggle { display: flex; }
  .navbar__cta { display: none; }

  /* FIX: the hamburger's tappable area was ~32-40px — under Apple/Google's
     44x44px minimum touch-target guideline. Bumped padding so it's easy to
     hit with a thumb without changing how it looks (still a small icon). */
  .navbar__toggle { width: 44px; height: 44px; padding: 10px 6px; justify-content: center; }

  /* Mobile-only panel header (title + explicit close button). Hidden by
     default in style.css; only shown once the panel is fixed/full-width
     here, so it never appears on desktop's inline nav. */
  .navbar__menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 8px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 8px;
  }
  .navbar__menu-head-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #1E2A4A; }
  .navbar__menu-close {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; /* meets the 44-48px tap-target guideline */
    border-radius: 50%;
    color: #1E2A4A;
    transition: background 0.2s ease;
  }
  .navbar__menu-close:hover { background: var(--color-bg-light); }
  .navbar__menu-close svg, .navbar__menu-close i { width: 20px; height: 20px; }

  /* Full-screen dimmed backdrop behind the open panel — tap it to close.
     Sits just under the panel (panel is a sibling with a higher z-index
     already, .navbar has z-index:1000) and fades in/out with it.
     AUDIT FIX: scoped display:block to the #navOverlay ID (rather than the
     .navbar__overlay class, same specificity as style.css's display:none)
     so there's no ambiguity about which rule wins — this one always does. */
  #navOverlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(6, 26, 69, 0.55); /* FIX: darkened from 0.45 → 0.55 so the scrim reads unmistakably as a dimmed backdrop, not a washed-out near-white haze */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
  }
  #navOverlay.is-open { opacity: 1; visibility: visible; }
}

/* ---------- TABLET (<=768px) ---------- */
@media (max-width: 768px) {
  .section { padding: 72px 0; }
  .section__head { margin-bottom: 40px; }

  .services,
  .services--triple { grid-template-columns: 1fr; } /* same specificity fix as above, for phones */
  .reasons { grid-template-columns: repeat(2, 1fr); }
  .tour-grid { grid-template-columns: 1fr; gap: 20px; }
  /* FIX: the redesigned media is 236px tall on desktop — on phones that eats
     a big share of the viewport before any text is visible. 190px keeps the
     photo prominent without pushing the title/description below the fold. */
  .tour-card__media { height: 190px; }
  .tour-card__body { padding: 22px; }

  .fleet-card { flex-basis: 260px; }
  .fleet-card__media { height: 160px; }

  /* FIX: gallery-grid had no rule between 1024px and 480px, so on most phones
     (and small tablets) it was still stuck at 3 columns — thumbnails became
     too small to tap or recognize. 2 columns is legible all the way to 360px. */
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }

  .booking-route {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .booking-route__line {
    top: 0; bottom: 0; left: 27px; right: auto;
    width: 2px; height: auto;
    background-image: linear-gradient(180deg, var(--color-secondary) 65%, transparent 0%);
    background-size: 2px 14px;
  }
  .booking-step { display: flex; align-items: flex-start; gap: 20px; text-align: left; }
  .booking-step__marker { margin: 0; flex-shrink: 0; }

  .footer__grid { grid-template-columns: 1fr; gap: 36px; }

  /* Hero — fills the mobile viewport proportionally instead of the desktop 100vh,
     and stops clipping content against the browser chrome. */
  .hero { min-height: 65vh; padding-bottom: 0; }
  /* FIX: hero__container still used its desktop 60px top/bottom padding, which
     fought the shorter min-height above and left title/subtitle/buttons feeling
     squeezed toward the middle with too much dead air around them. Tighter
     padding here lets the content breathe at the new proportions instead. */
  .hero__container--center { padding: 40px 20px; }
  .hero__title { font-size: clamp(26px, 7vw, 34px); line-height: 1.2; } /* FIX: fluid instead of one fixed size */
  .hero__subtitle { font-size: clamp(14.5px, 3.6vw, 16px); line-height: 1.6; }
  .hero-slideshow__label { font-size: 12px; padding: 8px 16px; }
  .hero-arrow { width: 40px; height: 40px; }
  .hero-arrow--prev { left: 10px; }
  .hero-arrow--next { right: 10px; }

  /* FIX: background-position:center (desktop default) crops the top of the subject
     on tall/narrow phone screens once the wide photo is cropped to a portrait-ish
     hero. Biasing toward the upper third keeps mountains/vehicles/faces in frame.
     background-size:cover never upscales beyond the source photo's native
     resolution (2560x1440 here) — it only crops, so this can't cause blur. */
  .hero-slideshow__slide {
    background-size: cover;
    background-position: center 35%;
  }

  /* CTA buttons — full width and stacked from 768px down, not just 480px,
     so both buttons are always big, thumb-friendly tap targets on phones. */
  .hero__actions { flex-direction: column; width: 100%; gap: 12px; }
  .hero__actions .btn { width: 100%; text-align: center; }

  .page-banner { padding: calc(var(--nav-h) + 44px) 0 56px; }

  .package-detail__cols { grid-template-columns: 1fr; }

  /* Section / card title fluid sizing so nothing wraps awkwardly on narrow screens */
  .section__title { font-size: clamp(22px, 6vw, 28px); }
  .service-card__title { font-size: clamp(17px, 4.6vw, 19px); }
}

/* ---------- 576px — large phones ---------- */
@media (max-width: 576px) {
  .section { padding: 60px 0; }
  .cta h2 { font-size: clamp(22px, 6.5vw, 28px); }
  .fleet-card { flex: 0 0 78vw; } /* one card mostly fills the screen in the slider, easier to browse by thumb */
}

/* ---------- MOBILE (<=480px) ---------- */
@media (max-width: 480px) {
  .container { padding: 0 16px; }

  .navbar__logo { height: 42px; }
  .navbar.is-scrolled .navbar__logo { height: 34px; }

  .hero__stats { gap: 24px; }
  .hero__stat-num, .hero__stat-suffix { font-size: 22px; }

  .ticket-card { padding: 26px 20px 20px; }
  .ticket-card__code { font-size: 22px; }

  .hero-slideshow__slide { padding-bottom: 24px; }
  .hero-slideshow__label { display: none; }
  .hero-arrow { width: 36px; height: 36px; }
  .hero-arrow svg, .hero-arrow i { width: 18px; height: 18px; }

  .reasons { grid-template-columns: 1fr; }

  .cta { padding: 64px 0; }

  /* FIX: bottom offset now also clears the iPhone home-indicator / gesture bar
     (env(safe-area-inset-bottom) is 0 on phones without a safe area, so this
     is a no-op everywhere else, including desktop). */
  .whatsapp-float {
    width: 52px; height: 52px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    right: 18px;
  }
  .whatsapp-float svg { width: 24px; height: 24px; }

  .accordion__header { font-size: 14.5px; }

  .route-card { flex-direction: column; align-items: flex-start; gap: 12px; }
  .route-card__note { text-align: left; }
}

/* ---------- 360px — small phones ---------- */
@media (max-width: 360px) {
  .hero__title { font-size: clamp(22px, 7.5vw, 26px); }
  .hero__subtitle { font-size: 13.5px; }
  .hero__actions { gap: 10px; }
  .btn--lg { padding: 13px 20px; font-size: 14.5px; } /* keeps the button readable without wrapping oddly on 320-360px screens */

  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } /* still 2 columns, just tighter gap */
  .section { padding: 52px 0; }
  .whatsapp-float { width: 48px; height: 48px; }
}
