:root {
    --bg: #efe8de;
    --khaki: #c8b79a;
    --olive: #56623a;
    --deep-olive: #3b492b;
    --flag-red: #c0392b;
    --accent: #d69b3c;
    --card: #ffffff;
    --muted: #6b6b6b;
    --glass: rgba(255, 255, 255, 0.6);
    --max-width: 1150px;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: 'Vazirmatn', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: linear-gradient(180deg, var(--bg), #efe6dc);
    color: #222;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    direction: rtl;
}

/* NAV */
.nav {
    position: sticky;
    top: 0;
    z-index: 60;
    background: linear-gradient(180deg, rgba(59, 73, 43, 0.95), rgba(59, 73, 43, 0.92));
    backdrop-filter: blur(4px);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25)
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 700;
    flex-direction: row-reverse
}

.logo img {
    width: 44px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25)
}

nav ul {
    display: flex;
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none
}

nav a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    font-weight: 600
}

nav a:hover {
    background: rgba(0, 0, 0, 0.12)
}

/* HERO */
.hero {
    min-height: 62vh;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 28px;
    align-items: center;
    padding: 44px 4vw;
    background: linear-gradient(180deg, rgba(24, 33, 18, 0.85), rgba(24, 33, 18, 0.6)), url('main.jpg') center/cover no-repeat
}

.hero-left {
    padding: 12px
}

.eyebrow {
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap
}

.eyebrow .main-title {
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4)
}

h1 {
    font-size: 2.4rem;
    margin: 6px 0;
    color: #fff;
    text-shadow: 0 6px 20px rgba(0, 0, 0, 0.45)
}

.hero p {
    color: rgba(255, 255, 255, 0.95);
    margin: 12px 0;
    max-width: 76%
}

.cta-row {
    display: flex;
    gap: 12px;
    margin-top: 18px
}

.btn {
    background: var(--flag-red);
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    border: 0;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(192, 57, 43, 0.22)
}

.btn.secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.18)
}

.poster {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.12)), url('kon.jpg') center/cover no-repeat;
    border-radius: 12px;
    padding: 18px;
    color: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center
}

.poster img {
    width: 100%;
    border-radius: 8px;
    object-fit: cover
}

/* LAYOUT */
.container {
    max-width: var(--max-width);
    margin: 28px auto;
    padding: 0 20px
}

.section {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.7));
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08)
}

.section h2 {
    margin-top: 0;
    color: var(--deep-olive);
    display: flex;
    align-items: center;
    gap: 12px
}

/* NEWS AGENCIES - horizontal scroll */
.agencies-wrapper {
    margin-top: 14px;
    overflow-x: auto;
    padding: 10px 6px;
    white-space: nowrap;
    scrollbar-width: thin
}

.agency-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(86, 98, 58, 0.06);
    color: var(--deep-olive);
    font-weight: 700;
    margin: 6px 8px;
    padding: 10px 14px;
    border-radius: 12px;
    text-decoration: none;
    transition: transform .18s, box-shadow .18s
}

.agency-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08)
}

/* LESSONS (main focus) - accordion cards */
.lessons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start
}

.lesson-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px
}

.lesson-card {
    background: linear-gradient(180deg, rgba(214, 155, 60, 0.04), rgba(214, 155, 60, 0.01));
    padding: 14px;
    border-radius: 12px;
    border-left: 6px solid var(--accent);
    cursor: pointer;
    transition: transform .25s, box-shadow .25s;
    position: relative;
    overflow: hidden
}

.lesson-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(60, 60, 60, 0.06)
}

.lesson-card .title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px
}

.lesson-card h3 {
    margin: 0;
    color: var(--deep-olive);
    font-size: 1.05rem
}

.lesson-card p.lead {
    margin: 8px 0 0;
    color: #333
}

.lesson-card .meta {
    font-size: 13px;
    color: var(--muted);
    margin-top: 8px
}

/* accordion content */
.lesson-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height .45s cubic-bezier(.2, .9, .2, 1), opacity .35s;
    opacity: 0;
    padding-right: 0
}

.lesson-card.open .lesson-content {
    opacity: 1;
    padding-right: 12px
}

.lesson-card .lesson-media {
    margin-top: 12px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12)
}

.lesson-card .lesson-media img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block
}

/* HEROES GRID */
.heroes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px
}

.normal {
    color: black;
    text-decoration: none;
}

.hero-card {
    background: linear-gradient(180deg, #fff, #fbf7f3);
    padding: 14px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(60, 60, 60, 0.06);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer
}

.hero-card img {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover
}

.hero-meta h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--deep-olive)
}

.hero-meta p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.92rem
}

/* VIDEO & GALLERY */
.video-wrap {
    position: relative;
    padding-top: 56.25%;
    border-radius: 12px;
    overflow: hidden
}

.video-wrap iframe,
.video-wrap video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%
}

