/* =========================================================
   ARTICLES PAGE RESET / RTL
   ========================================================= */

.articles-page {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

.articles-page *,
.articles-page *::before,
.articles-page *::after {
    box-sizing: border-box;
}

.articles-page .container {
    width: min(1380px, calc(100% - 40px));
    max-width: 1380px;
    margin-right: auto;
    margin-left: auto;
    direction: rtl;
    text-align: right;
}

.articles-page .section-heading {
    width: 100%;
    direction: rtl;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    text-align: right;
}

.articles-page .section-heading > div {
    flex: 0 1 auto;
    min-width: 0;
    text-align: right;
}

.articles-page .section-heading h2,
.articles-page .section-heading span {
    text-align: right;
}

.articles-page .section-heading > a {
    flex-shrink: 0;
    margin-right: auto;
    margin-left: 0;
}

.articles-page .featured-article {
    width: 100%;
    direction: rtl;
}

.articles-page .featured-article-content {
    min-width: 0;
    text-align: right;
}

.articles-page .featured-article-content h3,
.articles-page .featured-article-content p {
    text-align: right;
}

.articles-page .articles-grid {
    width: 100%;
    direction: rtl;
}

.articles-page .article-card {
    min-width: 0;
    direction: rtl;
}

.articles-page .article-card-content {
    text-align: right;
}

/* =========================================================
   MYFIT ARTICLES PAGE
   ========================================================= */

.articles-hero {
    position: relative;
    width: 100%;
    min-height: 470px;
    overflow: hidden;
}

.articles-hero-img {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.articles-hero-night {
    display: none;
}

[data-theme="dark"] .articles-hero-day {
    display: none;
}

[data-theme="dark"] .articles-hero-night {
    display: block;
}

.articles-hero-content {
    position: relative;
    z-index: 3;

    width: min(1380px, calc(100% - 40px));
    min-height: 470px;

    margin: 0 auto;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;

    padding: 55px 0;
}

.articles-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 18px;
    padding: 8px 14px;

    border: 1px solid rgba(155,203,85,.25);
    border-radius: 999px;

    background: rgba(155,203,85,.08);

    color: var(--accent);

    font-size: 12px;
    font-weight: 700;
}

.articles-hero-content h1 {
    max-width: 620px;

    margin: 0 0 18px;

    color: #fff;

    font-size: clamp(34px, 4vw, 58px);
    line-height: 1.4;
    font-weight: 900;
}

.articles-hero-content h1 span {
    display: block;
    color: var(--accent);
}

.articles-hero-content p {
    max-width: 570px;

    margin: 0 0 25px;

    color: rgba(255,255,255,.78);

    font-size: 15px;
    line-height: 2.1;
}

.articles-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    height: 50px;
    padding: 0 20px;

    border-radius: 13px;

    background: var(--accent);
    color: #101412;

    text-decoration: none;

    font-size: 13px;
    font-weight: 800;

    transition: .25s ease;
}

.articles-hero-btn:hover {
    transform: translateY(-2px);
}


/* =========================================================
   CATEGORIES
   ========================================================= */

.articles-categories {
    position: relative;
    z-index: 5;

    margin-top: -1px;
    padding: 20px 0;

    background: var(--bg);
}

.articles-categories .container {
    width: min(1380px, calc(100% - 40px));
    margin: auto;
}

.articles-category-list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 10px;
}

.article-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 44px;
    padding: 0 18px;

    border: 1px solid rgba(255,255,255,.07);
    border-radius: 999px;

    background: rgba(255,255,255,.025);

    color: var(--muted);

    text-decoration: none;

    font-size: 13px;
    font-weight: 700;

    transition: .25s ease;
}

.article-category:hover {
    color: var(--text);
    border-color: rgba(155,203,85,.25);
    background: rgba(155,203,85,.06);
}

.article-category.active {
    color: #101412;
    background: var(--accent);
    border-color: var(--accent);
}


/* =========================================================
   COMMON SECTION
   ========================================================= */

.featured-article-section,
.articles-list-section {
    padding: 55px 0;
}

.featured-article-section .container,
.articles-list-section .container {
    width: min(1380px, calc(100% - 40px));
    margin: auto;
}

/* =========================================================
   SECTION HEADINGS
   ========================================================= */

.articles-page .section-heading {
    position: relative;
    width: 100%;
    min-height: 44px;
    margin: 0 0 28px 0;
    padding: 0;
    direction: rtl;
    text-align: right;
}

