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

html {
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: #fff;
  color: #222;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid #222;
  outline-offset: 3px;
}

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

/* Header */

.site-header {
  background: #fff;
}

.header-bar {
  border-bottom: 1px solid #f4f4f4;
}

.header-inner {
  width: 100%;
  max-width: 940px;
  min-height: 68px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}

.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  max-width: 280px;
  text-decoration: none;
}

.site-logo img {
  display: block;
  width: auto;
  height: 48px;
  max-width: 100%;
}

.site-nav {
  flex: 1;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}

.nav-inner a {
  color: #222;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.nav-inner a:hover {
  color: #555;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}

.search-button,
.menu-button {
  width: 35px;
  height: 35px;
  margin: 0;
  padding: 4px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: #222;
  cursor: pointer;
}

.search-button {
  display: flex;
}

.menu-button {
  display: none;
}

.search-button svg,
.menu-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
}

.search-icon {
  width: 23px;
  height: 23px;
  stroke-width: 2;
}

.search-close-icon {
  display: none;
  width: 25px;
  height: 25px;
  stroke-width: 2;
}

.search-button[aria-expanded="true"] .search-icon {
  display: none;
}

.search-button[aria-expanded="true"] .search-close-icon {
  display: block;
}

.menu-icon {
  width: 27px;
  height: 27px;
  stroke-width: 3;
}

.menu-close-icon {
  display: none;
  width: 25px;
  height: 25px;
  stroke-width: 2;
}

.menu-button[aria-expanded="true"] .menu-icon {
  display: none;
}

.menu-button[aria-expanded="true"] .menu-close-icon {
  display: block;
}

.search-panel {
  display: none;
}

.search-panel.is-open {
  display: block;
}

.search-form {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  gap: 10px;
}

.search-form input {
  width: 100%;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
  outline: none;
}

.search-form input:focus {
  border-color: #777;
}

.search-form button {
  padding: 11px 18px;
  background: #222;
  color: #fff;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

/* Main Layout */

.page-main {
  padding: 45px 20px 70px;
}

.content-layout {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 650px) 250px;
  justify-content: center;
  align-items: start;
  gap: 40px;
}

.content-layout,
.article-content,
.article-body {
  min-width: 0;
  max-width: 100%;
}

.breadcrumbs {
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 14px;
  line-height: 1.4;
}

.breadcrumbs a {
  color: #c92313;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: #a91d10;
}

.breadcrumb-separator {
  color: #aaa;
  font-size: 13px;
  line-height: 1;
}

.article-content {
  width: 100%;
}

.article-content h1 {
  margin: 0 0 18px;
  color: #111;
  font-size: 36px;
  line-height: 1.25;
}

.article-meta {
  margin: -6px 0 22px;
  padding-bottom: 14px;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
  border-bottom: 1px solid #f4f4f4;
}

.article-body {
  font-size: 17px;
  line-height: 1.75;
}

.article-body h2 {
  margin: 28px 0 10px;
  color: #111;
  line-height: 1.35;
}

.article-body h3 {
  margin: 24px 0 8px;
  color: #111;
  font-size: 20px;
  line-height: 1.4;
}

.article-body p {
  margin: 0 0 18px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 18px;
  padding-left: 24px;
}

.article-body ul {
  list-style-type: disc;
}

.article-body li {
  margin-bottom: 6px;
}

.article-body a {
  color: #c92313;
  text-decoration: none;
}

.article-body a:hover {
  color: #a91d10;
}

.article-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 18px 0 24px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 15px;
  line-height: 1.5;
}

.article-body table > thead,
.article-body table > tbody,
.article-body table > tfoot {
  display: table;
  width: 100%;
  min-width: 100%;
  table-layout: auto;
}

.article-body th,
.article-body td {
  min-width: 130px;
  padding: 9px 10px;
  border-bottom: 1px solid #eee;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.article-body th:first-child,
.article-body td:first-child {
  width: 190px;
  min-width: 190px;
  max-width: 220px;
}

.article-body th {
  background: transparent;
  color: #111;
  font-weight: 700;
}

.article-body tbody tr:last-child td,
.article-body tbody tr:last-child th {
  border-bottom: 0;
}

.article-body img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
}

.article-body figure {
  width: 100%;
  max-width: 100%;
  margin: 26px 0;
}

.article-body figure img {
  margin: 0 auto;
}

