/* ============================================================
 * NEWS — стили витрины + реакции
 * (светлая тема «выцветшая бумага»)
 * ============================================================ */

:root{
  --bg:#f3ecd9;      /* фон страницы — бежевый, старая бумага */
  --bg-2:#ece4cf;    /* карточки */
  --bg-3:#e2d8bf;    /* вложенные блоки: source, tags, ava, reactions */
  --line:#d6cbb0;    /* границы — тёплые */
  --txt:#2a2620;     /* основной текст */
  --txt-2:#6b6152;   /* вторичный текст */
  --txt-3:#8f8574;   /* третичный (даты, счётчики) */
  --acc:#c0392b;     /* акцент (активная вкладка, лайк) */
  --acc-2:#c98a2b;   /* вторичный акцент (кнопка «+ Пост») */
  --link:#2a6fb0;    /* ссылки */
  --radius:14px;
}

*{box-sizing:border-box}

body.news-page{
  margin:0;
  background:var(--bg);
  color:var(--txt);
  font:15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}

.news-wrap{
  max-width:760px;
  margin:0 auto;
  padding:24px 18px 80px;
}

/* ---------- шапка ---------- */

.news-masthead{
  display:flex;align-items:baseline;justify-content:space-between;
  gap:12px;flex-wrap:wrap;
  padding-bottom:14px;margin-bottom:22px;
  border-bottom:1px solid var(--line);
}
.news-logo{
  font-weight:800;letter-spacing:.14em;font-size:13px;
  color:var(--txt);
}
.news-sub{color:var(--txt-3);font-size:12px;letter-spacing:.05em}

.news-back{margin:0 0 14px}
.news-back a{color:var(--txt-2);text-decoration:none;font-size:13px}
.news-back a:hover{color:var(--txt)}

.news-h1{font-size:20px;margin:0 0 16px;font-weight:700}

/* ---------- табы ---------- */