.articles-page .section-heading > div {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: right;
}

.articles-page .section-heading > div span {
    display: block;
    width: 100%;
    margin: 0 0 7px 0;
    padding: 0;
    text-align: right;
}

.articles-page .section-heading h2 {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: right;
}

.articles-page .section-heading > a {
    position: absolute;
    left: 0;
    right: auto;
    top: 50%;
    transform: translateY(-50%);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    min-width: 125px;
    height: 44px;
    margin: 0;
    padding: 0 16px;

    border: 1px solid rgba(155,203,85,.25);
    border-radius: 12px;
    background: rgba(155,203,85,.07);

    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    direction: rtl;

    font-size: 12px;
    font-weight: 800;

    transition:
        background .25s ease,
        border-color .25s ease,
        box-shadow .25s ease,
        transform .25s ease;
}

.articles-page .section-heading > a:hover {
    background: rgba(155,203,85,.13);
    border-color: rgba(155,203,85,.42);
    box-shadow: 0 8px 22px rgba(155,203,85,.08);
    transform: translateY(calc(-50% - 2px));
}

.articles-page .section-heading > a i {
    font-size: 11px;
}

/* فقط هدینگ بخش مقاله ویژه */
.articles-page .featured-article-section .articles-section-heading {
    position: relative;
    width: 100%;
    min-height: 44px;
}

.articles-page .featured-article-section .articles-heading-text {
    width: 100%;
    text-align: right;
}

