/* ═══════════════════════════════════════════════════════
   news.css — стили /news, /news/{slug}, /news/digest/{id}
   Дизайн-система «Лента» · Golos Text + JetBrains Mono
   ═══════════════════════════════════════════════════════ */

/* ── Back link ── */
.nw-back {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: color 150ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
    .nw-back:hover { color: var(--accent-dim); }
}
.nw-back:active { transform: scale(0.97); }

/* ── Article wrapper ── */
.nw-article {
    padding-top: 1.75rem;
    max-width: 720px;
    margin: 0 auto;
    padding-bottom: 3rem;
}

/* ── Inner pages: smaller hero padding ── */
.page-news-show .hero,
.page-news-digest .hero {
    padding: 2rem 0 1.5rem;
}

/* ── Digest title — tighter ── */
.page-news-digest .hero-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* ── Article meta ── */
.nw-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin: 1rem 0 .5rem;
    font-size: .78rem;
    color: var(--ink-2);
}

.nw-article-date {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: .75rem;
}

/* ── Article title ── */
.nw-article-title {
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
    margin: .5rem 0 1.5rem;
}

/* ── Article body ── */
.nw-article-body {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ink);
}

.nw-article-body p {
    margin: 0 0 1rem;
    text-wrap: pretty;
}

.nw-article-body h2,
.nw-article-body h3 {
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 2rem 0 .75rem;
}

.nw-article-body h2 { font-size: 1.35rem; }
.nw-article-body h3 { font-size: 1.1rem; }

.nw-article-body ul,
.nw-article-body ol {
    padding-left: 1.25rem;
    margin: 0 0 1rem;
}

.nw-article-body li {
    margin-bottom: .35rem;
}

.nw-article-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

.nw-article-body blockquote {
    border-left: 3px solid var(--line);
    margin: 1rem 0;
    padding: .5rem 0 .5rem 1.25rem;
    color: var(--ink-2);
    font-style: italic;
}

.nw-article-body strong {
    font-weight: 700;
}

/* ── Article cover image ── */
.nw-article-cover {
    float: right;
    margin: 0 0 1rem 1.5rem;
    max-width: 240px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.nw-article-cover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

@media (max-width: 560px) {
    .nw-article-cover {
        float: none;
        margin: 0 0 1rem;
        max-width: 100%;
    }
}

/* ── Badges ── */
.nw-badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 6px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    white-space: nowrap;
    background: var(--accent-soft);
    color: var(--accent);
}

.nw-badge--article {
    background: var(--tg-soft);
    color: var(--tg-text);
}

.nw-badge--regulation { background: #1e2a38; color: #6cb4f0; }
.nw-badge--deals { background: #1a2e1f; color: #5be49b; }
.nw-badge--tech { background: #2c2018; color: #f0a050; }
.nw-badge--market { background: #2c1a2e; color: #d07ff0; }

/* ── Toolbar (reactions + share) ── */
.nw-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin: 2rem 0;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    border: 1px solid var(--line);
}

.nw-reactions {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.nw-react-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .55rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink-2);
    font-size: .8rem;
    cursor: pointer;
    transition: border-color 150ms var(--ease-out), background 150ms var(--ease-out), transform 160ms var(--ease-out);
}

.nw-react-btn .emoji {
    font-size: 1rem;
    line-height: 1;
}

.nw-react-count {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: .72rem;
    min-width: .8rem;
    text-align: center;
}

@media (hover: hover) and (pointer: fine) {
    .nw-react-btn:hover {
        border-color: var(--muted);
        background: var(--surface);
    }
}

.nw-react-btn:active { transform: scale(0.95); }

.nw-react-btn.reacted {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.nw-toolbar-sep {
    width: 1px;
    height: 1.5rem;
    background: var(--line);
    flex-shrink: 0;
}

/* ── Share buttons ── */
.nw-share {
    display: flex;
    align-items: center;
    gap: .5rem;
    position: relative;
}

.nw-share-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .6rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink-2);
    font-size: .78rem;
    font-weight: 600;
    font-family: var(--sans);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 150ms var(--ease-out), background 150ms var(--ease-out), transform 160ms var(--ease-out);
}

.nw-share-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
    .nw-share-btn:hover {
        border-color: var(--muted);
        background: var(--surface);
    }
}

.nw-share-btn:active { transform: scale(0.95); }

.nw-share-btn--tg {
    border-color: var(--tg);
    color: var(--tg);
}

@media (hover: hover) and (pointer: fine) {
    .nw-share-btn--tg:hover {
        background: var(--tg-soft);
        border-color: var(--tg-dim);
    }
}

.nw-copied {
    position: absolute;
    right: 0;
    top: -1.5rem;
    font-size: .7rem;
    color: var(--money);
    font-weight: 600;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
    pointer-events: none;
}

.nw-copied.show {
    opacity: 1;
    transform: translateY(0);
}

/* ── Tags ── */
.nw-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: 1.5rem 0;
}

.nw-article-tag {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 6px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--ink-2);
    background: var(--bg-soft);
    border: 1px solid var(--line);
}

/* ── Source box ── */
.nw-source-box {
    margin: 1.5rem 0;
    font-size: .72rem;
    color: var(--ink-3);
    line-height: 1.4;
}

