/* =========================================================
   GRRM - Gerakan Resik Resik Masjid
   Responsive Stylesheet (Balanced · Mobile Optimized)
   ========================================================= */

/* =========================================================
   TABLET LANDSCAPE (<= 1100px)
   ========================================================= */
@media (max-width: 1100px) {

  .nav-toggle { display: flex; }

  .site-nav {
    position: fixed;
    top: 68px;
    right: 0;
    width: min(320px, 88vw);         /* ⭐ lebih lega di mobile */
    max-width: 100%;
    height: calc(100vh - 68px);
    background: #fff;
    border-left: 1px solid var(--border);
    box-shadow: -12px 0 32px rgba(106, 47, 181, 0.18);
    transform: translateX(100%);
    transition: transform 0.3s var(--ease-out);
    padding: 20px 16px;
    overflow-y: auto;
    z-index: 999;
  }
  .site-nav.open { transform: translateX(0); }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .site-nav a {
    display: block;
    padding: 12px 16px;
    font-size: 0.98rem;
    border-radius: 10px;
    min-height: 48px;
    line-height: 1.3;
  }
  .site-nav a.active::after { display: none; }
  .site-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
  }

  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .galeri-grid { grid-template-columns: repeat(3, 1fr); }
  .member-list { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }

  .pengumuman-card { grid-template-columns: 80px 1fr; }
  .pengumuman-cta {
    grid-column: 1 / -1;
    text-align: right;
    margin-top: 2px;
  }

  .footer-grid {
    grid-template-columns: auto 1.2fr 1fr 1fr;
    gap: 24px;
  }
  .footer-logo { width: 100px; height: 100px; }
}

/* =========================================================
   TABLET PORTRAIT (<= 900px)
   ========================================================= */
@media (max-width: 900px) {

  .section { padding: 52px 0; }

  .hero-content-inner { max-width: 100%; }
  .hero-content-inner h1 { font-size: clamp(1.5rem, 4.5vw, 2rem); }
  .hero-content-inner p { font-size: clamp(0.92rem, 1.4vw, 1rem); }

  .profil-grid,
  .sejarah-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .sejarah-grid .sejarah-image { order: -1; }

  .vm-grid { grid-template-columns: 1fr; }
  .kontak-grid { grid-template-columns: 1fr; }

  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
  }
  .footer-logo-col {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin-bottom: 8px;
  }
  .footer-logo { width: 90px; height: 90px; }

  .article { max-width: 100%; }
  .section-header { margin-bottom: 32px; }
}

/* =========================================================
   TABLET KECIL (<= 768px)
   ========================================================= */
