/* Homepage articles — editorial magazine look (distinct from product UI) */

.ha-section {
    --ha-ink: #1c2b2a;
    --ha-muted: #6b7c7a;
    --ha-line: #d5e0dd;
    --ha-paper: #f4f7f6;
    --ha-card: #ffffff;
    --ha-accent: #0f766e;
    --ha-accent-2: #c45c26;
    --ha-shadow: 0 12px 32px rgba(28, 43, 42, 0.08);
    position: relative;
    padding: 28px 0 36px;
    margin: 28px 0 20px;
    overflow: visible;
}

.ha-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(15, 118, 110, 0.08), transparent 55%),
        radial-gradient(ellipse 70% 50% at 0% 100%, rgba(196, 92, 38, 0.06), transparent 50%),
        linear-gradient(180deg, var(--ha-paper) 0%, #eef3f1 100%);
    z-index: 0;
}

.ha-section .container {
    position: relative;
    z-index: 1;
}

.ha-head {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ha-line);
    direction: ltr;
}

.ha-head-copy {
    text-align: right;
    direction: rtl;
    flex: 1 1 auto;
}

.ha-kicker {
    display: inline-block;
    font-family: iransans, yekan, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ha-accent);
    margin-bottom: 6px;
}

.ha-title {
    margin: 0;
    font-family: yekan, iransans2, sans-serif;
    font-size: 26px;
    font-weight: bold;
    color: var(--ha-ink);
    line-height: 1.35;
}

.ha-sub {
    margin: 8px 0 0;
    font-family: iransans, yekan, sans-serif;
    font-size: 13px;
    color: var(--ha-muted);
    line-height: 1.7;
    max-width: 36em;
}

.ha-all {
    flex: 0 0 auto;
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--ha-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--ha-ink);
    font-family: yekan, iransans, sans-serif;
    font-size: 13px;
    text-decoration: none !important;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.ha-all:hover {
    background: var(--ha-accent);
    border-color: var(--ha-accent);
    color: #fff !important;
    transform: translateY(-1px);
}

.ha-all i {
    font-size: 12px;
    transition: transform 0.25s ease;
}

.ha-all:hover i {
    transform: translateX(-3px);
}

/* Magazine grid: featured sets height; left stack fits that height */
.ha-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.28fr);
    gap: 16px;
    align-items: stretch;
    direction: rtl;
}

.ha-featured {
    display: flex;
    flex-direction: column;
    height: auto;
    max-width: 100%;
    background: var(--ha-card);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(213, 224, 221, 0.9);
    box-shadow: var(--ha-shadow);
    text-decoration: none !important;
    color: inherit;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.ha-featured:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(28, 43, 42, 0.12);
}

.ha-featured-media {
    position: relative;
    flex: 0 0 auto;
    aspect-ratio: 16 / 11;
    max-height: 220px;
    overflow: hidden;
    background: #dbe5e2;
}

.ha-featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s ease;
}

.ha-featured:hover .ha-featured-media img {
    transform: scale(1.05);
}

.ha-featured-body {
    flex: 0 0 auto;
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    direction: rtl;
    text-align: right;
}

.ha-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-family: iransans, yekan, sans-serif;
    font-size: 12px;
    color: var(--ha-muted);
}

.ha-cat {
    color: var(--ha-accent);
    font-weight: 600;
}

.ha-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #b0bfbc;
}

.ha-featured-title {
    margin: 0;
    font-family: yekan, iransans2, sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: var(--ha-ink);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}

.ha-featured:hover .ha-featured-title {
    color: var(--ha-accent);
}

.ha-excerpt {
    margin: 0;
    font-family: iransans, yekan, sans-serif;
    font-size: 12px;
    line-height: 1.75;
    color: var(--ha-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ha-read {
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-family: yekan, iransans, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--ha-accent-2);
}

.ha-read i {
    font-size: 12px;
    transition: transform 0.25s ease;
}

.ha-featured:hover .ha-read i,
.ha-side-card:hover .ha-read i,
.ha-card:hover .ha-read i {
    transform: translateX(-4px);
}

/* Side stack: height follows featured (does not grow the section) */
.ha-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 0;
    min-height: 100%;
    min-width: 0;
    overflow: hidden;
}

.ha-side-card {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 0;
    flex: 1 1 0;
    min-height: 0;
    background: var(--ha-card);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(213, 224, 221, 0.9);
    box-shadow: 0 6px 18px rgba(28, 43, 42, 0.05);
    text-decoration: none !important;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    direction: rtl;
}

