/*
|--------------------------------------------------------------------------
| Каталог статей — /articles
|--------------------------------------------------------------------------
| Для обновлённого app/Views/article.php.
| Общая пагинация оформляется в pagination.css.
|--------------------------------------------------------------------------
*/

.articles-hero,
.articles-hero *,
.articles-card,
.articles-card *,
.articles-empty,
.articles-empty * {
    box-sizing: border-box;
}

/* Шапка */

.articles-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(20px, 4vw, 48px);

    min-height: 220px;
    margin-bottom: 22px;
    padding: clamp(27px, 4vw, 44px);

    border: 1px solid var(--border, #d9e0ea);
    border-radius: 21px;

    background:
        radial-gradient(
            circle at 90% 15%,
            rgb(37 99 235 / 13%),
            transparent 38%
        ),
        var(--surface, #ffffff);

    box-shadow: 0 12px 32px rgb(15 23 42 / 5%);
}

.articles-hero::before {
    position: absolute;
    z-index: -1;
    right: -75px;
    bottom: -135px;

    width: 300px;
    height: 300px;

    border: 1px solid rgb(37 99 235 / 12%);
    border-radius: 50%;

    content: "";
    pointer-events: none;
}

.articles-hero-content {
    min-width: 0;
    max-width: 720px;
}

.articles-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    margin: 0 0 13px;

    color: var(--primary, #2563eb);

    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.4;
    text-transform: uppercase;
}

.articles-hero .eyebrow::before {
    width: 19px;
    height: 2px;

    border-radius: 2px;
    background: currentColor;

    content: "";
}

.articles-hero h1 {
    margin: 0;

    color: var(--text, #172033);

    font-size: clamp(2.1rem, 4.7vw, 3.55rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.1;
}

.articles-hero-description {
    max-width: 680px;
    margin: 17px 0 0;

    color: var(--text-soft, #64748b);

    font-size: 0.98rem;
    line-height: 1.7;
}

.articles-hero-symbol {
    display: grid;
    flex: 0 0 auto;
    place-items: center;

    width: clamp(84px, 12vw, 124px);
    aspect-ratio: 1;

    border: 1px solid rgb(37 99 235 / 24%);
    border-radius: 27px;

    background: var(--bg-soft, #eff6ff);
    color: var(--primary, #2563eb);

    font-size: clamp(2.3rem, 5vw, 3.5rem);
    line-height: 1;

    box-shadow: 0 15px 28px rgb(37 99 235 / 9%);
    transform: rotate(-6deg);
}

/* Карточки статей */

.articles-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.articles-card {
    display: flex;
    flex-direction: column;

    min-width: 0;
    overflow: hidden;

    border: 1px solid var(--border, #d9e0ea);
    border-radius: 17px;

    background: var(--surface, #ffffff);
    box-shadow: 0 8px 22px rgb(15 23 42 / 4%);

    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

.articles-card:hover {
    border-color: rgb(37 99 235 / 31%);

    box-shadow: 0 14px 29px rgb(15 23 42 / 7%);
    transform: translateY(-2px);
}

.articles-card-cover,
.articles-card-placeholder {
    display: grid;
    place-items: center;

    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;

    border-bottom: 1px solid var(--border, #d9e0ea);
}

.articles-card-cover {
    background: var(--bg-soft, #eff6ff);
}

.articles-card-cover img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    transition: transform 220ms ease;
}

.articles-card-cover:hover img {
    transform: scale(1.025);
}

.articles-card-cover:focus-visible {
    outline: 3px solid var(--primary, #2563eb);
    outline-offset: -3px;
}

.articles-card-placeholder {
    background:
        radial-gradient(
            circle at 75% 20%,
            rgb(37 99 235 / 15%),
            transparent 36%
        ),
        var(--bg-soft, #eff6ff);

    color: var(--primary, #2563eb);

    font-size: 3rem;
    line-height: 1;
}

.articles-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;

    min-width: 0;
    padding: clamp(19px, 2.8vw, 25px);
}

.articles-card-date {
    color: var(--text-faint, #94a3b8);

    font-size: 0.79rem;
    font-weight: 700;
    line-height: 1.4;
}

.articles-card-content h2 {
    margin: 9px 0 10px;

    color: var(--text, #172033);

    font-size: clamp(1.2rem, 2vw, 1.47rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.3;

    overflow-wrap: anywhere;
}

.articles-card-content h2 a {
    color: inherit;
    text-decoration: none;
}

.articles-card-content h2 a:hover {
    color: var(--primary, #2563eb);

    text-decoration: underline;
    text-underline-offset: 3px;
}

.articles-card-content h2 a:focus-visible {
    border-radius: 3px;
    outline: 2px solid var(--primary, #2563eb);
    outline-offset: 3px;
}

.articles-card-excerpt {
    margin: 0;

    color: var(--text-soft, #64748b);

    font-size: 0.91rem;
    line-height: 1.7;

    overflow-wrap: anywhere;
}

.articles-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    min-height: 34px;
    margin-top: auto;
    padding-top: 18px;

    color: var(--primary, #2563eb);

    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.4;
    text-decoration: none;
}

.articles-card-link:hover {
    color: var(--primary-hover, #1d4ed8);

    text-decoration: underline;
    text-underline-offset: 3px;
}

.articles-card-link:focus-visible {
    border-radius: 3px;
    outline: 2px solid var(--primary, #2563eb);
    outline-offset: 3px;
}

.articles-card-link span {
    transition: transform 160ms ease;
}

.articles-card-link:hover span {
    transform: translateX(3px);
}

.articles-pagination-info {
    margin: 24px 0 12px;

    color: var(--text-faint, #94a3b8);

    font-size: 0.82rem;
    line-height: 1.5;
    text-align: center;
}

/* Пустое состояние */

.articles-empty {
    display: grid;
    justify-items: center;

    padding: clamp(38px, 6vw, 62px) 24px;

    border: 1px dashed var(--border-strong, #b8c5d4);
    border-radius: 18px;

    background:
        radial-gradient(
            circle at 50% 0,
            rgb(37 99 235 / 7%),
            transparent 48%
        ),
        var(--surface, #ffffff);

    text-align: center;
}

.articles-empty > div {
    display: grid;
    place-items: center;

    width: 62px;
    height: 62px;
    margin-bottom: 17px;

    border: 1px solid rgb(37 99 235 / 15%);
    border-radius: 18px;

    background: var(--bg-soft, #eff6ff);
    color: var(--primary, #2563eb);

    font-size: 1.9rem;
    line-height: 1;
}

.articles-empty h2 {
    margin: 0;

    color: var(--text, #172033);

    font-size: 1.32rem;
    line-height: 1.3;
}

.articles-empty p {
    max-width: 500px;
    margin: 10px 0 0;

    color: var(--text-soft, #64748b);
    line-height: 1.65;
}

/* Мобильная версия */

@media (max-width: 760px) {
    .articles-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .articles-hero {
        min-height: 0;
        padding: 27px 24px;
        border-radius: 19px;
    }

    .articles-hero-symbol {
        width: 76px;
        border-radius: 21px;
        font-size: 2.2rem;
    }
}

@media (max-width: 520px) {
    .articles-hero {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 20px;

        padding: 24px 21px;
    }

    .articles-hero-symbol {
        width: 58px;
        border-radius: 17px;
        font-size: 1.75rem;
    }

    .articles-card-content {
        padding: 19px 17px;
    }
}

/* Тёмная тема */

html[data-theme="dark"] .articles-hero,
html[data-theme="dark"] .articles-card {
    box-shadow: none;
}

html[data-theme="dark"] .articles-hero-symbol,
html[data-theme="dark"] .articles-card-placeholder,
html[data-theme="dark"] .articles-empty > div {
    background-color: var(--bg-soft, #172033);
}

@media (prefers-reduced-motion: reduce) {
    .articles-card,
    .articles-card-cover img,
    .articles-card-link span {
        transition: none;
    }

    .articles-card:hover,
    .articles-card-cover:hover img,
    .articles-card-link:hover span {
        transform: none;
    }
}
