/* WhiteListed Press (WLPress) — wlpress.xyz. Токены — из брендбука WhiteListed Chat (brand/tokens.css):
   светлая «бумага» для чтения в интернете, тёмный «ночной» цвет мессенджера —
   там, где читатель переходит в сам WhiteListed Chat (блок приглашения). */

:root {
  --wl-blue: #2b82cb;          /* фирменный синий: знак, акценты */
  --wl-blue-ink: #1f6fb2;      /* синий для текста и кнопок на светлом (контраст ≥ 4.5) */
  --wl-night: #0e1621;         /* фон мессенджера */
  --wl-night-2: #1c2733;       /* поверхности мессенджера */
  --wl-night-line: #2a3a4a;
  --wl-mist: #8b9ab0;          /* вторичный текст в мессенджере */

  --paper: #f5f8fb;
  --paper-2: #ffffff;
  --ink: #0e1621;
  --ink-2: #33414f;
  --muted: #5b6b7f;
  --rule: #dce3ea;
  --link: var(--wl-blue-ink);
  --focus: var(--wl-blue);
  --ok: #1e7a46;
  --err: #b42318;
  --invite-bg: var(--wl-night);
  --invite-ink: #ffffff;
  --invite-muted: #cdd9e5;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, "PT Serif", serif;
  --measure: 40rem;
  --radius-s: 8px;
  --radius-m: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1621;
    --paper-2: #141e2a;
    --ink: #e6edf5;
    --ink-2: #cdd9e5;
    --muted: #8b9ab0;
    --rule: #2a3a4a;
    --link: #6cb4ee;
    --ok: #5fd08a;
    --err: #f87171;
    --invite-bg: #13283b;
    --invite-muted: #a8c4dd;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--paper-2); padding: 8px 12px; }

/* ── Знак WL ── */
.mark { width: 30px; height: 30px; flex: none; }
.mark-bg { fill: var(--wl-blue); }
.mark-stroke { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.check { width: 15px; height: 15px; margin-left: 5px; vertical-align: -2px; }
.check circle { fill: var(--wl-blue); }
.check path { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── Шапка ── */
.site { background: var(--paper); border-bottom: 1px solid var(--rule); }
.site-in, .sections-in, .wrap, .foot-in, .invite-in { max-width: 66rem; margin: 0 auto; padding: 0 16px; }
.site-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.wordmark { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.who { color: var(--muted); font-size: 15px; max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-link { font-size: 15px; font-weight: 600; }
.sections { border-top: 1px solid var(--rule); }
.sections-in { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.sections-in::-webkit-scrollbar { display: none; }
.sections a { display: inline-block; padding: 11px 0 9px; color: var(--ink-2); text-decoration: none; font-size: 15px; border-bottom: 2px solid transparent; }
.sections a:hover { color: var(--ink); }
.sections a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--wl-blue); font-weight: 600; }

/* ── Лента ── */
.wrap { padding-top: 32px; padding-bottom: 56px; }
.page-head { max-width: var(--measure); margin-bottom: 8px; }
.page-head h1 { font-size: clamp(28px, 4.4vw, 40px); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 12px; font-weight: 750; }
.page-intro { font: 19px/1.55 var(--serif); color: var(--ink-2); margin: 0; }
.page-num { color: var(--muted); margin: 10px 0 0; font-size: 15px; }

.feed { max-width: 48rem; }
.entry { display: grid; grid-template-columns: 1fr auto; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--rule); }
.entry:last-child { border-bottom: 0; }
.entry-channel { display: inline-block; font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; margin-bottom: 6px; }
.entry-channel:hover { color: var(--link); }
.entry-title { font-size: 22px; line-height: 1.25; letter-spacing: -0.012em; margin: 0 0 8px; font-weight: 700; }
.entry-title a { color: var(--ink); text-decoration: none; }
.entry-title a:hover { color: var(--link); text-decoration: underline; }
.entry-summary { font: 17px/1.55 var(--serif); color: var(--ink-2); margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.entry-meta a { color: var(--muted); }
.entry-thumb { width: 184px; aspect-ratio: 3 / 2; border-radius: var(--radius-m); overflow: hidden; background: var(--rule); align-self: start; margin-top: 4px; }
.entry-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.empty { padding: 40px 0; color: var(--ink-2); font: 18px/1.6 var(--serif); max-width: var(--measure); }

.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 32px 0 0; }
.pg { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--rule); border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-size: 15px; }
.pg:hover { border-color: var(--wl-blue); }
.pg-cur { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 600; }
.pg-gap { color: var(--muted); padding: 0 4px; }

.feed-layout { display: grid; grid-template-columns: minmax(0, 48rem); gap: 0 64px; }
.tag-cloud { margin-top: 48px; max-width: 48rem; }
@media (min-width: 1024px) {
  .feed-layout { grid-template-columns: minmax(0, 48rem) minmax(12rem, 15rem); }
  .tag-cloud { margin-top: 28px; position: sticky; top: 24px; align-self: start; }
}
.tag-cloud h2 { font-size: 17px; margin: 0 0 12px; }
.tag-cloud ul, .post-tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.tag-cloud a, .post-tags a { color: var(--ink-2); text-decoration: none; font-size: 15px; }
.tag-cloud a:hover, .post-tags a:hover { color: var(--link); text-decoration: underline; }
.tag-cloud a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ── Статья ── */
.wrap-post { max-width: 44rem; }
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.crumbs a { color: var(--muted); }
.post-channel { display: inline-block; font-weight: 650; font-size: 15px; color: var(--ink-2); text-decoration: none; margin-bottom: 10px; }
.post-channel:hover { color: var(--link); }
.post-title { font-size: clamp(30px, 5.2vw, 46px); line-height: 1.1; letter-spacing: -0.022em; font-weight: 780; margin: 0 0 16px; }
.post-lede { font: 21px/1.5 var(--serif); color: var(--ink-2); margin: 0 0 16px; }
.post-byline { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.post-cover { margin: 0 0 32px; }
.post-cover img { display: block; width: 100%; border-radius: var(--radius-m); background: var(--rule); }
.post-body { font: 19px/1.72 var(--serif); color: var(--ink); }
.post-body p { margin: 0 0 1.1em; }
.post-body h2 { font: 700 26px/1.25 var(--sans); letter-spacing: -0.015em; margin: 1.6em 0 0.5em; }
.post-body h3 { font: 700 21px/1.3 var(--sans); margin: 1.4em 0 0.4em; }
.post-body blockquote { margin: 1.4em 0; padding: 2px 0 2px 20px; border-left: 3px solid var(--wl-blue); color: var(--ink-2); font-style: italic; }
.post-body ul, .post-body ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.post-body li { margin-bottom: 0.35em; }
.post-body .art-img { display: block; width: 100%; border-radius: var(--radius-s); margin: 0.4em 0; }
.post-tags { margin: 28px 0 0; }

.flash { margin: 28px 0 0; padding: 12px 14px; border-radius: var(--radius-s); font-size: 15px; border: 1px solid; }
.flash-ok { color: var(--ok); border-color: currentColor; }
.flash-err { color: var(--err); border-color: currentColor; }

.sec-title { font-size: 20px; letter-spacing: -0.01em; margin: 0 0 14px; }
.sec-count { color: var(--muted); font-weight: 500; }

.reactions { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--rule); }
.rx-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rx { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper-2); color: var(--ink); font: inherit; font-size: 17px; }
button.rx { cursor: pointer; }
button.rx:hover { border-color: var(--wl-blue); }
.rx-n { font-size: 15px; font-variant-numeric: tabular-nums; }
.rx-zero .rx-n { color: var(--muted); }
.rx-mine { border-color: var(--wl-blue); box-shadow: inset 0 0 0 1px var(--wl-blue); }

.comments { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--rule); }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.comment:last-child { border-bottom: 0; }
.c-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.c-author { font-weight: 650; }
.c-head time { color: var(--muted); font-size: 13px; }
.c-reply-to { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.c-text { margin-top: 6px; font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.c-reply { display: inline-block; margin-top: 6px; font-size: 14px; }
.c-empty, .c-more { color: var(--muted); font-size: 15px; }

.signin-plaque { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; padding: 18px 20px; border: 1px solid var(--rule); border-left: 3px solid var(--wl-blue); border-radius: var(--radius-s); background: var(--paper-2); }
.signin-plaque p { margin: 0; flex: 1 1 18rem; font-size: 16px; line-height: 1.5; color: var(--ink-2); }

.c-form { display: flex; flex-direction: column; gap: 8px; }
.c-form label { font-weight: 650; font-size: 15px; }
.c-form textarea { width: 100%; min-height: 110px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--paper-2); color: var(--ink); font: 16px/1.5 var(--sans); resize: vertical; }
.c-form textarea:focus { border-color: var(--wl-blue); outline: none; box-shadow: 0 0 0 3px rgba(43, 130, 203, 0.25); }
.c-form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.c-as { color: var(--muted); font-size: 14px; flex: 1 1 16rem; }
.c-as > span { display: block; }
.c-replying { margin: 0; font-size: 14px; color: var(--ink-2); }
.logout { margin-top: 12px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: var(--radius-s); border: 1px solid var(--wl-blue-ink); background: var(--wl-blue-ink); color: #fff; font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: #185d96; border-color: #185d96; text-decoration: none; }

.message { max-width: var(--measure); padding: 24px 0; }
.message h1 { font-size: clamp(28px, 4.4vw, 38px); letter-spacing: -0.02em; margin: 0 0 12px; }
.message p { font: 18px/1.6 var(--serif); color: var(--ink-2); }

/* ── Приглашение: вход в мессенджер (единственный тёмный блок страницы) ── */
.invite {
  position: relative;
  overflow: hidden;
  background: var(--invite-bg);
  color: var(--invite-ink);
}
.invite::after {
  /* крупный штрих знака WL — водяной знак справа */
  content: "";
  position: absolute;
  right: -40px;
  bottom: -70px;
  width: 360px;
  height: 360px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M13 21 19 43 25 21 31 43 37 21M44 21V43h9' fill='none' stroke='%232b82cb' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  opacity: 0.22;
  pointer-events: none;
}
.invite-in { position: relative; z-index: 1; padding-top: 48px; padding-bottom: 52px; }
.invite-post .invite-in { max-width: 44rem; }
.invite-in > * { max-width: 34rem; }
.invite-mark { width: 44px; height: 44px; margin-bottom: 18px; }
.invite-lead { font-size: clamp(21px, 3vw, 26px); line-height: 1.3; font-weight: 650; letter-spacing: -0.012em; margin: 0 0 6px; }
.invite-tag { font: 19px/1.45 var(--serif); color: var(--invite-muted); margin: 0 0 24px; }
.invite-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-invert { background: #fff; border-color: #fff; color: var(--wl-night); }
.btn-invert:hover { background: #e6edf5; border-color: #e6edf5; }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: #fff; }
.invite :focus-visible { outline-color: #fff; }

/* ── Подвал ── */
.site-foot { background: var(--paper); border-top: 1px solid var(--rule); }
.foot-in { padding-top: 24px; padding-bottom: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; color: var(--muted); font-size: 14px; }
.foot-in p { margin: 0; max-width: 34rem; }
.foot-in nav { display: flex; gap: 18px; }
.foot-in a { color: var(--muted); }

@media (max-width: 640px) {
  .wrap { padding-top: 24px; }
  .entry { grid-template-columns: 1fr 104px; gap: 14px; padding: 22px 0; }
  .entry-thumb { width: 104px; aspect-ratio: 1 / 1; }
  .entry-title { font-size: 19px; }
  .entry-summary { font-size: 16px; -webkit-line-clamp: 2; }
  .post-body { font-size: 18px; }
  .post-lede { font-size: 19px; }
  .invite::after { width: 240px; height: 240px; right: -50px; bottom: -60px; }
}

@media print {
  .site, .invite, .site-foot, .comments, .reactions, .pager { display: none; }
  body { background: #fff; color: #000; }
}