@media (max-width: 768px) {

  .container { padding: 0 18px; }
  .section { padding: 44px 0; }

  .header-inner { height: 62px; }
  .brand-logo { width: 36px; height: 36px; }
  .brand-name { font-size: 1.05rem; }
  .brand-sub { font-size: 0.68rem; }

  .site-nav { top: 62px; height: calc(100vh - 62px); }

  .hero {
    height: 68vh;
    min-height: 400px;
    max-height: 560px;
  }
  .hero-content { padding: 0 18px; }
  .hero-content-inner h1 { font-size: 1.6rem; margin-bottom: 12px; }
  .hero-content-inner p { font-size: 0.92rem; margin-bottom: 20px; }
  .hero-tag {
    font-size: 0.68rem;
    padding: 5px 12px;
    margin-bottom: 12px;
  }

  .hero-arrow { width: 38px; height: 38px; }
  .hero-prev { left: 12px; }
  .hero-next { right: 12px; }

  .hero-dots { bottom: 16px; }
  .hero-dots .dot { width: 22px; height: 4px; }
  .hero-dots .dot.active { width: 34px; }

  .news-grid { grid-template-columns: 1fr; }
  .galeri-grid { grid-template-columns: repeat(2, 1fr); }
  .member-list { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }

  .section h2 { font-size: 1.3rem; }
  .section-header { margin-bottom: 26px; }
  .section-header-left { margin-bottom: 20px; }

  .card { padding: 24px 18px; }
  .card-icon { width: 52px; height: 52px; }
  .card-icon svg { width: 22px; height: 22px; }
  .vm-card { padding: 24px 20px; }
  .kontak-form { padding: 20px 16px; }

  .article-title { font-size: 1.3rem; }
  .article-thumb { aspect-ratio: 4 / 3; }
  .article-content p,
  .article-content ul,
  .article-content ol { font-size: 0.95rem; }
  .article-content blockquote {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
  .article-content h2,
  .article-content h3 { font-size: 1.05rem; }

  .article-share { gap: 8px; }
  .share-btn { width: 38px; height: 38px; font-size: 0.88rem; }

  .timeline { padding-left: 26px; }
  .timeline-item::before { left: -26px; }

  .org-level { gap: 12px; }
  .org-box { min-width: 140px; padding: 12px 14px; }

  .pagination a,
  .pagination span {
    min-width: 38px;
    height: 38px;
    font-size: 0.85rem;
  }

  .page-hero { padding: 36px 0 30px; }
  .page-hero h1 { font-size: 1.4rem; }
  .breadcrumb { font-size: 0.82rem; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-logo-col { grid-column: 1 / -1; }
  .footer-logo { width: 80px; height: 80px; }
  .footer-col h4 { font-size: 0.95rem; margin-bottom: 10px; }
  .footer-col p,
  .footer-col a { font-size: 0.85rem; }
}

/* =========================================================
   MOBILE (<= 600px)
   ========================================================= */
@media (max-width: 600px) {

  :root {
    --font-base: 15px;
  }

  .container { padding: 0 16px; }
  .section { padding: 40px 0; }

  .header-inner { height: 58px; }
  .brand-logo { width: 34px; height: 34px; }
  .brand-name { font-size: 1rem; }
  .brand-sub { font-size: 0.65rem; }

  /* ⭐ Drawer lebih lebar + sudut melengkung */
  .site-nav {
    top: 58px;
    height: calc(100vh - 58px);
    width: 88vw;
    max-width: 340px;
    border-left: none;
    border-radius: 16px 0 0 16px;
    padding: 20px 16px;
  }

  .site-nav ul { gap: 2px; }
  .site-nav a {
    font-size: 0.98rem;
    padding: 14px 16px;
    min-height: 50px;
  }

  .hero {
    height: 62vh;
    min-height: 360px;
    max-height: 480px;
  }
  .hero-content { padding: 0 16px; }
  .hero-content-inner h1 {
    font-size: 1.45rem;
    margin-bottom: 10px;
    line-height: 1.2;
  }
  .hero-content-inner p {
    font-size: 0.88rem;
    margin-bottom: 18px;
    line-height: 1.55;
  }
  .hero-tag { font-size: 0.62rem; padding: 4px 10px; }

  .hero-arrow { width: 34px; height: 34px; }
  .hero-arrow svg { width: 14px; height: 14px; }
  .hero-prev { left: 10px; }
  .hero-next { right: 10px; }

  .hero-dots { bottom: 14px; gap: 6px; }
  .hero-dots .dot { width: 20px; height: 4px; }
  .hero-dots .dot.active { width: 30px; }

  .news-grid { grid-template-columns: 1fr; }
  .galeri-grid { grid-template-columns: repeat(2, 1fr); }
  .member-list { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }

  .section h2 { font-size: 1.2rem; }
  .section-desc { font-size: 0.9rem; }
  .section-header { margin-bottom: 22px; }

  .filter-bar {
    padding: 12px 14px;
    gap: 8px;
    margin-bottom: 20px;
  }
  .filter-label {
    width: 100%;
    margin-bottom: 2px;
    font-size: 0.85rem;
  }
  .filter-chip {
    padding: 6px 14px;
    min-height: 34px;
    font-size: 0.82rem;
  }

  .card { padding: 22px 16px; }
  .vm-card { padding: 22px 18px; }
  .vm-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
  .vm-misi li,
  .list-check li { font-size: 0.9rem; }

  .news-body { padding: 14px 16px 18px; }
  .news-card h3 { font-size: 0.98rem; margin-bottom: 6px; }
  .news-card .excerpt { font-size: 0.85rem; margin-bottom: 12px; }
  .news-meta { font-size: 0.78rem; gap: 8px; margin-bottom: 8px; }

  .pengumuman-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }
  .pengumuman-date {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 12px;
    width: fit-content;
  }
  .pengumuman-date .day { font-size: 1.1rem; }
  .pengumuman-date .month { font-size: 0.7rem; margin-top: 0; }
  .pengumuman-cta { text-align: left; }
  .pengumuman-cta .btn { width: 100%; padding: 9px 16px; }

  .kontak-form { padding: 18px 14px; }
  .kontak-item { padding: 14px; }
  .kontak-item .icon { width: 38px; height: 38px; font-size: 0.95rem; }
  .kontak-item h4 { font-size: 0.88rem; }
  .kontak-item p,
  .kontak-item a { font-size: 0.85rem; }

  .article-title { font-size: 1.2rem; }
  .article-thumb { aspect-ratio: 4 / 3; font-size: 0.78rem; }
  .article-content p,
  .article-content ul,
  .article-content ol { font-size: 0.9rem; line-height: 1.7; }

  .timeline { padding-left: 22px; }
  .timeline-item::before {
    left: -22px;
    width: 14px;
    height: 14px;
    border-width: 3px;
  }
  .timeline-item h4 { font-size: 0.95rem; }

  .org-chart { gap: 22px; margin-bottom: 36px; }
  .org-level { gap: 10px; padding-top: 14px; }
  .org-level::before { height: 14px; }
  .org-box {
    min-width: 130px;
    padding: 12px 14px;
  }
  .org-box .role { font-size: 0.68rem; }
  .org-box .name { font-size: 0.88rem; }

  .galeri-album { margin-bottom: 32px; }
  .galeri-album-header h3 { font-size: 1rem; }
  .galeri-album-header .meta { font-size: 0.78rem; }
  .galeri-grid { gap: 8px; }

  .map-wrap iframe,
  .map-placeholder { height: 240px; }
  .map-title { padding: 14px 16px 0; font-size: 0.95rem; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 24px;
  }
  .footer-logo-col {
    grid-column: auto;
    justify-content: flex-start;
    margin-bottom: 4px;
  }
  .footer-logo { width: 70px; height: 70px; }
  .site-footer { padding-top: 36px; }
  .footer-bottom { padding: 14px 0; font-size: 0.78rem; }

  .btn { padding: 10px 18px; font-size: 0.88rem; min-height: 40px; }
  .btn-lg { padding: 12px 22px; font-size: 0.92rem; min-height: 44px; }
  .btn svg { width: 14px; height: 14px; }

  .pagination { gap: 5px; margin-top: 30px; }
  .pagination a,
  .pagination span {
    min-width: 34px;
    height: 34px;
    font-size: 0.8rem;
    padding: 0 8px;
    border-radius: 8px;
  }

  .page-hero { padding: 32px 0 26px; }
  .page-hero h1 { font-size: 1.25rem; }

  .about-section p { font-size: 0.9rem; margin-bottom: 12px; }
  .about-section h2 { font-size: 1.1rem; margin: 24px 0 10px; }
}

/* =========================================================
   MOBILE KECIL (<= 400px)
   ========================================================= */
@media (max-width: 400px) {

  :root {
    --font-base: 14px;
  }

  .container { padding: 0 14px; }
  .section { padding: 32px 0; }

  .brand-name { font-size: 0.95rem; }
  .brand-sub { font-size: 0.6rem; }

  .hero {
    height: 58vh;
    min-height: 340px;
  }
  .hero-content-inner h1 { font-size: 1.3rem; }
  .hero-content-inner p { font-size: 0.85rem; }
  .hero-tag { font-size: 0.58rem; padding: 3px 8px; }

  .section h2 { font-size: 1.1rem; }
  .page-hero h1 { font-size: 1.15rem; }
  .article-title { font-size: 1.1rem; }

  .galeri-grid { gap: 6px; }

  .filter-chip {
    padding: 5px 12px;
    font-size: 0.78rem;
    min-height: 32px;
  }

  .btn { padding: 9px 16px; font-size: 0.85rem; }
  .btn-lg { padding: 11px 18px; font-size: 0.88rem; }

  .share-btn { width: 34px; height: 34px; font-size: 0.82rem; }

  .pagination a,
  .pagination span {
    min-width: 32px;
    height: 32px;
    font-size: 0.78rem;
    padding: 0 6px;
  }

  .org-box {
    min-width: 110px;
    padding: 10px 12px;
  }

  .footer-logo { width: 60px; height: 60px; }
}

/* =========================================================
   LANDSCAPE MOBILE
   ========================================================= */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .hero {
    height: auto;
    min-height: 100vh;
    max-height: none;
    padding: 80px 0 50px;
  }
  .hero-slide {
    position: relative;
    min-height: 100vh;
  }
}

