/*
 * Блог и новини (templates/news.html, static/js/news.js). Built from the client's demo
 * (artec-novini.html). Scoped under .nw; the tokens below are redefined under html.dark, so the
 * page follows the navbar's dark switch.
 */
.nw {
  --red: #CF2E2E; --red-2: #E84545; --red-soft: #FDECEC;
  --ink: #171717; --on-ink: #fff; --muted: #5F6368; --line: #E8E9EB; --line-2: #D5D7DA;
  --bg: #fff; --alt: #F6F7F8; --card: #fff; --mark: #FFE58A;
  --night: #12171A;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --r: 18px; --shadow: 0 20px 44px rgba(0,0,0,.08); --ease: cubic-bezier(.2,.8,.2,1);
  color: var(--ink); background: var(--bg); line-height: 1.6; overflow-x: clip;
}
html.dark .nw {
  --red-soft: rgba(232,69,69,.15);
  --ink: #ECEFF1; --on-ink: #12171A; --muted: #A3ADB3; --line: rgba(255,255,255,.1); --line-2: rgba(255,255,255,.2);
  --bg: #171D21; --alt: #1B2226; --card: #222A2F; --mark: rgba(255,214,90,.35); --shadow: 0 20px 44px rgba(0,0,0,.35);
}
.nw a { color: inherit; text-decoration: none; }
.nw button { font: inherit; cursor: pointer; color: inherit; }
.nw img { display: block; max-width: 100%; }
.nw .wrap { max-width: 1220px; margin: 0 auto; padding: 0 20px; }
.nw .eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--red); font-weight: 600; }
.nw .eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; }
.nw h1, .nw h2, .nw h3 { letter-spacing: -.02em; line-height: 1.12; font-weight: 800; }
.nw .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 13px 24px; font-weight: 700; border: 2px solid transparent; transition: .2s; white-space: nowrap; line-height: 1.2; }
.nw .btn-red { background: var(--red); color: #fff; }
.nw .btn-red:hover { background: var(--red-2); transform: translateY(-2px); }
.nw .btn-line { border-color: var(--ink); color: var(--ink); background: transparent; }
.nw .btn-line:hover { background: var(--ink); color: var(--on-ink); }
.nw .link-red { color: var(--red); font-weight: 700; white-space: nowrap; }
.nw section { padding: 80px 0; position: relative; }
.nw section[id] { scroll-margin-top: 88px; }
@media (max-width: 1023px) { .nw section[id] { scroll-margin-top: 56px; } }
.nw .alt { background: var(--alt); }
.nw .badge { display: inline-block; font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; font-weight: 600; padding: 5px 10px; border-radius: 6px; background: var(--red); color: #fff; text-transform: uppercase; line-height: 1.3; }
.nw .badge.l { background: var(--red-soft); color: var(--red); }
html.dark .nw .badge.l { color: #FF8A8A; }
.nw .go { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.nw .go svg { width: 18px; height: 18px; transition: transform .25s; }
.nw a:hover .go svg { transform: translateX(5px); }

/* ===== HERO ===== */
.nw .top { padding: 56px 0 30px; position: relative; overflow: hidden; }
.nw .top::after { content: ""; position: absolute; right: -140px; top: -160px; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(207,46,46,.09), transparent 65%); pointer-events: none; }
html.dark .nw .top::after { background: radial-gradient(circle, rgba(207,46,46,.18), transparent 65%); }
.nw .crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 22px; }
.nw .crumbs a:hover { color: var(--red); }
.nw .top h1 { font-size: clamp(2.3rem, 5.2vw, 4.1rem); margin: 14px 0; max-width: 860px; }
.nw .top h1 em { font-style: normal; color: var(--red); }
html.dark .nw .top h1 em { color: var(--red-2); }
.nw .intro { color: var(--muted); font-size: 1.12rem; max-width: 620px; }
.nw .tools { display: flex; gap: 14px; align-items: center; margin-top: 32px; flex-wrap: wrap; position: relative; z-index: 1; }
.nw .search { position: relative; flex: 1; min-width: 260px; max-width: 420px; }
.nw .search input { width: 100%; font: inherit; color: var(--ink); border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 13px 44px 13px 46px; transition: .2s; }
.nw .search input::placeholder { color: var(--muted); opacity: .8; }
.nw .search input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(207,46,46,.12); }
.nw .search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.nw .search svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.nw .search kbd { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: .7rem; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; color: var(--muted); pointer-events: none; }
.nw .search input:focus ~ kbd, .nw .search input:not(:placeholder-shown) ~ kbd { opacity: 0; }
.nw .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.nw .chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 15px; font-size: .9rem; font-weight: 600; transition: .15s; display: inline-flex; gap: 8px; align-items: center; }
.nw .chip:hover { border-color: var(--ink); }
.nw .chip.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.nw .chip i { font-style: normal; font-family: var(--mono); font-size: .72rem; opacity: .55; }
@media (max-width: 700px) {
  .nw .top { padding-top: 32px; }
  .nw .search { max-width: none; min-width: 0; flex-basis: 100%; }
  .nw .search kbd { display: none; }
  .nw .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 6px; scrollbar-width: none; }
  .nw .chips::-webkit-scrollbar { display: none; }
  .nw .chip { flex: none; }
}

