Custom CSS Variables
:root {
    --content-max-width: 1200px;
    --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Custom Header Styles - Red Background for Both Modes */
.md-header {
  background-color: var(--md-primary-fg-color) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-bottom: none;
}

.md-header__logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-red {
  color: #ffffff;
  font-weight: 700;
}

.logo-team {
  color: #ffffff;
  font-weight: 400;
}

.md-header__nav-links {
  display: flex;
  gap: 2rem;
  margin-left: auto;
  margin-right: 1rem;
  align-items: center;
}

/* Nav links - White text on red background */
.md-header__nav-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s, transform 0.2s;
  opacity: 0.9;
}

.md-header__nav-link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* Theme toggle button styling - White icons */
.md-header__option {
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
}

.md-header__button[for^="__palette"] {
  color: #ffffff !important;
}

.md-header__button[for^="__palette"] svg {
  fill: #ffffff !important;
  opacity: 1 !important;
}

.md-option:checked + label {
  display: block !important;
}

.md-option:not(:checked) + label {
  display: none;
}

.md-header__option .md-select {
  display: flex;
  align-items: center;
}

.md-header__option label[hidden] {
  display: block !important;
  visibility: visible !important;
}

/* Search icon - White */
.md-header .md-icon svg {
  fill: #ffffff;
}

/* Make hamburger menu icon white on mobile */
.md-header__button.md-icon svg {
  fill: #ffffff;
}

/* Mobile Navigation Drawer Styling */
.md-nav--primary .md-nav__link {
  transition: background-color 0.2s, color 0.2s;
}

.md-nav--primary .md-nav__link:hover {
  background-color: rgba(211, 47, 47, 0.05);
  color: var(--md-primary-fg-color);
}

[data-md-color-scheme="slate"] .md-nav--primary .md-nav__link:hover {
  background-color: rgba(239, 83, 80, 0.1);
}

/* Header Logo Image - Light logo with white filter for visibility on red header */
.md-header__logo-img {
  display: inline-block;
  height: 28px;
  width: auto;
  margin-right: 0.5rem;
  vertical-align: middle;
  filter: brightness(0) invert(1); /* Makes logo white for red background */
  transition: opacity 0.2s ease;
}

.md-header__button.md-logo {
  display: flex;
  align-items: center;
  gap: 0;
}

/* Announcements grid: consistent card spacing and subtle borders */
.md-typeset .grid.cards > ul > li {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  background: var(--md-code-bg-color);
}

/* Card grid title styling - make titles red */
.md-typeset .grid.cards > ul > li strong,
.md-typeset .grid.cards > ol > li strong {
    color: var(--md-primary-fg-color) !important;
}

/* Enhanced Typography */
.md-typeset {
    font-size: 0.8rem;
    line-height: 1.7;
    letter-spacing: 0.01em;
}

.md-typeset h1 {
    font-weight: 700;
    font-size: clamp(1.25rem, 2.3vw, 1.4rem);
    line-height: 1.45;
    margin-bottom: 0.875rem;
    margin-top: 1.25rem;
    letter-spacing: -0.01em;
    color: #000000;
}

[data-md-color-scheme="slate"] .md-typeset h1 {
    color: #ffffff;
}

.md-typeset h2 {
    font-weight: 600;
    font-size: clamp(1.15rem, 2vw, 1.3rem);
    line-height: 1.5;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
    color: #000000;
}

[data-md-color-scheme="slate"] .md-typeset h2 {
    color: #ffffff;
}

.md-typeset h3 {
    font-weight: 600;
    font-size: clamp(1.1rem, 1.8vw, 1.2rem);
    line-height: 1.55;
    margin-top: 1.25rem;
    margin-bottom: 0.625rem;
    color: #000000;
}

[data-md-color-scheme="slate"] .md-typeset h3 {
    color: #ffffff;
}

.md-typeset h4 {
    font-weight: 600;
    font-size: clamp(1.05rem, 1.6vw, 1.15rem);
    line-height: 1.55;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #000000;
}

[data-md-color-scheme="slate"] .md-typeset h4 {
    color: #ffffff;
}

.md-typeset h5 {
    font-weight: 600;
    font-size: clamp(1rem, 1.4vw, 1.1rem);
    line-height: 1.6;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #000000;
}

[data-md-color-scheme="slate"] .md-typeset h5 {
    color: #ffffff;
}

/* Content Container - Better spacing and max-width */
.md-content__inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* Blog post page container with borders */
.md-content__inner > article,
.md-content__inner > .md-typeset {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: var(--md-default-bg-color);
}

/* Light mode border */
[data-md-color-scheme="default"] .md-content__inner > article,
[data-md-color-scheme="default"] .md-content__inner > .md-typeset {
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Dark mode border */
[data-md-color-scheme="slate"] .md-content__inner > article,
[data-md-color-scheme="slate"] .md-content__inner > .md-typeset {
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Hide the tag pills/badges at top if present */
.md-content__inner .md-tags {
  display: none;
}

/* Adjust spacing for blog posts */
.md-content__inner > article h1:first-child,
.md-content__inner > .md-typeset h1:first-child {
  margin-top: 0;
}

/* Author Information (Below Title) */
.post-meta-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 2rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-md-color-scheme="slate"] .post-meta-info {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.post-authors {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--md-primary-fg-color);
}

.post-author-name {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--md-default-fg-color);
  text-decoration: none;
  border-bottom: none !important;
  transition: color 0.2s;
}

.post-author-name:hover {
  color: var(--md-primary-fg-color);
}

.post-meta-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--md-default-fg-color);
  opacity: 0.7;
}

