.site-header {
  padding: 15px 20px;
  margin-bottom: 10px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 15px;
  max-width: 1200px;
  margin: 0 auto;
}

.site-logo {
  max-height: 60px;
  width: auto;
  display: block;
}

.site-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.site-title a {
  font-size: 1.6em;
  font-weight: bold;
  color: #007acc;
  text-decoration: none;
}

.site-title a:hover {
  text-decoration: underline;
}

.site-tagline {
  font-size: 0.95em;
  color: #444;
  margin-top: 4px;
}

body {
  font-family: sans-serif;
}
.container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;  /* ← smaller sidebar */
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px;
  padding: 20px;
}
h1 {
  word-break: break-word;
  overflow-wrap: break-word;
  font-size: 1.6em;
  line-height: 1.3;
  margin-top: 0.2em;
}
h2 {
  font-size: 1.1em;
  font-weight: normal;
  margin-top: 0.2em;
  margin-bottom: 0.5em;
  color: #444;
  word-break: break-word;
  overflow-wrap: break-word;
}
.right-sidebar {
  width: 100%; /* ← matches its 260px grid column */
  background: #ffffff;
  padding: 15px;
  border-radius: 8px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.right-sidebar li {
  word-wrap: break-word;
  line-height: 1.4;
}
.right-sidebar li a {
  font-size: 0.90em;
}
.content {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
}

.blog-image {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 627;  /* Maintain correct aspect ratio */
  object-fit: cover;         /* Crop to fill container if needed */
  object-position: center top; /* move crop down slightly */
  margin: 20px auto;
}

.image-caption {
  text-align: center;
  font-size: 0.85em;
  color: #666;
  margin-top: 6px;
  font-style: italic;
}


.category-group {
  margin-bottom: 1em;
}

.category-toggle {
  background: none;
  border: none;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  color: #007acc;
  text-align: left;
  padding: 0;
  margin-bottom: 0.3em;
}

.category-toggle:hover {
  text-decoration: underline;
}

.category-posts {
  padding-left: 1em;
  font-size: 0.8em;
  list-style: none;
  margin-bottom: 0.1em;
  display: none; /* collapsed by default */
}

body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

.dark-mode .content,
.dark-mode .right-sidebar,
.dark-mode .site-header {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border-color: #333;
}
.dark-mode a {
  color: #66ccff;
}
.dark-mode .category-toggle {
  color: #66ccff;
}
.dark-toggle {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.4em;
  cursor: pointer;
}
.tags a {
  display: inline-block;
  margin-right: 6px;
  font-size: 0.9em;
  color: #007acc;
  text-decoration: none;
}
.tags a:hover {
  text-decoration: underline;
}
.search-box {
  position: relative;
  max-width: 300px;
  margin-left: auto;
}

#searchInput {
  padding: 6px 10px;
  font-size: 0.95em;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.search-results {
  position: absolute;
  background: #fff;
  width: 100%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
  border-radius: 4px;
  margin-top: 4px;
}

.search-result {
  padding: 8px 10px;
  font-size: 0.9em;
  border-bottom: 1px solid #eee;
}

.search-result a {
  text-decoration: none;
  color: #007acc;
}

.search-result a:hover {
  text-decoration: underline;
}

.no-results {
  padding: 8px 10px;
  font-style: italic;
  color: #777;
}
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr; /* stack content and sidebar */
  }

  .right-sidebar {
    margin-top: 20px;
  }

  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .site-logo {
    max-height: 50px;
  }

  .site-title a {
    font-size: 1.3em;
  }

  .site-tagline {
    font-size: 0.9em;
  }

  .dark-toggle {
    align-self: flex-end;
    margin-top: 10px;
  }
}
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1em;
  color: #007acc;
  cursor: pointer;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: block;
  }

  .right-sidebar {
    display: none;
  }

  .right-sidebar.visible {
    display: block;
    margin-top: 10px;
  }
}
