/* ===== Responsive Styles ===== */

/* Large devices (desktops, less than 1200px) */
@media (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr 300px;
    }
}

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .sidebar {
        order: -1;
    }
    
    .boxes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .page-template-page-about .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    /* Header Navigation Fix */
    .header {
        padding: 10px 0;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .logo {
        flex: 0 0 auto;
    }
    
    .logo .drn-logo {
        max-height: 40px !important;
        width: auto;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    .main-nav {
        flex: 0 0 auto;
        position: relative;
    }
    
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 24px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
    }
    
    .menu-toggle span {
        display: block;
        width: 100%;
        height: 3px;
        background-color: var(--bg-light);
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .nav-list {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: var(--primary-color);
        padding: 80px 20px 20px;
        flex-direction: column;
        transition: right 0.3s ease;
        z-index: 999;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }
    
    .nav-list.active {
        right: 0;
    }
    
    .nav-list::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: 70px;
        background-color: var(--primary-dark);
    }
    
    .nav-link {
        display: block;
        padding: 12px 15px;
        margin: 5px 0;
        border-radius: var(--radius-md);
        font-size: 1rem;
        text-align: right;
        position: relative;
        z-index: 1;
    }
    
    .nav-link.active {
        background-color: rgba(255, 255, 255, 0.15);
    }
    
    /* Overlay for menu */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }
    
    .nav-overlay.active {
        display: block;
    }
    
    /* Hero Section */
    .hero {
        min-height: 400px;
        padding: 80px 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    /* Boxes Grid */
    .boxes-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .box-card {
        margin-bottom: 0;
    }
    
    /* Posts Grid */
    .posts-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-lg);
    }
    
    .footer-info {
        margin-bottom: 20px;
    }
    
    .footer-links {
        margin-bottom: 20px;
    }
    
    .footer-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .footer-list li {
        margin: 0;
    }
    
    .social-icons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    /* Page Header */
    .page-header {
        padding: 60px 0;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    /* Content Grid */
    .main-article,
    .sidebar-widget {
        padding: 20px;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    :root {
        --spacing-xs: 0.5rem;
        --spacing-sm: 0.75rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .header {
        padding: 8px 0;
    }
    
    .logo .drn-logo {
        max-height: 35px !important;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
    
    .hero {
        min-height: 350px;
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .section-header {
        margin-bottom: 30px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-description {
        font-size: 0.9rem;
    }
    
    .box-content {
        padding: 15px;
    }
    
    .box-title {
        font-size: 1.2rem;
    }
    
    .box-text {
        font-size: 0.9rem;
    }
    
    /* Posts */
    .post-image {
        height: 180px;
    }
    
    .post-content {
        padding: 15px;
    }
    
    .post-title {
        font-size: 1.1rem;
    }
    
    .post-excerpt {
        font-size: 0.85rem;
    }
    
    /* Footer */
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer-logo {
        font-size: 1.5rem;
    }
    
    .footer-description {
        font-size: 0.85rem;
    }
    
    .copyright {
        font-size: 0.8rem;
    }
}

/* High-resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero {
        background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), 
                          url('../images/12345.jpg');
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #e0e0e0;
        --text-light: #b0b0b0;
        --text-dark: #ffffff;
        --bg-color: #1a1a1a;
        --bg-light: #2d2d2d;
        --border-color: #444;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .box-card,
    .main-article,
    .sidebar-widget,
    .post-card {
        background-color: var(--bg-light);
        border-color: var(--border-color);
    }
    
    .box-title,
    .article-title,
    .post-title {
        color: var(--text-dark);
    }
    
    .box-text {
        color: var(--text-light);
    }
    
    .latest-posts {
        background: linear-gradient(135deg, #2d2d2d 0%, #252525 100%);
    }
}

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