/* Сайт зеркала каналов vigle.ru: лёгкий, без скриптов; светлая и тёмная тема. */
:root {
  --bg: #f7f7f5;
  --card: #ffffff;
  --text: #1c1d1f;
  --muted: #6b6f76;
  --line: #e3e3df;
  --accent: #2f5bd8;
  --accent-text: #ffffff;
  --badge: #ece9ff;
  --badge-text: #4a3aa8;
  --shade: #e9e9e5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141517;
    --card: #1d1f22;
    --text: #e8e8e6;
    --muted: #9a9ea6;
    --line: #2e3136;
    --accent: #7c9cff;
    --accent-text: #0f1320;
    --badge: #2c2850;
    --badge-text: #c9c1ff;
    --shade: #26292d;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: anywhere;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .4rem; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 2rem 0 .8rem; }
p { margin: 0 0 1rem; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.muted, .meta { color: var(--muted); }
.meta { font-size: .95rem; }

.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top .wrap { display: flex; align-items: center; min-height: 52px; }
.logo { font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; letter-spacing: .02em; padding: 10px 0; }
main.wrap { padding-top: 20px; padding-bottom: 32px; }

.badge {
  display: inline-block; vertical-align: middle;
  font-size: .7rem; font-weight: 700; line-height: 1; letter-spacing: .04em;
  padding: 4px 6px; border-radius: 6px;
  background: var(--badge); color: var(--badge-text);
}

.crumbs { font-size: .9rem; line-height: 2.2; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); padding: 8px 0; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 18px; border-radius: 10px;
  background: var(--accent); color: var(--accent-text);
  font-weight: 600; text-decoration: none; text-align: center;
}
.button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }

.channels { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.channel-card, .card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.card-link { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; min-height: 44px; }
.card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.channel-card .card-link { padding: 14px 16px; }
.channel-name { font-weight: 650; font-size: 1.1rem; }

.feed { display: grid; gap: 14px; }
.card-img { display: block; background: var(--shade); }
.card-img img { width: 100%; max-height: 420px; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px 14px; min-width: 0; }
.card-body time { font-size: .9rem; }
.excerpt { white-space: pre-line; }

.channel-head { margin-bottom: 18px; }
.channel-head .meta a { display: inline-block; padding: 4px 0; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

.post { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.post-channel { margin: 0 0 6px; font-weight: 600; line-height: 2.4; }
.post-channel a { color: inherit; text-decoration: none; padding: 10px 0; }
.post-media.grid > figure:not(:first-child) .play { transform: scale(.75); }
.post-head h1 { font-size: 1.35rem; }
/* Медиа поста: одно — во всю ширину; два и больше — сетка в две колонки, первое во всю ширину
   (как мозаика мессенджера). Картинка не выше экрана, целиком, на фоне. */
.post-media { margin: 0 -16px 14px; display: grid; gap: 4px; }
.post-media.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-media.grid > figure:first-child { grid-column: 1 / -1; }
.post-media figure { margin: 0; background: var(--shade); min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.post-media img { width: 100%; max-height: 80vh; object-fit: contain; }
.post-media figcaption { padding: 0 12px; background: var(--card); }
.watch { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.actions .button { flex: 1 1 auto; }
.subscribe { font-size: 1.05rem; min-height: 48px; }
.post-text { white-space: pre-wrap; margin: 0 0 18px; }
.post-text a { word-break: break-word; }

.video { position: relative; display: block; }
.play {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%; background: rgba(0, 0, 0, .55);
}
.play::after {
  content: ""; position: absolute; left: 26px; top: 20px;
  border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff;
}

.intro p { font-size: 1.05rem; }
.cta { margin-top: 28px; padding: 18px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.cta h2 { margin-top: 0; }
.error { padding: 24px 0; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.foot .wrap { padding-top: 16px; padding-bottom: 24px; }
.foot p { margin: 0 0 4px; }
.foot a { display: inline-block; padding: 12px 0; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  h1 { font-size: 1.35rem; }
  .pager .button { flex: 1 1 auto; }
}