.post-meta-separator {
  opacity: 0.5;
}

/* Mobile - Stack author info vertically */
@media screen and (max-width: 600px) {
  .post-meta-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-meta-details {
    width: 100%;
  }
}

/* Enhanced Code Blocks */
.md-typeset code {
    background-color: var(--md-code-bg-color);
    color: var(--md-code-fg-color);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
}

.md-typeset pre > code {
    background-color: transparent;
    padding: 0;
}

.md-typeset .highlight {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    margin: 1.5rem 0;
}

/* Enhanced Admonitions */
.md-typeset .admonition,
.md-typeset details {
    border-radius: 8px;
    box-shadow: var(--shadow-subtle);
    border-left: 4px solid var(--md-primary-fg-color);
    margin: 1.5rem 0;
}

.md-typeset .admonition-title {
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Enhanced Cards */
.md-typeset .grid.cards {
    gap: 1.5rem;
}

.md-typeset .grid.cards > ul > li,
.md-typeset .grid.cards > ol > li {
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid.cards > ol > li:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Enhanced Tables */
.md-typeset table:not([class]) {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.md-typeset table:not([class]) th {
    font-weight: 600;
    background-color: rgba(211, 47, 47, 0.05);
    letter-spacing: 0.02em;
}

/* Links with subtle red accent */
.md-typeset a {
    text-decoration: none;
    border-bottom: 1px solid rgba(211, 47, 47, 0.3);
    transition: border-color 0.2s ease;
}

.md-typeset a:hover {
    border-bottom-color: var(--md-primary-fg-color);
}

/* Enhanced Navigation */
.md-tabs {
    box-shadow: var(--shadow-subtle);
}

/* Better spacing for lists */
.md-typeset ul,
.md-typeset ol {
    margin: 1rem 0;
}

.md-typeset li {
    margin: 0.5rem 0;
}

/* Blockquotes */
.md-typeset blockquote {
    border-left: 4px solid var(--md-primary-fg-color);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background-color: rgba(211, 47, 47, 0.03);
    border-radius: 0 8px 8px 0;
    box-shadow: var(--shadow-subtle);
}

/* Horizontal Rules */
.md-typeset hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        var(--md-primary-fg-color),
        transparent);
    margin: 2rem 0;
    opacity: 0.1;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Medium-style Blog Layout */
.blog-header {
  max-width: 1200px;
  margin: 0 auto 1.5rem;
  padding: 1rem 0;
}

.blog-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.blog-subtitle {
  font-size: 1rem;
  color: var(--md-default-fg-color);
  opacity: 0.7;
  line-height: 1.6;
}

.blog-posts {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 0;
  padding-bottom: 4rem;
}

.blog-post {
  display: flex;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  /* Animation disabled */
}

[data-md-color-scheme="slate"] .blog-post {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Blog post hover animation disabled */
/* .blog-post:hover {
  transform: translateY(-2px);
} */

.post-content {
  flex: 1;
  min-width: 0;
}

.post-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.5rem 0;
}

.post-content h2 a {
  color: var(--md-default-fg-color);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.2s ease;
}

.post-content h2 a:hover {
  color: var(--md-primary-fg-color);
}

.post-excerpt {
  font-size: 0.8rem;
  line-height: 1.6;
  margin: 0.5rem 0 1rem 0;
  color: var(--md-default-fg-color);
  opacity: 0.8;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--md-default-fg-color);
  opacity: 0.6;
}

.post-separator {
  opacity: 0.5;
}

.post-image {
  flex-shrink: 0;
  width: 160px;
  height: 100px;
  overflow: hidden;
  border-radius: 6px;
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-post:hover .post-image img {
  transform: scale(1.05);
}

/* Responsive adjustments */
@media screen and (max-width: 76.1875em) {
    .md-content__inner {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Mobile Header - Hide nav links on tablets and below */
@media screen and (max-width: 960px) {
  .md-header__nav-links {
    display: none;
  }

  /* Adjust header spacing on tablets */
  .md-header__logo-text {
    font-size: 1.3rem;
  }

  .md-header__logo-img {
    height: 24px;
  }
}

@media screen and (max-width: 768px) {
  .blog-post {
    flex-direction: column-reverse;
    gap: 1rem;
  }

  .post-image {
    width: 100%;
    height: 200px;
  }

  .blog-header h1 {
    font-size: 1.75rem;
  }

  .post-content h2 {
    font-size: 1.2rem;
  }

  /* Mobile header adjustments */
  .md-header__logo-text {
    font-size: 1.2rem;
  }

  .md-header__logo-img {
    height: 22px;
    margin-right: 0.35rem;
  }

  /* Adjust theme toggle size on mobile */
  .theme-switch {
    height: 1rem;
    width: 1.75rem;
  }

  .theme-switch-thumb {
    width: 0.875rem;
    height: 0.875rem;
  }
}

@media screen and (max-width: 44.9375em) {
    .md-typeset {
        font-size: 0.9rem;
    }

    .md-content__inner {
        padding-top: 1.5rem;
        padding-bottom: 2rem;
    }

    /* Very small screens - further reduce header elements */
    .md-header__logo-text {
      font-size: 1.1rem;
    }

    .md-header__logo-img {
      height: 20px;
    }
}

/* GitHub repo link - White background in mobile drawer */
@media screen and (max-width: 59.9844em) {
  .md-nav__source {
    background-color: #fff;
    color: var(--md-primary-bg-color);
    display: block;
    padding: 0 .2rem;
  }
}

/* Removed more duplicate color definitions - colors.css and components.css handle these */
