/*
Theme Name: آکادمی دیجیتال
Theme URI: https://example.com/academy-digital-theme
Author: تیم اپکس
Author URI: https://example.com
Description: قالب وردپرسی آکادمی آموزشی، تبدیل‌شده از طراحی HTML اولیه. شامل هدر با جستجو، سایدبار منو، هیرو، آمار، مسیرهای یادگیری، تالار گفتگو، اشتراک ویژه و بخش آخرین مقالات (وردپرسی/داینامیک).
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: academy-digital
Tags: rtl-language-support, custom-menu, custom-logo, translation-ready
*/

:root {
    /* Colors from DESIGN_SYSTEM_1 */
    --primary: #0046cb;
    --primary-container: #0a5bff;
    --on-primary: #ffffff;
    --surface: #faf8ff;
    --on-surface: #191b24;
    --surface-variant: #e1e1ef;
    --outline: #737688;
    --outline-variant: #c3c5d9;
    --surface-container: #ededfa;
    --surface-container-high: #e7e7f4;
    --secondary: #555f6f;
    --tertiary: #9b2a00;
    --error: #ba1a1a;
    --navy: #091320;

    /* Spacing & Sizing */
    --gutter: 24px;
    --md: 24px;
    --sm: 12px;
    --xs: 4px;
    --lg: 48px;
    --xl: 80px;
    --container-max: 1280px;

    /* Roundness */
    --radius-default: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--surface);
    color: var(--on-surface);
    line-height: 1.6;
    direction: rtl;
}

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

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* Header */
header.site-header {
    background: white;
    border-bottom: 1px solid var(--outline-variant);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: var(--xs);
    text-decoration: none;
}

.logo img { max-height: 40px; width: auto; }

.search-bar {
    display: none;
    background: var(--surface-container);
    border-radius: var(--radius-full);
    padding: 6px 16px;
    width: 400px;
    align-items: center;
}

@media (min-width: 1024px) {
    .search-bar { display: flex; }
}

.search-bar input,
.search-bar .search-field {
    background: transparent;
    border: none;
    outline: none;
    flex-grow: 1;
    padding-right: 8px;
    font-family: inherit;
}

.search-bar .search-submit { display: none; }

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--md);
}

.btn-ghost {
    background: none;
    border: none;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--secondary);
    text-decoration: none;
}

/* Main Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gutter);
    padding: var(--md) 0;
}

@media (min-width: 1024px) {
    .main-grid {
        grid-template-columns: 260px 1fr;
    }
}

/* Sidebar */
aside.site-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    aside.site-sidebar { display: block; }
}

.sidebar-card {
    background: white;
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-xl);
    padding: var(--sm);
    margin-bottom: var(--md);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--sm);
    padding: var(--sm);
    text-decoration: none;
    color: var(--secondary);
    font-weight: 500;
    border-radius: var(--radius-default);
    transition: background 0.2s;
}

.nav-link:hover,
.nav-link.current-menu-item-link {
    background: var(--surface-container);
    color: var(--primary);
}

.sidebar-card nav ul { list-style: none; }

/* Hero */
.hero {
    background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-xl);
    padding: var(--lg);
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: var(--lg);
}

@media (min-width: 768px) {
    .hero { grid-template-columns: 1fr 300px; }
}

.hero-badge {
    background: rgba(0, 70, 203, 0.1);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero h1 span { color: var(--primary); }

.hero p {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 500px;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-default);
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
    display: inline-block;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-outline { background: white; border: 1px solid var(--outline-variant); color: var(--primary); }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--md);
    background: white;
    padding: var(--md);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-xl);
    margin: var(--xl) 0;
}

@media (min-width: 768px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-item {
    text-align: center;
    padding: var(--sm);
}

.stat-number { font-size: 1.5rem; font-weight: 900; margin: 4px 0; }
.stat-label { font-size: 0.75rem; color: var(--secondary); }

/* Registration Box */
.cta-box {
    background: var(--navy);
    color: white;
    border-radius: var(--radius-xl);
    padding: var(--lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: var(--md);
    margin: var(--xl) 0;
    text-align: center;
}

@media (min-width: 768px) {
    .cta-box { flex-direction: row; text-align: right; }
}

.cta-input-group {
    display: flex;
    background: rgba(255,255,255,0.1);
    padding: 6px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
}

.cta-input-group input {
    background: transparent;
    border: none;
    color: white;
    padding: 0 12px;
    flex-grow: 1;
    outline: none;
}

/* Slider/Featured Articles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--md);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--md);
}

.article-card {
    background: white;
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.card-img {
    height: 180px;
    width: 100%;
    object-fit: cover;
}

.card-body {
    padding: var(--md);
    flex-grow: 1;
}

.card-tag {
    font-size: 10px;
    font-weight: 700;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}

/* VIP Table */
.vip-section {
    background: var(--primary);
    border-radius: var(--radius-xl);
    padding: var(--lg);
    color: white;
    margin: var(--xl) 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--lg);
    align-items: center;
}

@media (min-width: 768px) {
    .vip-section { grid-template-columns: 1fr 1fr; }
}

.vip-card {
    background: white;
    color: var(--on-surface);
    padding: var(--lg);
    border-radius: var(--radius-lg);
    text-align: center;
}

/* Forum Section */
.split-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--lg);
    margin: var(--xl) 0;
}

@media (min-width: 1024px) {
    .split-grid { grid-template-columns: 1fr 1fr; }
}

.forum-card {
    background: var(--surface-container);
    padding: var(--md);
    border-radius: var(--radius-xl);
}

.forum-item {
    background: white;
    margin-bottom: var(--sm);
    padding: var(--sm);
    border-radius: var(--radius-default);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Footer */
footer.site-footer {
    background: white;
    border-top: 1px solid var(--outline-variant);
    padding: var(--xl) 0 var(--md) 0;
    margin-top: var(--xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--lg);
}

.footer-col h4 { margin-bottom: 1.5rem; font-weight: 700; }
.footer-col p { font-size: 0.875rem; color: var(--secondary); line-height: 1.8; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; font-size: 0.875rem; }
.footer-col ul li a { text-decoration: none; color: var(--secondary); }

.copyright {
    text-align: center;
    border-top: 1px solid var(--surface-container-high);
    margin-top: var(--lg);
    padding-top: var(--md);
    font-size: 0.75rem;
    color: var(--outline);
}

/* Utility */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.material-symbols-outlined { vertical-align: middle; }

/* Back to top / chat buttons */
.floating-actions {
    position: fixed;
    bottom: 24px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 90;
}

.floating-actions .btn-round {
    width: 50px;
    height: 50px;
    background: white;
    border: 1px solid var(--outline-variant);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
}

.floating-actions .btn-round-primary {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0,70,203,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* WordPress core alignment helpers */
.alignleft { float: left; margin-left: 1.5em; }
.alignright { float: right; margin-right: 1.5em; }
.aligncenter { display: block; margin: 0 auto; }
.screen-reader-text { position: absolute; left: -9999px; }
