/* General Setup */
:root {
    --primary-color: #FF6600;      /* نارنجی پرانرژی */
    --dark-bg: #222222;           /* پس‌زمینه تیره (برای هدر، فوتر، بخش‌های خاص) */
    --light-bg: #FFFFFF;          /* پس‌زمینه اصلی (سفید) */
    --light-secondary-bg: #f4f4f4; /* پس‌زمینه ثانویه (خاکستری خیلی روشن) */

    --text-on-light: #1a1a1a;        /* متن اصلی تیره (روی سفید) */
    --secondary-text-on-light: #555555; /* متن ثانویه تیره (روی سفید) */
    
    --text-on-dark: #FFFFFF;      /* متن اصلی روشن (روی تیره) */
    --secondary-text-on-dark: #a0a0a0; /* متن ثانویه روشن (روی تیره) */

    --font-family: 'Vazirmatn', sans-serif;
    
    --header-height: 5rem; 
}

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

html {
    scroll-behavior: smooth;
}

/* --- بدنه اصلی با تم روشن --- */
body {
    font-family: var(--font-family);
    background-color: var(--light-bg);
    color: var(--text-on-light);
    line-height: 1.6;
    text-align: right;
    overflow-x: hidden;
}

main {
    display: block;
    padding-top: var(--header-height);
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

h1, h2, h3, h4 {
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-on-light);
}

h2 {
    font-size: 2.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--secondary-text-on-light);
}

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

/* Header & Navbar (همچنان تیره برای کنتراست) */
.main-header {
    background: rgba(34, 34, 34, 0.8);
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo a {
    color: var(--text-on-dark);
    font-size: 1.5rem;
    font-weight: 900;
    z-index: 1002;
    position: relative;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--text-on-dark);
    font-weight: 700;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-cta {
    background-color: var(--primary-color);
    color: var(--text-on-dark);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.nav-cta:hover {
    background-color: #e05c00;
    color: var(--text-on-dark);
}

.hamburger-menu {
    display: none;
    z-index: 1002;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-on-dark);
    transition: all 0.3s ease-in-out;
}


/* --- Hero Section (تیره) --- */
.hero {
    height: calc(100vh - var(--header-height)); 
    background-color: var(--dark-bg); 
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-on-dark);
}
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent; 
    overflow: hidden; 
}
.hero-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M0 50 L50 100 L100 50 L50 0 Z" fill="none" stroke="rgba(255,102,0,0.2)" stroke-width="2"/></svg>');
    animation: breathe-lines 10s ease-in-out infinite;
}
@keyframes breathe-lines {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}
.hero-content {
    position: relative;
    z-index: 10;
}
.hero-title {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
    color: var(--text-on-dark);
}
.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-on-dark);
    margin-bottom: 2rem;
}

/* Buttons (دکمه‌ها روی پس‌زمینه روشن) */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 5px;
    font-weight: 700;
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-on-dark);
}
.btn-primary:hover {
    background-color: #e05c00;
    transform: translateY(-3px);
}
.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}
.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--text-on-dark);
}
.btn-large {
    font-size: 1.2rem;
    padding: 1rem 3rem;
}
/* دکمه کوچک برای کارت‌های وبلاگ */
.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}


/* Content Sections */
.content-section {
    padding: 6rem 0;
    background-color: var(--light-bg);
}

/* بخش‌های خاکستری روشن */
.bg-dark {
    background-color: var(--light-secondary-bg);
}

/* --- بخش‌هایی که باید تیره بمانند --- */
#contact, 
#instructors, 
#full-resume,
#final-cta,
.main-footer {
    background-color: var(--dark-bg);
    color: var(--text-on-dark);
}

#contact h1, #contact h2, #contact h3,
#instructors h1, #instructors h2, #instructors h3,
#full-resume h1, #full-resume h2, #full-resume h3,
#final-cta h1, #final-cta h2, #final-cta h3,
.main-footer h1, .main-footer h2, .main-footer h3 {
    color: var(--text-on-dark);
}

.resume-card h4 {
    color: var(--primary-color);
}

#contact p,
#instructors p,
#full-resume p,
#final-cta p,
.main-footer p,
.resume-card li {
    color: var(--secondary-text-on-dark);
}

#contact a,
#instructors a,
#full-resume a,
#final-cta a {
    color: var(--primary-color);
}

#contact a.btn-primary,
#instructors a.btn-primary,
#full-resume a.btn-primary,
#final-cta a.btn-primary {
    color: var(--text-on-dark);
}

