/* Subatomic Blog Theme - Default Styles */

/* ===== CSS Variables ===== */
:root {
  --sb-primary-color: #059669;
  --sb-primary-hover: #047857;
  --sb-text-color: #1f2937;
  --sb-text-muted: #6b7280;
  --sb-bg-color: #ffffff;
  --sb-bg-secondary: #f9fafb;
  --sb-border-color: #e5e7eb;
  --sb-aside-width: 320px;
  --sb-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sb-font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sb-radius: 2px;
  --sb-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --sb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ===== Base Styles ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

.sb-body {
  margin: 0;
  padding: 0;
  font-family: var(--sb-font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--sb-text-color);
  background-color: var(--sb-bg-secondary);
}

/* ===== Main Layout Container ===== */
.sb-main-container {
  display: grid;
  grid-template-columns: var(--sb-aside-width) 1fr;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
}

/* ===== Sidebar / Aside ===== */
.sb-aside {
  padding: 2rem 1.5rem;
  background-color: #0f1219;
  border-right: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Logo Section */
.sb-logo-container {
  margin-bottom: 0.5rem;
  padding: 1rem;
  padding-top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: -1rem;
  padding-bottom: 1.5rem;
}

.sb-logo-title {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
  text-decoration: none;
  transition: color 0.15s ease;
}

.sb-logo-title:hover {
  color: #ffffff;
}

.sb-logo-title:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 4px;
}

.sb-logo-subtitle {
  margin: 0.5rem 0 0 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Aside Sections */
.sb-aside-section {
  padding: 0;
}

.sb-aside-section-title {
  margin: 0 0 0.75rem 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
}

/* Lists within aside sections */
.sb-aside-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sb-aside-section li {
  /* margin: 0.25rem 0; */
}

.sb-aside-section a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.15s ease;
}

.sb-aside-section a:hover {
  color: #ffffff;
}

.sb-aside-section a:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

.sb-aside-section-content {
  display: flex;
  flex-direction: column;
}

/* Static Links */
.sb-static-links-container {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sb-static-links-link-container {
  margin: 0;
}

.sb-static-links-link {
  display: block;
  padding: 0.1rem;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
  border-radius: var(--sb-radius);
  /* transition: background-color 0.15s ease, color 0.15s ease, padding-left 0.15s ease; */
}

.sb-static-links-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  text-decoration:none;
  /* padding-left: 1rem; */
}

.sb-static-links-link:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* Tags Container */
.sb-aside-tag-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sb-aside-tag-link {
  display: inline-block;
  padding: 0.2rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sb-aside-tag-link:hover {
  background-color: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
  transform: translateY(-1px);
}

.sb-aside-tag-link:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* Aside Links */
.sb-aside-link-container {
  margin: 0;
  font-weight: normal;
}

.sb-aside-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.sb-aside-link:hover {
  background-color: rgba(16, 185, 129, 0.25);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.sb-aside-link:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* Search Container */
.site-search {
  padding: 0;
}

.searchContainer {
  width: 100%;
}

.sb-search-container {
  position: relative;
  width: 100%;
}

.sb-search-input {
  width: 100%;
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
  font-family: var(--sb-font-sans);
  color: #f1f5f9;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--sb-radius);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.sb-search-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.sb-search-input:focus {
  border-color: rgba(16, 185, 129, 0.6);
  background-color: rgba(255, 255, 255, 0.12);
}

.sb-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  background-color: #1a2030;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--sb-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-height: 60vh;
  overflow-y: auto;
}

.sb-search-result-container {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sb-search-result-container:last-child {
  border-bottom: none;
}

.sb-search-result-document-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.25rem;
}

.sb-search-result-document-url {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #10b981;
  text-decoration: none;
  margin-bottom: 0.25rem;
  transition: color 0.15s ease;
}

.sb-search-result-document-url:hover {
  color: #34d399;
}

.subatomic-search-sections-container {
  list-style: none;
  margin: 0;
  padding: 0;
}

.subatomic-search-sections-container li {
  margin: 0;
}

.subatomic-search-section-url {
  display: block;
  padding: 0.125rem 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.15s ease;
}

.subatomic-search-section-url:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* ===== Main Content ===== */
main {
  padding: 2rem;
  max-width: 1200px;
}

main > div {
  max-width: 52rem;
}

/* Card Layout */
.card-columns {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ===== Post Cards ===== */
.sb-postcard-container {
  background-color: var(--sb-bg-color);
  border-radius: var(--sb-radius);
  box-shadow: var(--sb-shadow);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sb-postcard-container + .sb-postcard-container {
  margin-top: 1.5rem;
}

.sb-postcard-container:hover {
  box-shadow: var(--sb-shadow-lg);
  transform: translateY(-2px);
}

.sb-postcard-container:focus-within {
  box-shadow: var(--sb-shadow-lg), 0 0 0 2px var(--sb-primary-color);
}

.sb-postcard-body {
  padding: 1.5rem;
}

.sb-postcard-title-container {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.sb-postcard-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--sb-text-color);
  text-decoration: none;
  line-height: 1.4;
}

.sb-postcard-title:hover {
  color: var(--sb-primary-color);
}

.sb-postcard-title:focus-visible {
  outline: 2px solid var(--sb-primary-color);
  outline-offset: 3px;
  border-radius: 2px;
}

.sb-postcard-date {
  font-size: 0.8125rem;
  color: var(--sb-text-muted);
}

.sb-postcard-description {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--sb-text-muted);
  line-height: 1.6;
}

/* ===== Sidebar Navigation (Posts list) ===== */
.sb-aside-navigation-container {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sb-aside-navigation-link {
  display: block;
  padding: 0.4rem 0.75rem;
  margin: 0.125rem -0.75rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: var(--sb-radius);
  border-left: 2px solid transparent;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.sb-aside-navigation-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.06);
  border-left-color: rgba(255, 255, 255, 0.3);
}

.sb-aside-navigation-link:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

.sb-aside-navigation-link-current {
  color: #10b981;
  font-weight: 500;
  border-left-color: #10b981;
  background-color: rgba(16, 185, 129, 0.08);
}

/* ===== Post Page Styles ===== */
.sb-post-title {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--sb-text-color);
  line-height: 1.3;
}

.sbt-post-tagline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem 0.25rem;
  margin: 0 0 1.5rem 0;
}

