/* ==========================================================================
   ANDROIDI — блог / ProStore
   Хаб статей, карточки материалов, страница статьи.
   Подключается после styles.css и app.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ХАБ БЛОГА
   -------------------------------------------------------------------------- */
.prostore-head {
    padding: 22px 0 6px;
}

.prostore-head h1 {
    margin: 0 0 10px;
    font-size: clamp(26px, 3vw, 38px);
}

.prostore-head__desc {
    max-width: 720px;
    margin: 0 0 20px;
    color: var(--text-2);
    font-size: 15.5px;
}

/* Большая карточка «главная статья» */
.post-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 0;
    margin: 8px 0 34px;
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    background: var(--surface);
    overflow: hidden;
    color: var(--text);
    transition: transform .2s ease, box-shadow .2s ease;
}

.post-featured:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh-3);
    color: var(--text);
}

.post-featured__img {
    position: relative;
    min-height: 320px;
    background: var(--brand-grad);
    overflow: hidden;
}

.post-featured__img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.post-featured:hover .post-featured__img img {
    transform: scale(1.04);
}

.post-featured__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 34px 36px;
}

.post-featured__cat {
    display: inline-flex;
    align-self: flex-start;
    padding: 5px 12px;
    border-radius: var(--r-pill);
    background: var(--brand-100);
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
}

.post-featured__title a {
    color: inherit;
}

.post-featured__title {
    display: block;
    margin: 0;
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -.02em;
}

.post-featured__text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-2);
    font-size: 15px;
    line-height: 1.6;
}

.post-featured__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-top: 4px;
    color: var(--text-3);
    font-size: 13px;
}

.post-featured__meta span,
.post-featured__meta time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 820px) {
    .post-featured {
        grid-template-columns: 1fr;
    }

    .post-featured__img {
        min-height: 200px;
        aspect-ratio: 16 / 9;
    }

    .post-featured__body {
        padding: 20px;
    }
}

/* --------------------------------------------------------------------------
   2. СЕТКА СТАТЕЙ
   -------------------------------------------------------------------------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

@media (max-width: 560px) {
    .post-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.post-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh-2);
}

.post-card__img {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--brand-50);
    overflow: hidden;
}

.post-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.post-card:hover .post-card__img img {
    transform: scale(1.04);
}

.post-card__ph {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--brand-grad);
    opacity: .9;
}

.post-card__time {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: var(--r-pill);
    background: rgba(12, 14, 25, .62);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    backdrop-filter: blur(6px);
}

.post-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    padding: 16px 18px 18px;
}

.post-card__cat {
    align-self: flex-start;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
}

.post-card__title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.32;
    letter-spacing: -.015em;
}

.post-card__title a {
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__title a:hover {
    color: var(--brand);
}

.post-card__text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.55;
}

.post-card__meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: auto;
    padding-top: 6px;
    color: var(--text-3);
    font-size: 12.5px;
}

.post-card__meta span,
.post-card__meta time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* --------------------------------------------------------------------------
   3. МИНИ-СТРОКА (популярные, сайдбар)
   -------------------------------------------------------------------------- */
.post-mini {
    display: flex;
    gap: 12px;
    padding: 9px;
    border-radius: var(--r);
    color: var(--text);
    transition: background .16s;
}

.post-mini:hover {
    background: var(--surface-2);
    color: var(--text);
}

.post-mini__img {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--brand-50);
}

.post-mini__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-mini__body {
    min-width: 0;
}

.post-mini__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
}

.post-mini__meta {
    margin-top: 4px;
    color: var(--text-3);
    font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   4. СТРАНИЦА СТАТЬИ
   -------------------------------------------------------------------------- */
.article-page {
    padding: 6px 0 20px;
}

.article-page__head {
    max-width: 900px;
    margin: 0 auto 22px;
    text-align: center;
}

.article-page__cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    padding: 5px 13px;
    border-radius: var(--r-pill);
    background: var(--brand-100);
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
}

