/* Тема IT — вид статьи по образцу masterlidov.github.io
   Тёмная шапка, акцент #ec1c1c, обложка во всю ширину с заголовком поверх,
   текст — узкой колонкой на белом. */

@font-face {
  font-family: 'it-baron'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('fonts/BaronBlack.woff') format('woff');
}
@font-face {
  font-family: 'it-baron'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('fonts/BaronBold.woff') format('woff');
}
@font-face {
  font-family: 'it-roboto'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('fonts/RobotoRegular.woff') format('woff');
}
@font-face {
  font-family: 'it-roboto'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('fonts/RobotoBold.woff') format('woff');
}
@font-face {
  font-family: 'it-fa'; font-weight: normal; font-style: normal; font-display: block;
  src: url('fonts/fontawesome-webfont.woff') format('woff');
}
.fa { font-family: 'it-fa'; font-style: normal; }
.fa-bars:before { content: '\f0c9'; }
.fa-search:before { content: '\f002'; }
.fa-comments:before { content: '\f075'; }
.fa-share-alt:before { content: '\f1e0'; }
.fa-envelope:before { content: '\f0e0'; }

:root {
  --accent: #ec1c1c;
  --accent-dark: #c81717;
  --dark: #202225;
  --dark-2: #2b2e31;
  --ink: #1c2026;
  --text: #3c4147;
  --muted: #7b8087;
  --line: #e4e7ea;
  --soft: #f6f7f9;
  --wrap: 1140px;
  --col: 760px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'it-roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 18px;
  min-width: 320px;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
  -webkit-text-size-adjust: 100%;
}