.nw-source-box-label {
    font-size: .72rem;
    color: var(--ink-3);
}

.nw-source-box-name {
    color: var(--ink-3);
}

.nw-source-box-link {
    color: var(--ink-3);
    text-decoration: none;
    font-family: var(--mono);
    font-size: .68rem;
}

@media (hover: hover) and (pointer: fine) {
    .nw-source-box-link:hover { text-decoration: underline; }
}

/* ── Related articles ── */
.nw-related {
    margin: 2.5rem 0 0;
}

.nw-related-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 1rem;
}

.nw-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem;
}

.nw-related-card {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
    transition: border-color 150ms var(--ease-out), transform 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .nw-related-card:hover {
        border-color: var(--muted);
    }
}

.nw-related-card:active { transform: scale(0.98); }

.nw-related-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
}

.nw-related-card-title {
    font-size: .85rem;
    font-weight: 650;
    line-height: 1.35;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nw-related-card-date {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: .68rem;
    color: var(--ink-2);
    margin-top: auto;
}

/* ═══ News listing page (/news) ═══ */

/* ── Digest card ── */
.nw-digest-card {
    display: block;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
    margin-bottom: 2rem;
    transition: border-color 150ms var(--ease-out), transform 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .nw-digest-card:hover {
        border-color: var(--muted);
    }
}

.nw-digest-card:active { transform: scale(0.99); }

.nw-digest-label {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent);
    margin-bottom: .35rem;
}

.nw-digest-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.3;
    color: var(--ink);
    margin: 0 0 .5rem;
}

.nw-digest-meta {
    font-size: .78rem;
    color: var(--ink-2);
}

.nw-digest-meta .mono {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
}

/* ── News rows ── */
.nw-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--line);
}

.nw-row {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    gap: .75rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--line);
    align-items: start;
}

.nw-row--has-img {
    grid-template-columns: 4.5rem 1fr 5rem;
}

.nw-date {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: .72rem;
    color: var(--ink-2);
    padding-top: .15rem;
    white-space: nowrap;
}

.nw-body {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-width: 0;
}

.nw-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem .5rem;
}

.nw-title-link {
    font-size: .92rem;
    font-weight: 650;
    line-height: 1.35;
    color: var(--ink);
    text-decoration: none;
    transition: color 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .nw-title-link:hover { color: var(--accent); }
}

.nw-source {
    font-size: .72rem;
    color: var(--ink-2);
}

.nw-source .mono {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
}

.nw-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}

.nw-tag {
    display: inline-block;
    padding: .1rem .45rem;
    border-radius: 4px;
    font-size: .65rem;
    font-weight: 600;
    color: var(--ink-2);
    background: var(--bg-soft);
}

.nw-thumb {
    width: 5rem;
    height: 5rem;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

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

/* ── Pager ── */
.nw-pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    font-size: .85rem;
    font-weight: 600;
}

.nw-pager a {
    color: var(--accent);
    text-decoration: none;
    transition: color 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .nw-pager a:hover { color: var(--accent-dim); }
}

.nw-pager .off {
    color: var(--ink-2);
    opacity: .4;
}

/* ── Empty state ── */
.empty {
    text-align: center;
    padding: 3rem 0;
    color: var(--ink-2);
    font-size: .95rem;
}

/* ═══ Digest page (/news/digest/{id}) ═══ */

.nd-meta {
    font-size: .82rem;
    color: var(--ink-2);
    margin-top: .5rem;
}

.nd-meta .mono {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
}

.nd-intro {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--ink);
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    border: 1px solid var(--line);
}

.nd-section {
    margin: 2rem 0;
}

.nd-section-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0 0 .75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--line);
}

.nd-items {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.nd-item {
    padding: .5rem 0;
    font-size: .92rem;
    line-height: 1.6;
    color: var(--ink);
}

.nd-item p {
    margin: 0 0 .35rem;
}

.nd-bottom {
    margin: 2rem 0;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    border: 1px solid var(--line);
}

.nd-bottom-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent);
    margin-bottom: .5rem;
}

.nd-bottom p {
    margin: 0;
    font-size: .95rem;
    line-height: 1.6;
}

/* ═══ Mobile ═══ */

@media (max-width: 640px) {
    .nw-article {
        padding-left: .5rem;
        padding-right: .5rem;
    }

    .nw-row {
        grid-template-columns: 3.5rem 1fr;
    }

    .nw-row--has-img {
        grid-template-columns: 3.5rem 1fr 4rem;
    }

    .nw-thumb {
        width: 4rem;
        height: 4rem;
    }

    .nw-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .nw-toolbar-sep {
        width: 100%;
        height: 1px;
    }

    .nw-share {
        flex-wrap: wrap;
    }

    .nw-digest-card {
        padding: 1rem;
    }

    .nw-related-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══ Reduced motion ═══ */

@media (prefers-reduced-motion: reduce) {
    .nw-back,
    .nw-react-btn,
    .nw-share-btn,
    .nw-title-link,
    .nw-related-card,
    .nw-digest-card,
    .nw-pager a {
        transition: none;
    }

    .nw-back:active,
    .nw-react-btn:active,
    .nw-share-btn:active,
    .nw-related-card:active,
    .nw-digest-card:active {
        transform: none;
    }
}
