/* ==========================================================
   فهرست
   ----------------------------------------------------------
   01. Fonts
   02. Base / Reset
   03. Banner
   04. Partners
   05. About Aral
   06. Why Aral
   07. Products Slider
   08. Latest Projects
   09. Articles Slider
   ========================================================== */


/* ==========================================================
   01. FONTS
   ========================================================== */

@font-face {
    font-family: dana;
    src: url(fonts/Dana-Medium.ttf);
}

@font-face {
    font-family: kalameh;
    src: url(fonts/KalamehFaNum-Medium.ttf);
}

@font-face {
    font-family: iransans;
    src: url(fonts/IranianSans.ttf);
}


/* ==========================================================
   02. BASE / RESET
   ========================================================== */

* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    line-height: 2.4rem;
    font-weight: 400;
    /* color: rgb(79, 79, 79); */
    outline: 0 !important;
    font-family: dana, kalameh, iransans, Helvetica, serif, sans-serif, Arial, Arial;

    a {
        text-decoration: none;
        color: inherit;
    }

    img {
        width: 100%;
        display: inline-block;
    }

    ul {
        margin: 0;
        padding: 0;
    }

    li {
        list-style: none;
    }
}

:root {
    --aral-blue: #21409a;
    --aral-bg-gray: #f6f6f6;
    --banner-h: 60vh;
}

body {
    position: relative;
}


/* ==========================================================
   03. BANNER
   ========================================================== */

.banner-top {
    width: 100%;
    overflow: hidden;
}

.banner-img {
    width: 100%;
    height: calc(100vh - 190px);   /* ارتفاع بنر = ارتفاع صفحه منهای هدر و partners */
    min-height: 280px;
    display: block;
    object-fit: cover;
    object-position: center center;
}

@media (max-width: 768px) {
    .banner-img {
        height: auto;
        min-height: 0;
    }
}

/* ==========================================================
   04. PARTNERS
   ========================================================== */

.partners-section {
    overflow: hidden;
    background-image: url("images/partners/partners-background.png");
    background-position: top;
    background-size: cover;
    filter: grayscale(100%);
    opacity: 80%;
    /*padding: 1.8rem 3rem 1.2rem;*/
    padding: 0.9rem 3rem 0.7rem;
}

.partners-title {
    color: #21409d;
    font-weight: 700;
}

.logo-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    /*height: 90px;*/
    height: 64px;
    direction: ltr;
}

.logo-track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: scroll-track 30s linear infinite;
}

.logo-item {
    width: 226px;
    /*height: 85px;*/
    height: 64px;
    flex: 0 0 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
}

.logo-item img {
    max-width: 226px;
    /*max-height: 85px;*/
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: 0.3s ease;
}


@keyframes scroll-track {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-1200px);
    }
}


@media (min-width: 992px) {
    .partners-section {
        background-attachment: fixed;
    }
}

@media (max-width: 768px) {
    .partners-section {
        padding: 0.5rem 1rem;
    }

    .logo-slider {
        height: 48px;
    }

    .logo-item {
        width: 130px;
        height: 48px;
        flex: 0 0 130px;
        padding: 0 12px;
    }

    .logo-item img {
        max-width: 100px;
        max-height: 32px;
    }

    .group-1,
    .group-2 {
        animation-duration: 14s;
    }
}


/* ==========================================================
   05. ABOUT ARAL
   ========================================================== */

.about-aral-section {
    margin-bottom: 50px;
}

.about-aral-wrapper {
    background: rgba(245, 245, 245, 1);
    padding: 96px 20px 30px;
    width: 100%;
    box-sizing: border-box;
}

.about-aral-header {
    text-align: center;
    margin: 0 auto;
    width: 75%;
}

.about-aral-header h2 {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    color: rgba(33, 64, 154, 1);
    margin-bottom: 2.5rem;
}

.about-aral-desc {
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 400;
    line-height: 1.9;
    color: #6D6D6D;
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
}

