:root {
  --primary: #CC0000;
  --primary-dark: #990000;
  --secondary: #1a1a1a;
  --text: #333;
  --text-light: #666;
  --bg: #fff;
  --bg-alt: #f4f4f4;
  --border: #ddd;
  --font-main: 'Merriweather', 'Vazirmatn', sans-serif;
  --container-width: 1400px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-main); color: var(--text); background: var(--bg); line-height: 1.6; min-height: 100vh; overflow-x: hidden; }
[dir="rtl"] body { text-align: right; }
[dir="ltr"] body { text-align: left; }

a { text-decoration: none; color: inherit; transition: 0.2s; font-family: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* Global Layout with Persistent Sidebars */
.global-layout { 
    display: grid; 
    grid-template-columns: 280px 1fr 280px; 
    grid-template-areas: "left-sidebar main right-sidebar";
    gap: 30px; 
    margin-top: 30px;
    align-items: flex-start;
}

[dir="rtl"] .global-layout {
    grid-template-areas: "right-sidebar main left-sidebar";
}

.sidebar-left { grid-area: left-sidebar; }
.sidebar-right { grid-area: right-sidebar; }
.main-content { grid-area: main; min-width: 0; }

.sidebar {
    position: sticky;
    top: 176px;
    height: calc(100vh - 160px);
    overflow-y: auto;
    padding: 0 10px 40px;
}
/* Hide scrollbar but keep functionality */
.sidebar::-webkit-scrollbar { width: 0; }
.sidebar { -ms-overflow-style: none; scrollbar-width: none; }

.sidebar-title { 
    font-size: 18px; 
    font-weight: 900; 
    margin-bottom: 25px; 
    border-right: 4px solid var(--primary); 
    padding-right: 12px; 
    color: var(--secondary); 
    font-family: 'Vazirmatn', sans-serif;
    text-transform: uppercase;
}
[dir="ltr"] .sidebar-title { border-right: none; border-left: 4px solid var(--primary); padding-left: 12px; }

/* Header */
.header { background: #fff; padding: 0; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; height: 156px; display: flex; align-items: center; }
.header-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.brand { display: flex; align-items: center; height: 156px; gap: 20px; flex-shrink: 0; }
#logo-container { height: 78px; display: flex; align-items: center; }
#logo-container img { height: 100%; width: auto; object-fit: contain; }

.nav-container { flex-grow: 1; display: flex; justify-content: center; }
.nav { display: flex; gap: 30px; align-items: center; }
.nav-link { font-weight: 900; font-size: 16px; white-space: nowrap; color: var(--secondary); font-family: 'Vazirmatn', sans-serif; }
.nav-link:hover { color: var(--primary); }

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 900;
    font-size: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    border: 2px solid transparent;
    font-family: 'Vazirmatn', sans-serif;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(204, 0, 0, 0.2); }
.btn-outline { background: transparent; color: var(--secondary); border-color: var(--secondary); }
.btn-outline:hover { background: var(--secondary); color: #fff; }

.pillar-btn {
    display: inline-block;
    padding: 8px 20px;
    background: #f0f0f0;
    color: var(--secondary);
    border-radius: 4px;
    font-weight: 900;
    font-size: 13px;
    transition: 0.3s;
    margin-top: 15px;
    font-family: 'Vazirmatn', sans-serif;
}
.pillar-btn:hover { background: var(--primary); color: #fff; }

/* Hero - No longer full width */
.hero { 
    position: relative; 
    height: 450px; 
    background: #222; 
    color: #fff; 
    display: flex; 
    align-items: center; 
    text-align: center; 
    background-size: cover; 
    background-position: center; 
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 40px;
    font-family: 'Vazirmatn', sans-serif;
}
.hero-overlay { position: absolute; inset: 0; z-index: 1; }
.hero-content { position: relative; z-index: 2; padding: 40px; width: 100%; }
.hero-title { font-size: 42px; font-weight: 900; line-height: 1.2; margin-bottom: 20px; }
.hero-subtitle { font-size: 18px; margin-bottom: 30px; opacity: 0.9; }
.hero-btns { display: flex; gap: 15px; justify-content: center; }

/* Page Hero - For detail pages, now constrained */
.page-hero { 
    position: relative; 
    height: 350px; 
    border-radius: 15px;
    overflow: hidden; 
    margin-bottom: 40px; 
    background-size: cover; 
    background-position: center; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    font-family: 'Vazirmatn', sans-serif; 
}
.page-hero-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); z-index: 1; }
.page-hero-content { position: relative; z-index: 2; padding: 40px; color: #fff; }
.page-hero-title { font-size: 48px; font-weight: 900; line-height: 1.2; }

/* Pillars Section */
.pillars-section { padding: 60px 0; border-top: 1px solid #eee; margin-top: 60px; }
.pillars-grid { display: flex; gap: 30px; justify-content: center; }
.pillar { 
    flex: 1;
    min-width: 0;
    text-align: center; 
    padding: 30px 20px; 
    background: #fff; 
    border: 1px solid #eee; 
    border-radius: 12px; 
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pillar:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.pillar-icon { margin-bottom: 15px; color: var(--primary); }
.pillar-title { font-size: 20px; font-weight: 900; margin-bottom: 10px; color: var(--secondary); font-family: 'Vazirmatn', sans-serif; }
.pillar-desc { font-size: 14px; opacity: 0.7; line-height: 1.6; flex-grow: 1; }

/* Campaign Cards */
.campaigns-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; }
.campaign-card { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #eee; display: flex; flex-direction: column; transition: 0.3s; }
.campaign-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.05); }
.campaign-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.campaign-body { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.campaign-title { font-size: 18px; font-weight: 900; margin-bottom: 10px; font-family: 'Vazirmatn', sans-serif; }
.campaign-preview { font-size: 14px; opacity: 0.7; margin-bottom: 20px; flex-grow: 1; }

/* Progress Bar */
.progress-wrap { margin-bottom: 20px; }
.progress-bar { height: 8px; background: #eee; border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: var(--primary); transition: 1s; }
.progress-bar.completed .progress-fill { background: #4caf50; }
.progress-text { font-size: 12px; font-weight: 700; color: var(--text-light); display: flex; align-items: center; gap: 5px; font-family: 'Vazirmatn', sans-serif; }

/* Publication Cards */
.footer-pub-card { display: flex; gap: 12px; margin-bottom: 20px; padding: 12px; border-radius: 8px; border: 1px solid #eee; background: #fafafa; }
.footer-pub-cover { width: 60px; height: 80px; object-fit: cover; border-radius: 4px; }
.pub-issue-tag { font-size: 12px; font-weight: 900; color: var(--primary); display: block; font-family: 'Vazirmatn', sans-serif; }
.pub-title-sm { font-size: 13px; font-weight: 900; margin: 3px 0; display: block; font-family: 'Vazirmatn', sans-serif; }

/* News Items */
.news-item-sidebar { border-bottom: 1px solid #eee; padding-bottom: 15px; margin-bottom: 15px; }
.news-title-sm { font-size: 15px; font-weight: 900; line-height: 1.4; font-family: 'Vazirmatn', sans-serif; }

/* Detail View Layout */
.detail-view-content { padding: 0 0 60px; }
.article-body { font-size: 19px; line-height: 1.8; color: #333; font-family: 'Merriweather', 'Vazirmatn', serif; }
.article-body p { margin-bottom: 25px; }

/* Lang Switcher */
.lang-switcher-bar { background: #f8f8f8; border-bottom: 1px solid #eee; padding: 10px 0; font-family: 'Vazirmatn', sans-serif; }
.lang-switcher { display: flex; gap: 20px; }
.lang-btn { cursor: pointer; opacity: 0.5; font-weight: 900; font-size: 13px; transition: 0.3s; }
.lang-btn.active { opacity: 1; color: var(--primary); }

/* Footer */
.footer { background: var(--secondary); color: #fff; padding: 60px 0 40px; margin-top: 80px; }
.copyright { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; opacity: 0.5; font-family: 'Vazirmatn', sans-serif; }

/* Comments Section */
.comments-section { margin-top: 60px; padding-top: 40px; border-top: 1px solid #eee; }
.comment-item { background: #fafafa; padding: 20px; border-radius: 10px; margin-bottom: 15px; border: 1px solid #eee; }
.comment-meta { display: flex; justify-content: space-between; margin-bottom: 10px; border-bottom: 1px solid #eee; padding-bottom: 8px; }
.comment-author { font-weight: 900; color: var(--primary); font-size: 15px; font-family: 'Vazirmatn', sans-serif; }
.comment-date { font-size: 11px; opacity: 0.5; font-family: 'Vazirmatn', sans-serif; }

.comment-form { background: #fff; border: 1px solid #eee; padding: 30px; border-radius: 12px; margin-top: 40px; }
.form-input { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 15px; font-family: inherit; }

@media (max-width: 800px) {
    .global-layout { grid-template-columns: 1fr; grid-template-areas: "main" "left-sidebar" "right-sidebar"; }
    .sidebar { position: static; height: auto; border: none; padding: 0; }
}

@media (max-width: 768px) {
    .campaigns-grid { grid-template-columns: 1fr; }
    .pillars-grid { flex-direction: column; }
    .hero-title { font-size: 32px; }
}
.sidebar-right .sidebar-title { font-size: 30px; }
.sidebar-right .pub-issue-tag { font-size: 23px; }
.sidebar-right .pub-title-sm { font-size: 24px; }
