/* استایل H1/معرفی/مقالات صفحه اصلی — منتقل‌شده از home.html */

.home-page {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* ===== H1 و پاراگراف معرفی (سئو — بدون برهم زدن طراحی) ===== */

/* مخفی از دید کاربر، ولی در DOM باقی می‌ماند (نه display:none) */
.home-hero-text--hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.home-hero-text {
    max-width: 820px;
    margin: 0 auto;
    padding: 18px 20px 6px;
    text-align: center;
}

.home-hero-text h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
    line-height: 1.7;
}

.home-hero-text p {
    font-size: 0.9rem;
    color: #475569;
    margin: 0;
    line-height: 1.9;
}

@media (max-width: 600px) {
    .home-hero-text h1 { font-size: 1.1rem; }
    .home-hero-text p { font-size: 0.82rem; }
}

/* ===== بخش آخرین مقالات صفحه اصلی ===== */
.home-articles {
    max-width: 1100px;
    margin: 40px auto 24px;
    padding: 0 20px;
}

.home-articles h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 18px;
    text-align: center;
}

.home-articles__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.home-article-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.home-article-card:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 24px -8px rgba(99, 102, 241, 0.25);
}

.home-article-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.home-article-card__body {
    padding: 14px 16px;
}

.home-article-card__body h3 {
    font-size: 0.95rem;
    color: #0f172a;
    margin: 0 0 8px;
    font-weight: 700;
    line-height: 1.6;
}

.home-article-card__body p {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0;
    line-height: 1.7;
}

/* ===== متن سئوی پایین صفحه اصلی (قبل از فوتر) — دو سطر دیده می‌شود، بقیه با «بیشتر» ===== */
.home-seo-text {
    max-width: 1100px;
    margin: 40px auto 28px;
    padding: 0 20px;
}

.home-seo-text__card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px 24px 14px;
}

.home-seo-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px;
    line-height: 1.8;
}

.home-seo-text__body {
    font-size: 0.9rem;
    color: #475569;
    line-height: 2;
}

.home-seo-text__body h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 18px 0 6px;
}

.home-seo-text__body h2:first-child { margin-top: 0; }
.home-seo-text__body p { margin: 0 0 8px; }
.home-seo-text__body a { color: #6366f1; text-decoration: none; }
.home-seo-text__body a:hover { text-decoration: underline; }

/* حالت جمع‌شده: ۴ سطر؛ دو سطر اول واضح، دو سطر بعد محو می‌شود (فقط وقتی JS فعال باشد) */
.home-seo-text.is-collapsed .home-seo-text__body {
    max-height: 7.2rem;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 45%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 0, #000 45%, transparent 100%);
}

.home-seo-text__toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px auto 4px;
    padding: 6px 14px;
    background: none;
    border: none;
    color: #6366f1;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.home-seo-text__toggle[hidden] { display: none; }
.home-seo-text__toggle svg { transition: transform .2s ease; }
.home-seo-text__toggle.is-open svg { transform: rotate(180deg); }
.home-seo-text__toggle:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; border-radius: 8px; }

@media (max-width: 600px) {
    .home-seo-text { margin-top: 28px; }
    .home-seo-text__card { padding: 16px 16px 10px; }
    .home-seo-text h1 { font-size: 1rem; }
    .home-seo-text__body { font-size: 0.82rem; }
    .home-seo-text.is-collapsed .home-seo-text__body { max-height: 6.6rem; }
}
