/* docs/stylesheets/extra.css */
.md-main__inner {
  max-width: 80%;
  /* default is ~1000px */
}

.md-content {
  max-width: 80%;
  /* default ~700px */
}

/* Light scheme (Material 'default') */
[data-md-color-scheme="default"] {
  --md-code-bg-color: #f8fafc;
  --md-code-fg-color: #2c2c2c;
  --md-code-hl-keyword-color: #6f42c1;
  --md-code-hl-name-color: #0b76da;
  --md-code-hl-string-color: #b54708;
  --md-code-hl-number-color: #d73a49;
}

/* Dark scheme (Material 'slate') */
[data-md-color-scheme="slate"] {
  --md-code-bg-color: #0f111a;
  --md-code-fg-color: #e6e6e6;
  --md-code-hl-keyword-color: #c792ea;
  --md-code-hl-name-color: #82aaff;
  --md-code-hl-string-color: #ecc48d;
  --md-code-hl-number-color: #f78c6c;
}


/* === Clean Minimal FAQ Styling (final override) === */

/* Neutral gray frame and subtle background */
.md-typeset .admonition.question,
.md-typeset details.question {
  border: 1px solid var(--md-default-fg-color--lightest);
  background-color: rgba(128, 128, 128, 0.05);
  border-left: 3px solid var(--md-default-fg-color--lighter);
  box-shadow: none;
  border-radius: 6px;
}

/* Question summary styling */
.md-typeset .admonition.question>summary,
.md-typeset details.question>summary {
  color: var(--md-default-fg-color);
  font-weight: 600;
  background: none;
  border: none;
  padding: 0.75em 1em;
}

/* Remove any icons before text */
.md-typeset .admonition.question::before,
.md-typeset details.question::before,
.md-typeset .admonition.question>summary::before,
.md-typeset details.question>summary::before {
  display: none !important;
  content: none !important;
}

/* === Force arrow color to gray === */
.md-typeset details>summary::after,
.md-typeset details.question>summary::after {
  color: #aaa !important;
  /* neutral gray arrow */
  opacity: 0.7 !important;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Brighter gray on expand */
.md-typeset details[open]>summary::after,
.md-typeset details.question[open]>summary::after {
  color: #ccc !important;
  opacity: 0.9 !important;
  transform: rotate(90deg);
}

/* Subtle hover feedback */
.md-typeset details.question>summary:hover {
  background-color: rgba(128, 128, 128, 0.08);
  border-radius: 6px;
}

/* Increase top header (logo bar) height */
.md-header {
  min-height: 70px;
  /* default is ~64px */
}

/* Ensure content aligns vertically */
.md-header__inner {
  height: 100%;
}

.md-header__button.md-logo img {
  height: 46px;
  /* default ~24–32px */
  width: auto;
}

/* Header title (site name next to logo) */
.md-header__title {
  /* font-family: "Inter", sans-serif; */
  /* or any font you prefer */
  /* font-size: 1.35rem; */
  /* increase/decrease as needed */
  /* font-weight: 600; */
  /* 400–700 works well */
  /* letter-spacing: 0.02em; */
  /* optional, gives a premium feel */
}

/* Optional: prevent wrapping on smaller screens */
.md-header__title {
  white-space: nowrap;
}

/* Shared H1 sizing & typography */
.md-content__inner>header>h1,
.md-content__inner h1 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
}

/* Light mode (black text) */
[data-md-color-scheme="default"] .md-content__inner>header>h1,
[data-md-color-scheme="default"] .md-content__inner h1 {
  color: #343434;
}

/* Dark mode (white text) */
[data-md-color-scheme="slate"] .md-content__inner>header>h1,
[data-md-color-scheme="slate"] .md-content__inner h1 {
  color: #d3d3d3;
}

/* Tighten spacing between page title and first section heading (blog + non-blog) */

/* 1) Remove spacing under the title header block */
.md-content__inner>header {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* 2) Remove spacing under the title itself */
.md-content__inner>header>h1 {
  margin-bottom: 0.25rem !important;
}

/* 3) Pull up the first H2/H3 that appears anywhere in the content area */
.md-content__inner .md-typeset h2:first-of-type,
.md-content__inner .md-typeset h3:first-of-type {
  margin-top: 0.25rem !important;
}

