/* ============================================================
   Mega888iOS — Responsive Styles
   Mobile-first approach with breakpoints
   ============================================================ */

/* ---- Large desktop (> 1024px) ---- */
@media (max-width: 1200px) {
  .hero h1 {
    font-size: 2.25rem;
  }
}

/* ---- Desktop (1024px and below) ---- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .app-card {
    max-width: 400px;
  }

  .content-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }

  .toc-toggle {
    display: flex;
  }

  .toc-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease);
  }

  .toc-content.open {
    max-height: 500px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .footer-brand {
    grid-column: span 3;
  }
}

/* ---- Tablet (768px and below) ---- */
@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .header-actions .search-btn {
    display: none;
  }

  .header-actions .btn {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .section {
    padding: 48px 0;
  }

  .hero {
    padding: 40px 0 32px;
  }

  .hero h1 {
    font-size: 1.875rem;
  }

  .hero-desc {
    font-size: 1rem;
  }

  .quick-info {
    grid-template-columns: repeat(2, 1fr);
  }

  .device-grid {
    grid-template-columns: 1fr;
  }

  .hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .footer-brand {
    grid-column: span 2;
  }

  .page-header h1 {
    font-size: 1.75rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .article-content h2 {
    font-size: 1.375rem;
  }

  .article-content h3 {
    font-size: 1.125rem;
  }

  .cta-banner {
    padding: 28px 20px;
  }

  .cta-banner h2 {
    font-size: 1.375rem;
  }
}

/* ---- Mobile (480px and below) ---- */
@media (max-width: 480px) {
  .container,
  .container-narrow {
    padding: 0 16px;
  }

  .section {
    padding: 36px 0;
  }

  .hero {
    padding: 32px 0 24px;
  }

  .hero h1 {
    font-size: 1.625rem;
  }

  .hero-cta {
    flex-direction: column;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .hero-trust {
    gap: 10px 16px;
  }

  .quick-info {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .hub-grid {
    grid-template-columns: 1fr;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-brand {
    grid-column: span 1;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-legal {
    justify-content: center;
  }

  .app-card {
    padding: 20px;
  }

  .app-card-buttons {
    grid-template-columns: 1fr;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .back-to-top {
    bottom: 16px;
    right: 16px;
  }
}

/* ---- Small mobile (360px and below) ---- */
@media (max-width: 360px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .logo-text .logo-sub {
    display: none;
  }

  .app-card {
    padding: 16px;
  }
}

/* ============================================================
   TABLET / SMALL DESKTOP
   ============================================================ */

@media (max-width: 900px) {

  .article-download-bar {
    padding: 18px 20px;
  }

  .article-download-top {
    gap: 18px;
  }

  .article-download-app {
    gap: 14px;
  }

  .article-download-icon {
    width: 64px;
    height: 64px;

    flex-basis: 64px;
  }

  .article-download-title {
    font-size: 1.08rem;
  }

  .article-download-actions {
    gap: 8px;
  }

  .article-download-btn,
  .article-download-btn:link,
  .article-download-btn:visited {
    min-width: 76px;
    min-height: 44px;

    padding: 10px 13px;

    font-size: 0.82rem;
  }

  .article-download-details {
    grid-template-columns:
      1.8fr
      0.7fr
      0.8fr
      0.9fr
      1.1fr;
  }
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 700px) {

  .mega-download-section {
    margin: 30px 0;
  }

  .mega-download-intro {
    margin-bottom: 18px;
  }

  .article-download-bar {
    padding: 16px;

    border-radius: 14px;
  }

  .article-download-top {
    display: flex;
    flex-direction: column;

    align-items: stretch;

    gap: 16px;
  }

  .article-download-app {
    width: 100%;
  }

  .article-download-icon {
    width: 60px;
    height: 60px;

    flex: 0 0 60px;
  }

  .article-download-title {
    font-size: 1rem;
  }

  .article-download-status {
    font-size: 0.78rem;
  }

  .article-download-version {
    font-size: 0.71rem;
  }

  .article-download-actions {
    width: 100%;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 8px;
  }

  .article-download-btn,
  .article-download-btn:link,
  .article-download-btn:visited {
    width: 100%;
    min-width: 0;
    min-height: 43px;

    padding: 10px 7px;

    font-size: 0.78rem;
  }

  .download-btn-icon {
    width: 16px;
    height: 16px;

    flex-basis: 16px;
  }


  /* File details */

  .article-download-details {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 12px 0;

    margin-top: 16px;
    padding-top: 14px;
  }

  .download-detail-item {
    padding: 0 12px;
  }

  .download-detail-item:nth-child(odd) {
    padding-left: 0;
  }

  .download-detail-item:nth-child(even) {
    padding-right: 0;
    border-right: 0;
  }
}


/* ============================================================
   SMALL MOBILE
   ============================================================ */

@media (max-width: 420px) {

  .article-download-bar {
    padding: 14px;
  }

  .article-download-app {
    gap: 12px;
  }

  .article-download-icon {
    width: 56px;
    height: 56px;

    flex-basis: 56px;

    border-radius: 13px;
  }

  .article-download-title {
    font-size: 0.96rem;
  }

  .article-download-status {
    font-size: 0.72rem;
  }

  .article-download-version {
    font-size: 0.66rem;
  }

  .article-download-actions {
    gap: 6px;
  }

  .article-download-btn,
  .article-download-btn:link,
  .article-download-btn:visited {
    min-height: 41px;

    padding: 9px 5px;

    font-size: 0.72rem;

    border-radius: 8px;
  }

  .download-btn-icon {
    width: 14px;
    height: 14px;

    flex-basis: 14px;
  }


  /* Detail file satu kolom */

  .article-download-details {
    grid-template-columns: 1fr;

    gap: 0;
  }

  .download-detail-item,
  .download-detail-item:nth-child(odd),
  .download-detail-item:nth-child(even) {
    padding: 8px 0;

    border-right: 0;
  }

  .download-detail-item:first-child {
    padding-top: 0;
  }

  .download-detail-item + .download-detail-item {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .download-detail-item dt {
    margin-bottom: 2px;
  }
}


/* ============================================================
   VERY SMALL MOBILE
   ============================================================ */

@media (max-width: 340px) {

  .article-download-actions {
    grid-template-columns: 1fr;
  }

  .article-download-btn,
  .article-download-btn:link,
  .article-download-btn:visited {
    min-height: 43px;
  }
}

/* ============================================================
   FOOTER SOCIAL - TABLET / MOBILE
   ============================================================ */

@media (max-width: 700px) {

  .footer-social {
    margin-top: 20px;
  }

  .footer-social-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .footer-social-link,
  .footer-social-link:link,
  .footer-social-link:visited {
    width: 100%;
    min-height: 42px;

    justify-content: flex-start;

    padding: 10px 12px;

    font-size: 0.75rem;
  }

  .footer-social-link svg {
    width: 16px !important;
    height: 16px !important;

    min-width: 16px !important;
    min-height: 16px !important;

    max-width: 16px !important;
    max-height: 16px !important;

    flex-basis: 16px !important;
  }
}


/* Small Mobile */
@media (max-width: 360px) {

  .footer-social-links {
    grid-template-columns: 1fr;
  }

}

/* Mobile */
@media (max-width: 480px) {
  .mobile-menu-logo-image {
    height: 38px;
    max-width: 160px;
  }
}


/* Small Mobile */
@media (max-width: 360px) {
  .mobile-menu-logo-image {
    height: 34px;
    max-width: 145px;
  }
}

/* ============================================================
   HERO GAMING EFFECT - TABLET
   ============================================================ */

@media (max-width: 900px) {

  .game-glow-one {
    width: 340px;
    height: 340px;

    right: -100px;
  }

  .game-grid {
    opacity: 0.08;
  }

  .game-hud {
    display: none;
  }

}


/* ============================================================
   HERO GAMING EFFECT - MOBILE
   ============================================================ */

@media (max-width: 700px) {

  .game-grid {
    width: 420px;
    height: 300px;

    right: -220px;
    bottom: -130px;

    opacity: 0.07;

    background-size: 32px 32px;
  }

  .game-glow-one {
    width: 280px;
    height: 280px;

    top: -120px;
    right: -130px;

    opacity: 0.45;
  }

  .game-glow-two {
    width: 260px;
    height: 260px;

    bottom: -160px;
    left: -120px;
  }

  .game-glow-three {
    display: none;
  }

  .ring-one {
    width: 170px;
    height: 170px;

    right: -110px;

    opacity: 0.35;
  }

  .ring-two {
    display: none;
  }

  .streak-one {
    width: 180px;

    right: -50px;
  }

  .streak-two {
    width: 150px;
  }

  .streak-three {
    display: none;
  }

  .particle-4,
  .particle-5,
  .particle-6 {
    display: none;
  }

}


/* ============================================================
   REDUCED MOTION
   Accessibility + performance
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

  .game-particle,
  .game-streak,
  .game-ring {
    animation: none !important;
  }

}

@media (max-width: 480px) {
  .mega-author-box {
    margin: 24px 0 32px;
    padding: 20px;
    border-radius: 12px;
  }

  .mega-author-box .mega-author-title {
    margin-bottom: 16px;
    font-size: 17px;
  }

  .mega-author-box .mega-author-profile {
    gap: 12px;
    margin-bottom: 16px;
  }

  .mega-author-box .mega-author-avatar {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }

  .mega-author-box .mega-author-name {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .mega-author-box {
    margin: 24px 0 32px;
    padding: 20px;
    border-radius: 12px;
  }

  .mega-author-box .mega-author-title {
    margin-bottom: 16px;
    font-size: 17px;
  }

  .mega-author-box .mega-author-profile {
    gap: 12px;
    margin-bottom: 14px;
  }

  .mega-author-box .mega-author-avatar {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }

  .mega-author-box .mega-author-name {
    font-size: 16px;
  }
}