/* تبلت */
@media (max-width: 1024px) {
    .about-aral-wrapper {
        padding: 50px 20px 48px;
    }

    .about-aral-header {
        width: 90%;
    }

    .about-aral-header h2 {
        margin-bottom: 1.75rem;
    }
}

/* موبایل */
@media (max-width: 768px) {
    .about-aral-wrapper {
        padding: 40px 16px 40px;
    }

    .about-aral-header {
        width: 100%;
    }

    .about-aral-header h2 {
        margin-bottom: 1.25rem;
    }

    .about-aral-desc {
        line-height: 1.7;
    }
}

/* موبایل کوچک */
@media (max-width: 480px) {
    .about-aral-wrapper {
        padding: 30px 12px 32px;
    }
}


/* ==========================================================
   06. WHY ARAL
   ========================================================== */

.why-aral-section {
    margin-bottom: 50px;
}

.why-aral-wrapper {
    background: rgba(245, 245, 245, 1);
    padding: 0 20px 120px;
    width: 100%;
}

.why-aral-header {
    text-align: center;
    margin-bottom: 4.5rem;
}

.why-aral-header h4 {
    font-size: 30px;
    font-weight: 500;
    color: #838383;
    margin-bottom: 1rem;
}

.cards-outer {
    width: 100%;
    background: white;
    border-radius: 16px;
    padding: 2rem 1.25rem;
    margin: -6rem auto 0;
}

.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.card {
    background: white;
    border: none !important;
    border-radius: 20px;
    padding: 22px 16px;
    flex: 1 1 100%; /* یک ستونه در موبایل کوچک */
    text-align: center;
    box-shadow: 0 0 18px 6px rgba(0, 0, 0, 0.04);
}

.card .card-img {
    width: 22%;
    color: #E8442F;
    margin: 0 auto 1.25rem;
    display: block;
}

.card h3 {
    font-size: 17px;
    font-weight: 400;
    color: #1A1A1A;
    margin: 0 0 8px;
}

.card-desc {
    font-size: 13px;
    font-weight: 300;
    line-height: 1.7;
    color: #666;
    margin: 0;
}

/* موبایل بزرگ (≥576px): دو ستونه */
@media (min-width: 576px) {
    .card {
        flex: 1 1 calc(50% - 16px);
    }

    .why-aral-header h4 {
        font-size: 28px;
    }

    .why-aral-desc {
        font-size: 17px;
    }
}

/* تبلت (≥768px) */
@media (min-width: 768px) {
    .why-aral-wrapper {
        padding: 50px 40px 150px;
    }

    .why-aral-header h4 {
        font-size: 30px;
    }

    .why-aral-desc {
        font-size: 19px;
        max-width: 85%;
        width: fit-content;
    }

    .cards-outer {
        width: 92%;
        padding: 3rem 2rem;
        margin-top: -8rem;
    }

    .card h3 {
        font-size: 18px;
    }

    .card-desc {
        font-size: 14px;
    }
}

/* دسکتاپ کوچک (≥992px): چهار ستونه */
@media (min-width: 992px) {
    .why-aral-wrapper {
        padding: 60px 50px 160px;
    }

    .why-aral-desc {
        font-size: 21px;
        max-width: 80%;
    }

    .cards-outer {
        width: 85%;
        padding: 4rem 3rem;
        margin-top: -11rem;
    }

    .card {
        flex: 1; /* چهار ستونه، عرض مساوی */
    }

    .card .card-img {
        width: 28%;
    }

    .card h3 {
        font-size: 19px;
    }

    .card-desc {
        font-size: 14.5px;
    }
}

/* دسکتاپ بزرگ (≥1200px): اندازه اصلی طرح */
@media (min-width: 1200px) {
    .why-aral-wrapper {
        padding: 70px 60px 180px;
    }

    .why-aral-header h4 {
        font-size: 32px;
        margin-bottom: 2rem;
    }

    .why-aral-desc {
        font-size: 24px;
        line-height: 2;
        max-width: 78%;
    }

    .cards-outer {
        width: 77%;
        padding: 4.5rem 3.5rem;
        margin-top: -13rem;
    }

    .card {
        padding: 35px 25px;
    }

    .card .card-img {
        width: 30%;
        margin-bottom: 2rem;
    }

    .card h3 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .card-desc {
        font-size: 15px;
        line-height: 1.8;
    }
}


