/* ==========================================================================
   BARSÄZ — Home
   استایل اختصاصی صفحه اول
   ========================================================================== */

/* --------------------------------------------------------------------------
   HERO
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    padding: 86px 0 76px;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: -220px;
    inset-inline-end: -180px;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 68%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1.04fr .96fr;
    gap: 66px;
    align-items: center;
}

.hero-title {
    margin-bottom: 24px;
}

.hero-title .line {
    display: block;
}

.hero-title em {
    font-style: normal;
    color: var(--accent);
}

.hero-lead {
    max-width: 490px;
    margin-bottom: 34px;
    font-size: 16.5px;
    line-height: 2.1;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 44px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 40px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.hero-meta .m strong {
    display: block;
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 900;
    line-height: 1.5;
}

.hero-meta .m small {
    color: var(--muted);
    font-size: 12.5px;
}

/* ---------- Hero art ---------- */
.hero-art {
    position: relative;
    padding: 0 26px;
}

.hero-blob {
    position: absolute;
    top: -28px;
    inset-inline-start: 30px;
    z-index: 0;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: var(--accent-2);
    opacity: .85;
    pointer-events: none;
}

.hero-frame {
    position: relative;
    z-index: 1;
    aspect-ratio: 4 / 4.7;
    border: 1px solid var(--line);
    border-radius: var(--radius-arch);
    overflow: hidden;
    background: linear-gradient(170deg, var(--surface-2), var(--bg-2));
}

.hero-frame > svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 1s var(--ease);
}

.hero-frame:hover .hero-photo {
    transform: scale(1.045);
}

@media (prefers-reduced-motion: reduce) {
    .hero-frame:hover .hero-photo { transform: none; }
}

.hero-float {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: float 6s ease-in-out infinite;
}

.hero-float.a {
    top: 54px;
    inset-inline-start: -18px;
}

.hero-float.b {
    bottom: 64px;
    inset-inline-end: -18px;
    animation-delay: 1.4s;
}

.hero-float .ic {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
}

.hero-float .ic svg {
    width: 19px;
    height: 19px;
}

.hero-float b {
    display: block;
    font-family: var(--font-display);
    font-size: 16px;
    line-height: 1.5;
}

.hero-float small {
    color: var(--muted);
    font-size: 11.5px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-float { animation: none; }
}

/* --------------------------------------------------------------------------
   Courses
   -------------------------------------------------------------------------- */
.courses-head {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 48px;
    text-align: center;
}

.courses-head > * {
    min-width: 0;
}

.courses-head-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 760px;
    margin-inline: auto;
}

.courses-head-text .eyebrow {
    justify-content: center;
    gap: 12px;
}

.courses-head-text .eyebrow::before,
.courses-head-text .eyebrow::after {
    content: "";
    width: 34px;
    height: 1px;
    background: currentColor;
    opacity: .8;
}

.courses-head-text .eyebrow::before {
    display: inline-block;
}

.courses-head-text .eyebrow::after {
    display: inline-block;
}

.courses-head-text .home-section-desc {
    margin-inline: auto;
}

.courses-swiper-wrap {
    position: relative;
    display: block;
}

.courses-swiper-wrap .courses-swiper {
    min-width: 0;
}

.courses-swiper {
    padding-bottom: 6px;
}

/* --------------------------------------------------------------------------
   About / space
   -------------------------------------------------------------------------- */
.about-inner {
    display: grid;
    grid-template-columns: .92fr 1.08fr;
    gap: 72px;
    align-items: center;
}

.about-collage {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5.15;
    min-height: 500px;
    border-radius: var(--radius-arch);
    background: linear-gradient(170deg, var(--surface-2), var(--bg-2));
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    isolation: isolate;
}

/* قاب تودرتو و هالهٔ پایین تصویر — طراحی ماکت گالری */
.about-collage::before {
    content: "";
    position: absolute;
    inset: 14px;
    z-index: 3;
    border: 1px solid color-mix(in srgb, var(--light) 62%, transparent);
    border-radius: var(--radius-arch);
    pointer-events: none;
}

.about-collage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    background: linear-gradient(to top, color-mix(in srgb, var(--dark) 44%, transparent), transparent 42%);
    pointer-events: none;
}

.about-collage .about-blob {
    z-index: 0;
}

.about-collage img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 32%;
    border: 0;
    border-radius: var(--radius-arch);
}

.about-collage .ph {
    position: absolute;
    z-index: 1;
    inset: 0;
    border: 1px solid var(--line);
    border-radius: inherit;
}

.about-badge {
    position: absolute;
    inset-inline-end: -16px;
    bottom: 34px;
    z-index: 4;
    padding: 14px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
}