.sb-tag-link {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--sb-text-muted);
  background: none;
  border: none;
  text-decoration: none;
  transition: color 0.15s ease;
}

.sb-tag-link:hover {
  color: var(--sb-primary-color);
}

.sb-tag-link:focus-visible {
  outline: 2px solid var(--sb-primary-color);
  outline-offset: 2px;
}

/* ===== Post Author ===== */
.sb-post-author-container {
  font-size: 0.9375rem;
  color: var(--sb-text-muted);
  margin-bottom: 1.5rem;
}

.sb-post-author-link {
  color: var(--sb-primary-color);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed rgba(5, 150, 105, 0.4);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.sb-post-author-link:hover {
  color: var(--sb-primary-hover);
  border-bottom-style: solid;
  border-color: var(--sb-primary-hover);
}

.sb-post-author-link:focus-visible {
  outline: 2px solid var(--sb-primary-color);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== Post Content ===== */
.sb-content-container {
  max-width: 52rem;
}

.sb-post-content {
  line-height: 1.75;
  border-top: 1px solid var(--sb-border-color);
  padding-top: 1.5rem;
}

.sb-post-content h1,
.sb-post-content h2,
.sb-post-content h3,
.sb-post-content h4,
.sb-post-content h5,
.sb-post-content h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--sb-text-color);
}

.sb-post-content h1 { font-size: 1.875rem; }
.sb-post-content h2 { font-size: 1.5rem; }
.sb-post-content h3 { font-size: 1.25rem; }
.sb-post-content h4 { font-size: 1.125rem; }

.sb-post-content p {
  margin: 0 0 0.75rem 0;
}

.sb-post-content a {
  color: #046c4e;
  text-decoration: underline;
  text-decoration-color: rgba(4, 108, 78, 0.4);
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.sb-post-content a:hover {
  color: #03543f;
  text-decoration-color: #03543f;
}

.sb-post-content a:focus-visible {
  outline: 2px solid var(--sb-primary-color);
  outline-offset: 2px;
  border-radius: 2px;
  text-decoration: none;
}

.sb-post-content ul,
.sb-post-content ol {
  margin: 0 0 0.75rem 0;
  padding-left: 1.25rem;
}

.sb-post-content li {
  margin-bottom: 0.2rem;
}

.sb-post-content blockquote {
  margin: 0.75rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid var(--sb-primary-color);
  background-color: var(--sb-bg-secondary);
  font-style: italic;
}

.sb-post-content pre {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border-radius: var(--sb-radius);
  overflow-x: auto;
}

.sb-post-content code {
  font-family: var(--sb-font-mono);
  font-size: 0.875em;
}

.sb-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--sb-radius);
}

.sb-post-content table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
}

.sb-post-content th,
.sb-post-content td {
  padding: 0.75rem;
  border: 1px solid var(--sb-border-color);
  text-align: left;
}

.sb-post-content th {
  background-color: var(--sb-bg-secondary);
  font-weight: 600;
}

/* ===== Table of Contents ===== */
.sb-toc-container {
  float: right;
  margin: 0 0 1rem 1.5rem;
  padding: 0.75rem 1rem;
  max-width: 280px;
  background-color: var(--sb-bg-secondary);
  border: 1px solid var(--sb-border-color);
  border-radius: var(--sb-radius);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.sbt-toc-list-container {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sbt-toc-list-container .sbt-toc-list-container {
  padding-left: 0.75rem;
}

.sbt-toc-list-container li {
  margin: 0.125rem 0;
}

.sbt-toc-list-link {
  color: var(--sb-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.sbt-toc-list-link:hover {
  color: var(--sb-text-color);
}

.sbt-toc-list-link:focus-visible {
  outline: 2px solid var(--sb-primary-color);
  outline-offset: 2px;
}

/* ===== Responsive Design ===== */
@media (max-width: 900px) {
  .sb-main-container {
    grid-template-columns: 1fr;
  }

  .sb-aside {
    position: relative;
    height: auto;
    order: 2;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  }

  main {
    order: 1;
  }

  main {
    padding: 1.5rem;
  }

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

  .sb-toc-container {
    float: none;
    max-width: none;
    margin: 0 0 1.5rem 0;
  }
}

@media (max-width: 600px) {
  .sb-aside {
    padding: 1.5rem 1rem;
  }

  main {
    padding: 1rem;
  }

  .sb-postcard-body {
    padding: 1.25rem;
  }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --sb-primary-color: #34d399;
    --sb-primary-hover: #6ee7b7;
    --sb-text-color: #f3f4f6;
    --sb-text-muted: #9ca3af;
    --sb-bg-color: #1f2937;
    --sb-bg-secondary: #111827;
    --sb-border-color: #374151;
    --sb-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --sb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  }
}
