/**
 * Полная новость 4ege.ru — отдельный слой (.post)
 */

.post {
  --post-bg: #fff;
  --post-ink: #141820;
  --post-muted: #6b7280;
  --post-line: #e8eaef;
  --post-soft: #f3f4f8;
  --post-accent: #4f5fd6;
  --post-accent-hover: #3d4db8;
  --post-up: #0d9f6e;
  --post-down: #c44d4d;
  --post-radius: 14px;
  --post-chip-radius: 10px;

  width: calc(100% - 2px);
  margin: 0 0 18px;
  font-family: 'GoloS', Arial, sans-serif;
  color: var(--post-ink);
  background: var(--post-bg);
  border: 1px solid var(--post-line);
  border-radius: var(--post-radius);
  box-shadow: 0 8px 32px rgba(20, 24, 32, 0.06);
  overflow: hidden;
}

.post__sheet {
  padding: 28px 32px 32px;
}

.post__ico {
  display: block;
  flex-shrink: 0;
}

/* ——— Шапка ——— */

.post__head {
  margin-bottom: 22px;
}

.post__cats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--post-muted);
}

.post__cats a {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--post-soft);
  color: var(--post-accent);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.post__cats a:hover {
  background: #e8ebfa;
  color: var(--post-accent-hover);
}

.post__edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: auto;
  border-radius: 8px;
  color: var(--post-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.post__edit:hover {
  background: var(--post-soft);
  color: var(--post-accent);
}

.post__title {
  margin: 0;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--post-ink);
}

.post__byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--post-muted);
}

.post__byline-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.post__badge {
  padding: 3px 9px;
  border-radius: 6px;
  background: #fef3e2;
  color: #9a5b14;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ——— Панель: рейтинг + кнопки ——— */

.post__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin-bottom: 28px;
  padding: 14px 16px;
  background: var(--post-soft);
  border-radius: var(--post-chip-radius);
}

.post__votes {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--post-bg);
  border: 1px solid var(--post-line);
  border-radius: 999px;
}

.post__votes a {
  text-decoration: none;
  color: inherit;
}

.post__vote {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--post-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.post__vote:hover {
  background: var(--post-soft);
}

.post__vote--up:hover {
  color: var(--post-up);
}

.post__vote--down:hover {
  color: var(--post-down);
}

.post__vote:active {
  transform: scale(0.94);
}

.post__score {
  min-width: 2.2em;
  padding: 0 10px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: var(--post-ink);
}

/* Скрыть старые стрелки DLE, если вдруг попадут */
.post .arrow1,
.post .arrow2,
.post .rattt,
.post .optrtr,
.post .optrtr1 {
  display: none !important;
}

.post__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.post__tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--post-line);
  border-radius: var(--post-chip-radius);
  background: var(--post-bg);
  color: var(--post-ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
  box-sizing: border-box;
}

.post__tool:hover,
.post a:hover .post__tool {
  border-color: #c5c9e8;
  color: var(--post-accent);
  box-shadow: 0 2px 8px rgba(79, 95, 214, 0.12);
}

.post__tool--active {
  border-color: #c5cae8;
  background: #f0f2ff;
  color: var(--post-accent);
}

.post__tool-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--post-soft);
  color: inherit;
  transition: background 0.15s;
}

.post__tool:hover .post__tool-ico,
.post__tool--active .post__tool-ico {
  background: #e8ebfa;
}

.post__tool-txt {
  white-space: nowrap;
}

/* DLE оборачивает теги в <a> */
.post__tools > a {
  text-decoration: none;
}

/* ——— Текст ——— */

.post__body {
  font-size: 17px;
  line-height: 1.75;
  color: #252a35;
}

.post__body > :first-child {
  margin-top: 0;
}

.post__body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.post__body table {
  max-width: 100%;
}

.post__body a {
  color: var(--post-accent);
}

.post__body a:hover {
  color: var(--post-accent-hover);
}