/* گالری جدید با انیمیشن ورق خوردن */
.gallery-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    margin-top: 12px;
    height: 300px;
}

.gallery-track {
    display: flex;
    height: 100%;
    width: max-content;
    transition: transform 1.5s ease-in-out;
}

.gallery-item {
    width: 25%;
    /* 4 تصویر در هر ردیف */
    height: 100%;
    padding: 5px;
    flex-shrink: 0;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-item img:hover {
    transform: scale(1.03);
}

/* FOOTER */
footer {
    padding: 28px 20px;
    background: linear-gradient(180deg, #262626, #121212);
    color: #ddd;
    text-align: center;
    border-top: 4px solid rgba(192, 57, 43, 0.06)
}

footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700
}

/* responsiveness */
@media (min-width:900px) {
    .lessons {
        grid-template-columns: 1fr 420px
    }

    .lesson-grid {
        grid-column: 1/2
    }
}

@media (max-width:900px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: 62vh
    }

    .poster {
        order: -1
    }

    .eyebrow {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px
    }

    .eyebrow .main-title {
        font-size: 1.5rem;
        margin-bottom: 10px
    }

    .nav {
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 8px
    }

    .logo {
        margin-bottom: 8px
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center
    }

    .gallery-item {
        width: 50%;
    }

    /* در موبایل 2 تصویر در هر ردیف */
}

@media (max-width:600px) {
    .hero {
        padding: 24px 4vw
    }

    h1 {
        font-size: 1.8rem
    }

    .hero p {
        max-width: 100%
    }

    .gallery-container {
        height: 250px
    }

    .gallery-item {
        width: 50%;
    }

    /* در موبایل کوچک 2 تصویر در هر ردیف */
    nav ul {
        flex-direction: column;
        gap: 5px;
        align-items: center;
        width: 100%;
    }

    nav a {
        padding: 10px 15px;
        display: block;
        width: 100%;
        text-align: center;
    }

    .nav {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width:400px) {
    .gallery-item {
        width: 100%;
    }

    /* در موبایل خیلی کوچک 1 تصویر در هر ردیف */
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 14px;
    z-index: 1000;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    nav ul {
        display: none;
        flex-direction: column;
        background: rgba(59, 73, 43, 0.98);
        width: 100%;
        border-radius: 12px;
        margin-top: 8px;
        padding: 10px 0;
    }

    nav ul.active {
        display: flex;
    }

    nav a {
        padding: 12px 100px;
        width: 100%;
        text-align: center;
    }

    .nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: rgba(59, 73, 43, 0.95);
        padding: 12px 24px;
        position: relative;
    }
}


/* little helpers & transitions */
.fade-up {
    opacity: 0;
    transform: translateY(18px)
}

.is-visible {
    opacity: 1;
    transform: none;
    transition: all .8s cubic-bezier(.2, .9, .3, 1)
}

.toggle-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--deep-olive);
    font-weight: 800
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

/* تغییرات بخش درس‌ها برای حالت دسکتاپ */
@media (min-width: 900px) {
    .lessons .lesson-grid {
        grid-column: 1 / -1;
        justify-items: center;
    }

    .lesson-grid {
        grid-template-columns: 1fr;
        max-width: 900px;
        margin: 0 auto;
    }
}

/* استایل‌های جدید برای پخش کننده ویدیو */
.video-player {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.video-player-main {
    width: 100%;
    height: 400px;
    background: #000;
    position: relative;
}

.video-player-main video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-player-title {
    padding: 12px 16px;
    background: var(--deep-olive);
    color: white;
    font-weight: 600;
    text-align: center;
}

.video-thumbnails {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #f5f5f5;
    overflow-x: auto;
}

.video-thumb {
    flex: 0 0 auto;
    width: 120px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.video-thumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.video-thumb.active {
    border: 3px solid var(--accent);
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-thumb-title {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.75rem;
    padding: 4px 6px;
    text-align: center;
}

/* مدال برای نمایش اطلاعات شهدا */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* مدال برای نمایش تصویر بزرگ گالری */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.gallery-modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.gallery-modal-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.gallery-modal-close {
    position: absolute;
    top: -40px;
    left: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.gallery-section {
    text-align: center;
    padding: 60px 20px;
    background: #1a1a1a;
    color: white;
}

.gallery-wrapper {
    overflow: hidden;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 16px;
    position: relative;
}

.gallery-track {
    display: flex;
    gap: 12px;
    animation: scrollGallery 40s linear infinite;
}

.gallery-track img {
    width: calc(25% - 12px);
    border-radius: 12px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-track img:hover {
    transform: scale(1.05);
}

@keyframes scrollGallery {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.gallery-section {
    text-align: center;
    padding: 60px 20px;
    background: #1a1a1a;
    color: white;
}

.gallery-swiper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.swiper-slide img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.swiper-slide img:hover {
    transform: scale(1.05);
}