.about-badge b {
    display: block;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.4;
    color: var(--accent);
}

.about-badge small {
    color: var(--muted);
    font-size: 11.5px;
}

.about-text h2 {
    margin-bottom: 18px;
}

.about-text > p {
    color: var(--muted);
    font-size: 15px;
}

/* --------------------------------------------------------------------------
   Testimonials
   -------------------------------------------------------------------------- */
.testi-swiper {
    padding-bottom: 88px;
}

.testi-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: auto;
    padding: 34px 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.testi-card .q {
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 900;
    line-height: 1;
    color: var(--accent-2);
}

.testi-card p {
    flex: 1;
    margin: 0;
    color: var(--ink-2);
    font-size: 14.5px;
    line-height: 2.05;
}

.testi-who {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.testi-avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: none;
    overflow: hidden;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 900;
}

.testi-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testi-avatar svg {
    width: 22px;
    height: 22px;
}

.testi-who b {
    display: block;
    font-size: 14px;
}

.testi-who small {
    color: var(--muted);
    font-size: 12px;
}

.testi-bottom {
    position: absolute;
    bottom: 0;
    inset-inline: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.testi-pagination {
    position: static !important;
    width: auto !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   Articles
   -------------------------------------------------------------------------- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* تیتر بخش مقالات راست‌چین */
.head-split.articles-head {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 40px;
}

.head-split.articles-head > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: right;
    max-width: 760px;
    min-width: 0;
}

.head-split.articles-head .eyebrow {
    justify-content: flex-start;
}

.head-split.articles-head .eyebrow::before {
    display: inline-block;
}

.head-split.articles-head .home-section-desc {
    margin-inline: 0;
}

.articles-all {
    display: inline-flex;
    white-space: nowrap;
    flex: none;
}

@media (max-width: 1100px) {
    .head-split.articles-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .head-split.articles-head > div {
        max-width: none;
    }

    .articles-all {
        align-self: flex-start;
    }
}

@media (max-width: 640px) {
    .head-split.articles-head {
        align-items: flex-start;
        text-align: right;
        gap: 12px;
        margin-bottom: 30px;
    }

    .head-split.articles-head > div {
        align-items: flex-start;
        text-align: right;
        max-width: none;
        margin-inline: 0;
    }

    .head-split.articles-head h2 {
        font-size: 1.45rem;
    }
}

/* --------------------------------------------------------------------------
   Products
   -------------------------------------------------------------------------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* لینک «همه محصولات»: در دسکتاپ داخل هد، در موبایل زیر محصولات (وسط‌چین) */
.products-all-link {
    display: none;
}

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Category chips (حذف‌شده — کلاس لینک «همه دوره‌ها» می‌ماند)
   -------------------------------------------------------------------------- */
.courses-all-wrap {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.courses-all {
    display: inline-flex;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.faq-inner {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 64px;
    align-items: start;
}

.faq-head {
    position: sticky;
    top: calc(var(--header-h) + 28px);
}

.faq-head h2 {
    margin-bottom: 16px;
}

.faq-head p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 15px;
}

/* --------------------------------------------------------------------------
   CTA
   -------------------------------------------------------------------------- */
.cta-band {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 44px;
    padding: 68px 64px;
    border-radius: var(--radius-lg);
    background: var(--dark);
    color: var(--on-dark);
    overflow: hidden;
}

.cta-band::before {
    content: "";
    position: absolute;
    top: -160px;
    inset-inline-end: -110px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 42%, transparent), transparent 66%);
    pointer-events: none;
}

.cta-band::after {
    content: "";
    position: absolute;
    bottom: -190px;
    inset-inline-start: -80px;
    width: 360px;
    height: 360px;
    border: 1px solid var(--on-dark-line);
    border-radius: 50%;
    pointer-events: none;
}

.cta-band > * { position: relative; z-index: 1; }

.cta-band h2 {
    max-width: 560px;
    margin-bottom: 12px;
}

.cta-band p {
    max-width: 520px;
    margin: 0;
    color: var(--on-dark-muted);
}

.cta-band .btn { flex: none; }

/* --------------------------------------------------------------------------
   Empty state (fallback)
   -------------------------------------------------------------------------- */
.empty-note {
    padding: 40px 8px;
    color: var(--muted);
}
/* --------------------------------------------------------------------------
   Empty state (fallback)
   -------------------------------------------------------------------------- */
