/**
 * فایل استایل واکنش‌گرا برای قالب رمان یار
 * بازنویسی شده با رویکرد Mobile-First و یکپارچه با متغیرهای CSS.
 * @version 1.1.0
 */

/* ==========================================================================
   1. Base Mobile Styles (Default for all screens)
   ========================================================================== */

/* --- Layout --- */
.container {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

.site-header .container,
.footer-bottom .container {
    flex-direction: column;
    text-align: center;
}

.site-branding {
    margin-bottom: 1rem;
}

.main-navigation {
    display: none; /* Hidden on mobile, shown on larger screens */
}

.mobile-menu-toggle {
    display: block; /* The hamburger icon, visible only on mobile */
}

.sidebar, .content-area {
    width: 100%;
    float: none; /* Avoid using float for layout */
}

.footer-widgets {
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* --- Grids & Cards --- */
.novel-grid, .novel-featured-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Make single column cards a bit different on mobile */
@media (max-width: 575px) {
    .novel-grid {
        display: block;
    }
    .novel-card {
        margin-bottom: 1.5rem;
    }
}

/* --- Typography --- */
.entry-title {
    font-size: 1.8rem;
}

/* --- Forms --- */
.search-form {
    flex-direction: column;
}
.search-form .search-field,
.search-form .search-submit {
    width: 100%;
    border-radius: var(--radius);
}
.search-form .search-field {
    margin-bottom: 10px;
}

/* ==========================================================================
   2. Mobile Menu Styles
   ========================================================================== */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--color-primary);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background-color: var(--color-surface);
    box-shadow: -3px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--color-bg);
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--color-text);
}

.mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu a {
    display: block;
    padding: 15px 20px;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-bg);
    transition: background-color 0.2s ease;
}

.mobile-menu a:hover {
    background-color: var(--color-bg);
}


/* ==========================================================================
   3. Tablet Styles (and up) - min-width: 768px
   ========================================================================== */

@media only screen and (min-width: 768px) {
    
    .container {
        width: 95%;
        max-width: 960px;
    }
    
    .site-header .container,
    .footer-bottom .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: right;
    }
    
    .main-navigation {
        display: block; /* Show desktop navigation */
    }
    
    .mobile-menu-toggle {
        display: none; /* Hide hamburger icon */
    }

    .novel-grid, .novel-featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }

    .advanced-search-form {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ==========================================================================
   4. Large Tablet & Small Desktop (and up) - min-width: 992px
   ========================================================================== */

@media only screen and (min-width: 992px) {
    .container {
        max-width: 960px;
    }

    .novel-grid, .novel-featured-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-widgets {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ==========================================================================
   5. Large Desktop (and up) - min-width: 1200px
   ========================================================================== */

@media only screen and (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .novel-grid, .novel-featured-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}


/* ==========================================================================
   6. Component Specific Styles (Advanced Search & Slider)
   ========================================================================== */

.advanced-search {
    padding: 20px;
    background-color: var(--color-surface);
    border-radius: var(--radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.advanced-search-form {
    display: grid;
    gap: 15px;
}

.advanced-search-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.advanced-search-field input,
.advanced-search-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: var(--color-bg);
}

.advanced-search-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

.advanced-search-submit,
.advanced-search-reset {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.advanced-search-submit {
    background-color: var(--color-accent);
    color: #fff;
}

.advanced-search-reset {
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid #ddd;
}


.novel-slider {
    position: relative;
    margin-bottom: 30px;
    overflow: hidden;
    border-radius: var(--radius);
}

/* ... Other slider styles are fine, can be kept as is, but consider using CSS variables. */
