@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@400;600;700&display=swap');

:root {
  --md-primary-fg-color: #2d5a7b;
  --md-primary-fg-color--light: #3a7ca5;
  --md-primary-fg-color--dark: #1e4460;
  --md-accent-fg-color: #2d5a7b;
}

.md-typeset h1, .md-typeset h2, .md-typeset h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hero-section { 
  padding: 2rem 0 1.5rem; 
}

.hero-section h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.8rem;
}

.hero-authors { 
  font-size: 0.92rem; 
  color: #3d3d5c; 
  margin-bottom: 0.3rem; 
}

.hero-affiliations { 
  font-size: 0.78rem; 
  color: #6b6b8d; 
  font-style: italic; 
  margin-bottom: 0.5rem; 
}

.hero-meta { 
  font-size: 0.82rem; 
  margin-top: 0.3rem; 
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.example-card {
  background: #f4f1eb;
  border: 1px solid #d4d0c8;
  border-radius: 6px;
  padding: 1.2rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.example-card:hover {
  border-color: #2d5a7b;
  box-shadow: 0 2px 8px rgba(45,90,123,0.08);
  text-decoration: none;
}

.example-card .sec {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: #2d5a7b;
  font-weight: 500;
}

.example-card .title {
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  margin: 0.3rem 0 0.4rem;
}

.example-card .desc { 
  font-size: 0.78rem; 
  color: #6b6b8d; 
  line-height: 1.45; 
}

/* Override Material theme defaults on code-file details */
details.code-file {
  margin: 0.8rem 0;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: none;
  background: none;
  padding: 0;
}

details.code-file > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  background: none;
  min-height: unset;
}

/* Remove ALL default markers and icons */
details.code-file > summary::-webkit-details-marker,
details.code-file > summary::marker {
  display: none;
  content: "";
}

details.code-file > summary::before,
details.code-file > summary::after {
  display: none !important;
  content: none !important;
}

details.code-file > summary .filename {
  font-family: var(--md-code-font-family);
  font-size: 0.82rem;
  font-weight: 500;
}

details.code-file > summary .filename::before {
  content: "›";
  display: inline-block;
  margin-right: 0.5rem;
  font-weight: 700;
  transition: transform 0.2s;
}

details.code-file[open] > summary .filename::before {
  transform: rotate(90deg);
}

details.code-file > summary .download-btn {
  font-size: 0.78rem;
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 4px;
  text-decoration: none;
  color: var(--md-default-fg-color--light);
}

details.code-file > summary .download-btn:hover {
  border-color: var(--md-primary-fg-color);
  color: var(--md-primary-fg-color);
  text-decoration: none;
}

/* Remove extra margin from code block inside details */
details.code-file .highlight {
  margin: 0;
  border-radius: 0;
}

details.code-file .highlight pre {
  margin: 0;
  border-radius: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

/* Back to Examples button */
.back-btn {
  display: inline-block;
  margin: 1.5rem 0;
  padding: 0.75rem 1.5rem;
  background: var(--md-primary-fg-color);
  color: white !important;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(45, 90, 123, 0.15);
}

.back-btn:hover {
  background: var(--md-primary-fg-color--dark);
  box-shadow: 0 4px 12px rgba(45, 90, 123, 0.25);
  text-decoration: none;
}

.citation-box {
  background: #e8f0f6;
  border-left: 3px solid #2d5a7b;
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.2rem;
}

.parameter-table table {
  width: 100%;
  border-collapse: collapse;
}

.parameter-table th,
.parameter-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid #d4d0c8;
}

.parameter-table th {
  background: #f4f1eb;
  font-weight: 600;
  color: #2d5a7b;
}

.parameter-table tr:nth-child(even) {
  background: #fafaf8;
}

figure {
  margin: 0;
  text-align: center;
}

figure figcaption {
  font-size: 0.78rem;
  color: #6b6b8d;
  margin-top: 0.4rem;
}

/* Dark mode (slate scheme) */
[data-md-color-scheme="slate"] .example-card {
  background: var(--md-code-bg-color);
  border-color: var(--md-default-fg-color--lightest);
}

[data-md-color-scheme="slate"] .example-card .desc,
[data-md-color-scheme="slate"] .hero-authors,
[data-md-color-scheme="slate"] figure figcaption {
  color: var(--md-default-fg-color--light);
}

[data-md-color-scheme="slate"] .hero-affiliations {
  color: var(--md-default-fg-color--lighter);
}

[data-md-color-scheme="slate"] .parameter-table th {
  background: var(--md-code-bg-color);
  color: var(--md-primary-fg-color--light);
}

[data-md-color-scheme="slate"] .parameter-table th,
[data-md-color-scheme="slate"] .parameter-table td {
  border-color: var(--md-default-fg-color--lightest);
}

[data-md-color-scheme="slate"] .parameter-table tr:nth-child(even) {
  background: var(--md-code-bg-color);
}

[data-md-color-scheme="slate"] .citation-box {
  background: rgba(45, 90, 123, 0.15);
}

/* Responsive */
@media (max-width: 600px) {
  .examples-grid {
    grid-template-columns: 1fr !important;
  }
  div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}