.ha-side-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(28, 43, 42, 0.1);
}

.ha-side-media {
    overflow: hidden;
    background: #dbe5e2;
}

.ha-side-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.ha-side-card:hover .ha-side-media img {
    transform: scale(1.06);
}

.ha-side-body {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    text-align: right;
    min-width: 0;
    overflow: hidden;
}

.ha-side-title {
    margin: 0;
    font-family: yekan, iransans2, sans-serif;
    font-size: 13px;
    font-weight: bold;
    color: var(--ha-ink);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}

.ha-side-card:hover .ha-side-title {
    color: var(--ha-accent);
}

.ha-side-body .ha-read {
    margin-top: 0;
    font-size: 11px;
}

.ha-side-body .ha-meta {
    font-size: 11px;
    gap: 6px;
}

/* Fallback equal grid when fewer than 2 articles use side stack only */
.ha-grid--flat {
    grid-template-columns: repeat(4, 1fr);
}

.ha-card {
    display: flex;
    flex-direction: column;
    background: var(--ha-card);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(213, 224, 221, 0.9);
    box-shadow: 0 6px 18px rgba(28, 43, 42, 0.05);
    text-decoration: none !important;
    color: inherit;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ha-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(28, 43, 42, 0.1);
}

.ha-card-media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #dbe5e2;
}

.ha-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.ha-card:hover .ha-card-media img {
    transform: scale(1.05);
}

.ha-card-body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    direction: rtl;
    text-align: right;
    flex: 1 1 auto;
}

.ha-card-title {
    margin: 0;
    font-family: yekan, iransans2, sans-serif;
    font-size: 15px;
    font-weight: bold;
    color: var(--ha-ink);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}

.ha-card:hover .ha-card-title {
    color: var(--ha-accent);
}

.ha-card-body .ha-read {
    margin-top: auto;
}

/* Entrance motion */
@keyframes ha-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ha-featured,
.ha-side-card,
.ha-card {
    animation: ha-rise 0.55s ease both;
}

.ha-side-card:nth-child(1) { animation-delay: 0.08s; }
.ha-side-card:nth-child(2) { animation-delay: 0.16s; }
.ha-side-card:nth-child(3) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
    .ha-featured,
    .ha-side-card,
    .ha-card,
    .ha-featured-media img,
    .ha-side-media img,
    .ha-card-media img {
        animation: none !important;
        transition: none !important;
    }
}

/* Tablet */
@media screen and (max-width: 991px) {
    .ha-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ha-featured {
        min-height: 0;
        flex-direction: row;
        direction: rtl;
    }

    .ha-featured-media {
        flex: 0 0 42%;
        min-height: 200px;
    }

    .ha-featured-body {
        flex: 1 1 auto;
        padding: 16px 18px;
        justify-content: center;
    }

    .ha-featured-title {
        font-size: 18px;
    }

    .ha-excerpt {
        -webkit-line-clamp: 2;
    }

    .ha-side {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 0;
        overflow: visible;
        gap: 12px;
    }

    .ha-side-card {
        flex: none;
        min-height: 110px;
        grid-template-columns: 110px 1fr;
    }

    .ha-side-body {
        padding: 12px 14px;
        gap: 6px;
    }

    .ha-side-title {
        font-size: 14px;
    }

    .ha-grid--flat {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media screen and (max-width: 767px) {
    .ha-section {
        padding: 18px 0 24px;
        margin: 16px 0 12px;
    }

    .ha-head {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .ha-title {
        font-size: 20px;
    }

    .ha-sub {
        font-size: 12px;
    }

    .ha-all {
        align-self: flex-start;
        padding: 8px 12px;
        font-size: 12px;
    }

    .ha-featured {
        flex-direction: column;
        border-radius: 14px;
    }

    .ha-featured-media {
        flex: none;
        width: 100%;
        aspect-ratio: 16 / 10;
        min-height: 0;
    }

    .ha-featured-body {
        padding: 14px;
    }

    .ha-featured-title {
        font-size: 16px;
    }

    .ha-excerpt {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .ha-side-card {
        grid-template-columns: 96px 1fr;
        flex: none;
        min-height: 96px;
        border-radius: 12px;
    }

    .ha-side-body {
        padding: 10px 12px;
    }

    .ha-side-title {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }

    .ha-grid--flat {
        grid-template-columns: 1fr;
    }

    .ha-card-title {
        font-size: 14px;
    }
}
