:root {
  --color-text: #161616;
  --color-muted: #666;
  --color-border: #e7e7e7;
  --color-surface: #fff;
  --color-soft: #f7f7f7;
  --color-brand: #b31322;
  --color-brand-dark: #83111a;
  --container: 1180px;
  --radius: 8px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

.theme-dark {
  --color-text: #f2f2f2;
  --color-muted: #b8b8b8;
  --color-border: #303030;
  --color-surface: #111;
  --color-soft: #1b1b1b;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  text-rendering: optimizeSpeed;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--color-brand);
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  z-index: 100000;
  top: 8px;
  right: 8px;
  width: auto;
  height: auto;
  padding: 8px 12px;
  clip: auto;
  background: var(--color-text);
  color: #fff;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  overflow: visible;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 24px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.site-branding {
  display: flex;
  align-items: center;
  max-width: 220px;
}

.site-branding {
  min-width: 0;
}

.site-title {
  display: inline-block;
  color: var(--color-brand);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
}

.site-description {
  margin: 2px 0 0;
  color: var(--color-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.custom-logo {
  display: block;
  max-height: 46px;
  width: auto;
  aspect-ratio: 10 / 3;
  object-fit: contain;
}

.primary-nav ul,
.footer-nav ul,
.primary-nav .menu,
.footer-nav .menu {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-nav a,
.footer-nav a {
  display: block;
  padding: 6px 10px;
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.4;
}

@media (min-width: 761px) and (max-width: 1120px) {
  .site-header__inner {
    gap: 12px;
  }

  .primary-nav ul,
  .primary-nav .menu {
    gap: 4px;
  }

  .primary-nav a {
    padding-inline: 6px;
    font-size: 0.92rem;
  }

  .site-branding {
    max-width: 150px;
  }

  .custom-logo {
    max-height: 38px;
  }
}

.primary-nav .page_item,
.footer-nav .page_item {
  list-style: none;
}

.header-icon-button,
.drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.search-toggle {
  display: inline-flex;
}

.nav-toggle span:not(.screen-reader-text) {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0;
  background: var(--color-text);
}

.theme-mode-toggle {
  gap: 2px;
  font-size: 1rem;
  font-weight: 800;
}

.theme-dark .theme-mode-toggle__light,
.theme-light .theme-mode-toggle__dark {
  opacity: 0.35;
}

.search-icon {
  position: relative;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  position: absolute;
  right: 12px;
  bottom: -6px;
  width: 8px;
  height: 2px;
  background: currentColor;
  content: "";
  transform: rotate(-45deg);
  transform-origin: right center;
}

.drawer-close {
  display: none;
  margin: 0 0 18px;
  font-size: 1.5rem;
  line-height: 1;
}

.site-search-panel,
.drawer-backdrop {
  display: none;
}

.site-search-panel {
  position: fixed;
  z-index: 60;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(90vw, 420px);
  padding: 18px;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 180ms ease;
}

.site-search-panel.is-open {
  display: block;
  transform: translateX(0);
  visibility: visible;
}

.site-search-panel .drawer-close {
  display: inline-flex;
}

.drawer-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.drawer-open .drawer-backdrop {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.drawer-open {
  overflow: hidden;
}

.site-main {
  padding: 32px 0 40px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

.layout--article {
  grid-template-columns: minmax(0, 760px) 320px;
  justify-content: space-between;
}

.single-article-layout {
  max-width: 980px;
}

.single-article-layout .article {
  width: 100%;
}

.section-heading,
.archive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--color-text);
}

.home-news {
  display: grid;
  gap: 30px;
}

.category-archive-layout {
  display: block;
}

.home-section {
  min-width: 0;
}

.home-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.home-card-grid .post-card {
  display: block;
  padding-bottom: 14px;
}

.home-card-grid .post-card__media {
  margin-bottom: 10px;
}

.home-card-grid .post-card__title {
  font-size: 0.98rem;
}

.home-card-grid .post-card__excerpt {
  display: none;
}

.home-card-grid .post-meta {
  font-size: 0.78rem;
}

.section-heading h1,
.section-heading h2,
.archive-header h1 {
  margin: 0;
  padding-bottom: 8px;
  font-size: 1.35rem;
  line-height: 1.4;
}

.section-heading a {
  color: var(--color-brand);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-news {
  margin-bottom: 30px;
}

.hero-news__article {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.hero-news__media,
.post-card__media {
  display: block;
  overflow: hidden;
  background: var(--color-soft);
}

.hero-news__image,
.post-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hero-news__content h1 {
  margin: 10px 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.25;
}

.hero-news__content p {
  margin: 0 0 14px;
  color: var(--color-muted);
  font-size: 1.02rem;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.post-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-border);
}

.post-card__image--placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(179, 19, 34, 0.12), rgba(22, 22, 22, 0.06)),
    var(--color-soft);
}

.post-card__category a,
.hero-news__content .post-categories a {
  display: inline-block;
  margin: 0 0 6px 6px;
  color: var(--color-brand);
  font-size: 0.78rem;
  font-weight: 800;
}

.post-card__title {
  margin: 0 0 7px;
  font-size: 1.05rem;
  line-height: 1.45;
}

.post-card__excerpt {
  margin: 0 0 10px;
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.post-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--color-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.article-meta a {
  color: var(--color-text);
  font-weight: 700;
}

.article-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.article-meta__author a {
  color: var(--color-brand);
}

.sidebar {
  position: sticky;
  top: 96px;
}

.widget {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-border);
}

.widget-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.widget ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.widget li + li {
  margin-top: 8px;
}

.article {
  min-width: 0;
}

.article__header {
  margin-bottom: 18px;
}

.article__category {
  margin-bottom: 10px;
  text-align: right;
}

.article__category a {
  display: inline-block;
  margin: 0 0 6px 6px;
  padding: 5px 12px;
  border-radius: var(--radius);
  background: var(--color-brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.5;
}

.article__category a:hover,
.article__category a:focus {
  color: #fff;
  background: var(--color-brand-dark);
}

.article__title {
  margin: 0 0 12px;
  color: var(--color-text);
  font-size: clamp(1.55rem, 2.35vw, 2.15rem);
  line-height: 1.35;
  font-weight: 800;
}

.article__featured {
  overflow: hidden;
  margin: 0 0 22px;
  border-radius: var(--radius);
  background: transparent;
}

.article__featured img {
  width: 100%;
  height: auto;
  aspect-ratio: 860 / 484;
  border-radius: var(--radius);
  object-fit: cover;
}

.article__featured figcaption {
  position: static;
  margin-top: 8px;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.article__content {
  font-size: 1.08rem;
  line-height: 2;
}

.article__content > * {
  margin-top: 0;
  margin-bottom: 1.15em;
}

.article__content h2,
.article__content h3 {
  line-height: 1.45;
}

.article__content h2 {
  font-size: 1.45rem;
}

.article__content h3 {
  font-size: 1.25rem;
}

.article__content a {
  color: var(--color-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article__content blockquote {
  margin-inline: 0;
  padding: 12px 18px;
  border-right: 4px solid var(--color-brand);
  background: var(--color-soft);
  font-weight: 700;
}

.read-also {
  margin: 18px 0;
  padding: 10px 12px;
  border-right: 3px solid var(--color-brand);
  background: var(--color-soft);
  font-size: 0.96rem;
  line-height: 1.7;
}

.read-also span {
  color: var(--color-brand);
  font-weight: 800;
}

.read-also a {
  margin-right: 6px;
  color: var(--color-text);
  font-weight: 800;
  text-decoration: none;
}

.article__footer,
.post-navigation,
.comments-area {
  margin-top: 28px;
}

.article__footer {
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
}

.adjacent-posts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.adjacent-posts-grid__next {
  justify-self: end;
  width: 100%;
}

.adjacent-post {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--color-soft);
}

.adjacent-post__body {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
}

.adjacent-post__label {
  color: var(--color-brand);
  font-size: 0.9rem;
  font-weight: 800;
}

.adjacent-post strong {
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.55;
}

.adjacent-post time {
  color: var(--color-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.adjacent-post__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(179, 19, 34, 0.1);
  color: var(--color-brand);
  font-size: 1.4rem;
  font-weight: 800;
}

.adjacent-posts-grid__previous .adjacent-post {
  text-align: right;
}

.adjacent-posts-grid__next .adjacent-post {
  flex-direction: row-reverse;
  text-align: left;
}

.adjacent-posts-grid__next .adjacent-post__arrow {
  transform: rotate(180deg);
}

.comments-area {
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.comments-title,
.comment-reply-title {
  margin: 0 0 16px;
  font-size: 1.2rem;
  line-height: 1.4;
}

.comment-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-list .comment {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-border);
}

.comment-body {
  display: grid;
  gap: 8px;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-author img {
  border-radius: 50%;
}

.comment-form-comment textarea {
  width: 100%;
  min-height: 140px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  resize: vertical;
}

.comment-form {
  display: grid;
  gap: 12px;
}

.comment-form p {
  margin: 0;
}

.comment-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--color-text);
  font-weight: 700;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--color-brand);
  outline: 2px solid rgba(179, 19, 34, 0.15);
  outline-offset: 0;
}

.comment-notes,
.logged-in-as,
.comment-form-cookies-consent {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.comment-form-cookies-consent {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-form-cookies-consent label {
  margin: 0;
  font-weight: 400;
}

.form-submit .submit {
  min-height: 42px;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--color-brand);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.tag-list a {
  display: inline-block;
  margin: 0 0 8px 8px;
  padding: 5px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: transparent;
  color: var(--color-brand);
  font-size: 0.86rem;
  font-weight: 800;
}

.share-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  color: var(--color-muted);
  font-weight: 800;
}

.share-links__items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-brand);
  font-size: 0.85rem;
  font-weight: 900;
}

.related-links {
  margin-bottom: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.related-links h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  line-height: 1.4;
}

.related-links ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-links a {
  display: block;
  color: var(--color-text);
  font-weight: 800;
  line-height: 1.6;
}

.ad-slot {
  min-height: 90px;
  margin: 0 0 20px;
  padding: 12px;
  border: 1px dashed var(--color-border);
  background: var(--color-soft);
}

.search-form {
  display: flex;
  gap: 8px;
}

.search-form label {
  flex: 1;
}

.search-field {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
}

.search-form button {
  min-height: 42px;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--color-brand);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.nav-links,
.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.page-numbers,
.post-page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.page-numbers.current,
.post-page-numbers.current {
  border-color: var(--color-brand);
  background: var(--color-brand);
  color: #fff;
}

.load-more-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 28px auto 0;
  padding: 8px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 800;
  cursor: pointer;
}

.load-more-button[hidden] {
  display: none;
}

.load-more-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.not-found {
  max-width: 680px;
  padding: 48px 0;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 88px;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.footer-branding {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font-weight: 800;
}

.footer-branding .custom-logo {
  max-height: 34px;
}

.footer-nav a {
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 400;
}

@media (max-width: 980px) {
  .layout,
  .layout--article,
  .hero-news__article {
    grid-template-columns: 1fr;
  }

  .home-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .site-header__inner {
    position: relative;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    min-height: 64px;
    gap: 8px;
  }

  .nav-toggle {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
  }

  .site-branding {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    text-align: center;
  }

  .site-description {
    display: none;
  }

  .custom-logo {
    max-height: 42px;
  }

  .site-title {
    font-size: 1.15rem;
  }

  .header-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .theme-mode-toggle {
    position: absolute;
    left: 50px;
    width: 36px;
    height: 36px;
    padding: 6px;
    font-size: 0.86rem;
  }

  .search-toggle {
    display: inline-flex;
    width: 42px;
    height: 42px;
  }

  .primary-nav {
    position: fixed;
    z-index: 60;
    top: 0;
    right: 0;
    bottom: 0;
    display: block;
    width: 90vw;
    max-width: 420px;
    padding: 18px;
    border-left: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--shadow);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 180ms ease;
  }

  .primary-nav.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .primary-nav ul,
  .primary-nav .menu {
    display: block;
    width: 100%;
    padding: 0;
  }

  .primary-nav a {
    padding: 12px 4px;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.04rem;
  }

  .drawer-close {
    display: inline-flex;
  }

  .site-search-panel {
    position: fixed;
    z-index: 60;
    top: 0;
    bottom: 0;
    left: 0;
    width: 90vw;
    max-width: 420px;
    padding: 18px;
    border-right: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--shadow);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 180ms ease;
  }

  .site-search-panel.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .site-search-panel .search-form {
    align-items: stretch;
    flex-direction: column;
  }

  .site-search-panel .search-field,
  .site-search-panel .search-form button {
    min-height: 48px;
  }

  .drawer-backdrop {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .drawer-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .drawer-open {
    overflow: hidden;
  }

  .post-grid,
  .post-card {
    grid-template-columns: 1fr;
  }

  .home-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-card__media {
    order: -1;
  }

  .section-heading,
  .archive-header,
  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .article__content {
    font-size: 1rem;
  }

  .article__title {
    font-size: 1.38rem;
    line-height: 1.45;
  }

  .article__content h2 {
    font-size: 1.25rem;
  }

  .article__content h3 {
    font-size: 1.12rem;
  }

  .adjacent-posts-grid {
    grid-template-columns: 1fr;
  }

  .adjacent-post {
    min-height: auto;
  }

  .share-links {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