#contact a.btn-secondary,
#instructors a.btn-secondary,
#full-resume a.btn-secondary,
#final-cta a.btn-secondary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}
#contact a.btn-secondary:hover,
#instructors a.btn-secondary:hover,
#full-resume a.btn-secondary:hover,
#final-cta a.btn-secondary:hover {
    color: var(--text-on-dark);
    background-color: var(--primary-color);
}


.section-title {
    text-align: center;
    margin-bottom: 4rem;
    font-size: 2.5rem;
}

/* Classes Section (کارت‌ها در بخش روشن) */
.class-cards {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 2rem;
}

#classes .class-card {
    background-color: var(--light-bg);
    border: 1px solid #ddd;
}
#locations .class-card {
    background-color: var(--light-secondary-bg);
    border: 1px solid #ddd;
}
.class-card {
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.class-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
}
.class-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Instructor Section */
.instructor-layout {
    display: flex;
    align-items: center;
    gap: 4rem;
}
.instructor-image img {
    max-width: 400px;
    width: 100%;
    border-radius: 10px;
}
.instructor-bio {
    flex: 1;
}


/* --- Scroll Animation Styles (بدون تغییر) --- */
.hidden-anim {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.show-anim {
    opacity: 1;
    transform: translateY(0);
}

/* --- Page Header (روشن) --- */
.page-header {
    background-color: var(--light-bg); 
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 6rem 0 4rem 0; 
}
.page-header::before { 
    display: none;
}
.page-header h1 {
    font-size: 3rem;
    color: var(--text-on-light);
    position: relative;
    z-index: 2;
}
.page-header p {
    font-size: 1.2rem;
    color: var(--secondary-text-on-light); 
    position: relative;
    z-index: 2;
}


/* --- About Page Layout (بخش روشن) --- */
.about-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 4rem;
    align-items: flex-start;
}
.about-narrative h2 {
    color: var(--primary-color);
    font-size: 2rem;
}
.about-resume h3 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}
.resume-list { list-style: none; padding: 0; }
.resume-list li {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    padding-right: 2rem;
    position: relative;
    color: var(--secondary-text-on-light);
}
.resume-list li::before {
    content: '✔';
    color: var(--primary-color);
    position: absolute;
    right: 0;
    top: 0;
}
.resume-list li strong {
    color: var(--text-on-light);
}

/* --- Full Resume Details Grid (بخش تیره) --- */
.resume-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.resume-card {
    background-color: #333;
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid #444;
}
.resume-card h4 {
    font-size: 1.3rem;
    border-bottom: 1px solid #555;
    padding-bottom: 0.5rem;
}
.resume-card ul { list-style: none; padding: 0; }
.resume-card li::before {
    content: '›';
    position: absolute;
    right: 0;
    top: 0;
    color: var(--primary-color);
    font-weight: 700;
}


/* --- بخش جدید: استایل‌های وبلاگ --- */

/* گرید صفحه لیست مقالات */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* استایل کارت هر مقاله */
.post-card {
    background: var(--light-bg);
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}
.post-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    transform: translateY(-5px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card-image-link {
    display: block;
}
.post-card-image-link img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.post-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* باعث می‌شود دکمه همیشه در پایین کارت باشد */
}

.post-card-date {
    font-size: 0.8rem;
    color: var(--secondary-text-on-light);
    margin-bottom: 0.5rem;
}

.post-card-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.post-card-title a {
    color: var(--text-on-light);
    transition: color 0.3s ease;
}
.post-card-title a:hover {
    color: var(--primary-color);
}

.post-card-excerpt {
    font-size: 0.9rem;
    flex-grow: 1; /* پاراگراف را می‌کشد تا دکمه پایین بماند */
    margin-bottom: 1rem;
}

/* --- استایل‌های صفحه داخلی مقاله --- */

/* محدود کننده عرض متن برای خوانایی */
.post-container {
    max-width: 800px;
    margin: 0 auto;
}

.post-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}
.post-header h1 {
    font-size: 2.8rem;
    line-height: 1.3;
}
.post-meta {
    font-size: 0.9rem;
    color: var(--secondary-text-on-light);
}

.post-featured-image {
    margin-bottom: 2rem;
}
.post-featured-image img {
    width: 100%;
    border-radius: 10px;
}

