/* Дизайн "Вектор": Manrope за текста, Unbounded (широк гротеск) за заглавията, JetBrains Mono за етикети и дати.
   Акцентът идва от config/site.php (SITE_ACCENT). */
:root {
    --ink: #0F172A;
    --text: #36425A;
    --muted: #526077;
    --faint: #7F8BA3;
    --line: #E2E7F0;
    --soft: #F3F6FB;
    --ph: #E3EAF6;
    --accent: #0F2BDB;
    --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --wide: 'Unbounded', 'Manrope', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #FFFFFF; color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus { outline: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }
input, button { font: inherit; color: inherit; }
input { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
input::placeholder { color: var(--muted); opacity: 1; }
img { max-width: 100%; display: block; }
.hl:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: .3px; }
.muted { color: var(--muted); }
.mono-label { margin: 0; font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--muted); letter-spacing: 1px; }
.mono-kicker { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: 1px; }
.more { display: inline-flex; gap: 6px; align-items: center; min-height: 44px; font-family: var(--mono); font-size: 13px; }
.empty { border: 1px dashed var(--line); border-radius: 16px; padding: 48px 24px; text-align: center; color: var(--muted); }
.live { display: inline-flex; gap: 8px; align-items: center; color: var(--accent); }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live::before { animation: none; } }
.btn { min-height: 44px; padding: 0 18px; border-radius: 8px; background: var(--accent); color: #fff; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 14px; cursor: pointer; }
.btn:hover { color: #fff; background: var(--ink); }
.btn-block { width: 100%; }

/* ---------- Рамка: странична колона + съдържание ---------- */
.shell { display: flex; min-height: 100vh; }
.side-nav { flex: 0 0 280px; border-right: 1px solid var(--line); padding: 28px 20px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; min-width: 0; }
.logo:hover { color: var(--ink); }
.brand-logo { display: block; width: 100%; max-width: 240px; height: auto; }
.brand-name { font-family: var(--wide); font-weight: 700; font-size: 22px; letter-spacing: -.5px; line-height: 1.1; }
.mainnav { display: flex; flex-direction: column; gap: 2px; }
.mainnav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 15px; }
.mainnav a:hover { background: var(--soft); color: var(--ink); }
.mainnav a.on { background: #E6EBFF; color: var(--accent); }
.nav-dot { width: 8px; height: 8px; border-radius: 2px; border: 2px solid currentColor; flex-shrink: 0; }
.mainnav a.on .nav-dot { background: currentColor; }
.side-note { border-top: 1px solid var(--line); padding-top: 20px; display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.side-note p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); }

.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topline { border-bottom: 1px solid var(--line); padding: 14px 32px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.logo-m { display: none; }
.topline-info { display: flex; gap: 20px; align-items: center; color: var(--muted); }
.searchform { flex: 0 1 380px; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--muted); }
.searchform:focus-within { border-color: var(--accent); background: #fff; }
.searchform input { flex: 1; min-width: 0; background: none; border: 0; color: var(--ink); font-size: 15px; outline: none; }
.topline-btns { display: none; gap: 6px; }
.icon-btn { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }

.breaking { display: flex; gap: 14px; align-items: center; padding: 12px 32px; background: var(--accent); color: #fff; }
.breaking-label { background: #fff; color: var(--accent); padding: 4px 10px; border-radius: 6px; font-weight: 700; flex-shrink: 0; }
.breaking a { font-weight: 700; }
.breaking a:hover { color: #fff; text-decoration: underline; }

main.page { padding: 32px; display: flex; flex-direction: column; gap: 48px; width: 100%; max-width: 1320px; }

footer.site { margin-top: auto; border-top: 1px solid var(--line); padding: 24px 32px; display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); }
footer.site nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* ---------- Снимки и карти ---------- */
.thumb { position: relative; aspect-ratio: 16/9; background: var(--ph); overflow: hidden; border-radius: 12px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.r32 { aspect-ratio: 3/2; }
.thumb.r43 { aspect-ratio: 4/3; }
.thumb-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--faint); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 32px 24px; }
.card a { display: flex; flex-direction: column; gap: 12px; }
.card h3 { margin: 0; font-size: 18px; line-height: 1.35; font-weight: 700; }
.card .mono { font-size: 12px; }

/* ---------- Начална ---------- */
.hero { display: flex; flex-wrap: wrap; gap: 32px; align-items: stretch; }
.hero-card { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; justify-content: space-between; border: 1px solid var(--line); border-radius: 16px; padding: 32px; background: var(--soft); }
.hero-card:hover { color: var(--ink); border-color: var(--accent); }
.hero-txt { display: flex; flex-direction: column; gap: 18px; }
.hero h1, .hero h2 { overflow-wrap: anywhere; margin: 0; font-family: var(--wide); font-weight: 600; font-size: 38px; line-height: 1.14; letter-spacing: -1px; }
.hero p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--text); }
.hero-foot { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.round-arrow { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hero-img { flex: 1.3 1 420px; min-width: 0; min-height: 420px; display: flex; }
.hero-img .thumb { flex: 1; aspect-ratio: auto; border-radius: 16px; }

.split { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.split-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.split-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.tile { background: #fff; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.tile:hover { background: var(--soft); color: var(--ink); }
.tile h3 { margin: 0; font-family: var(--wide); font-weight: 500; font-size: 18px; line-height: 1.32; overflow-wrap: anywhere; }
.tile .mono { font-size: 12px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 20px; }
.timeline li { position: relative; }
.timeline li::before { content: ''; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #C9D3E3; }
.timeline li.now::before { background: var(--accent); }
.timeline time { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.timeline a { font-size: 15px; line-height: 1.45; font-weight: 600; }

.most { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.most li { border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.most .n { font-family: var(--wide); font-weight: 700; font-size: 30px; color: var(--accent); line-height: 1; }
.most a { font-size: 15px; line-height: 1.45; font-weight: 600; }

.row-block { display: flex; flex-direction: column; gap: 16px; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.row-head h2 { margin: 0; font-family: var(--wide); font-weight: 600; font-size: 24px; }

.views { border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-wrap: wrap; gap: 32px; }
.views-intro { flex: 1 1 220px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.views-intro h2 { margin: 0; font-family: var(--wide); font-weight: 600; font-size: 24px; }
.views-intro p { margin: 0; font-size: 15px; color: var(--text); }
.view { flex: 1 1 220px; display: flex; flex-direction: column; gap: 14px; border-left: 2px solid var(--accent); padding-left: 18px; }
.view .hl { font-size: 18px; line-height: 1.4; font-weight: 600; }

/* ---------- Статия ---------- */
.story { display: flex; flex-direction: column; gap: 36px; }
.article-head { display: flex; flex-direction: column; gap: 20px; max-width: 980px; }
.crumbs { display: flex; gap: 10px; color: var(--muted); flex-wrap: wrap; }
.crumbs a.on { color: var(--accent); }
.article-head h1 { margin: 0; font-family: var(--wide); font-weight: 600; font-size: 44px; line-height: 1.12; letter-spacing: -1.2px; }
.standfirst { margin: 0; font-size: 21px; line-height: 1.5; color: var(--text); max-width: 820px; }
figure.cover { margin: 0; display: flex; flex-direction: column; gap: 10px; }
figure.cover img { width: 100%; aspect-ratio: 21/9; object-fit: cover; border-radius: 16px; background: var(--ph); }
figure.cover figcaption { font-size: 12px; color: var(--muted); }

.article-grid { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.article-meta { flex: 0 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 16px; color: var(--muted); position: sticky; top: 24px; }
.author { display: flex; gap: 12px; align-items: center; font-family: var(--sans); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.author-name { display: block; font-weight: 700; font-size: 15px; color: var(--ink); }
.author-role { font-size: 13px; }
.meta-lines { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.share { border-top: 1px solid var(--line); padding-top: 14px; display: flex; gap: 8px; }
.share a, .share button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.share .accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.share a:hover, .share button:hover, .share .copied { background: var(--ink); border-color: var(--ink); color: #fff; }
.body { flex: 999 1 520px; min-width: 0; max-width: 700px; font-size: 19px; line-height: 1.75; color: #1E293B; }
.body p { margin: 0 0 1.1em; }
.body h2, .body h3 { font-family: var(--wide); font-weight: 600; line-height: 1.25; margin: 1.4em 0 .6em; }
.body h2 { font-size: 26px; }
.body h3 { font-size: 21px; }
.body a { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.body img { max-width: 100%; height: auto; border-radius: 12px; }
.body figure { margin: 1.6em 0; }
.body figcaption { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 8px; }
.body blockquote { margin: 1.6em 0; padding: 0 0 0 24px; border-left: 4px solid var(--accent); font-family: var(--wide); font-weight: 500; font-size: 22px; line-height: 1.4; }
.body blockquote p:last-child { margin: 0; }
.body ul, .body ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.body table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 1.5em 0; }
.body td, .body th { border: 1px solid var(--line); padding: 8px; }
.body iframe { max-width: 100%; }
.read-also { margin: 1.6em 0; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 12px; padding: 18px 22px; background: var(--soft); display: flex; flex-direction: column; gap: 8px; }
.read-also .kicker { font-family: var(--mono); font-weight: 700; font-size: 12px; letter-spacing: 1px; color: var(--accent); text-transform: uppercase; }
.read-also a { color: var(--ink) !important; text-decoration: none !important; font-weight: 700; font-size: 18px; line-height: 1.35; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tags a { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font-weight: 400; text-decoration: none !important; color: var(--ink) !important; }
.tags a:hover { border-color: var(--accent); color: var(--accent) !important; }
.source-box { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.source-box strong { color: var(--ink); }
.source-box a { color: var(--muted); font-weight: 400; }

.sidebar { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.side-box h2 { margin: 0 0 14px; font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.side-box ol { list-style: none; margin: 0; padding: 0; }
.side-box > ol:not(.timeline) li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.side-box .n { font-family: var(--wide); font-weight: 700; font-size: 20px; color: var(--accent); min-width: 26px; }
.side-box li a { font-size: 15px; line-height: 1.4; font-weight: 600; }
.side-box .timeline { padding-left: 16px; gap: 16px; }

/* ---------- Рубрика и списъци ---------- */
.cat-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.cat-head > div { display: flex; flex-direction: column; gap: 8px; }
.cat-head h1 { margin: 0; font-family: var(--wide); font-weight: 600; font-size: 44px; line-height: 1.1; letter-spacing: -1px; }
.cat-head p { margin: 0; font-size: 17px; color: var(--text); max-width: 720px; }
.cat-tabs { display: flex; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.cat-tabs a { padding: 10px 14px; border-radius: 7px; min-height: 40px; display: flex; align-items: center; }
.cat-tabs a.on { background: #fff; color: var(--accent); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }

.list-grid { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.list-main { flex: 999 1 600px; min-width: 0; }
.list-head { border-bottom: 1px solid var(--line); }
.list-head:empty { display: none; }
.row { border-bottom: 1px solid var(--line); }
.row a { display: flex; gap: 24px; padding: 20px 0; }
.row .thumb { flex: 0 0 220px; aspect-ratio: 3/2; }
.row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.row .kicker { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 1px; text-transform: uppercase; }
.row h3 { margin: 0; font-family: var(--wide); font-weight: 500; font-size: 19px; line-height: 1.32; }
.row p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text); }
.row .meta { display: flex; gap: 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.list-title { display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.list-title h1 { margin: 0; font-family: var(--wide); font-weight: 600; font-size: 40px; line-height: 1.12; letter-spacing: -1px; }
.list-title p { margin: 0; color: var(--muted); font-size: 16px; }
.list-title .kicker { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.list-title .searchform { flex: none; }
.list-title .searchform .field { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.list-title .searchform .btn { display: none; }

.pager { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 32px; font-family: var(--mono); }
.pager a, .pager span { min-width: 44px; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.pager span.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pager span.gap { border: 0; min-width: 20px; }
.pager span.off { color: var(--faint); }
.pager a:hover { border-color: var(--accent); }

/* ---------- Текстови страници ---------- */
.page-text { max-width: 760px; display: flex; flex-direction: column; gap: 24px; }
.prose { font-size: 17px; line-height: 1.7; color: #1E293B; }
.prose h2 { font-family: var(--wide); font-weight: 600; font-size: 22px; line-height: 1.3; margin: 1.8em 0 .5em; color: var(--ink); }
.prose p { margin: 0 0 1em; }
.prose ul { margin: 0 0 1em; padding-left: 1.3em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Дневник на API-то ---------- */
table.log { width: 100%; border-collapse: collapse; font-size: 13px; }
table.log th, table.log td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ok { color: #047857; font-weight: 600; } .bad { color: #b91c1c; font-weight: 600; }
details pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; background: var(--soft); padding: 8px; }

/* ---------- Таблет ---------- */
@media (max-width: 1100px) {
    .article-meta { position: static; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; gap: 16px 32px; align-items: center; }
    .article-meta .meta-lines, .article-meta .share { border-top: 0; padding-top: 0; }
    .sidebar { flex-basis: 100%; }
}

/* ---------- Мобилни: колоната става падащо меню ---------- */
@media (max-width: 900px) {
    .shell { display: block; }
    .side-nav { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100vh; background: #fff; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 0 100vmax rgba(15, 23, 42, 0); }
    .side-nav.open { transform: none; box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .35); }
    .topline { position: sticky; top: 0; z-index: 20; background: #fff; padding: 10px 16px; gap: 6px 12px; }
    .logo-m { display: flex; flex: 1; min-width: 0; }
    .logo-m .brand-logo { height: 40px; width: auto; max-width: 100%; }
    .topline-btns { display: flex; }
    .topline-info { order: 3; flex-basis: 100%; gap: 16px; font-size: 12px; }
    .searchform { order: 4; flex-basis: 100%; display: none; }
    .searchform.open { display: flex; }
    .breaking { padding: 12px 16px; flex-direction: column; align-items: flex-start; gap: 8px; }
    main.page { padding: 20px 16px 24px; gap: 32px; }
    footer.site { padding: 20px 16px; }
}
@media (max-width: 640px) {
    .hero { gap: 14px; flex-direction: column-reverse; }
    .hero-card, .hero-img { flex: none; width: 100%; }
    .tiles { grid-template-columns: 1fr; }
    .hero-card { border: 0; background: none; padding: 0; gap: 12px; }
    .hero-img { min-height: 0; }
    .hero-img .thumb { aspect-ratio: 4/3; border-radius: 14px; }
    .hero h1, .hero h2 { font-size: 25px; line-height: 1.18; letter-spacing: -.5px; }
    .hero p { display: none; }
    .round-arrow { display: none; }
    .tile { padding: 18px; }
    .tile h3 { font-size: 16px; }
    .cards { grid-template-columns: 1fr; gap: 24px; }
    .row-head h2, .views-intro h2 { font-size: 20px; }
    .views { padding: 20px; }
    .article-head h1 { font-size: 27px; letter-spacing: -.5px; }
    .standfirst { font-size: 18px; }
    figure.cover img { aspect-ratio: 4/3; border-radius: 14px; }
    .body { font-size: 18px; }
    .body h2 { font-size: 21px; }
    .body blockquote { font-size: 19px; }
    .cat-head h1, .list-title h1 { font-size: 30px; }
    .row a { gap: 14px; padding: 16px 0; }
    .row .thumb { flex-basis: 104px; aspect-ratio: 1; }
    .row h3 { font-size: 15px; }
    .row p { display: none; }
}
.hero h2 { font-size: 30px; line-height: 1.18; }
@media (max-width: 640px) { .hero h2 { font-size: 24px; } }

/* Знакът на сайта вместо инициали до "автора" (brand.mark). */
.avatar.avatar-mark { background: none; border: 0; padding: 0; overflow: hidden; border-radius: 10px; }
.avatar-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