/* ==========================================================
   07. PRODUCTS SLIDER
   ========================================================== */

.products-section {
    opacity: 0;
    margin-top: 80px;
    margin-bottom: 5rem;
    transition: opacity 1.4s ease-out, margin-top 1.4s ease-out;
}

.products-section.in-view {
    opacity: 1;
    margin-top: 0;
}

.products-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

.aral-section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    gap: 8px;
    color: rgba(33, 64, 154, 1);
    margin-bottom: 2rem;
}

/* ---------- اسلایدر (پایه: موبایل کوچک) ---------- */

.products-slider {
    display: flex;
    align-items: center;
    gap: 10px;
}

.products-track-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    width: 1180px;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    padding: 40px 0;
    margin: -40px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
}

.products-track-wrapper::-webkit-scrollbar {
    display: none;
}

.products-track {
    display: flex;
    gap: 16px;
    width: max-content;
    padding: 0 calc(50% - 120px);
}

.product-slide {
    flex: 0 0 240px;
    flex-shrink: 0;
    scroll-snap-align: center;
}

.product-slide-inner {
    position: relative;
    overflow: hidden;
    width: 240px;
    height: 230px;
    cursor: pointer;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.3s ease-out;
}

.product-slide.is-center .product-slide-inner {
    transform: scale(1.1);
    z-index: 3;
}

.product-slide-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    z-index: 1;
}

.product-slide-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent);
    z-index: 1;
    pointer-events: none;
}

.product-slide-title {
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    padding: 0 8px;
    text-align: center;
    white-space: nowrap;
    font-size: 17px;
    font-weight: 500;
    color: #535252;
    z-index: 2;
    margin-top: 1rem;
}

.product-slide.is-center .product-slide-title {
    font-size: 19px;
    font-weight: bold;
}

.product-brands {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    transform: translateY(100%);
    transition: transform 0.35s ease;
    z-index: 2;
}

.product-slide-inner:hover .product-brands {
    transform: translateY(0);
}

.product-slide-inner:hover .product-slide-img {
    transform: scale(1.08);
}

.brand-tag {
    flex: 1;
    text-align: center;
    background: #838383;
    padding: 8px 3px;
    transition: background 0.3s ease;
}

.brand-tag:hover {
    background: rgba(33, 64, 154, 1);
}