/* استایل‌های تایپوگرافی داخل متن مقاله */
.post-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}
.post-content h2 {
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}
.post-content h3 {
    font-size: 1.6rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.post-content ul {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-right: 2rem;
    margin-bottom: 1.5rem;
}
.post-content blockquote {
    font-size: 1.2rem;
    font-style: italic;
    font-weight: 700;
    color: var(--text-on-light);
    border-right: 5px solid var(--primary-color);
    padding-right: 1.5rem;
    margin: 2rem 0;
}

/* --- اصلاحیه: استایل گرید در صفحه اصلی --- */
/* این قانون، گرید ساده در index.html را درست می‌کند */
/* و بر گرید کارت‌های گالری (gallery.njk) تاثیری ندارد */
#gallery .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}
#gallery .gallery-grid img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}
#gallery .gallery-grid img:hover {
    transform: translateY(-5px);
}
/* --- پایان اصلاحیه --- */


/* --- استایل‌های گالری (بازطراحی شده با فیلتر) --- */

.gallery-section {
    padding-top: 2rem;
    padding-bottom: 2rem;
}
.gallery-title {
    font-size: 2rem;
    text-align: right;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-tab {
    background: transparent;
    border: 2px solid #ddd;
    color: var(--secondary-text-on-light);
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: all 0.3s ease;
}
.filter-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.filter-tab.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-dark);
}

/* گرید واکنش‌گرا برای کارت‌ها (در صفحه گالری) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    transition: opacity 0.3s ease;
}

.gallery-card {
    background: var(--light-bg);
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}
.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.gallery-card.is-hidden {
    display: none;
}
.gallery-card a {
    display: block;
    cursor: zoom-in;
}
.gallery-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #eee;
}
.gallery-card p {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--secondary-text-on-light);
    text-align: center;
    margin-bottom: 0;
    white-space: normal;
}

.gallery-section.bg-dark {
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}
.gallery-section.bg-dark .gallery-card {
    background-color: var(--light-bg);
}


/* --- استایل‌های قابلیت "مشاهده بیشتر" --- */
.gallery-grid:not(.expanded) .gallery-card.is-hidden-by-limit {
    display: none;
}
.gallery-expand-container {
    text-align: center;
    margin-top: 2rem;
}
.is-hidden {
    display: none !important;
}


/***********************************************************/
/* --- کدهای واکنش‌گرایی (Responsive Design) --- */
/***********************************************************/

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {

    :root {
        --header-height: 4.5rem; 
    }

    /* --- ۱. تنظیمات کلی --- */
    h2, .section-title { font-size: 2rem; }
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .container { padding: 0 1.5rem; }
    .content-section { padding: 4rem 0; }
    
    .page-header {
        padding: 4rem 0 2rem 0;
    }


    /* --- ۲. منوی ناوبری (Navbar) --- */
    .main-header {
        padding: 0.5rem 0;
    }
    .navbar { padding: 0 1.5rem; }
    .hamburger-menu { display: flex; }
    .nav-links { display: none; }

    /* منوی موبایل (تیره) */
    .nav-container {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--dark-bg);
        z-index: 1001;
        display: flex;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
    }
    .nav-container.active {
        transform: translateX(0);
    }
    .nav-container .nav-links {
        display: flex;
        flex-direction: column;
        text-align: center;
    }
    .nav-container .nav-links li { margin: 1.5rem 0; }
    .nav-container .nav-links a {
        font-size: 1.5rem;
        color: var(--text-on-dark);
    }
    .nav-container .nav-links .nav-cta {
        font-size: 1.5rem;
        padding: 0.8rem 2rem;
    }

    /* --- ۳. اصلاح چیدمان ستون‌ها (بدون تغییر) --- */
    .instructor-layout {
        flex-direction: column;
        gap: 2rem;
    }
    #advanced .instructor-layout,
    #kids .instructor-layout {
        flex-direction: column-reverse;
    }
    .about-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* --- ۴. گالری در موبایل --- */
    
    .filter-tabs {
        gap: 0.5rem;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1rem;
        flex-wrap: nowrap;
    }
    .filter-tab {
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
        flex-shrink: 0;
    }
    
    /* گرید گالری (صفحه گالری) */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    .gallery-card img {
        height: 120px;
    }
    .gallery-card p {
        font-size: 0.75rem;
        padding: 0.5rem;
        line-height: 1.4;
    }
    .gallery-grid:not(.expanded) .gallery-card.is-hidden-by-limit {
        display: none;
    }
    
    /* گرید گالری (صفحه اصلی) */
    #gallery .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }


    /* --- ۵. وبلاگ در موبایل --- */

    /* گرید وبلاگ (تک ستونه) */
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .post-card-title {
        font-size: 1.2rem;
    }
    
    /* تایپوگرافی مقاله */
    .post-header h1 {
        font-size: 2rem;
    }
    .post-content p {
        font-size: 1rem;
    }
    .post-content h2 {
        font-size: 1.6rem;
    }
    .post-content blockquote {
        font-size: 1.1rem;
    }
}