/* ================================================
   Islamic Magazine - Main Stylesheet
   Supports RTL (Urdu/Arabic) and LTR (English)
   ================================================ */

/* ===== Custom Fonts ===== */
@font-face {
    font-family: 'Mehr Nastaliq';
    src: url('../fonts/Mehr_Nastaliq_Web v.2.0.woff') format('woff'),
         url('../fonts/Mehr_Nastaliq_Web v. 2.0.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ===== CSS Variables ===== */
:root {
    --primary-color: #2c5f2d;
    --secondary-color: #c49a6c;
    --accent-color: #8b4513;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #dfe6e9;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Mehr Nastaliq', 'Noto Nastaliq Urdu', 'Amiri', 'Arial', sans-serif;
    line-height: 1.8;
    color: var(--text-dark);
    background-color: var(--bg-light);
    font-size: 16px;
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="ltr"] {
    text-align: left;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

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

p {
    margin-bottom: 1rem;
    line-height: 2;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* ===== Header ===== */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e4620 100%);
    color: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-info {
    font-size: 0.9rem;
}

.language-switcher {
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.lang-btn:hover,
.lang-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.header-main {
    padding: 20px 0;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
}

.site-branding h1 {
    font-size: 1.8rem;
    margin-bottom: 0;
    color: white;
}

.site-tagline {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 5px;
}

/* ===== Navigation ===== */
.main-navigation {
    background-color: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 15px 20px;
    color: white;
    font-weight: 500;
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: var(--secondary-color);
}

.mobile-menu-toggle {
    display: none;
    background: var(--secondary-color);
    border: none;
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.2rem;
}

/* ===== Search Bar ===== */
.search-bar {
    display: flex;
    gap: 5px;
    max-width: 400px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
}

.search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--accent-color);
}

/* ===== Main Content Area ===== */
.main-content {
    padding: 40px 0;
    min-height: 60vh;
}

/* ===== Article Grid ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.article-card {
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.article-thumbnail {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.article-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-category {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.article-title {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: var(--text-dark);
    line-height: 1.5;
}

.article-title a {
    color: inherit;
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-excerpt {
    color: var(--text-light);
    margin-bottom: 15px;
    flex: 1;
    font-size: 0.95rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-light);
}

.article-author {
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== Featured Section ===== */
.featured-section {
    background: var(--bg-white);
    padding: 40px 0;
    margin-bottom: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--secondary-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--primary-color);
}

[dir="rtl"] .section-title::after {
    right: 50%;
    left: auto;
    transform: translateX(50%);
}

/* ===== Sidebar ===== */
.sidebar {
    background: var(--bg-white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.sidebar-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar ul li:last-child {
    border-bottom: none;
}

.sidebar ul li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dark);
}

.sidebar ul li a:hover {
    color: var(--primary-color);
}

/* ===== Latest Issue Widget ===== */
.latest-issue {
    text-align: center;
}

.issue-cover {
    width: 100%;
    max-width: 250px;
    margin: 0 auto 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.download-btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 600;
    transition: var(--transition);
}

.download-btn:hover {
    background: var(--accent-color);
    transform: scale(1.05);
}

/* ===== Footer ===== */
.site-footer {
    background: linear-gradient(135deg, #1e4620 0%, var(--primary-color) 100%);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: white;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 10px 18px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-dark);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ===== Responsive Design ===== */
/* Mobile-first responsive layout */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    /* Latest Issue Grid: 1 column on mobile for optimal mobile UX */
    .latest-issue-grid {
        grid-template-columns: 1fr !important;
    }
    
    .header-main .container {
        flex-direction: column;
        gap: 20px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--accent-color);
}