.article-body figcaption {
  margin-top: 8px;
  color: #777;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

/* Related Posts */

.related-posts {
  margin-top: 38px;
}

.related-posts h2 {
  margin: 0 0 14px;
  color: #111;
  line-height: 1.35;
}

.related-posts ul {
  margin: 0;
  padding-left: 18px;
  list-style-type: square;
  list-style-position: outside;
}

.related-posts li {
  margin: 6px 0;
  padding-left: 0;
}

.related-posts a {
  color: #c92313;
  font-weight: 600;
  text-decoration: none;
}

.related-posts a:hover {
  color: #a91d10;
}


/* Homepage, category and search result title links */
.home-post h2 a {
  color: #2f5f7f;
  text-decoration: none;
}

.home-post h2 a:hover {
  color: #1f425c;
  text-decoration: underline;
}

/* Sidebar */

.sidebar {
  width: 100%;
}

.sidebar-section + .sidebar-section {
  margin-top: 38px;
}

.sidebar-section h2 {
  margin: 0 0 12px;
  color: #111;
  line-height: 1.35;
}

.article-body h2,
.related-posts h2,
.sidebar-section h2 {
  font-size: 22px;
}

.sidebar-section p {
  margin: 0 0 15px;
  color: #555;
  font-size: 14px;
  line-height: 1.6;
}

.popular-categories nav,
.featured-posts nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.popular-categories a,
.featured-posts a {
  width: fit-content;
  color: #222;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  text-decoration: none;
}

.popular-categories a:hover,
.featured-posts a:hover {
  color: #555;
}

/* Footer */

.site-footer {
  padding: 28px 20px 22px;
  background: #fff;
  border-top: 1px solid #f4f4f4;
  text-align: center;
}

.footer-links {
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.footer-links a {
  color: #444;
  font-size: 14px;
  text-decoration: none;
}

.footer-links a:hover {
  color: #111;
}

.copyright {
  margin: 0;
  color: #777;
  font-size: 13px;
}

/* Tablet and Mobile */

@media (max-width: 900px) {
  .content-layout {
    max-width: 650px;
    grid-template-columns: 1fr;
    gap: 45px;
  }
}

@media (max-width: 768px) {
  .header-bar {
    border-bottom: 0;
  }

  .header-inner {
    --mobile-header-height: 68px;
    position: relative;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0;
  }

  /* Keep the logo and action icons in a fixed-height top row. */
  .site-logo,
  .header-actions {
    height: var(--mobile-header-height);
  }

  /* Draw the normal header border directly below the top row. */
  .header-inner::after {
    content: "";
    position: absolute;
    top: var(--mobile-header-height);
    left: 50%;
    width: 100vw;
    height: 1px;
    background: #f4f4f4;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .menu-button {
    display: flex;
  }

  .site-nav {
    display: none;
    order: 3;
    flex: 0 0 100%;
    width: 100%;
  }

  .site-nav.is-open {
    display: block;
  }

  .nav-inner {
    padding: 12px 0 16px;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

  .nav-inner a {
    padding: 6px 0;
    text-align: right;
  }
}

@media (max-width: 700px) {
  .header-inner {
    --mobile-header-height: 62px;
    min-height: 62px;
    padding: 0 12px;
  }

  .site-logo {
    max-width: 220px;
  }

  .site-logo img {
    height: 40px;
  }

  .page-main {
    padding: 32px 20px 50px;
  }

  .content-layout {
    gap: 40px;
  }

  .breadcrumbs {
    margin-bottom: 12px;
    font-size: 13px;
  }

  .article-content h1 {
    font-size: 30px;
  }

  .article-body table {
    font-size: 14px;
  }

  .article-body th,
  .article-body td {
    min-width: 120px;
    padding: 8px 9px;
  }

  .article-body th:first-child,
  .article-body td:first-child {
    width: 165px;
    min-width: 165px;
    max-width: 190px;
  }

  .article-body img {
    margin: 20px auto;
  }

  .article-body figure {
    margin: 22px 0;
  }

  .sidebar-section + .sidebar-section {
    margin-top: 32px;
  }

  .footer-links {
    gap: 7px 16px;
  }
}

@media (max-width: 420px) {
  body {
    font-size: 15px;
  }


  .site-logo {
    max-width: 190px;
  }

  .site-logo img {
    height: 38px;
  }

  .page-main {
    padding: 28px 16px 45px;
  }

  .article-content h1 {
    font-size: 28px;
  }

  .search-form {
    padding: 15px;
  }
}


/* Search page */
.search-page-form {
  display: flex;
  gap: 10px;
  margin: 18px 0 28px;
}
.search-page-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #ccc;
  font: inherit;
}
.search-page-form button {
  padding: 11px 18px;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 520px) {
  .search-page-form {
    flex-direction: column;
  }
}