.post__note {
  margin: 24px 0 0;
  padding: 14px 16px;
  border-left: 3px solid var(--post-accent);
  border-radius: 0 8px 8px 0;
  background: var(--post-soft);
  font-size: 13px;
  line-height: 1.5;
  color: var(--post-muted);
}

.post__note a {
  color: var(--post-accent);
  text-decoration: none;
}

.post__note a:hover {
  text-decoration: underline;
}

/* ——— Поиск ——— */

.post__search {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--post-line);
}

.post__search-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px 14px;
  padding: 12px 14px;
  background: var(--post-soft);
  border-radius: var(--post-chip-radius);
  border: 1px solid var(--post-line);
}

.post__search-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--post-muted);
  cursor: pointer;
}

.post__search-hint {
  font-size: 13px;
  font-weight: 500;
}

.post__search-input {
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--post-line);
  border-radius: 8px;
  background: var(--post-bg);
  font-family: inherit;
  font-size: 15px;
  color: var(--post-ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.post__search-input:focus {
  border-color: var(--post-accent);
  box-shadow: 0 0 0 3px rgba(79, 95, 214, 0.15);
}

.post__search-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: var(--post-accent);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.post__search-btn:hover {
  background: var(--post-accent-hover);
}

/* Сброс старого .gynb */
.post .gynb {
  margin: 0;
  padding: 0;
}

/* ——— Похожие ——— */

.post__more {
  margin-top: 36px;
}

.post__more-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--post-ink);
}

.post .similar-news-block {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.post .similar-news-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post .similar-item-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--post-line);
  border-radius: var(--post-chip-radius);
  background: var(--post-bg);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.post .similar-item-link::after {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-top: 2px solid var(--post-muted);
  border-right: 2px solid var(--post-muted);
  transform: rotate(45deg);
  transition: border-color 0.15s;
}

.post .similar-item-link:hover {
  border-color: #c5c9e8;
  box-shadow: 0 4px 16px rgba(79, 95, 214, 0.1);
  transform: translateX(2px);
}

.post .similar-item {
  flex: 1;
  min-width: 0;
}

.post .similar-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--post-ink);
}

.post .similar-item-link:hover .similar-title {
  color: var(--post-accent);
}

.post .similar-item-link:hover::after {
  border-color: var(--post-accent);
}

.post .similar-description {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--post-muted);
}

/* ——— Комментарии ——— */

.post__comments {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--post-line);
}

.post__comments-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--post-ink);
}

/* ——— theme-v2 ——— */

body.theme-v2 .post {
  --post-bg: var(--sheet, #fffdf9);
  --post-ink: var(--ink, #2a241c);
  --post-muted: var(--ink-soft, #5c5348);
  --post-line: var(--rule, #d9cfc0);
  --post-soft: #f0ebe2;
  --post-accent: var(--accent, #7a4a2d);
  --post-accent-hover: var(--accent-hover, #5a361f);
  box-shadow: var(--shadow, 0 2px 14px rgba(42, 36, 28, 0.06));
}

body.theme-v2 .post__title {
  font-family: Georgia, "Times New Roman", Times, serif;
}

body.theme-v2 .post__body {
  color: #3d362e;
}

body.theme-v2 .post .similar-item-link:hover .similar-title {
  color: var(--post-accent);
}

/* ——— Мобильная ——— */

@media screen and (max-width: 950px) {
  .post__tool--mob .post__tool-txt {
    display: none;
  }

  .post__tool--mob {
    padding: 8px 10px;
  }
}

@media screen and (max-width: 700px) {
  .post__sheet {
    padding: 20px 16px 24px;
  }

  .post__bar {
    flex-direction: column;
    align-items: stretch;
  }

  .post__tools {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .post__search-form {
    grid-template-columns: 1fr;
  }

  .post__search-label .post__search-hint {
    display: none;
  }

  .post__search-btn {
    width: 100%;
  }
}