.article-page h1 {
    margin: 0 0 14px;
    font-size: clamp(26px, 3.4vw, 42px);
    line-height: 1.14;
}

.article-page__lead {
    max-width: 760px;
    margin: 0 auto 20px;
    color: var(--text-2);
    font-size: 17px;
    line-height: 1.6;
}

.article-page__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 18px;
    color: var(--text-3);
    font-size: 13.5px;
}

.article-page__meta span,
.article-page__meta time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-page__meta .author {
    color: var(--text);
    font-weight: 600;
}

.article-page__cover {
    max-width: 1060px;
    margin: 0 auto 30px;
    border-radius: var(--r-xl);
    overflow: hidden;
    background: var(--surface-2);
}

.article-page__cover img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.article-page__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px;
    align-items: start;
    max-width: 1120px;
    margin: 0 auto;
}

.article-page__body {
    min-width: 0;
    font-size: 17px;
    line-height: 1.75;
}

.article-page__body .dle-text {
    font-size: 17px;
    line-height: 1.75;
    color: var(--text);
}

.article-page__body .dle-text p {
    margin-bottom: 1.3em;
}

.article-page__body .dle-text h2 {
    margin-top: 2.2em;
    font-size: 26px;
}

.article-page__body .dle-text h3 {
    margin-top: 1.8em;
    font-size: 21px;
}

.article-page__body .dle-text img {
    border-radius: var(--r);
    margin: 1.6em 0;
}

.article-page__body .dle-text blockquote {
    margin: 1.8em 0;
    padding: 18px 22px;
    font-size: 18px;
}

.article-page__aside {
    position: sticky;
    top: calc(var(--header-h) + 18px);
    display: grid;
    gap: 18px;
}

.article-page__aside .aside-block {
    margin: 0;
}

/* Поделиться */
.article-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.article-share__label {
    margin-right: 6px;
    color: var(--text-3);
    font-size: 13px;
    font-weight: 600;
}

.article-share button,
.article-share a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
}

.article-share button:hover,
.article-share a:hover {
    border-color: var(--brand);
    color: var(--brand);
}

/* Автор */
.article-author {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 26px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
}

.article-author__ava {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--brand-grad);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.article-author__name {
    display: block;
    font-size: 15px;
    font-weight: 700;
}

.article-author__role {
    color: var(--text-3);
    font-size: 12.5px;
}

/* Оглавление */
.toc {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface-2);
}

.toc__title {
    margin: 0 0 10px;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}

.toc li {
    margin: 0 0 6px;
    counter-increment: toc;
    font-size: 13.5px;
    line-height: 1.4;
}

.toc a {
    display: flex;
    gap: 8px;
    color: var(--text-2);
}

.toc a::before {
    content: counter(toc) ".";
    color: var(--text-3);
    font-weight: 600;
}

.toc a:hover {
    color: var(--brand);
}

@media (max-width: 1024px) {
    .article-page__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .article-page__aside {
        position: static;
    }
}

@media (max-width: 720px) {
    .article-page__head {
        text-align: left;
    }

    .article-page__meta {
        justify-content: flex-start;
    }

    .article-page__cover {
        margin-bottom: 20px;
        border-radius: var(--r-lg);
    }

    .article-page__body,
    .article-page__body .dle-text {
        font-size: 16px;
    }
}

/* --------------------------------------------------------------------------
   5. ПОДВАЛ БЛОГА / CTA
   -------------------------------------------------------------------------- */
.prostore-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin: 40px 0 0;
    padding: 24px 26px;
    border-radius: var(--r-lg);
    background: var(--surface-brand);
}

.prostore-cta__text {
    flex: 1 1 320px;
}

.prostore-cta h3 {
    margin: 0 0 4px;
    font-size: 19px;
}

.prostore-cta p {
    margin: 0;
    color: var(--text-2);
    font-size: 14px;
}