/* =========================================================
   LAYAR BESAR (>= 1280px)
   ========================================================= */
@media (min-width: 1280px) {
  .container { padding: 0 32px; }
}

/* =========================================================
   LAYAR SANGAT BESAR (>= 1440px)
   ========================================================= */
@media (min-width: 1440px) {
  :root {
    --container: 1320px;
    --font-base: 17px;
  }

  .footer-logo { width: 140px; height: 140px; }
}

/* =========================================================
   PREFERENSI AKSESIBILITAS
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  body {
    animation: none !important;
  }
  body.page-exiting {
    transition: none !important;
    opacity: 1;
    transform: none;
  }
  body.nav-open::before {
    animation: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-slide { transition: none; }

  .btn:hover,
  .news-card:hover,
  .card:hover,
  .vm-card:hover,
  .member-card:hover,
  .kontak-item:hover,
  .org-box:hover,
  .galeri-item:hover {
    transform: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --text: #000000;
    --text-muted: #1f1a2b;
    --border: #6a2fb5;
    --primary-light: #e8ddfa;
    --primary-soft: #cdb3ef;
  }

  .btn-outline { border-width: 3px; }
  .filter-chip { border-width: 2px; }
  .form-control { border-width: 2px; }

  .news-card,
  .card,
  .vm-card,
  .member-card,
  .kontak-item,
  .org-box {
    border-width: 2px;
  }

  .site-nav a.active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
  }
}

/* =========================================================
   PRINT
   ========================================================= */
@media print {
  .site-header,
  .site-footer,
  .hero,
  .page-hero,
  .filter-bar,
  .pagination,
  .article-share,
  .hero-arrow,
  .hero-dots,
  .nav-toggle,
  .map-wrap {
    display: none !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
    animation: none !important;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .article { max-width: 100%; }

  a { color: #000; text-decoration: underline; }

  .news-card,
  .card,
  .vm-card {
    border: 1px solid #999;
    box-shadow: none;
    page-break-inside: avoid;
  }

  .article-content a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }
}