.brand-tag img {
    max-width: 100%;
    max-height: 16px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ---------- فلش‌ها ---------- */

.slider-arrow {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #B1B1B1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
    position: relative;
    z-index: 5;
    touch-action: manipulation;
}

.slider-arrow i {
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-arrow:hover {
    background: rgba(33, 64, 154, 1);
    color: #fff;
}

.slider-arrow.disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* موبایل بزرگ / تبلت کوچک (≥576px) */
@media (min-width: 576px) {
    .products-wrapper {
        padding: 0 20px;
    }

    .aral-section-title {
        font-size: 32px;
        margin-bottom: 3rem;
    }

    .products-slider {
        gap: 15px;
    }

    .product-slide {
        flex: 0 0 280px;
    }

    .product-slide-inner {
        width: 280px;
        height: 268px;
    }

    .products-track {
        gap: 30px;
        padding: 0 calc(50% - 140px);
    }

    .product-slide.is-center .product-slide-inner {
        transform: scale(1.183);
    }

    .product-slide-title {
        font-size: 22px;
        top: 14px;
    }

    .product-slide.is-center .product-slide-title {
        font-size: 26px;
    }

    .slider-arrow {
        width: 36px;
        height: 36px;
    }

    .slider-arrow i {
        font-size: 26px;
    }

    .brand-tag {
        font-size: 0.72rem;
        padding: 10px 4px;
    }

    .brand-tag img {
        max-height: 20px;
    }
}

/* دسکتاپ (≥992px): بازگشت به سایز اصلی طرح */
@media (min-width: 992px) {
    .products-section {
        margin-top: 120px;
        margin-bottom: 15rem;
    }

    .products-wrapper {
        padding: 0 40px;
    }

    .aral-section-title {
        font-size: 44px;
        gap: 15px;
        margin-bottom: 4.5rem;
    }

    .products-slider {
        gap: 25px;
    }

    .product-slide {
        flex: 0 0 360px;
    }

    .product-slide-inner {
        width: 360px;
        height: 345px;
    }

    .products-track {
        gap: 50px;
        padding: 0 calc(50% - 180px);
    }

    .product-slide.is-center .product-slide-inner {
        transform: scale(1.183); /* 426 / 360 */
    }

    .product-slide-inner::before {
        height: 90px;
    }

    .product-slide-title {
        font-size: 32px;
        top: 18px;
    }

    .product-slide.is-center .product-slide-title {
        font-size: 36px;
    }

    .slider-arrow {
        width: 42px;
        height: 42px;
    }

    .slider-arrow i {
        font-size: 35px;
    }

    .brand-tag {
        font-size: 0.8rem;
        padding: 12px 6px;
    }

    .brand-tag img {
        max-height: 24px;
    }
}


/* ==========================================================
   08. LATEST PROJECTS
   ========================================================== */

/* ---------- قاب بخش (فاصله کناری) ---------- */

.latest-projects-section {
    padding: 2.5rem 1rem;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

/* ---------- ردیف اصلی ---------- */

.latest-projects-section .five-cols-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* ---------- ستون‌ها (موبایل) ---------- */

.latest-projects-section .project-col {
    position: relative;
    flex: 1 1 100%;
    min-width: 0;
    opacity: 0;
    margin-top: 50px;
    transition: opacity 0.7s ease-out, margin-top 0.7s ease-out;
}

.latest-projects-section .five-cols-row.in-view .project-col {
    opacity: 1;
    margin-top: 0;
}

/* انیمیشن پلکانی */
.latest-projects-section .five-cols-row.in-view .project-col:nth-child(1) { transition-delay: 0s; }
.latest-projects-section .five-cols-row.in-view .project-col:nth-child(2) { transition-delay: 0.12s; }
.latest-projects-section .five-cols-row.in-view .project-col:nth-child(3) { transition-delay: 0.24s; }
.latest-projects-section .five-cols-row.in-view .project-col:nth-child(4) { transition-delay: 0.36s; }
.latest-projects-section .five-cols-row.in-view .project-col:nth-child(5) { transition-delay: 0.48s; }

/* ---------- کارت ---------- */

.latest-projects-section .project-card {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
}

.latest-projects-section .project-img-wrapper {
    position: absolute;
    inset: 0;
}

.latest-projects-section .project-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

/* لایه تیره روی تصویر */
.latest-projects-section .project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.85) 0%,
            rgba(0, 0, 0, 0.25) 55%,
            rgba(0, 0, 0, 0.05) 100%
    );
    opacity: 0.85;
    transition: opacity 0.4s ease;
}

/* ---------- محتوای کارت ---------- */

.latest-projects-section .project-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px;
    color: #fff;
    overflow: hidden;
    box-sizing: border-box;
}

.latest-projects-section .project-category {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.4rem 2.2rem;
    border-radius: 50px;
    margin-bottom: 8px;
}

.latest-projects-section .project-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 6px;
    white-space: normal;
    writing-mode: horizontal-tb;
}

.latest-projects-section .project-desc {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 12px;
}

.latest-projects-section .btn-project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
}

.latest-projects-section .btn-project-link i {
    transition: transform 0.25s ease;
}

.latest-projects-section .btn-project-link:hover i {
    transform: translateX(-4px);
}

/* ---------- دکمه «سایر پروژه‌ها» ---------- */

.latest-projects-section .more-projects-wrap {
    text-align: right;
}