/* featured + recommended */
.nw .feat { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; margin-top: 34px; }
.nw .hero-card { position: relative; border-radius: 24px; overflow: hidden; min-height: 480px; display: flex; align-items: flex-end; color: #fff; isolation: isolate; }
.nw .hero-card .im { position: absolute; inset: 0; z-index: -2; background: #20282D; }
.nw .hero-card .im img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.nw .hero-card:hover .im img { transform: scale(1.05); }
.nw .hero-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10,13,15,.05) 0%, rgba(10,13,15,.6) 42%, rgba(10,13,15,.96) 100%); }
.nw .hero-card .tx { padding: 34px; }
.nw .hero-card .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .85rem; color: #E6EAEC; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.nw .hero-card h2, .nw .hero-card p { text-shadow: 0 2px 16px rgba(0,0,0,.45); }
.nw .hero-card h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin: 12px 0 10px; max-width: 660px; }
.nw .hero-card p { color: #D5DADD; max-width: 560px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nw .hero-card .go { margin-top: 18px; }
.nw .side { display: grid; gap: 14px; align-content: start; }
.nw .side .lbl { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin-bottom: -2px; }
.nw .mini { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 18px; padding: 12px; background: var(--card); transition: .25s; }
.nw .mini:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--line-2); }
.nw .mini .im { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--alt); }
.nw .mini .im img { width: 100%; height: 100%; object-fit: cover; }
.nw .mini h3 { font-size: 1.02rem; margin: 6px 0 2px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nw .mini small { color: var(--muted); font-size: .8rem; }
@media (max-width: 900px) {
  .nw .feat { grid-template-columns: 1fr; }
  .nw .hero-card { min-height: 400px; }
  .nw .hero-card .tx { padding: 24px; }
  .nw .mini { grid-template-columns: 104px 1fr; }
}

/* ===== SECTION HEADS ===== */
.nw .shead { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.nw .shead h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-top: 10px; }
.nw .shead p { color: var(--muted); max-width: 520px; }

/* ===== GRID ===== */
.nw .all { padding-top: 56px; }
.nw .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.nw .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: transform .35s var(--ease), box-shadow .35s, opacity .35s; }
.nw .card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.nw .card .im { aspect-ratio: 16 / 10; overflow: hidden; background: var(--alt); position: relative; }
.nw .card .im img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.nw .card:hover .im img { transform: scale(1.06); }
.nw .card .im .badge { position: absolute; left: 14px; top: 14px; background: rgba(255,255,255,.94); color: var(--red); }
html.dark .nw .card .im .badge { background: rgba(18,23,26,.88); color: #FF8A8A; }
.nw .card .bd { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.nw .card .meta { font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.nw .card h3 { font-size: 1.14rem; margin-bottom: 8px; }
.nw .card p { color: var(--muted); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nw .card .go { margin-top: auto; padding-top: 16px; color: var(--red); font-size: .95rem; }
html.dark .nw .card .go { color: #FF7A7A; }
.nw .card.hide { display: none; }
.nw .card.fade { opacity: 0; transform: translateY(14px); }
.nw mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; }
.nw .count { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.nw .empty { text-align: center; padding: 50px 20px; border: 2px dashed var(--line); border-radius: var(--r); color: var(--muted); }
.nw .empty b { display: block; color: var(--ink); font-size: 1.15rem; margin-bottom: 6px; }
.nw .empty a { color: var(--red); font-weight: 700; }
.nw .more { text-align: center; margin-top: 40px; }
.nw .more[hidden] { display: none; }
@media (max-width: 980px) { .nw .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .nw .grid { grid-template-columns: 1fr; gap: 16px; } }

/* ===== PROJECTS (our photos, darkened) ===== */
.nw .projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.nw .proj { position: relative; border-radius: var(--r); overflow: hidden; min-height: 340px; background: #20282D; color: #fff; padding: 26px; display: flex; flex-direction: column; justify-content: flex-end; isolation: isolate; }
.nw .proj img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1s var(--ease); }
.nw .proj::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10,13,15,.1) 0%, rgba(10,13,15,.55) 45%, rgba(10,13,15,.95) 100%); }
.nw .proj:hover img { transform: scale(1.06); }
.nw .proj small { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; color: #FF9A9A; }
.nw .proj h3 { font-size: 1.3rem; margin-top: 8px; }
.nw .proj .kpis { display: flex; gap: 22px; margin: 14px 0 4px; }
.nw .proj .kpis b { display: block; font-size: 1.15rem; line-height: 1.1; }
.nw .proj .kpis span { font-size: .78rem; color: #AEB7BC; }
.nw .proj .go { margin-top: 14px; }
@media (max-width: 900px) { .nw .projects { grid-template-columns: 1fr; } .nw .proj { min-height: 280px; } }

/* ===== SERIES ===== */
.nw .series { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.nw .ser { border: 1px solid var(--line); border-radius: 22px; padding: 28px; background: var(--card); }
.nw .ser h3 { font-size: 1.35rem; margin: 10px 0 6px; }
.nw .ser > p { color: var(--muted); margin-bottom: 16px; }
.nw .ser ol { list-style: none; display: grid; gap: 2px; margin: 0 -8px; padding: 0; }
.nw .ser li a { display: grid; grid-template-columns: 34px 1fr 20px; gap: 10px; align-items: center; padding: 11px 8px; border-radius: 12px; transition: .2s; }
.nw .ser li a:hover { background: var(--alt); }
.nw .ser li .n { font-family: var(--mono); font-weight: 600; color: var(--red); font-size: .88rem; }
.nw .ser li b { font-weight: 600; font-size: .95rem; line-height: 1.35; }
.nw .ser li svg { width: 18px; height: 18px; color: var(--muted); transition: .25s; }
.nw .ser li a:hover svg { transform: translateX(4px); color: var(--red); }
@media (max-width: 1060px) { .nw .series { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .nw .series { grid-template-columns: 1fr; } .nw .ser { padding: 22px 20px; } }

/* ===== NEXT STEPS ===== */
.nw .next { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.nw .nx { border-radius: 20px; padding: 28px; border: 1px solid var(--line); background: var(--card); transition: .25s; display: flex; flex-direction: column; }
.nw .nx:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.nw .nx .ic { width: 50px; height: 50px; border-radius: 14px; background: var(--red-soft); display: grid; place-items: center; margin-bottom: 18px; }
.nw .nx .ic svg { width: 26px; height: 26px; color: var(--red); }
.nw .nx h3 { font-size: 1.2rem; margin-bottom: 6px; }
.nw .nx p { color: var(--muted); font-size: .95rem; }
.nw .nx .go { color: var(--red); margin-top: auto; padding-top: 16px; }
@media (max-width: 900px) { .nw .next { grid-template-columns: 1fr; } }

/* ===== reveal ===== */
.nw .rv { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.nw .rv.in { opacity: 1; transform: none; }
.nw .rv.in:hover { transition-duration: .25s; }
.nw .nx.rv.in:hover { transform: translateY(-4px); }
@media (prefers-reduced-motion: reduce) {
  .nw *, .nw *::before { transition: none !important; animation: none !important; }
  .nw .rv { opacity: 1; transform: none; }
}