.news-tabs{
  display:flex;gap:6px;flex-wrap:wrap;margin-bottom:20px;
}
.news-tabs a{
  padding:7px 12px;border-radius:999px;
  background:var(--bg-2);color:var(--txt-2);
  text-decoration:none;font-size:13px;
  border:1px solid var(--line);
  transition:background .15s,color .15s;
}
.news-tabs a:hover{background:var(--bg-3);color:var(--txt)}
.news-tabs a.on{background:var(--acc);color:#fff;border-color:transparent}
.news-tabs-admin{margin-left:auto;background:var(--acc-2) !important;color:#2a2620 !important;border-color:transparent !important}

/* ---------- карточка поста ---------- */

.news-card{
  background:var(--bg-2);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px 18px 10px;
  margin-bottom:16px;
}

.news-card-head{
  display:flex;gap:12px;align-items:center;margin-bottom:12px;
}
.news-ava{width:40px;height:40px;flex:0 0 40px;border-radius:50%;overflow:hidden;background:var(--bg-3)}
.news-ava img{width:100%;height:100%;object-fit:cover;display:block}
.news-ava .ava-letter{
  width:100%;height:100%;display:flex;align-items:center;justify-content:center;
  color:var(--txt-2);font-weight:700;
}

.news-meta{min-width:0}
.news-author{font-weight:600;font-size:14px}
.news-date{color:var(--txt-3);font-size:12px;margin-top:2px}
.news-type{padding:1px 7px;border-radius:6px;background:var(--bg-3);color:var(--txt-2);font-size:11px}
.news-type-repost{background:#ede0f3;color:#7a3d99}
.news-type-liked{background:#f6e0e0;color:#a83a3a}
.news-type-note{background:#e2efe4;color:#3f7a4a}

.news-title{
  font-size:19px;line-height:1.3;margin:6px 0 10px;font-weight:700;
}
.news-title a{color:var(--txt);text-decoration:none}
.news-title a:hover{color:var(--link)}

.news-body{color:var(--txt);font-size:15px}
.news-body p{margin:0 0 12px}
.news-body a{color:var(--link)}

.news-image{margin:12px 0}
.news-image img{max-width:100%;border-radius:10px;display:block}

.news-source{
  margin:10px 0;padding:8px 12px;
  background:var(--bg-3);border-radius:8px;
  font-size:13px;color:var(--txt-2);
}
.news-source a{color:var(--link)}

.news-tags{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}
.news-tag{font-size:12px;color:var(--txt-3);background:var(--bg-3);padding:2px 8px;border-radius:6px}

/* ---------- низ карточки ---------- */

.news-card-foot{
  display:flex;align-items:center;gap:14px;
  padding:10px 0 6px;margin-top:10px;
  border-top:1px solid var(--line);
  color:var(--txt-2);font-size:13px;
}
.news-card-foot a{color:var(--txt-2);text-decoration:none}
.news-card-foot a:hover{color:var(--txt)}
.news-like{
  background:none;border:0;padding:0;cursor:pointer;
  color:var(--txt-2);font-size:13px;display:inline-flex;align-items:center;gap:5px;
  font-family:inherit;
}
.news-like:hover{color:var(--acc)}
.news-like.on{color:var(--acc)}
.news-views{color:var(--txt-3)}
.news-edit,.news-del{margin-left:auto;color:var(--txt-3)}
.news-edit + .news-del{margin-left:10px}

/* ---------- пагинация ---------- */

.news-pager{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;margin:26px 0}
.news-pager a,.news-pager span{
  min-width:34px;height:34px;padding:0 10px;
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:8px;background:var(--bg-2);color:var(--txt-2);
  text-decoration:none;font-size:13px;border:1px solid var(--line);
}
.news-pager a:hover{background:var(--bg-3);color:var(--txt)}
.news-pager .on{background:var(--acc);color:#fff;border-color:transparent}

/* ---------- одиночный пост ---------- */

.news-card-single{padding-bottom:18px}

/* ---------- комментарии ---------- */

.news-comments{margin-top:30px}
.news-comments h2{font-size:16px;margin:0 0 16px;font-weight:700}
.news-comment{
  display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--line);
}
.news-comment-body{flex:1;min-width:0}
.news-comment-head{display:flex;gap:10px;align-items:baseline;margin-bottom:4px}
.news-comment-head b{font-size:14px}
.news-comment-head span{color:var(--txt-3);font-size:12px}

.news-comment-form{margin-top:16px;display:flex;flex-direction:column;gap:10px}
.news-comment-form textarea{
  width:100%;background:var(--bg-2);border:1px solid var(--line);
  color:var(--txt);border-radius:10px;padding:12px;font:inherit;resize:vertical;
}
.news-comment-form textarea:focus{outline:none;border-color:var(--acc)}
.news-comment-form button{
  align-self:flex-start;
  background:var(--acc);color:#fff;border:0;border-radius:10px;
  padding:10px 20px;font:inherit;font-weight:600;cursor:pointer;
}
.news-comment-form button:hover{background:#a93226}

.news-empty{color:var(--txt-3);padding:20px 0}
.news-err{color:#a83a3a;padding:10px 12px;background:#f6e0e0;border-radius:8px;margin:0 0 16px}

/* ---------- форма в админке ---------- */

.news-form{display:flex;flex-direction:column;gap:14px;max-width:640px}
.news-form label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--txt-2)}
.news-form input,.news-form select,.news-form textarea{
  background:var(--bg-2);border:1px solid var(--line);color:var(--txt);
  border-radius:8px;padding:10px 12px;font:inherit;
}
.news-form input:focus,.news-form select:focus,.news-form textarea:focus{
  outline:none;border-color:var(--acc);
}
.news-form button{
  align-self:flex-start;background:var(--acc);color:#fff;border:0;
  border-radius:10px;padding:10px 22px;font:inherit;font-weight:600;cursor:pointer;
}
.news-form button:hover{background:#a93226}
.news-cancel{margin-left:12px;color:var(--txt-2);align-self:center;font-size:13px}

.news-table{width:100%;border-collapse:collapse;margin-top:14px;font-size:13px}
.news-table th,.news-table td{
  text-align:left;padding:8px 10px;border-bottom:1px solid var(--line);
}
.news-table th{color:var(--txt-3);font-weight:600;font-size:12px}
.news-table a{color:var(--link);text-decoration:none}

/* ============================================================
 * РЕАКЦИИ — две кнопки: 👍 и 👎
 * ============================================================ */

.news-reactions{
  display:flex;gap:8px;flex-wrap:wrap;align-items:center;
  margin:12px 0 6px;
}

.news-reaction{
  display:inline-flex;align-items:center;gap:6px;
  padding:5px 12px 5px 10px;
  background:var(--bg-3);
  border:1px solid var(--line);
  border-radius:999px;
  cursor:pointer;
  color:var(--txt-2);
  font:inherit;font-size:13px;line-height:1;
  transition:transform .12s ease, background .15s, border-color .15s, color .15s;
}
.news-reaction:hover{background:#e8dfc8;transform:translateY(-1px)}
.news-reaction:active{transform:translateY(0) scale(.96)}
.news-reaction[disabled]{opacity:.55;cursor:not-allowed;transform:none}
.news-reaction[disabled]:hover{background:var(--bg-3);transform:none}

.news-reaction__emoji{
  font-size:20px;
  line-height:1;
  display:inline-block;
}

.news-reaction__count{
  min-width:11px;text-align:center;font-weight:600;color:var(--txt-2);font-size:13px;
}
.news-reaction.is-active .news-reaction__count{color:var(--txt)}

.news-reaction.is-active{
  border-color:currentColor;
  background:#e8dfc8;
}

/* цвет активной кнопки */
.news-reaction--fire.is-active{color:#2f8f4a}  /* зелёный — палец вверх */
.news-reaction--sad.is-active {color:#c0392b}  /* красный — палец вниз */

/* ---------- мобильная адаптация ---------- */

@media (max-width:520px){
  .news-wrap{padding:18px 12px 60px}
  .news-card{padding:14px 14px 8px;border-radius:12px}
  .news-title{font-size:17px}
  .news-card-foot{gap:10px;font-size:12px}
  .news-reactions{gap:6px}
  .news-reaction{padding:4px 10px 4px 8px;font-size:12px}
  .news-reaction__emoji{font-size:18px}
}