.empty-note {
    padding: 40px 8px;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 54px;
    }
    .hero-art {
        width: 100%;
        max-width: 520px;
        margin-inline: auto;
    }
    .about-inner {
        grid-template-columns: 1fr;
        gap: 54px;
    }
    .about-collage {
        width: 100%;
        max-width: 520px;
        margin-inline: auto;
        height: auto;
        min-height: 0;
        aspect-ratio: 4 / 4.8;
    }
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 860px) {
    .hero {
        padding: 56px 0 60px;
    }
    .hero-inner {
        gap: 40px;
    }
    .hero-art {
        padding: 0 18px;
    }
    .faq-inner {
        grid-template-columns: 1fr;
        gap: 34px;
    }
    .faq-head {
        position: static;
    }
    .cta-band {
        flex-direction: column;
        align-items: flex-start;
        padding: 48px 34px;
        gap: 28px;
    }
}

@media (max-width: 720px) {
    .hero-lead {
        font-size: 15.5px;
        margin-bottom: 28px;
    }
    .hero-actions {
        margin-bottom: 34px;
    }
    .hero-meta {
        gap: 12px 26px;
        padding-top: 22px;
    }
    .hero-meta .m strong {
        font-size: 21px;
    }
    .marquee {
        padding: 14px 0;
    }
    .marquee-item {
        gap: 18px;
        padding-inline: 18px;
        font-size: 17px;
    }
    .courses-head {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
        margin-bottom: 34px;
    }
    .course-body {
        padding: 20px 20px 22px;
    }
    .testi-card {
        padding: 28px 24px;
    }
    .testi-swiper {
        padding-bottom: 80px;
    }
    .articles-grid {
        gap: 22px;
    }
    .article-body {
        padding: 20px;
    }
}

/* ---------------------------------------------------------------------------
   موبایل — بازچینش بخش‌ها برای تجربهٔ فشرده و سریع
   --------------------------------------------------------------------------- */
