:root {
  --site-width: 1200px;
  --sidebar-width: 320px;
  --content-gap: 32px;
  --font-base: 16px;
  --text-color: #111827;
  --muted-color: #6b7280;
  --line-color: #e5e7eb;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  --h1-size: 26px;
  --h2-size: 24px;
  --h3-size: 22px;
  --h4-size: 20px;
  --h5-size: 18px;
  --h6-size: 18px;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: var(--font-base);
  line-height: 1.7;
  color: var(--text-color);
  background: #fff;
}

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

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

a:hover {
  text-decoration: underline;
}

ul,
ol {
  padding-left: 1.25rem;
}

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

.page-section {
  margin-top: 32px;
  margin-bottom: 56px;
}

.site-header {
  width: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--line-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  width: min(100% - 32px, 1400px);
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-branding {
  flex: 0 0 auto;
}

.site-title {
  display: inline-block;
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
}

.site-description {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted-color);
}

.custom-logo-link img {
  max-height: 44px;
  width: auto;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.main-navigation {
  display: flex;
  align-items: center;
}

.primary-menu,
.footer-menu,
.tools-menu,
.recent-posts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-menu {
  display: flex;
  align-items: center;
  gap: 24px;
}

.primary-menu > li {
  position: relative;
  display: flex;
  align-items: center;
}

.primary-menu a {
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.primary-menu .sub-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 30;
  list-style: none;
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu,
.primary-menu li.submenu-open > .sub-menu {
  display: block;
}

.primary-menu .sub-menu li + li {
  margin-top: 8px;
}

.submenu-toggle {
  border: 0;
  background: transparent;
  padding: 6px;
  cursor: pointer;
  color: var(--muted-color);
}

.search-toggle,
.mobile-menu-toggle,
.search-close,
.search-submit {
  cursor: pointer;
}

.search-toggle {
  width: 42px;
  height: 42px;
  border: 0 !important;
  outline: 0;
  border-radius: 999px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
  appearance: none;
}

.search-toggle:hover,
.search-toggle:focus,
.search-toggle:focus-visible {
  border: 0 !important;
  outline: 0;
  box-shadow: none;
}

.search-icon {
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-color);
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  background: var(--text-color);
  transform: rotate(45deg);
  border-radius: 999px;
}

.mobile-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-color);
  border-radius: 12px;
  background: var(--surface);
  padding: 0;
  position: relative;
}

.mobile-menu-toggle span:not(.screen-reader-text) {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--text-color);
}

.mobile-menu-toggle span:nth-child(1) { top: 13px; }
.mobile-menu-toggle span:nth-child(2) { top: 20px; }
.mobile-menu-toggle span:nth-child(3) { top: 27px; }

.search-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 3000;
}

.search-modal.is-active {
  display: block;
}

.search-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.56);
}

.search-modal-content {
  position: relative;
  width: min(100% - 32px, 680px);
  margin: 10vh auto 0;
  background: var(--surface);
  padding: 32px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.search-modal-title {
  margin: 0 0 18px;
}

.search-close {
  position: absolute;
  top: 12px;
  right: 16px;
  border: 0;
  background: transparent;
  font-size: 32px;
  line-height: 1;
}

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

.search-form label {
  flex: 1;
}

.search-field {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line-color);
  padding: 0 14px;
  font: inherit;
}

.search-submit {
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  background: #111827;
  color: #fff;
  font: inherit;
  font-weight: 700;
}

.content-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  gap: var(--content-gap);
}

.content-area,
.sidebar-area,
.card-post,
.single-entry,
.widget {
  min-width: 0;
}

.content-area-full {
  width: 100%;
}

.single-entry,
.card-post,
.widget,
.archive-header,
.post-navigation-block {
  background: var(--surface);
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.single-entry {
  padding: 0;
}

.single-entry .entry-content,
.single-entry .entry-header,
.post-navigation-block {
  padding: 0;
}

.card-post {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin-bottom: 16px;
}

.post-thumb img,
.post-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 16 / 9;
}

.post-body {
  min-width: 0;
}

.entry-meta,
.recent-posts-list time,
.archive-description,
.site-info {
  color: var(--muted-color);
  font-size: 14px;
}

.entry-title,
.archive-title,
.widget-title,
.search-modal-title,
.single-entry h1,
.single-entry h2,
.single-entry h3,
.single-entry h4,
.single-entry h5,
.single-entry h6 {
  line-height: 1.35;
  margin-top: 0;
}