/* Baron оставлен только логотипу (.logo), как в оригинале */
h1, h2, h3, h4 { font-family: 'it-roboto', Arial, sans-serif; color: var(--ink); line-height: 1.25; margin: 0 0 .5em; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- шапка ---------- */
.top-line { background: var(--dark); color: #fff; position: sticky; top: 0; z-index: 50; }
.top-inner {
  position: relative;
  display: flex; align-items: center;
  min-height: 65px;
  width: 100%;
}
.logo {
  position: absolute; left: 0; top: 0;
  font-family: 'it-baron', Georgia, serif; font-size: 23px; color: #fff;
  line-height: 65px; white-space: nowrap; padding-left: 20px; z-index: 2;
}
.logo span { color: var(--accent); }
.logo:hover, .logo:focus { color: #fff; }
.burger {
  display: none; background: none; border: 0; color: #fff;
  font-size: 20px; padding: 12px; cursor: pointer;
}
.main-menu { flex: 1; min-width: 0; padding: 0 100px; width: 100%; text-align: center; }
.main-menu ul { list-style: none; margin: 0; padding: 0; display: block; }
.main-menu li { display: inline-block; margin-right: -4px; }
.main-menu a {
  display: inline-block; padding: 22px 14px; color: #c9cdd2;
  font-size: 15px; text-transform: uppercase; letter-spacing: .3px;
}
.main-menu a:hover { color: #fff; background: var(--dark-2); }

/* ---------- обложка статьи ---------- */
.page-header {
  position: relative; color: #fff;
  height: 80vh; min-height: 460px;
  background-size: cover; background-position: center;
}
.page-header.overlay::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20, 22, 24, .92) 0%, rgba(20, 22, 24, .45) 45%, rgba(20, 22, 24, .15) 100%);
}
.page-header.plain { height: auto; min-height: 0; background: var(--dark); padding: 46px 0 42px; }
.page-header-content { position: absolute; left: 0; right: 0; bottom: 12%; z-index: 1; }
.page-header.plain .page-header-content { position: static; }
.page-header-meta > * { display: inline-block; }
.page-header-meta h1 {
  color: #fff; font-size: 32px; line-height: 1.2; margin: 15px 0;
  font-family: 'it-roboto', Arial, sans-serif; font-weight: 700;
  display: block;
}
.page-header-meta .date {
  color: #fff; font-size: 13px; font-family: 'it-roboto', Arial, sans-serif;
  font-weight: 400; margin-top: 10px; display: block;
}
.page-category-link {
  font-size: 13px; text-transform: uppercase; letter-spacing: .4px;
  color: #fff; background: var(--accent); padding: 2px 8px; margin-right: 10px;
}
.page-category-link:hover { background: var(--accent-dark); color: #fff; }

/* ---------- тело статьи ---------- */
.article-content { padding: 36px 0 60px; background: #fff; }
.article-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.single-post { max-width: var(--col); }
.post-tags { margin-bottom: 22px; }
.post-tag {
  display: inline-block; background: var(--soft); color: var(--muted);
  padding: 4px 10px; border-radius: 3px; font-size: 14px; margin: 0 6px 6px 0;
}
.post-tag:hover { color: var(--accent); }

.post-body p { margin: 25px 0; line-height: 1.6; }
.post-body h2, .post-body h3, .post-body h4 { font-family: 'it-roboto', Arial, sans-serif; }
.post-body h2, .post-body h3, .post-body h4 { line-height: 1.2; margin: 34px 0 14px; }
.post-body h2 { font-size: 26px; font-weight: 700; }
.post-body h3 { font-size: 21px; }
.post-body ul, .post-body ol { padding-left: 22px; margin: 25px 0; }
.post-body li { margin-bottom: 8px; }
.post-body img { border-radius: 4px; }
.post-body blockquote {
  padding: 20px; margin: 40px 50px; font-size: 20px; color: #000;
  border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
}
code, kbd, pre, samp { font-family: monospace, monospace; }
.post-body code { background: var(--soft); padding: 2px 6px; border-radius: 3px; font-size: .9em; }
.post-body pre {
  background: var(--dark); color: #e6e9ec; padding: 18px 20px;
  border-radius: 5px; overflow-x: auto;
}
.post-body pre code { background: none; color: inherit; padding: 0; }
.post-body table { width: 100%; border-collapse: collapse; margin: 26px 0; font-size: 16px; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.post-body th { background: var(--soft); }

/* ---------- карусель ---------- */
.carousel { position: relative; margin: 26px 0; }
.carousel-inner { display: flex; transition: transform .4s ease; }
.carousel-item { flex: 0 0 100%; }
.carousel-item img { width: 100%; }
.carousel-caption { color: var(--muted); font-size: 14px; padding-top: 8px; }
.carousel-btn {
  position: absolute; top: 40%; background: rgba(0,0,0,.5); color: #fff;
  border: 0; font-size: 26px; padding: 6px 14px; cursor: pointer; border-radius: 3px;
}
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }
.carousel-dots { text-align: center; margin-top: 10px; }
.carousel-dot {
  width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0;
  background: #cfd3d7; margin: 0 3px; cursor: pointer; display: inline-block;
}
.carousel-dot.active { background: var(--accent); }

/* ---------- сайдбар ---------- */
.sidebar { position: sticky; top: 85px; }
.widget { background: var(--soft); border-radius: 5px; padding: 22px; }
.widget-title { font-size: 19px; margin: 0 0 14px; }
.category-list { list-style: none; margin: 0; padding: 0; }
.category-list li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
.category-list li:last-child { border-bottom: 0; }
.category-count { color: var(--muted); font-size: 14px; }

/* ---------- комментарии ---------- */
.comments-section { margin-top: 46px; padding-top: 30px; border-top: 1px solid var(--line); }
.comments-title { font-size: 22px; font-family: 'it-roboto', Arial, sans-serif; font-weight: 700; }
.comment { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-header { display: flex; gap: 14px; font-size: 14px; margin-bottom: 6px; }
.comment-author { font-weight: 700; color: var(--ink); }
.comment-date { color: var(--muted); }
.comment-content { margin-bottom: 8px; }
.comment-reply-btn {
  background: none; border: 0; color: var(--accent); cursor: pointer;
  font-size: 14px; padding: 0;
}
.form-group { margin-bottom: 14px; }
.form-control {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 15px;
  border: 1px solid var(--line); border-radius: 3px; background: #fff; color: var(--text);
}
textarea.form-control { min-height: 96px; resize: vertical; }
.checkbox-label-inline { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.btn-primary {
  background: var(--accent); color: #fff; border: 0; border-radius: 3px;
  padding: 12px 24px; font: inherit; font-weight: 700; cursor: pointer;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.alert-success { background: #e8f5e9; color: #2e7d32; padding: 12px 14px; border-radius: 3px; }
.alert-error { background: #fdecea; color: #c62828; padding: 12px 14px; border-radius: 3px; }
.no-comments { color: var(--muted); }
.comment-message { margin-top: 12px; }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; margin: 26px 0; }
.video-wrapper iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }

/* ---------- подвал ---------- */
.site-footer { background: var(--dark); color: #9aa0a6; padding: 26px 0; text-align: center; }
.site-footer p { margin: 0; font-size: 14px; }
.site-footer-links { margin-top: 8px !important; }
.site-footer a { color: #9aa0a6; text-decoration: none; }
.site-footer a:hover { color: #ffffff; }

/* ---------- адаптив ---------- */
@media (max-width: 1000px) {
  .article-cols { grid-template-columns: 1fr; gap: 32px; }
  .sidebar { position: static; }
}
@media (max-width: 900px) {
  .burger { display: block; margin-left: auto; margin-right: 62px; }
  .search-wrap { left: -16px; right: -8px; }
  .search-wrap .search { right: 0; width: 40px; }
  .search-wrap .search-field, .search-results { padding-left: 16px; padding-right: 16px; }
  .main-menu { display: none; flex-basis: 100%; }
  .main-menu.open { display: block; }
  .main-menu ul { flex-direction: column; }
  .main-menu a { padding: 13px 0; border-top: 1px solid var(--dark-2); }
  .top-inner { display: flex; flex-wrap: wrap; padding: 0 16px; justify-content: space-between; }
  .top-inner .logo, .top-inner .main-menu, .top-inner .burger { grid-column: auto; }
  .logo { position: static; line-height: 65px; }
  .main-menu ul { justify-content: flex-start; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .page-header { height: 56vh; min-height: 320px; }
  .page-header-content { bottom: 8%; }
  .page-header-meta h1 { font-size: 24px; }
  .article-content { padding: 26px 0 44px; }
  .post-body h2 { font-size: 22px; }
  .post-body p { margin: 20px 0; }
  .post-body blockquote { margin: 28px 0; padding: 14px 16px; font-size: 17px; }
}

/* ---------- страница списка ---------- */
.list-hero { background: var(--dark); color: #fff; padding: 40px 0 36px; }
.list-hero.has-photo {
  background-image:
    linear-gradient(90deg, rgba(20, 22, 24, .88) 0%, rgba(20, 22, 24, .66) 38%, rgba(20, 22, 24, .24) 72%, rgba(20, 22, 24, .10) 100%),
    url('../../uploads/hero-main.webp');
  background-size: cover;
  background-position: center 42%;
  background-repeat: no-repeat;
}
.list-hero h1 { color: #fff; margin: 10px 0 0; font-size: 30px; }
.list-hero p { color: #c2c7cd; margin: 8px 0 0; max-width: 70ch; }
.post-list { max-width: var(--col); }
.list-item {
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px;
  padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line);
}
.list-item:last-of-type { border-bottom: 0; }
.list-thumb img { width: 100%; height: 118px; object-fit: cover; border-radius: 4px; display: block; }
.list-body h2 { font-size: 21px; margin: 4px 0 8px; }
.list-body p { margin: 0 0 8px; color: var(--text); font-size: 16px; }
.list-body .date { color: var(--muted); font-size: 14px; }
.list-cat {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding: 2px 8px;
}
.list-cat:hover { background: var(--accent-dark); color: #fff; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 26px 0 0; }
.pagination a, .pagination .current {
  min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 3px; color: var(--ink); font-size: 15px;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 700px) {
  .list-item { grid-template-columns: 1fr; }
  .list-thumb img { height: 160px; }
}


/* ---------- хлебные крошки ---------- */
.breadcrumbs { margin: 0 0 15px -10px; }
.breadcrumbs ul { list-style: none; margin: 0; padding: 0; }
.breadcrumbs li {
  display: inline-block; font-size: 16px; position: relative;
  color: var(--ink); padding-right: 16px; margin-right: 10px;
}
.breadcrumbs li + li { padding-left: 4px; }
.breadcrumbs li a { color: #ec1c1c; }
.breadcrumbs li a::after {
  content: '\00BB'; position: absolute; right: 0; top: 0; color: #ccc;
}
.breadcrumbs li a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs .active { color: var(--ink); }
.breadcrumbs .active::after { content: ''; }

/* ---------- поделиться ---------- */
.item-social { margin-top: 14px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #fff; border: 1px solid #fff;
  padding: 6px 12px 6px 30px; border-radius: 2px; line-height: 1.2;
  position: relative; margin: 6px 2px 0 0;
}
.share-btn:hover { background: #fff; color: #202225; }
.share-btn .fa-share-alt {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 13px; width: 12px; text-align: center;
}
.share-btn .fa { font-size: 13px; }

/* ---------- последние статьи ---------- */
.latest-box { margin-top: 26px; }
.lb-header {
  border-bottom: 2px solid var(--accent); padding-bottom: 5px;
  margin-bottom: 15px; font-family: 'it-roboto', Arial, sans-serif; font-size: 19px; color: var(--ink);
}
.lb-item {
  position: relative; display: block; overflow: hidden;
  background: #f0f0f0; margin-bottom: 2px;
  transition: background .25s ease;
}
.lb-thumb { display: block; width: 100%; height: 96px; object-fit: cover; }
.lb-body { background: rgba(249, 249, 249, .94); padding: 9px 12px; }
.lb-item-header { font-size: 14px; line-height: 1.4; display: block; font-weight: 500; color: #333; }
.lb-item:hover { background: #e4e4e4; }
.lb-item:hover .lb-body { background: #fff; }
.lb-item:hover .lb-item-header { color: var(--accent); }
.lb-footer { line-height: 1.2; margin-top: 4px; }
.lb-footer .date { color: var(--muted); font-size: 13px; }


/* ---------- поиск: выпадающая панель из шапки ---------- */
.search-wrap { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; }
.search-form { position: static; }
.search-wrap .search {
  position: absolute; right: 20px; top: 0; z-index: 41; pointer-events: auto;
  width: 46px; height: 65px; line-height: 65px; text-align: center;
  color: #454749; cursor: pointer; font-size: 16px; display: block;
  transition: color .25s ease;
}
.search-wrap .search:hover, .search-wrap.is-open .search { color: var(--accent); }
.search-wrap .search-field {
  position: absolute; left: 0; right: 0; top: 65px; z-index: 40; pointer-events: auto;
  background: #272a2a; padding: 12px 20px; display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.search-wrap.is-open .search-field { display: block; }
.search-wrap.is-open .search-results { display: block; }
.search-wrap .search-field input {
  width: 100%; max-width: 720px; margin: 0 auto; display: block;
  padding: 11px 15px; font: inherit; font-size: 16px; color: #fff;
  background: #1f2222; border: 1px solid #454949; border-radius: 3px;
}
.search-wrap .search-field input::placeholder { color: rgba(255, 255, 255, .2); font-style: italic; }
.search-wrap .search-field input:focus { border-color: #6a6e6e; outline: none; }

.search-results {
  display: none; pointer-events: auto;
  position: absolute; left: 0; right: 0; top: 65px; z-index: 40;
  background: #272a2a; color: #c9cdd2;
  max-height: 70vh; overflow-y: auto; padding: 0 20px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.search-count { color: #8b9097; font-size: 14px; margin: 12px 0 6px; }
.search-empty { color: #8b9097; margin: 12px 0 4px; }
.search-results ul { list-style: none; margin: 0; padding: 0; }
.search-results li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 9px 0; border-bottom: 1px solid #33373d;
}
.search-results li:last-child { border-bottom: 0; }
.search-results li a { color: #e6e9ec; font-size: 16px; }
.search-results li a:hover { color: var(--accent); }
.search-results mark { background: rgba(236, 28, 28, .3); color: #fff; padding: 0 2px; }
.search-date { color: #8b9097; font-size: 13px; white-space: nowrap; }

/* ---------- последние комментарии ---------- */
.cm-list { list-style: none; margin: 0; padding: 0; }
.cm-list li { padding: 10px 0; border-bottom: 1px solid #e9ebee; }
.cm-list li:last-child { border-bottom: 0; }
.cm-link { display: block; color: var(--ink); font-size: 15px; line-height: 1.4; }
.cm-link:hover { color: var(--accent); }
.cm-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 4px; }
.cm-author { color: var(--muted); font-size: 13px; }
.cm-foot .date { color: var(--muted); font-size: 13px; font-family: 'it-roboto', sans-serif; font-weight: 400; }

/* ---------- читайте также ---------- */
.related { margin: 26px 0 30px; padding: 18px 20px; background: var(--soft); border-radius: 5px; }
.related h2 { font-size: 20px; margin: 0 0 12px; font-family: 'it-roboto', Arial, sans-serif; font-weight: 700; }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { padding: 7px 0; border-bottom: 1px solid #e2e5e8; }
.related li:last-child { border-bottom: 0; }
.related a { color: var(--ink); font-size: 16px; }
.related a:hover { color: var(--accent); }
.related-cat { color: var(--muted); font-size: 13px; margin-left: 8px; }

/* ---------- призыв к действию в конце статьи ---------- */
.post-cta {
  margin: 34px 0 8px; padding: 26px 24px;
  background: linear-gradient(135deg, #fdf3f3, var(--soft));
  border: 1px solid #f2dcdc; border-left: 4px solid var(--accent);
  border-radius: 6px;
}
.post-cta h2 { font-size: 24px; margin: 0 0 12px; color: var(--ink); font-weight: 700; }
.post-cta-badge {
  display: inline-block; margin: 0 0 12px; padding: 4px 10px;
  background: var(--accent); color: #fff; border-radius: 3px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.post-cta-lead { margin: 0; font-size: 17px; color: var(--text); }
.post-cta-btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 12px; }
.post-cta-more { margin: 0 0 14px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.post-cta-more a { color: var(--accent); font-weight: 700; text-decoration: underline; }
.cta-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 4px;
  font-weight: 700; font-size: 16px; color: #fff; text-align: center; text-decoration: none;
  transition: filter .2s ease, transform .2s ease;
}
.cta-btn:hover { filter: brightness(1.08); color: #fff; transform: translateY(-1px); }
.cta-tg { background: #2aabee; }
.cta-max { background: #6a4bd1; }
.post-cta-note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.post-cta-note strong { color: var(--accent); }
.post-cta-note a { color: var(--accent); font-weight: 700; text-decoration: underline; }

/* ---------- призыв в сайдбаре ---------- */
.sidebar-cta {
  margin: 0 0 24px; padding: 20px 18px;
  background: linear-gradient(135deg, #fdf3f3, var(--soft));
  border: 1px solid #f2dcdc; border-left: 4px solid var(--accent);
  border-radius: 6px;
}
.sidebar-cta-badge {
  display: inline-block; margin: 0 0 10px; padding: 3px 9px;
  background: var(--accent); color: #fff; border-radius: 3px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.sidebar-cta-title { margin: 0 0 8px; font-size: 19px; color: var(--ink); font-weight: 700; }
.sidebar-cta-lead { margin: 0 0 14px; font-size: 15px; line-height: 1.5; color: var(--text); }
.sidebar-cta-btns { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.sidebar-cta-btns .cta-btn { width: 100%; padding: 10px 16px; font-size: 15px; }
.sidebar-cta-more { margin: 0; font-size: 13px; line-height: 1.45; }
.sidebar-cta-more a { color: var(--accent); font-weight: 700; text-decoration: underline; }

@media (max-width: 560px) {
  .post-cta { padding: 20px 16px; }
  .post-cta h2 { font-size: 21px; }
  .post-cta-btns { flex-direction: column; }
  .post-cta-btns .cta-btn { width: 100%; }
}