@media (max-width: 640px) {
    /* ---------- دوره‌ها ---------- */
    .courses-head {
        align-items: center;
        text-align: center;
        gap: 12px;
        margin-bottom: 30px;
    }
    /* ---------- هیرو موبایل: اول تصویر، بعد متن مرتب با فضای سفید ---------- */
    .hero {
        padding: 34px 0 48px;
    }
    .hero-inner {
        gap: 44px; /* فاصلهٔ بیشتر تصویر از متن بالای آن */
    }
    .hero-copy {
        text-align: start;
        padding-top: 8px;
    }

    /* تصویر: مثل دسکتاپ — قاب قوس‌دار با پدینگ و نشان‌های شناور، پایینِ متن */
    .hero-art {
        order: 0;
        width: 100%;
        max-width: 520px;
        padding: 0 16px;
        margin-inline: auto;
        margin-top: 22px;
    }
    .hero-frame {
        aspect-ratio: 4 / 4.4;
        border: 1px solid var(--line);
        border-radius: var(--radius-arch);
    }
    .hero-float {
        padding: 10px 13px;
        gap: 9px;
    }
    .hero-float.a {
        top: 26px;
        inset-inline-start: -8px;
    }
    .hero-float.b {
        bottom: 30px;
        inset-inline-end: -8px;
    }
    .hero-float b {
        font-size: 13.5px;
    }
    .hero-float .ic {
        width: 30px;
        height: 30px;
    }
    .hero-float .ic svg {
        width: 16px;
        height: 16px;
    }

    .hero-title {
        margin-bottom: 12px;
    }
    .hero-lead {
        max-width: none;
        font-size: 14px;
        line-height: 2.05;
        margin-bottom: 24px;
    }

    /* دکمه‌ها کنار هم — فشرده تا در همهٔ عرض‌های موبایل سالم بنشینند */
    .hero-actions {
        display: grid;
        grid-template-columns: 1.2fr 1fr;
        gap: 10px;
        margin-bottom: 26px;
    }
    .hero-actions .btn {
        flex: none;
        width: auto;
        min-width: 0;
        justify-content: center;
        white-space: nowrap;
        padding: 12px 10px;
        font-size: 13.5px;
    }
    .hero-actions .btn svg {
        display: none;
    }

    /* نوار آمار کم‌حجم و یک‌ردیفه */
    .hero-meta {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 24px;
        padding-top: 18px;
        text-align: right;
    }

    .hero-meta .m {
        flex: none;
    }
    .hero-meta .m strong {
        font-size: 17px;
    }
    .hero-meta .m small {
        font-size: 10.5px;
        line-height: 1.75;
    }

    /* ---------- دوره‌ها ---------- */
    .courses-head {
        align-items: center;
        text-align: center;
        gap: 14px;
        margin-bottom: 38px;
    }
    .courses-all {
        display: inline-flex;
        flex: none;
        white-space: nowrap;
    }
    .course-media {
        aspect-ratio: 4 / 3.2;
    }

    /* ---------- درباره: متن اول، تصویر کوتاه‌تر ---------- */
    .about-inner {
        gap: 28px;
    }
    .about-collage {
        width: 100%;
        max-width: 300px;
        margin-inline: auto;
        height: auto;
        aspect-ratio: 4 / 5.2;
    }
    .about-badge {
        inset-inline-end: 10px;
        bottom: 12px;
        padding: 10px 14px;
    }
    .about-badge b {
        font-size: 17px;
    }

    /* ---------- آمار ---------- */
    .stats-band {
        padding: 36px 0;
    }

    /* ---------- نظرات ---------- */
    .testi-card {
        padding: 24px 20px;
    }
    .testi-swiper {
        padding-bottom: 76px;
    }

    .testi-card {
        height: 300px;
        min-height: 300px;
        padding: 26px 22px;
        gap: 12px;
        text-align: right;
        align-items: stretch;
        margin-inline: auto;
        overflow: hidden;
    }

    .testi-card .q {
        font-size: 40px;
    }

    .testi-card p {
        width: 100%;
        font-size: 13.5px;
        line-height: 1.95;
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .testi-who {
        justify-content: flex-start;
        width: 100%;
        padding-top: 14px;
    }

    /* ---------- مقالات: فهرست ردیفی فشرده (عکس راست، عنوان و تاریخ) ---------- */
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .articles-grid .article-card {
        position: relative;
        flex-direction: row;
        align-items: stretch;
        border-radius: var(--radius);
    }
    .articles-grid .article-card:hover {
        transform: none;
    }
    .articles-grid .article-media {
        width: 108px;
        flex: none;
        aspect-ratio: 1 / 1;
    }
    .articles-grid .article-body {
        justify-content: center;
        gap: 8px;
        padding: 12px 14px;
    }
    .articles-grid .article-body .course-cat,
    .articles-grid .article-body p,
    .articles-grid .article-meta a {
        display: none;
    }
    .articles-grid .article-body h3 {
        font-size: 14px;
        line-height: 1.75;
    }
    /* کل کارت کلیک‌پذیر: لینک عنوان روی همهٔ کارت کشیده می‌شود */
    .articles-grid .article-body h3 a::after {
        content: "";
        position: absolute;
        inset: 0;
    }
    .articles-grid .article-meta {
        margin: 0;
        padding: 0;
        border: 0;
        font-size: 11.5px;
    }

    /* ---------- محصولات: دو ستونیِ جمع‌وجور مثل ویترین فروشگاه ---------- */
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
    .shop-all-link {
        display: none;
    }
    /* فاصلهٔ کمتر هد فروشگاه از محصولات در موبایل */
    #shop .head-split {
        margin-bottom: 30px;
    }
    .products-all-link {
        display: flex;
        width: max-content;
        margin: 28px auto 0;
    }

    /* ---------- CTA ---------- */
    .cta-band {
        padding: 36px 22px;
        gap: 22px;
    }
    .cta-band .btn {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .hero {
        padding-top: 28px;
    }
    .hero-meta .m strong {
        font-size: 16px;
    }
    .hero-float.a {
        top: 20px;
        inset-inline-start: -4px;
    }
    .hero-float.b {
        bottom: 20px;
        inset-inline-end: -4px;
    }
    .hero-float small {
        display: none;
    }
    .testi-bottom {
        gap: 12px;
    }
    .sw-btn {
        width: 42px;
        height: 42px;
    }
}

/* --------------------------------------------------------------------------
   Instructors
   -------------------------------------------------------------------------- */
.instructors-swiper {
    padding-bottom: 88px;
}

.instructor-card {
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
        border-color var(--dur) var(--ease);
}

.instructor-card:hover {
    transform: translateY(-5px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
}

.instructor-card .media {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--surface-2);
}

.instructor-card .media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.instructor-card .body {
    padding: 20px;
}

.instructor-card h3 {
    margin-bottom: 4px;
    font-size: 15.5px;
}

.instructor-card .specialty {
    display: inline-block;
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 700;
}

.instructor-card p {
    display: -webkit-box;
    margin: 10px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.9;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.instructor-card .badge {
    margin-top: 14px;
}

.instructor-card .social-row {
    margin-top: 14px;
}

.instructor-bottom {
    position: absolute;
    bottom: 0;
    inset-inline: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.instructor-pagination {
    position: static !important;
    width: auto !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 420px) {
    .instructors-swiper {
        padding-bottom: 76px;
    }
    .instructor-bottom {
        gap: 12px;
    }
}

/* دسکتاپ: فاصلهٔ کمتر زیر کارتهای استاد تا بخش بعدی */
@media (min-width: 641px) {
    #instructors {
        padding-bottom: 64px;
    }
    .instructors-swiper {
        padding-bottom: 64px;
    }
}