/* 4) If your first heading is wrapped (common), also reduce padding at the top of the typeset container */
.md-content__inner .md-typeset {
  padding-top: 0 !important;
}

/* ===  Match main website font sizes (15px body) === */
.md-typeset {
  font-size: 15px;
  line-height: 1.7;
}

.md-typeset code,
.md-typeset pre {
  font-size: 14px;
}

.md-typeset table:not([class]) {
  font-size: 15px;
}

/* =================================================================
   HIDE COVER IMAGE ON INDIVIDUAL BLOG POST PAGES
   (image still appears in the tile grid on the listing page)
   ================================================================= */
.md-typeset p:has(> img[alt="Post cover"]) {
  display: none;
}

.md-post--excerpt .md-post__content p:has(> img[alt="Post cover"]) {
  display: block;
}

/* =================================================================
   BLOG TILE GRID — 3-column card layout for blog listing pages
   ================================================================= */

/* Make the content area a grid on blog listing pages */
.md-content__inner:has(> .md-post--excerpt) {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: stretch;
}

/* Let the page header span full width above the grid */
.md-content__inner:has(> .md-post--excerpt)>header {
  grid-column: 1 / -1;
}

/* Pagination spans full width below the grid */
.md-content__inner:has(> .md-post--excerpt)>.md-pagination {
  grid-column: 1 / -1;
}

/* --- Individual post card --- */
.md-post--excerpt {
  position: relative;
  border: 1px solid rgba(128, 128, 128, 0.15);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  background: var(--md-default-bg-color);
  cursor: pointer;
  min-height: 0;
}

/* Make the title link cover the entire card so the whole tile is clickable */
.md-post--excerpt .md-post__content h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.md-post--excerpt:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* --- Image area --- */
.md-post--excerpt .md-post__content p:has(> img) {
  margin: 0;
  padding: 0;
  order: -1;
  /* move image above everything */
  line-height: 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.md-post--excerpt .md-post__content p>img {
  width: 100% !important;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.md-post--excerpt:hover .md-post__content p>img {
  transform: scale(1.04);
}

/* --- Content area (title + meta) --- */
.md-post--excerpt .md-post__content {
  display: flex;
  flex-direction: column;
  padding: 0;
  flex: 1;
  min-height: 0;
}

/* Title */
.md-post--excerpt .md-post__content h2 {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  padding: 0.6rem 0.75rem 0.35rem;
  border-bottom: none;
  /* Clamp title to 3 lines to keep tiles equal */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.md-post--excerpt .md-post__content h2 a {
  color: var(--md-default-fg-color);
  text-decoration: none;
}

.md-post--excerpt .md-post__content h2 a:hover {
  color: var(--md-accent-fg-color, #1e88e5);
}

/* Remove anchor/permalink icon from titles in grid */
.md-post--excerpt .md-post__content h2 .headerlink {
  display: none;
}

/* --- Metadata (date, category, read time) --- */
.md-post--excerpt .md-post__header {
  order: 10;
  /* push below image+title */
  padding: 0 0.75rem;
  margin: 0;
  margin-top: auto;
}

.md-post--excerpt .md-post__header .md-meta {
  font-size: 0.72rem;
  opacity: 0.6;
}

.md-post--excerpt .md-post__header .md-meta__list {
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

/* --- "Continue reading" link --- */
.md-post--excerpt .md-post__action {
  padding: 0 0.75rem 0.6rem;
  margin: 0;
}

.md-post--excerpt .md-post__action a {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff !important;
  text-decoration: none;
}

.md-post--excerpt .md-post__action a:hover {
  color: #cccccc !important;
  text-decoration: underline;
}

/* --- Dark mode adjustments --- */
[data-md-color-scheme="slate"] .md-post--excerpt {
  border-color: rgba(255, 255, 255, 0.08);
}

[data-md-color-scheme="slate"] .md-post--excerpt:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* --- Responsive: 2 columns on medium screens --- */
@media (max-width: 960px) {
  .md-content__inner:has(> .md-post--excerpt) {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }
}

/* --- Responsive: 1 column on small screens --- */
@media (max-width: 600px) {
  .md-content__inner:has(> .md-post--excerpt) {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}