h1,
.single-entry h1,
.archive-title {
  font-size: var(--h1-size);
}

h2,
.single-entry h2,
.widget-title {
  font-size: var(--h2-size);
}

h3,
.single-entry h3 {
  font-size: var(--h3-size);
}

h4,
.single-entry h4 {
  font-size: var(--h4-size);
}

h5,
.single-entry h5 {
  font-size: var(--h5-size);
}

h6,
.single-entry h6 {
  font-size: var(--h6-size);
}

.archive-header {
  margin-bottom: 24px;
}

.widget-title {
  margin-bottom: 16px;
}

.entry-title {
  margin-bottom: 10px;
  word-break: keep-all;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.meta-separator {
  color: var(--muted-color);
}

.entry-summary {
  color: #374151;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.6;
  min-height: calc(1.6em * 2);
}

.entry-content > *:first-child,
.entry-summary > *:first-child {
  margin-top: 0;
}

.entry-content > *:last-child,
.entry-summary > *:last-child {
  margin-bottom: 0;
}

.tools-menu li + li,
.recent-posts-list li + li {
  margin-top: 12px;
}

.tools-menu a,
.recent-posts-list a {
  font-weight: 600;
}

.recent-posts-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 0;
}

.post-grid {
  display: grid;
  gap: 28px 24px;
}

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

.archive-grid + .navigation,
.archive-header + .archive-grid,
.category-top-widgets + .archive-grid {
  margin-top: 24px;
}

.navigation.pagination {
  margin-top: 32px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-links a,
.nav-links span {
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  text-decoration: none;
  background: var(--surface-soft);
}

.post-navigation-block {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
}

.sidebar-area > .widget + .widget {
  margin-top: 28px;
}

.category-top-widgets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.category-top-widget-slot {
  min-width: 0;
}

.category-top-widget-slot .widget {
  height: 100%;
}

.front-page-entry {
  margin-bottom: 48px;
}

.home-section-header {
  margin-bottom: 24px;
}

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

.footer-inner {
  width: min(100% - 32px, var(--site-width));
  margin: 0 auto;
  padding: 24px 0 28px;
}

.footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  align-items: center;
}

.footer-menu li {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  line-height: 1.3;
  margin-top: 0 !important;
}

.footer-menu a {
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.site-info {
  margin: 14px 0 0;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.skip-link:focus {
  clip: auto !important;
  clip-path: none;
  width: auto;
  height: auto;
  padding: 10px 14px;
  background: #111827;
  color: #fff;
  z-index: 9999;
  left: 16px;
  top: 16px;
}

.search-modal-open,
.mobile-nav-open {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .header-inner {
    min-height: 64px;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main-navigation {
    position: fixed;
    top: 65px;
    right: 16px;
    left: 16px;
    background: var(--surface);
    border: 1px solid var(--line-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 16px;
    display: none;
    align-items: stretch;
  }

  .main-navigation.is-open {
    display: block;
  }

  .primary-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .primary-menu > li {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-color);
  }

  .primary-menu > li:last-child {
    border-bottom: 0;
  }

  .primary-menu .sub-menu {
    position: static;
    display: none;
    box-shadow: none;
    margin-top: 12px;
    margin-left: 12px;
  }

  .primary-menu li.submenu-open > .sub-menu {
    display: block;
  }

  .category-top-widgets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .content-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-container,
  .header-inner,
  .footer-inner,
  .search-modal-content {
    width: min(100% - 24px, var(--site-width));
  }

  .search-form {
    flex-direction: column;
  }

  .search-submit {
    height: 46px;
  }

  .post-navigation-block {
    flex-direction: column;
  }
}


.archive-header-centered {
  text-align: center;
}

.archive-header-centered .archive-description {
  margin-left: auto;
  margin-right: auto;
}

.single-post-entry .entry-header {
  margin-bottom: 24px;
}

.single-post-entry .entry-meta {
  margin-bottom: 0;
}

.post-content-widgets {
  margin-top: 32px;
}

.single-post-entry .entry-content {
  margin-top: 32px;
}

.related-posts-section {
  margin-top: 48px;
  margin-bottom: 64px;
}

.related-posts-header {
  margin-bottom: 24px;
}

.related-posts-section + .site-footer {
  margin-top: 0;
}

@media (min-width: 600px) and (max-width: 1000px) {
  .post-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 599px) {
  .post-grid-3,
  .category-top-widgets {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1001px) {
  .post-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


.single-post .content-wrap.site-container {
  margin-top: 32px;
}
