/* Публичный сайт: нейтральные серые и белый, акцент — синий из логотипа КЖЕ, соцсети — в своих цветах; светлая и тёмная темы */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #16181c;
  --muted: #6b6f76;
  --line: #dfe2e6;
  --accent: #1f4e8c;
  --accent-hover: #2f62a3;
  --on-accent: #ffffff;
  --danger: #b3261e;
  --danger-bg: #fbe9e7;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101114;
    --surface: #1a1c20;
    --text: #eef0f3;
    --muted: #9aa0a8;
    --line: #2d3036;
    --accent: #4a82c6;
    --accent-hover: #6a9bd6;
    --on-accent: #ffffff;
    --danger: #ef7b72;
    --danger-bg: #3a1f1c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); -webkit-text-size-adjust: 100%;
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1 { font: 700 32px/1.2 var(--sans); margin: 0 0 16px; }
h2 { font: 700 22px/1.3 var(--sans); margin: 0 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
img, video { max-width: 100%; }

.s-top { display: flex; align-items: center; justify-content: center; gap: 12px 24px; flex-wrap: wrap; width: 100%; max-width: 1040px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left)); }
.s-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 700; }
.s-logo { display: block; width: 44px; height: 44px; border-radius: 10px; flex: none; }
.s-page { flex: 1 0 auto; width: 100%; max-width: 1040px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right)) 64px max(16px, env(safe-area-inset-left)); }
/* Главная — содержимое по центру экрана и по вертикали */
.home .s-page { display: flex; flex-direction: column; justify-content: center; padding-bottom: 32px; }
.s-foot { width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 16px max(32px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; justify-content: center; gap: 8px 16px; color: var(--muted); font-size: 14px; text-align: center; }
.s-foot a { color: var(--muted); }

.s-hero { padding: 0; max-width: 720px; margin: 0 auto; text-align: center; }
.s-hero p { color: var(--muted); font-size: 19px; margin: 0; }
.s-hero-logo { display: block; width: 112px; height: 112px; margin: 0 auto 20px; border-radius: 24px; box-shadow: 0 8px 24px rgb(31 78 140 / .25); }
.home .s-page { padding-top: max(32px, env(safe-area-inset-top)); }
.page-message .s-page { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.page-message .s-page p { max-width: 520px; margin: 0 0 12px; color: var(--muted); }
.page-message .s-page p:last-child { margin-top: 12px; }

/* Плитки */
/* Плитки одной ширины по центру: неполный ряд не прижимается влево */
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 32px 0 0; }
.tiles .tile { flex: 0 1 240px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 24px 20px; min-height: 170px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-decoration: none;
  transition: border-color .15s, transform .15s, box-shadow .15s; }
.tile:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 20px rgb(0 0 0 / .12); }
.tile-ico { display: grid; margin-bottom: 6px; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--accent); color: var(--on-accent); }
.tile-ico svg { width: 26px; height: 26px; }
/* Логотипы соцсетей — сами по себе цветные, без плашки */
.k-vk .tile-ico, .k-tg .tile-ico, .k-max .tile-ico, .k-yt .tile-ico { background: none; }
.k-vk .tile-ico svg, .k-tg .tile-ico svg, .k-max .tile-ico svg, .k-yt .tile-ico svg { width: 48px; height: 48px; }
.k-vk:hover { border-color: #0077ff; }
.k-tg:hover { border-color: #26a5e4; }
.k-max:hover { border-color: #6a4cf5; }
.k-yt:hover { border-color: #ff0000; }
.tile-title { font-weight: 700; font-size: 18px; }
.tile-text { color: var(--muted); font-size: 14px; line-height: 1.45; }
.k-suggest { border-style: dashed; border-color: var(--accent); }

/* Страница поста (для RSS) */
.post time { color: var(--muted); font-size: 14px; }
.post { max-width: 720px; }
.post h1 { margin-top: 4px; }
.post-text p { margin: 0 0 1em; }
.post-text a { overflow-wrap: anywhere; }
.post figure { margin: 0 0 16px; }
.post figure img, .post figure video { display: block; border-radius: 10px; }
.s-cta { max-width: 720px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }

/* Форма предложения — колонкой по центру: заголовок, подводка, переключатель и кнопка по центру, поля во всю ширину */
.s-narrow { width: 100%; max-width: 640px; margin: 0 auto; }
.s-narrow > h1, .lead { text-align: center; }
.lead { color: var(--muted); margin: 0 0 8px; }
.suggest { display: grid; gap: 20px; margin-top: 24px; }
.suggest label, .suggest .label { display: block; font-weight: 600; font-size: 15px; }
.suggest textarea, .suggest input[name=contact] { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); font: 16px/1.5 var(--sans); }
.suggest textarea { resize: vertical; }
.suggest textarea:focus, .suggest input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.drop { display: grid !important; gap: 4px; justify-items: center; text-align: center; margin-top: 6px; padding: 28px 16px; border: 2px dashed var(--line); border-radius: 12px;
  background: var(--surface); cursor: pointer; font-weight: 400 !important; }
.drop:hover, .drop.over { border-color: var(--accent); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop span:first-of-type { color: var(--accent); font-weight: 600; }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.file-list li { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 15px; }
.file-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact { border: 0; padding: 0; margin: 0; }
.contact { text-align: center; }
.contact legend { font-weight: 600; font-size: 15px; padding: 0; margin: 0 auto 8px; }
.contact input[name=contact] { text-align: left; }
.switch { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.switch label { font-weight: 400; }
.switch input { position: absolute; opacity: 0; }
.switch span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); cursor: pointer; font-size: 15px; }
.switch input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.contact input[name=contact] { margin-top: 10px; }
.contact p { margin: 8px 0 0; }
.consent { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; font-size: 14px !important; line-height: 1.5; }
.consent input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.consent a { text-decoration: underline; }
.s-foot { flex-wrap: wrap; }
.policy { max-width: 760px; }
.policy h2 { font-size: 20px; margin: 32px 0 10px; }
.policy p, .policy li { margin: 0 0 10px; }
.policy ul { padding-left: 22px; }
.policy .warn { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.btn { justify-self: center; min-width: 220px; font: 600 16px var(--sans); padding: 12px 22px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); cursor: pointer; }
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .6; cursor: progress; }
.error { background: var(--danger-bg); color: var(--danger); padding: 12px 14px; border-radius: 10px; }
.progress { position: relative; height: 28px; border-radius: 8px; background: var(--line); overflow: hidden; }
.progress .bar { position: absolute; inset: 0 auto 0 0; width: 0; background: color-mix(in srgb, var(--accent) 30%, transparent); transition: width .2s; }
.progress span { position: relative; display: block; line-height: 28px; padding: 0 10px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }

.suggest > p { text-align: center; margin: 0; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 24px; margin-bottom: 12px; }
  .s-top { padding-bottom: 8px; }
  .s-brand { gap: 10px; font-size: 15px; }
  .s-logo { width: 38px; height: 38px; }
  .s-hero p { font-size: 16px; }
  .s-hero-logo { width: 88px; height: 88px; border-radius: 20px; margin-bottom: 16px; }
  /* Плитки по две в ряд, «Предложить новость» — первой и во всю ширину */
  .tiles { gap: 10px; margin-top: 24px; }
  .tiles .tile { flex: 1 1 calc(50% - 5px); min-height: 132px; padding: 18px 10px; border-radius: 12px; }
  .tiles .k-suggest { flex-basis: 100%; min-height: 0; padding: 20px 16px; }
  .tile-title { font-size: 16px; }
  .tile-text { font-size: 13px; }
  .tile-ico, .k-vk .tile-ico svg, .k-tg .tile-ico svg, .k-max .tile-ico svg { width: 40px; height: 40px; }
  .tile:hover { transform: none; }
  .s-page { padding-bottom: 40px; }
  .suggest { gap: 18px; margin-top: 16px; }
  .drop { padding: 22px 12px; }
  .switch { display: grid; grid-template-columns: 1fr 1fr; }
  .switch span { display: block; text-align: center; }
  .btn { width: 100%; }
  .policy h2 { font-size: 18px; margin-top: 24px; }
  .s-foot { padding-top: 18px; font-size: 13px; }
}
