/* IdeaMAX CMS - Responsive Styles */

/* Tablet Styles */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .page-title,
    .post-title {
        font-size: 2rem;
    }

    .posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .site-main {
        padding: 2rem 0;
    }
    
    /* Child pages grid - 2 columns on tablet */
    .child-pages-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    /* Child pages grid - 1 column on mobile */
    .child-pages-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        margin: 2rem 0;
    }

    .child-page-title {
        font-size: 1rem;
        padding: 1rem;
    }

    /* Header Mobile */
    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .site-logo {
        text-align: center;
    }

    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
        z-index: 1001;
        order: 2;
        background:#000;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background: #fff;
        margin: 3px 0;
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Prevent scrolling when mobile menu is open */
    body.mobile-menu-open {
        overflow: hidden;
    }

    .main-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2B3444;
        box-shadow: var(--shadow-md);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.3s ease;
        order: 3;
    }

    .main-navigation.active {
        max-height: 600px;
        opacity: 1;
        overflow-y: auto;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
    }

    .nav-item {
        width: 100%;
        position: relative;
    }

    .nav-link {
        display: block;
        padding: 1rem 2rem;
        padding-right: 3.5rem;
        color: #fff;
        border-radius: 0;
    }

    /* Mobile submenu toggle button */
    .mobile-submenu-toggle {
        display: block;
        position: absolute;
        right: 0;
        top: 0;
        height: 100%;
        width: 3rem;
        background: none;
        border: none;
        color: #fff;
        cursor: pointer;
        font-size: 14px;
        transition: transform 0.3s ease;
        z-index: 1;
    }

    .mobile-submenu-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .mobile-submenu-toggle i {
        transition: transform 0.3s ease;
        display: inline-block;
    }

    .has-submenu.active .mobile-submenu-toggle i {
        transform: rotate(180deg);
    }

    .nav-link:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: none;
    }

    /* Mobile submenu styles */
    .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.2);
        display: none;
        padding: 0;
        border-radius: 0;
    }

    .sub-menu.active {
        display: block;
    }

    .sub-menu a {
        padding: 0.75rem 3rem;
        border-left: 3px solid rgba(255, 255, 255, 0.5);
        color: #fff;
    }

    /* Typography Mobile */
    .page-title,
    .post-title {
        font-size: 1.75rem;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.875rem; }

    .page-excerpt {
        font-size: 1rem;
    }

    .page-body {
        font-size: 1rem;
    }

    /* Layout Mobile */
    .site-main {
        padding: 1.5rem 0;
    }

    .page-header,
    .post-header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

    .content-area {
        max-width: 100%;
    }

    /* Posts Grid Mobile */
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .post-content {
        padding: 1rem;
    }

    /* Breadcrumbs Mobile */
    .breadcrumbs-wrapper {
        padding: 0.75rem 0;
    }

    .breadcrumb-list {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .breadcrumb-item {
        font-size: 0.875rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    /* Typography */
    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 24px;
    }

    h3 {
        font-size: 20px;
    }

    /* Post meta */
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-meta span {
        margin: 5px 0;
    }

    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Buttons */
    .btn {
        width: 100%;
        text-align: center;
    }

    /* Tables - make them scrollable */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 500px;
    }
}

/* Print styles */
@media print {
    /* Hide navigation and non-essential elements */
    .site-header,
    .site-footer,
    .sidebar,
    .comments,
    .comment-form,
    .navigation,
    .mobile-menu-toggle {
        display: none;
    }

    /* Adjust layout for print */
    .content-area {
        width: 100%;
        margin: 0;
    }

    /* Ensure text is black for better printing */
    body {
        color: #000;
        background: #fff;
    }

    /* Show URLs for links */
    a[href]:after {
        content: " (" attr(href) ")";
    }

    /* Page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
    }

    p, blockquote, ul, ol {
        page-break-inside: avoid;
    }
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* High contrast mode */
@media (prefers-contrast: high) {
    body {
        background: #fff;
        color: #000;
    }

    a {
        color: #0000ff;
        text-decoration: underline;
    }

    .btn {
        border: 2px solid #000;
    }
}

@media(max-width:760px) {
    .nav-link {
    color:#fff!important;
        
    }
    }
}