.more-btn {
    color: #FDFDFD;
    background-color: #949494;
    border: none;
    border-radius: 50px;
    margin-top: 2rem;
    padding: 0.4rem 2.2rem;
    font-size: 1.05rem;
}

.more-btn:hover {
    background-color: rgba(33, 64, 154, 1);
}

.latest-projects-section .more-projects-link {
    color: inherit;
    text-decoration: none;
}

.latest-projects-section .more-projects-link:hover {
    color: inherit;
}

/* ---------- ≥576px: سه ستون ---------- */
@media (min-width: 576px) {
    .latest-projects-section {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .latest-projects-section .project-col {
        flex: 1 1 calc(33.333% - 12px);
    }
}

/* ---------- ≥768px ---------- */
@media (min-width: 768px) {
    .latest-projects-section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* ---------- بهینه‌سازی کارت‌ها در تبلت کوچک ---------- */
@media (min-width: 568px) and (max-width: 820px) {
    .latest-projects-section .project-content {
        padding: 10px;
    }

    .latest-projects-section .project-category {
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
        margin-bottom: 6px;
        white-space: nowrap;
    }

    .latest-projects-section .project-title {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    .latest-projects-section .btn-project-link {
        font-size: 0.75rem;
        gap: 5px;
        white-space: nowrap;
    }

    .latest-projects-section .more-btn {
        font-size: 0.9rem;
        padding: 0.4rem 1.5rem;
    }
}

/* ---------- ≥992px: آکاردئون پروژه‌ها ---------- */
@media (min-width: 992px) {
    .latest-projects-section {
        padding-left: 3rem;
        padding-right: 3rem;
    }

    .latest-projects-section .five-cols-row {
        flex-wrap: nowrap;
        height: 504px;
        gap: 0;
    }

    .latest-projects-section .project-col {
        flex: 1 1 0;
        transition:
                flex 0.35s ease-out,
                opacity 0.7s ease-out,
                margin-top 0.7s ease-out;
    }

    .latest-projects-section .project-card {
        aspect-ratio: auto;
        height: 100%;
        border-radius: 0;
    }

    /* حالت پیش‌فرض دسکتاپ */
    .latest-projects-section .project-overlay {
        opacity: 0;
    }

    .latest-projects-section .project-content {
        opacity: 0;
        transform: translateY(20px);
        transition:
                opacity 0.35s ease,
                transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .latest-projects-section .project-category {
        opacity: 0;
        transform: translateY(10px);
        transition:
                opacity 0.35s ease 0.05s,
                transform 0.35s ease 0.05s;
    }

    .latest-projects-section .project-desc,
    .latest-projects-section .btn-project-link {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, opacity 0.35s ease;
    }

    /* افکت آکاردئون */
    .latest-projects-section .five-cols-row.is-hovering .project-col {
        flex: 0.95 1 0;
    }

    .latest-projects-section .five-cols-row.is-hovering .project-col.is-active {
        flex: 1.12 1 0;
    }

    .latest-projects-section .project-col.is-active .project-img {
        transform: scale(1.05);
    }

    .latest-projects-section .project-col.is-active .project-overlay {
        opacity: 1;
    }

    .latest-projects-section .project-col.is-active .project-content {
        opacity: 1;
        transform: translateY(0);
    }

    .latest-projects-section .project-col.is-active .project-category {
        opacity: 1;
        transform: translateY(0);
    }

    .latest-projects-section .project-col.is-active .project-desc,
    .latest-projects-section .project-col.is-active .btn-project-link {
        max-height: 100px;
        opacity: 1;
    }

    .latest-projects-section .five-cols-row.is-hovering
    .project-col:not(.is-active) .project-category {
        opacity: 0;
    }

    .latest-projects-section .five-cols-row.is-hovering
    .project-col:not(.is-active) .project-title {
        writing-mode: vertical-rl;
        text-orientation: mixed;
        font-size: 1rem;
        white-space: nowrap;
    }

    .latest-projects-section .five-cols-row:not(.is-hovering)
    .project-category {
        opacity: 1;
        transform: translateY(0);
    }

    .latest-projects-section .five-cols-row:not(.is-hovering)
    .project-title {
        writing-mode: horizontal-tb;
    }
}

/* ---------- ≥1200px ---------- */
@media (min-width: 1200px) {
    .latest-projects-section {
        padding-left: 5rem;
        padding-right: 5rem;
    }

    .latest-projects-section .project-content {
        padding: 22px 20px 24px;
    }

    .latest-projects-section .project-title {
        font-size: 1.08rem;
    }
}

/* ---------- ≥1500px ---------- */
@media (min-width: 1500px) {
    .latest-projects-section {
        padding-left: 8rem;
        padding-right: 8rem;
    }
}


/* ==========================================================
   09. ARTICLES SLIDER
   ========================================================== */

/* ---------- قاب بخش (فاصله کناری) ---------- */

.articles-section {
    margin: 2rem 1rem;
    box-sizing: border-box;
}

/* ---------- پس‌زمینه و قاب اسلایدر ---------- */

.articles-slider-wrapper {
    background: #CECECE;
    padding-bottom: 1.5rem;
}

.articles-slider {
    position: relative;
    min-height: 400px;
}

/* ---------- اسلاید (پایه: موبایل) ---------- */

.article-slide {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;
    align-items: stretch;

    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;

    pointer-events: none;
    gap: 1rem;

    padding: 1.25rem 1rem 0;
    min-height: 400px;

    box-sizing: border-box;
}

.article-slide.is-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    z-index: 2;
}

/* ---------- محتوا ---------- */

.article-content {
    flex: 0 0 auto;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;

    padding-right: 0 !important;

    order: 2;
    min-width: 0;
}

.article-title {
    font-size: clamp(1.05rem, 0.85rem + 1vw, 1.5rem);
    font-weight: 800;
    color: #838383;
    margin: 0 0 12px;
    line-height: 1.45;
}

.article-desc {
    font-size: 0.9rem;
    color: #666464;
    line-height: 1.7;
    margin: 0 0 16px;
}

.more-article-btn {
    width: 100%;
    white-space: nowrap;
}

.more-article-btn a {
    color: inherit;
    text-decoration: none;
}

/* ---------- تصویر ---------- */

.article-img-wrap {
    flex: 0 0 clamp(170px, 42vw, 210px);
    order: 1;

    border-radius: 14px;
    overflow: hidden;
    min-width: 0;
}

.article-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------- فلش‌ها ---------- */

.articles-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.articles-arrow {
    width: 34px;
    height: 34px;

    border-radius: 50%;
    border: none;

    background: #fff;
    color: rgba(40, 52, 139, 1);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 13px;
    cursor: pointer;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: background 0.25s ease, color 0.25s ease;
}

.articles-arrow:hover {
    background: rgba(40, 52, 139, 1);
    color: #fff;
}

/* ---------- نوار پیشرفت ---------- */

.articles-progress {
    display: flex;
    max-width: 100%;
    margin: 12px auto 0;
}

.progress-segment {
    flex: 1;
    height: 4px;
    overflow: hidden;
}

.progress-segment .segment-fill {
    display: block;
    height: 100%;
    width: 0;

    background: rgba(40, 52, 139, 1);
    border-radius: 2px;

    transition: width 0.5s ease;
}

.progress-segment.is-active .segment-fill {
    width: 100%;
}

/* ---------- ≥576px ---------- */
@media (min-width: 576px) {
    .articles-section {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }
}

/* ---------- تبلت و دسکتاپ (≥768px): چیدمان افقی ---------- */
@media (min-width: 768px) {
    .articles-section {
        margin-top: 1rem;
        margin-bottom: 5rem;
    }

    .articles-slider-wrapper {
        min-height: clamp(350px, 35vw, 460px);
        padding-bottom: 2.5rem;
    }

    .articles-slider {
        min-height: clamp(350px, 35vw, 460px);
    }

    .article-slide {
        flex-direction: row;
        align-items: stretch;

        gap: clamp(2rem, 5vw, 7rem);

        padding:
                clamp(1.25rem, 3vw, 4rem)
                clamp(1.25rem, 4vw, 6rem)
                0;

        min-height: clamp(350px, 35vw, 460px);
    }

    .article-content {
        flex: 1.1 1 0;
        min-width: 0;
        justify-content: center;

        padding-right: 2.5rem !important;

        order: initial;
    }

    .article-desc {
        font-size: 0.95rem;
        line-height: 1.75;
        margin-bottom: 18px;
    }

    .more-article-btn {
        width: fit-content;
        white-space: nowrap;
    }

    .article-img-wrap {
        flex: 0.9 1 0;
        min-width: 0;
        height: auto;
        min-height: 0;

        aspect-ratio: 4 / 3;
        overflow: hidden;

        order: initial;
        border-radius: 24px;
    }

    .articles-controls {
        gap: 14px;
    }

    .articles-arrow {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }

    .articles-progress {
        margin: 0 auto;
    }
}

/* ---------- ≥992px ---------- */
@media (min-width: 992px) {
    .articles-section {
        margin-left: 3rem;
        margin-right: 3rem;
    }
}

/* ---------- ≥1200px ---------- */
@media (min-width: 1200px) {
    .articles-section {
        margin-left: 5rem;
        margin-right: 5rem;
    }
}

/* ---------- ≥1500px ---------- */
@media (min-width: 1500px) {
    .articles-section {
        margin-left: 8rem;
        margin-right: 8rem;
    }
}

/* ---------- موبایل (<768px): اسلایدها بیرون از حالت absolute ----------
   این بلوک باید آخرِ بخش مقالات بماند تا قاعده‌های پایه را بازنویسی کند. */
@media (max-width: 767.98px) {
    .articles-slider {
        display: grid;
        min-height: 0;
    }

    .articles-slider-wrapper {
        padding-bottom: 0;
    }

    .article-slide {
        position: relative;
        inset: auto;
        grid-area: 1 / 1; /* همه اسلایدها روی هم در یک خانه */
        min-height: 0;
        padding-bottom: 1.25rem;
    }

    .article-slide:not(.is-active) {
        visibility: hidden;
    }

    .article-slide.is-active {
        visibility: visible;
    }

    .article-img-wrap {
        flex: 0 0 auto;
        aspect-ratio: 3 / 2; /* اگر عکس بریده شد 4 / 3 یا 16 / 10 امتحان کن */
    }

    .articles-controls {
        position: relative;
        z-index: 5;
        margin-top: 0.5rem;
        padding-bottom: 1rem;
    }

    .articles-progress {
        margin-top: 0;
    }
}

/* نوار شرکا در موبایل‌های خیلی کوچک (≤400px) */
@media (max-width: 399.98px) {
    .partners-section {
        padding: .35rem .75rem;
    }

    .logo-slider {
        height: clamp(26px, 9vw, 36px);
    }

    .logo-item {
        width: clamp(76px, 26vw, 104px);
        height: clamp(26px, 9vw, 36px);
        flex: 0 0 clamp(76px, 26vw, 104px);
        padding: 0 8px;
    }

    .logo-item img {
        max-width: 100%;
        max-height: clamp(16px, 5.5vw, 22px);
    }
}

/* لوگوهای برند روی کارت محصولات: هم‌وزن دیداری (لوگوهای trim‌شده + ضریب --s برای هر لوگو) */
.product-brands { --brand-h: 13px; }
.brand-tag { display: flex; align-items: center; justify-content: center; flex: 1 1 auto; min-width: 0; padding-left: 10px; padding-right: 10px; }
.brand-tag img {
    height: calc(var(--brand-h) * var(--s, 1));
    max-height: none;
    width: auto;
    max-width: 100%;
}
@media (min-width: 576px) { .product-brands { --brand-h: 15px; } .brand-tag img { max-height: none; } }
@media (min-width: 992px) { .product-brands { --brand-h: 18px; } .brand-tag img { max-height: none; } }