.articles-page .featured-article-section .articles-all-btn {
    left: 0;
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

.articles-page .featured-article-section .articles-all-btn:hover {
    transform: translateY(calc(-50% - 2px));
}

@media (max-width: 700px) {
    .articles-page .section-heading {
        min-height: 105px;
    }

    .articles-page .section-heading > a,
    .articles-page .featured-article-section .articles-all-btn {
        left: 0;
        right: auto;
        top: auto;
        bottom: 0;
        transform: none;
    }

    .articles-page .section-heading > a:hover,
    .articles-page .featured-article-section .articles-all-btn:hover {
        transform: translateY(-2px);
    }
}

/* =========================================================
   FEATURED
   ========================================================= */

.featured-article {
    display: grid;
    grid-template-columns: 1.25fr 1fr;

    min-height: 360px;

    overflow: hidden;

    border: 1px solid rgba(255,255,255,.06);
    border-radius: 24px;

    background: var(--surface);

    box-shadow: 0 15px 45px rgba(0,0,0,.08);
}

.featured-article-image {
    position: relative;
    min-height: 360px;
    overflow: hidden;
}

.featured-article-image img {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.article-night-image {
    display: none;
}

[data-theme="dark"] .article-day-image {
    display: none;
}

[data-theme="dark"] .article-night-image {
    display: block;
}

.article-category-badge,
.article-card-category {
    position: absolute;
    top: 16px;
    right: 16px;

    padding: 7px 12px;

    border-radius: 999px;

    background: rgba(16,20,18,.72);
    backdrop-filter: blur(10px);

    color: #fff;

    font-size: 11px;
    font-weight: 700;
}

.featured-article-content {
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 45px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 15px;

    margin-bottom: 14px;

    color: var(--muted);

    font-size: 11px;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-meta i {
    color: var(--accent);
}

.featured-article-content h3 {
    margin: 0 0 15px;

    color: var(--text);

    font-size: 27px;
    line-height: 1.7;
}

.featured-article-content p {
    margin: 0 0 24px;

    color: var(--muted);

    font-size: 13px;
    line-height: 2.1;
}

.article-read-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    align-self: flex-start;

    min-height: 47px;
    padding: 0 18px;

    border-radius: 12px;

    background: var(--accent);
    color: #101412;

    text-decoration: none;

    font-size: 12px;
    font-weight: 800;

    transition: .25s ease;
}

.article-read-btn:hover {
    transform: translateY(-2px);
}


/* =========================================================
   ARTICLES GRID
   ========================================================= */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.article-card {
    overflow: hidden;

    border: 1px solid rgba(255,255,255,.06);
    border-radius: 20px;

    background: var(--surface);

    box-shadow: 0 10px 30px rgba(0,0,0,.05);

    transition:
        transform .3s ease,
        box-shadow .3s ease,
        border-color .3s ease;
}

.article-card:hover {
    transform: translateY(-6px);

    border-color: rgba(155,203,85,.2);

    box-shadow: 0 18px 40px rgba(0,0,0,.12);
}

.article-card-image {
    position: relative;

    display: block;

    height: 215px;

    overflow: hidden;
}

.article-card-image img {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform .45s ease;
}

.article-card:hover .article-card-image img {
    transform: scale(1.045);
}

.article-card-content {
    padding: 22px;
}

.article-card-content h3 {
    margin: 0 0 10px;

    color: var(--text);

    font-size: 17px;
    line-height: 1.7;
}

.article-card-content p {
    margin: 0 0 18px;

    color: var(--muted);

    font-size: 12px;
    line-height: 2;
}

.article-card-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    color: var(--accent);

    text-decoration: none;

    font-size: 12px;
    font-weight: 800;
}

.article-card-link:hover {
    gap: 10px;
}


/* =========================================================
   CTA
   ========================================================= */

.articles-cta {
    position: relative;

    width: min(1380px, calc(100% - 40px));
    min-height: 240px;

    margin: 40px auto 70px;

    overflow: hidden;

    border-radius: 25px;
}

.articles-cta-img {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.articles-cta-night {
    display: none;
}

[data-theme="dark"] .articles-cta-day {
    display: none;
}

[data-theme="dark"] .articles-cta-night {
    display: block;
}

.articles-cta-content {
    position: relative;
    z-index: 2;

    min-height: 240px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    padding: 35px 55px;
}

.articles-cta-content span {
    color: #7BAE3F;

    font-size: 12px;
    font-weight: 800;
}

.articles-cta-content h2 {
    margin: 7px 0;

    color: #fff;

    font-size: 33px;
    font-weight: 850;
}

.articles-cta-content p {
    margin: 0;

    color: rgba(255,255,255,.75);

    font-size: 19px;
}

.articles-cta-btn {
    flex-shrink: 0;

    display: inline-flex;
    align-items: center;
    gap: 9px;

    min-height: 50px;
    padding: 0 20px;

    border-radius: 13px;

    background: var(--accent);
    color: #101412;

    text-decoration: none;

    font-size: 12px;
    font-weight: 800;
}


/* =========================================================
   LIGHT
   ========================================================= */

[data-theme="light"] .article-category {
    background: rgba(255,255,255,.8);
    border-color: rgba(23,33,29,.08);
}

[data-theme="light"] .article-category:hover {
    background: #f0f6ea;
}

[data-theme="light"] .article-category.active {
    background: #7BAE3F;
}

[data-theme="light"] .featured-article,
[data-theme="light"] .article-card {
    border-color: rgba(23,33,29,.07);
}

[data-theme="light"] .articles-hero-content h1,
[data-theme="light"] .articles-cta-content h2 {
    color: #fff;
}

[data-theme="light"] .articles-hero-content p {
    color: #fff;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 950px) {

    .featured-article {
        grid-template-columns: 1fr;
    }

    .featured-article-image {
        min-height: 300px;
    }

    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .articles-cta-content {
        padding: 30px;
    }
}


@media (max-width: 700px) {

    .articles-hero {
        min-height: 430px;
    }

    .articles-hero-content {
        width: calc(100% - 28px);
        min-height: 430px;
        padding: 35px 0;
    }

    .articles-hero-content h1 {
        font-size: 34px;
    }

    .articles-hero-content p {
        font-size: 13px;
    }

    .articles-category-list {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;

        scrollbar-width: none;
    }

    .articles-category-list::-webkit-scrollbar {
        display: none;
    }

    .article-category {
        flex-shrink: 0;
        min-height: 40px;
        padding: 0 14px;
        font-size: 11px;
    }

    .featured-article-section,
    .articles-list-section {
        padding: 40px 0;
    }

    .featured-article-section .container,
    .articles-list-section .container {
        width: calc(100% - 24px);
    }

    .section-heading h2 {
        font-size: 23px;
    }

    .featured-article-content {
        padding: 25px 20px;
    }

    .featured-article-content h3 {
        font-size: 21px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .article-card-image {
        height: 220px;
    }

    .articles-cta {
        width: calc(100% - 24px);
        min-height: 330px;
        margin-bottom: 45px;
    }

    .articles-cta-content {
        min-height: 330px;

        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-end;

        padding: 25px 20px;
    }

    .articles-cta-content h2 {
        font-size: 23px;
    }

    .articles-cta-btn {
        width: 100%;
        justify-content: center;
    }
}
