/**
 * RESPONSIVE.CSS - Pondok Pesantren Website
 * Mobile-first responsive design
 */

/* Header & nav: semua di header-new.css */

/* ========================================
   BASE (Mobile - < 768px)
   Default styles sudah di main.css
   ======================================== */

/* ========================================
   SMALL MOBILE (max-width: 360px)
   ======================================== */
@media (max-width: 360px) {
    /* Header adjustments */
    .logo-img {
        width: 45px;
        height: 45px;
        border-radius: var(--radius-md);
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }
    
    .logo-text p {
        font-size: 0.7rem;
    }
    
    .menu-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    /* Typography */
    .hero h1,
    .hero-home h1 {
        font-size: 1.75rem;
    }
    
    .hero p,
    .hero-home p {
        font-size: 0.95rem;
    }
    
    .section-title h2 {
        font-size: var(--font-size-2xl);
    }
    
    /* Buttons */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: var(--font-size-sm);
    }
    
    /* Cards */
    .news-title,
    .unit-title {
        font-size: var(--font-size-lg);
    }
    
    /* Grids */
    .content-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .gallery-preview {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* ========================================
   MOBILE (min-width: 375px)
   ======================================== */
@media (min-width: 375px) {
    /* Slight improvements for larger phones */
    .container {
        padding-left: var(--spacing-lg);
        padding-right: var(--spacing-lg);
    }
}

/* ========================================
   LARGE MOBILE / SMALL TABLET (min-width: 480px)
   ======================================== */
@media (min-width: 480px) {
    /* Hero sections */
    .hero {
        padding: 5.5rem 0;
    }
    
    .hero h1 {
        font-size: 2.75rem;
    }
    
    .hero-home h1 {
        font-size: 3.5rem;
    }
    
    /* Grids */
    .gallery-preview {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    /* Footer */
    .footer-grid {
        gap: var(--spacing-xl);
    }
}

/* ========================================
   TABLET (min-width: 768px)
   ======================================== */
@media (min-width: 768px) {
    /* Base adjustments */
    body {
        padding-top: 95px;
        font-size: var(--font-size-base);
    }
    
    :root {
        --header-height: 95px;
    }
    
    /* Container */
    .container {
        padding-left: var(--spacing-xl);
        padding-right: var(--spacing-xl);
    }
    
    /* Header */
    .logo-img {
        width: 55px;
        height: 55px;
    }
    
    .logo-text h1 {
        font-size: 1.3rem;
    }
    
    .logo-text p {
        font-size: 0.85rem;
    }
    
    /* Navigation stays mobile-style */
    .main-nav {
        max-width: 360px;
    }
    
    .main-nav a {
        padding: 0.875rem 1.125rem;
        font-size: 0.95rem;
    }
    
    /* Hero sections */
    .hero {
        padding: 6rem 0;
        margin-bottom: 4rem;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .hero p {
        font-size: 1.2rem;
    }
    
    .hero-home {
        padding: 5.25rem 0 4.5rem;
    }

    .hero-home h1 {
        font-size: 2rem;
    }

    .hero-home p {
        font-size: 1rem;
    }
    
    .hero-logo-wrapper {
        width: 90px;
        height: 90px;
    }

    /* Grids */
    .content-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: var(--spacing-2xl);
    }
    
    .unit-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-preview {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: var(--spacing-lg);
    }
    
    .quick-links {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Cards */
    .news-image,
    .card-image {
        height: 240px;
    }
    
    .gallery-item {
        height: 240px;
    }
    
    /* CTA Section */
    .cta-title {
        font-size: 2.75rem;
    }
    
    .cta-desc {
        font-size: 1.25rem;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .site-footer {
        padding: 4rem 0 1.5rem;
    }
    
    /* Sections */
    .home-section {
        margin: 5rem auto;
    }
    
    .section-bg {
        padding: 5rem 0;
    }
}

/* ========================================
   LARGE TABLET (min-width: 900px)
   ======================================== */
@media (min-width: 900px) {
    /* Grids */
    .unit-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .quick-links {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   DESKTOP (min-width: 992px)
   ======================================== */
@media (min-width: 992px) {
    /* Base */
    body {
        padding-top: var(--header-height-desktop);
    }
    
    :root {
        --header-height: 100px;
        --header-height-desktop: 100px;
    }
    
    /* Hero */
    .hero {
        padding: 7rem 0;
        margin-bottom: 5rem;
    }
    
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .hero-home {
        padding: 6rem 0 5.25rem;
        margin-bottom: 5.25rem;
    }
    
    .hero-home h1 {
        font-size: 2.4rem;
    }
    
    .hero-logo-wrapper {
        width: 110px;
        height: 110px;
    }
    
    /* Grids */
    .content-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .unit-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .quick-links {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Cards */
    .news-image,
    .card-image {
        height: 260px;
    }
    
    .gallery-item {
        height: 260px;
    }
    
    /* CTA */
    .cta-title {
        font-size: 3rem;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Sections */
    .home-section {
        margin: 6rem auto;
    }
    
    .section-bg {
        padding: 6rem 0;
    }
}

/* ========================================
   LARGE DESKTOP (min-width: 1200px)
   ======================================== */
@media (min-width: 1200px) {
    /* Container max-width already set in main.css */
    
    /* Hero */
    .hero h1 {
        font-size: 3.75rem;
    }
    
    .hero-home h1 {
        font-size: 2.6rem;
    }
    
    .hero-home p {
        font-size: 1.1rem;
    }
    
    .hero-logo-wrapper {
        width: 120px;
        height: 120px;
    }
    
    /* Navigation */
    .main-nav a {
        padding: 0.75rem 1.375rem;
        font-size: 1rem;
    }
    
    /* Typography */
    .section-title h2 {
        font-size: var(--font-size-4xl);
    }
    
    /* Cards */
    .news-image,
    .card-image {
        height: 280px;
    }
    
    .gallery-preview {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    /* CTA */
    .cta-title {
        font-size: 3.5rem;
    }
    
    .cta-desc {
        font-size: 1.3rem;
    }
}

/* ========================================
   EXTRA LARGE DESKTOP (min-width: 1400px)
   ======================================== */
@media (min-width: 1400px) {
    /* Further refinements for very large screens */
    .hero h1 {
        font-size: 4rem;
    }
    
    .hero-home h1 {
        font-size: 5rem;
    }
    
    .content-grid,
    .unit-grid {
        gap: var(--spacing-3xl);
    }
}

/* ========================================
   LANDSCAPE ORIENTATION
   ======================================== */
@media (max-height: 600px) and (orientation: landscape) {
    /* Reduce vertical padding in landscape */
    .hero,
    .hero-home {
        padding: 6rem 0;
    }
    
    .section-bg {
        padding: 3rem 0;
    }
    
    .home-section {
        margin: 3rem auto;
    }
    
    /* Navigation overlay */
    .main-nav {
        height: calc(100vh - 70px);
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    /* Hide non-essential elements */
    .site-header,
    .site-footer,
    .menu-toggle,
    .nav-overlay,
    .cta-section,
    .btn {
        display: none !important;
    }
    
    /* Reset body */
    body {
        padding-top: 0;
        background: var(--white);
        color: var(--black);
    }
    
    /* Full width */
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    /* Black & white */
    .hero,
    .hero-home,
    .section-bg {
        background: var(--white) !important;
        color: var(--black) !important;
        padding: 1rem 0 !important;
    }
    
    /* Cards */
    .card,
    .news-card,
    .unit-card {
        box-shadow: none !important;
        border: 1px solid var(--gray-300);
        page-break-inside: avoid;
    }
    
    /* Links */
    a {
        color: var(--black);
        text-decoration: underline;
    }
    
    /* Show URLs after links */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: var(--font-size-xs);
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@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;
    }
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */
@media (prefers-contrast: high) {
    /* Increase contrast for accessibility */
    .btn {
        border-width: 3px;
    }
    
    .card,
    .news-card,
    .unit-card {
        border: 2px solid var(--gray-800);
    }
    
    a {
        text-decoration: underline;
    }
}

/* ========================================
   DARK MODE SUPPORT (Optional)
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* Uncomment if you want to support dark mode automatically
    :root {
        --gray-50: #1a1a1a;
        --gray-100: #2d2d2d;
        --white: #121212;
        --gray-800: #e0e0e0;
    }
    
    body {
        background-color: var(--gray-50);
        color: var(--gray-800);
    }
    
    .card,
    .news-card,
    .unit-card,
    .pengumuman-card {
        background-color: var(--gray-100);
    }
    */
}
