/* ===== Новости Master Clients: блок на главной, /news, новость, подписка (pages/news.php, partials/news_subscribe.php) ===== */
:root {
    --nw-ink: #1f1b2d;
    --nw-text: #4a4560;
    --nw-muted: #8a85a0;
    --nw-line: #ece8f4;
    --nw-violet: #7c5cbf;
    --nw-soft: #f4f1fb;
}

.nw-wrap, .nw-article { max-width: 1120px; margin: 0 auto; }
.nw-article { max-width: 820px; }
.nw-h2 { font-family: Manrope, system-ui, sans-serif; font-weight: 700; font-size: 26px; letter-spacing: -.02em; color: var(--nw-ink); margin: 44px 0 18px; }

/* ---------- блок на главной ---------- */
.nw-home { padding: 90px 0 70px; background: linear-gradient(180deg, #fff 0%, #faf8fe 100%); }
.nw-home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.nw-home-head .lp-text { margin: 0; max-width: 560px; }
.nw-home-head .lp-h2 { margin-bottom: 10px; }
.nw-home-all { flex: 0 0 auto; }

/* ---------- карточки ---------- */
.nw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.nw-card {
    --c: var(--nw-violet);
    position: relative;
    display: flex; flex-direction: column;
    background: #fff;
    border: 1px solid var(--nw-line);
    border-radius: 22px;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.nw-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(40, 28, 80, .1); border-color: color-mix(in srgb, var(--c) 30%, var(--nw-line)); }
.nw-card-pic { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: color-mix(in srgb, var(--c) 10%, #fff); }
.nw-card-pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.nw-card:hover .nw-card-pic img { transform: scale(1.03); }
.nw-card-ph {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    font-size: 54px; color: var(--c);
    background:
        radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--c) 22%, transparent) 0, transparent 55%),
        radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--c) 16%, transparent) 0, transparent 50%),
        color-mix(in srgb, var(--c) 7%, #fff);
}
.nw-card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.nw-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--nw-muted); margin-bottom: 10px; }
.nw-kind {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    font-weight: 600; font-size: 12px;
    color: var(--c, var(--nw-violet));
    background: color-mix(in srgb, var(--c, var(--nw-violet)) 11%, #fff);
    text-decoration: none;
}
a.nw-kind:hover { background: color-mix(in srgb, var(--c, var(--nw-violet)) 18%, #fff); }
.nw-card-title { font-family: Manrope, system-ui, sans-serif; font-size: 19px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; margin: 0 0 8px; }
.nw-card-title a { color: var(--nw-ink); text-decoration: none; }
.nw-card-title a::after { content: ""; position: absolute; inset: 0; } /* вся карточка — ссылка */
.nw-card-text { color: var(--nw-text); font-size: 15px; line-height: 1.55; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nw-card-more { margin-top: auto; font-weight: 600; font-size: 14px; color: var(--c); text-decoration: none; position: relative; z-index: 1; }
.nw-card-more i { transition: transform .2s ease; display: inline-block; }
.nw-card:hover .nw-card-more i { transform: translateX(3px); }

/* первая новость — крупно на две колонки */
.nw-card-lead { grid-column: span 2; flex-direction: row; }
.nw-card-lead .nw-card-pic { flex: 0 0 55%; aspect-ratio: auto; min-height: 280px; }
.nw-card-lead .nw-card-body { padding: 28px 28px 26px; justify-content: center; }
.nw-card-lead .nw-card-title { font-size: 24px; }
.nw-card-lead .nw-card-text { -webkit-line-clamp: 5; font-size: 16px; }
html[lang="hy"] .nw-card-title, html[lang="hy"] .nw-article-title, html[lang="hy"] .nw-h2 { font-family: "Noto Sans Armenian", system-ui, sans-serif; letter-spacing: 0; }

/* ---------- подписка ---------- */
.nw-sub {
    margin-top: 40px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 30px; align-items: center;
    padding: 30px 32px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 0% 0%, rgba(167, 123, 243, .18) 0, transparent 45%),
        radial-gradient(circle at 100% 100%, rgba(20, 184, 166, .12) 0, transparent 45%),
        #fff;
    border: 1px solid var(--nw-line);
    box-shadow: 0 14px 40px rgba(40, 28, 80, .06);
}
.nw-sub-copy { display: flex; gap: 16px; align-items: flex-start; }
.nw-sub-ico { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; color: #fff; background: linear-gradient(135deg, #7c5cbf, #a77bf3); box-shadow: 0 10px 22px rgba(124, 92, 191, .3); }
.nw-sub-title { font-family: Manrope, system-ui, sans-serif; font-size: 21px; font-weight: 700; color: var(--nw-ink); margin: 2px 0 6px; }
.nw-sub-text { margin: 0; color: var(--nw-text); font-size: 15px; line-height: 1.55; }
.nw-sub-row { display: flex; gap: 10px; }
.nw-sub-row .form-control { height: 50px; border-radius: 14px; border: 1.5px solid var(--nw-line); padding: 0 16px; font-size: 16px; }
.nw-sub-row .form-control:focus { border-color: var(--nw-violet); box-shadow: 0 0 0 4px rgba(124, 92, 191, .12); }
.nw-sub-row .lp-btn { flex: 0 0 auto; height: 50px; padding: 0 22px; border-radius: 14px; border: 0; }
.nw-sub-topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 10px; }
.nw-chip { --c: var(--nw-violet); position: relative; cursor: pointer; margin: 0; text-decoration: none; }
.nw-chip input { position: absolute; opacity: 0; pointer-events: none; }
.nw-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--nw-line); background: #fff; color: var(--nw-text); font-size: 13px; font-weight: 500; transition: .15s; }
.nw-chip:hover span { border-color: color-mix(in srgb, var(--c) 40%, var(--nw-line)); }
.nw-chip input:checked + span, .nw-chip.is-on span { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); color: var(--c); }
.nw-chip input:checked + span::before { content: "\F26E"; font-family: bootstrap-icons; font-size: 14px; line-height: 1; }
.nw-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(124, 92, 191, .25); }
.nw-sub-agree { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--nw-muted); line-height: 1.45; cursor: pointer; margin: 0; }
.nw-sub-agree input { margin-top: 2px; accent-color: var(--nw-violet); }
.nw-sub-agree input.is-invalid { outline: 2px solid #dc3545; outline-offset: 1px; }
.nw-sub-agree a { color: var(--nw-violet); }
.nw-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.nw-sub .form-alert { margin: 12px 0 0; font-size: 14px; border-radius: 12px; }
.nw-sub-strip { margin-top: 46px; }

/* ---------- список /news ---------- */
.nw-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.nw-head-text { color: var(--pg-muted, var(--nw-muted)); font-size: 17px; margin: 0; }
.nw-rss { color: #f97316; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.nw-rss:hover { color: #ea580c; }
.nw-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.nw-filter .nw-chip span { padding: 8px 14px; font-size: 14px; }
.nw-empty { text-align: center; padding: 60px 20px; color: var(--nw-muted); background: #fff; border: 1px dashed var(--nw-line); border-radius: 22px; }
.nw-empty i { font-size: 46px; color: #c9bfe6; display: block; margin-bottom: 10px; }
.nw-pager { display: flex; justify-content: center; gap: 6px; margin-top: 30px; flex-wrap: wrap; }
.nw-pager a, .nw-pager span { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--nw-line); background: #fff; color: var(--nw-ink); text-decoration: none; font-weight: 600; }
.nw-pager a:hover { border-color: var(--nw-violet); color: var(--nw-violet); }
.nw-pager .is-on { background: var(--nw-violet); border-color: var(--nw-violet); color: #fff; }

/* ---------- новость ---------- */
.nw-article-head { margin-bottom: 22px; }
.nw-article-title { font-family: Manrope, system-ui, sans-serif; font-weight: 800; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.12; letter-spacing: -.025em; color: var(--nw-ink); margin: 6px 0 14px; }
.nw-article-lead { font-size: 19px; line-height: 1.55; color: var(--nw-text); margin: 0; }
.nw-article-cover { margin: 0 0 24px; border-radius: 24px; overflow: hidden; background: var(--nw-soft); box-shadow: 0 20px 50px rgba(40, 28, 80, .12); }
.nw-article-cover img { width: 100%; height: auto; display: block; }
.nw-article-body { font-size: 17px; }
.nw-article-body img { max-width: 100%; height: auto; border-radius: 14px; }
.nw-article-body iframe { max-width: 100%; border-radius: 14px; }
.nw-article-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; }
.nw-share { display: flex; align-items: center; gap: 8px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--nw-line); color: var(--nw-muted); font-size: 14px; }
.nw-share a, .nw-share button { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--nw-line); background: #fff; color: var(--nw-text); font-size: 17px; text-decoration: none; transition: .15s; }
.nw-share a:hover, .nw-share button:hover { color: var(--nw-violet); border-color: var(--nw-violet); }

/* ---------- подтверждение и отписка ---------- */
.nw-state { max-width: 560px; margin: 30px auto; text-align: center; background: #fff; border: 1px solid var(--nw-line); border-radius: 26px; padding: 42px 32px 34px; box-shadow: 0 14px 40px rgba(40, 28, 80, .06); }
.nw-state-ico { width: 74px; height: 74px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; font-size: 34px; color: var(--nw-violet); background: var(--nw-soft); }
.nw-state-ico.is-ok { color: #16a34a; background: #e9f9ef; }
.nw-state-ico.is-muted { color: var(--nw-muted); background: #f3f2f7; }
.nw-state-title { font-family: Manrope, system-ui, sans-serif; font-weight: 800; font-size: 26px; color: var(--nw-ink); margin: 0 0 10px; }
.nw-state-text { color: var(--nw-text); font-size: 16px; line-height: 1.55; margin: 0 0 22px; }
.nw-state-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.nw-state .lp-btn { border: 0; }
.nw-state .lp-btn-light { border: 1.5px solid var(--nw-line); }
.nw-prefs { text-align: left; }
.nw-pref { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1px solid var(--nw-line); border-radius: 14px; margin-bottom: 8px; cursor: pointer; font-weight: 500; color: var(--nw-ink); }
.nw-pref .form-check-input { margin: 0; width: 20px; height: 20px; }
.nw-pref .form-check-input:checked { background-color: var(--nw-violet); border-color: var(--nw-violet); }
.nw-prefs .form-alert { margin-top: 12px; }

@media (max-width: 991.98px) {
    .nw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nw-card-lead { grid-column: span 2; }
    .nw-sub { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 767.98px) {
    .nw-home { padding: 60px 0 50px; }
    .nw-home-head { flex-direction: column; align-items: flex-start; }
    .nw-grid { grid-template-columns: 1fr; }
    .nw-card-lead { grid-column: auto; flex-direction: column; }
    .nw-card-lead .nw-card-pic { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
    .nw-card-lead .nw-card-body { padding: 20px 22px 22px; }
    .nw-card-lead .nw-card-title { font-size: 20px; }
    .nw-sub { padding: 22px 18px; }
    .nw-sub-row { flex-direction: column; }
    .nw-head { flex-direction: column; align-items: flex-start; }
    .nw-state { padding: 32px 20px 26px; }
}
