/* ==========================================================================
   Omar Alsaqa — Academic & Machine Learning Researcher Website
   Curated Editorial & High-Tech Swiss Minimalist Design
   ========================================================================== */

:root {
  /* Dark Mode (Pure Luxury Obsidian & Swiss Monochrome) */
  --bg-page: #080a0f;
  --bg-page-radial: radial-gradient(ellipse 70% 50% at 50% -10%, rgba(255, 255, 255, 0.03), transparent 75%);
  --bg-surface: #0f131d;
  --bg-surface-elevated: #161c2a;
  --bg-glass: rgba(8, 10, 15, 0.85);

  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.16);
  --border-accent: rgba(255, 255, 255, 0.24);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #f8fafc;
  --accent-indigo: #f8fafc;
  --accent-emerald: #f8fafc;
  
  --chip-bg: rgba(255, 255, 255, 0.04);
  --chip-border: rgba(255, 255, 255, 0.1);
  --chip-highlight-bg: rgba(255, 255, 255, 0.08);
  --chip-highlight-border: rgba(255, 255, 255, 0.2);

  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --container-max: 880px;
  --header-max: 1080px;
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-page: #fbfbfe;
  --bg-page-radial: none;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f4f5fa;
  --bg-glass: rgba(251, 251, 254, 0.88);

  --border-hairline: rgba(0, 0, 0, 0.07);
  --border-subtle: rgba(0, 0, 0, 0.14);
  --border-accent: rgba(0, 0, 0, 0.22);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-cyan: #0f172a;
  --accent-indigo: #0f172a;
  --accent-emerald: #0f172a;

  --chip-bg: rgba(0, 0, 0, 0.03);
  --chip-border: rgba(0, 0, 0, 0.09);
  --chip-highlight-bg: rgba(0, 0, 0, 0.06);
  --chip-highlight-border: rgba(0, 0, 0, 0.18);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  background-image: var(--bg-page-radial);
  background-repeat: no-repeat;
  color: var(--text-primary);
  line-height: 1.7;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--border-subtle);
  text-underline-offset: 3px;
  transition: var(--transition);
}

a:hover {
  color: var(--text-primary);
  text-decoration-color: var(--text-primary);
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.page-content {
  padding-top: 6.75rem;
  padding-bottom: 2.25rem;
}

/* ==========================================================================
   Top Navigation Header (Centered Floating Island Capsule)
   ========================================================================== */

.site-header {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 1rem;
}

.header-inner {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  padding: 5px 8px 5px 12px;
  border-radius: 9999px;
  background: rgba(8, 10, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-hairline);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 95vw;
}

.header-inner.is-scrolled {
  background: rgba(8, 10, 15, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: var(--border-subtle);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .header-inner {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .header-inner.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.06);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--chip-bg);
  text-decoration: none;
}

.nav-link.active {
  color: var(--text-primary);
  font-weight: 600;
  background-color: var(--chip-highlight-bg);
}

.nav-actions {
  display: flex;
  align-items: center;
}

.top-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 0.25rem;
}

.top-theme-btn:hover {
  color: var(--text-primary);
  background-color: var(--chip-bg);
  border-color: var(--border-subtle);
  transform: rotate(15deg);
}

/* ==========================================================================
   Hero Section (Editorial Grid & Profile)
   ========================================================================== */

.hero-editorial {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 3rem;
  align-items: start;
}

.hero-text-block {
  display: flex;
  flex-direction: column;
}

.hero-name {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}

/* Interactive Name Swap on Hover */
.name-swap {
  display: inline-grid;
  position: relative;
  cursor: pointer;
  user-select: none;
  vertical-align: top;
}

.name-swap .name-primary,
.name-swap .name-secondary {
  grid-area: 1 / 1;
  display: inline-block;
  white-space: nowrap;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.name-swap .name-primary {
  opacity: 1;
  transform: translateY(0);
}

.name-swap .name-secondary {
  opacity: 0;
  transform: translateY(35%);
  pointer-events: none;
}

.name-swap:hover .name-primary,
.name-swap.is-toggled .name-primary {
  opacity: 0;
  transform: translateY(-35%);
}

.name-swap:hover .name-secondary,
.name-swap.is-toggled .name-secondary {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hero-role {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.hero-bio {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.hero-bio p {
  margin-bottom: 1.15rem;
}

.hero-bio p:last-child {
  margin-bottom: 0;
}

.hero-bio strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Hero Action Buttons (Monochrome, Swiss Minimal) */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1.05rem;
  border-radius: 8px;
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.hero-btn:hover {
  background-color: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-primary);
  text-decoration: none;
}

.hero-btn-primary {
  background-color: var(--text-primary) !important;
  border-color: var(--text-primary) !important;
  color: var(--bg-page) !important;
  font-weight: 600;
}

.hero-btn-primary:hover {
  background-color: var(--text-secondary) !important;
  border-color: var(--text-secondary) !important;
  color: var(--bg-page) !important;
}

/* Portrait Photo Unit & Social Icons (Clean Flat Monochrome) */
.hero-visual-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.avatar-frame {
  width: 220px;
  height: 220px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  background-color: var(--bg-surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: var(--transition);
}

.avatar-frame:hover {
  border-color: var(--border-subtle);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
  width: 100%;
}

.avatar-location {
  font-size: 0.825rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin: 0;
  letter-spacing: -0.01em;
}

.avatar-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.avatar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-secondary);
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.avatar-icon-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ==========================================================================
   Editorial Sections & Headings
   ========================================================================== */

.editorial-section {
  padding-top: 2.75rem;
}

.hero-editorial + .editorial-section {
  padding-top: 1.5rem;
}

.section-top-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-hairline);
  padding-bottom: 0.85rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.section-link {
  font-size: 0.875rem;
  color: var(--accent-indigo);
}

/* ==========================================================================
   Research Themes Index (Numbered Editorial Rows)
   ========================================================================== */

.themes-index {
  display: flex;
  flex-direction: column;
}

.theme-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 1.5rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--border-hairline);
  transition: var(--transition);
}

.theme-row:last-child {
  border-bottom: none;
}

.theme-num {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent-cyan);
  font-weight: 500;
  padding-top: 0.15rem;
}

.theme-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.theme-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ==========================================================================
   Publications Editorial List
   ========================================================================== */

.publications-editorial-list {
  display: flex;
  flex-direction: column;
}

.pub-editorial-entry {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 1.5rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border-hairline);
  scroll-margin-top: 5rem;
}

.pub-editorial-entry:first-child {
  padding-top: 0.5rem;
}

.pub-editorial-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pub-counter {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pub-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  row-gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.venue-badge {
  font-size: 0.825rem;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-primary);
}

a.venue-badge,
.venue-link {
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity 0.2s ease, text-decoration-color 0.2s ease;
}

a.venue-badge:hover,
.venue-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--border-subtle);
  text-underline-offset: 3px;
  opacity: 0.85;
}

.type-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-muted);
}

.pub-heading {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.pub-heading a,
.pub-title-link {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease, text-decoration-color 0.2s ease;
}

.pub-heading a:hover,
.pub-title-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--border-subtle);
  text-underline-offset: 4px;
}

.pub-body-col *:last-child {
  margin-bottom: 0;
}

/* Homepage Streamlined Publications (Compact Editorial Typography) */
.publications-streamlined .pub-editorial-entry {
  display: block;
  padding: 0.95rem 0;
}

.publications-streamlined .pub-heading {
  font-size: 1.05rem;
  line-height: 1.38;
  margin-bottom: 0.25rem;
}

.publications-streamlined .venue-badge {
  font-size: 0.78rem;
}

.publications-streamlined .pub-authors-line {
  font-size: 0.85rem;
  margin-bottom: 0;
}

.pub-authors-line {
  font-size: 0.925rem;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.author-me {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--border-subtle);
  text-underline-offset: 3px;
}

.pub-abstract {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0.9rem;
}

.pub-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tag-pill {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Fancy Hover: # gracefully slides & fades in from the left */
.tag-pill::before {
  content: "#";
  display: inline-block;
  opacity: 0;
  width: 0;
  max-width: 0;
  transform: translateX(-5px) scale(0.65);
  transition: opacity 0.2s ease, width 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), margin-right 0.2s ease;
  color: var(--text-muted);
  pointer-events: none;
  overflow: hidden;
  font-weight: 500;
}

.tag-pill:hover {
  border-color: var(--border-subtle);
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
  text-decoration: none;
}

.tag-pill:hover::before {
  opacity: 1;
  width: 0.65em;
  max-width: 1em;
  transform: translateX(0) scale(1);
  margin-right: 2px;
  color: var(--text-secondary);
}

/* Tag Filter Buttons: # shows only on hover */
.tag-filter-btn,
.action-btn.tag-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0;
}

.tag-filter-btn .tag-hash {
  display: inline-block;
  opacity: 0;
  width: 0;
  max-width: 0;
  margin-right: 0;
  overflow: hidden;
  pointer-events: none;
  font-weight: 500;
  line-height: 1;
  transform: translateX(-4px) scale(0.7);
  transition: opacity 0.2s ease, width 0.2s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), margin-right 0.2s ease;
}

.tag-filter-btn:hover .tag-hash {
  opacity: 0.9;
  width: 0.65em;
  max-width: 1em;
  margin-right: 2px;
  transform: translateX(0) scale(1);
}

.pub-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.action-btn {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  background-color: var(--chip-bg);
  color: var(--text-secondary);
  border: 1px solid var(--chip-border);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.action-btn:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  text-decoration: none;
}

.tag-filter-btn.active {
  background-color: var(--text-primary) !important;
  color: var(--bg-page) !important;
  border-color: var(--text-primary) !important;
  font-weight: 600;
}

/* BibTeX Drawer */
.bibtex-drawer {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  position: relative;
}

.bibtex-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.55;
}

.bibtex-copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.btn-success {
  background-color: var(--bg-surface-elevated) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-subtle) !important;
  font-weight: 600;
}

/* ==========================================================================
   Timeline / Announcements
   ========================================================================== */

.editorial-timeline {
  display: flex;
  flex-direction: column;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.75rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border-hairline);
  align-items: baseline;
}

.timeline-entry:last-child {
  border-bottom: none;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  color: var(--text-muted);
}

.timeline-heading {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.timeline-body {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Contact Editorial Card
   ========================================================================== */

.contact-editorial-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  padding: 2.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.contact-heading {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.contact-subtext {
  font-size: 0.975rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.contact-subtext strong {
  color: var(--text-primary);
}

.contact-email-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  max-width: 440px;
  margin-bottom: 1.25rem;
  gap: 0.75rem;
}

.contact-email-val {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.contact-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

/* ==========================================================================
   Blog / Markdown Typography (Hugo Liftoff Simplicity)
   ========================================================================== */

.post-list {
  display: flex;
  flex-direction: column;
}

.post-entry {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-hairline);
}

.post-entry:first-child {
  padding-top: 0.5rem;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  row-gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 0.4rem;
}

.post-meta span,
.post-meta a {
  white-space: nowrap;
}

.post-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}

.post-title a {
  color: inherit;
}

.post-title a:hover {
  color: var(--accent-indigo);
  text-decoration: none;
}

.post-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Single Post Markdown Reading */
.markdown-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-primary);
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.025em;
  scroll-margin-top: 5.5rem;
}

.markdown-content h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border-hairline);
  padding-bottom: 0.5rem;
}

.markdown-content p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.markdown-content blockquote {
  border-left: 3px solid var(--accent-indigo);
  padding: 0.85rem 1.35rem;
  margin: 1.75rem 0;
  background-color: var(--bg-surface);
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.markdown-content pre {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin: 1.75rem 0;
}

.markdown-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: var(--bg-surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border-hairline);
}

.markdown-content pre code {
  background: transparent;
  border: none;
  padding: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-hairline);
  padding: 1.5rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-indigo);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 820px) {
  .page-content {
    padding-top: 5.25rem;
    padding-bottom: 2.25rem;
  }

  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-bio {
    text-align: left;
    max-width: 620px;
    margin: 0 auto;
  }

  .hero-status {
    justify-content: center;
  }

  .hero-name {
    font-size: 2.5rem;
  }

  .hero-links {
    justify-content: center;
  }

  .hero-visual-unit {
    margin: 0 auto;
    order: -1;
  }

  .theme-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .pub-editorial-entry {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .pub-index-col {
    display: none;
  }

  .pub-counter {
    display: none;
  }

  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

@media (max-width: 580px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .site-header {
    padding: 0 0.5rem;
  }

  .header-inner {
    padding: 3px 6px 3px 8px;
    max-width: calc(100vw - 1rem);
  }

  .top-nav {
    gap: 0.2rem;
  }

  .nav-links {
    gap: 0.1rem;
  }

  .nav-link {
    font-size: 0.76rem;
    padding: 0.26rem 0.45rem;
  }

  .top-theme-btn {
    width: 28px;
    height: 28px;
    margin-left: 0.15rem;
  }

  .hero-name {
    font-size: 2.15rem;
  }

  .section-top-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .pub-heading {
    font-size: 1.15rem;
    line-height: 1.35;
  }
}

@media (max-width: 380px) {
  .site-header {
    padding: 0 0.25rem;
  }

  .header-inner {
    padding: 2px 4px 2px 6px;
    max-width: calc(100vw - 0.5rem);
  }

  .nav-link {
    font-size: 0.72rem;
    padding: 0.22rem 0.32rem;
  }

  .top-theme-btn {
    width: 26px;
    height: 26px;
  }

  .hero-name {
    font-size: 1.95rem;
  }
}



/* ==========================================================================
   Anti-Scraper Contact & CV Request Modal Pop-up
   ========================================================================== */

button.nav-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  line-height: inherit;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(5, 7, 11, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

[data-theme="light"] .modal-backdrop {
  background-color: rgba(15, 23, 42, 0.45);
}

.modal-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 460px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.45), 0 0 1px 1px var(--border-hairline);
  padding: 1.65rem 1.75rem;
  transform: scale(0.95) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.is-visible .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.modal-title-group {
  flex: 1;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.015em;
}

.modal-subtext {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.modal-subtext code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-hairline);
  color: var(--accent-indigo);
  font-weight: 500;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  transform: rotate(90deg);
}

/* Redesigned Compact Contact Cards */
.contact-channel-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-channel-card:hover {
  border-color: var(--border-subtle);
}

.contact-channel-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.contact-channel-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.contact-channel-icon svg {
  width: 15px;
  height: 15px;
}

.contact-channel-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-channel-label {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1;
  margin-bottom: 0.15rem;
}

.contact-channel-value {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
  user-select: all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.contact-channel-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.contact-channel-actions .action-icon-btn {
  width: 28px;
  height: 28px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.contact-channel-actions .action-icon-btn svg {
  width: 13px;
  height: 13px;
  pointer-events: none;
}

.contact-channel-actions .action-icon-btn.btn-success {
  color: #10b981 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  background-color: var(--chip-bg) !important;
}

/* Sub-options for Messaging directly below phone box */
.phone-sub-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding: 0.15rem 0.2rem 0;
}

.phone-sub-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.phone-sub-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.sub-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.18s ease;
}

.sub-action-pill:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
  text-decoration: none;
}

.sub-action-whatsapp:hover {
  color: #25d366;
  border-color: rgba(37, 211, 102, 0.4);
}

@media (max-width: 520px) {
  .modal-overlay {
    padding: 1rem 0.75rem;
  }
  .modal-container {
    padding: 1.25rem 1.15rem;
    border-radius: 14px;
  }
  .contact-channel-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .contact-channel-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--border-hairline);
  }
}

/* ==========================================================================
   Blog Post Layout, Sticky Table of Contents & Prose
   ========================================================================== */

.container-post {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 6.75rem 1.5rem 3.5rem;
}

.post-layout {
  display: flex;
  gap: 3.5rem;
  align-items: flex-start;
  justify-content: space-between;
}

.post-main {
  flex: 1;
  min-width: 0;
  max-width: 760px;
}

.post-header {
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--border-hairline);
  padding-bottom: 1.5rem;
}

.post-title {
  font-size: 2.25rem;
  margin-bottom: 0.85rem;
  line-height: 1.25;
}

.post-lead {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

/* Desktop Sticky Right-hand Table of Contents */
.post-toc-sidebar {
  width: 250px;
  flex-shrink: 0;
  display: block;
  position: -webkit-sticky;
  position: sticky;
  top: 5.5rem;
  align-self: flex-start;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  padding: 0.5rem 0 1rem;
  scrollbar-width: thin;
  z-index: 20;
}

.post-toc-sticky {
  display: flex;
  flex-direction: column;
}

.toc-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-hairline);
}

.toc-body {
  font-size: 0.84rem;
  line-height: 1.45;
}

/* Hugo Generated Table of Contents (<nav id="TableOfContents">) */
#TableOfContents {
  font-size: 0.84rem;
}

#TableOfContents ul {
  list-style: none;
  padding-left: 0.75rem;
  margin: 0.2rem 0;
  border-left: 1px solid var(--border-hairline);
}

#TableOfContents > ul {
  padding-left: 0;
  border-left: none;
  margin: 0;
}

#TableOfContents li {
  margin: 0.3rem 0;
}

#TableOfContents a {
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0.55rem;
  border-radius: 5px;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.4;
}

#TableOfContents a:hover {
  color: var(--text-primary);
  background-color: rgba(125, 125, 125, 0.08);
}

#TableOfContents a.active {
  color: var(--accent-indigo) !important;
  font-weight: 600;
  border-left-color: var(--accent-indigo) !important;
  background-color: rgba(99, 102, 241, 0.1);
}

[data-theme="light"] #TableOfContents a.active {
  color: #4338ca !important;
  border-left-color: #4f46e5 !important;
  background-color: rgba(79, 70, 229, 0.08);
}

/* Mobile Collapsible Table of Contents */
.mobile-toc {
  display: none;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 0.85rem 1.15rem;
  margin-bottom: 2rem;
}

.mobile-toc summary {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  outline: none;
}

.mobile-toc .toc-body {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-hairline);
}

@media (max-width: 1024px) {
  .post-toc-sidebar {
    display: none;
  }
  .mobile-toc {
    display: block;
  }
}

/* ==========================================================================
   Code Blocks, Line Numbers, Copy Button & Adaptive Themes
   ========================================================================== */

.highlight {
  position: relative;
  margin: 1.75rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  background-color: var(--bg-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease;
}

.highlight:hover {
  border-color: var(--border-subtle);
}

.highlight pre {
  margin: 0;
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.65;
  background: transparent !important;
  border: none !important;
}

/* Line numbers */
.chroma .line {
  display: flex;
  align-items: baseline;
}

.chroma .lnt,
.chroma .ln {
  display: inline-block;
  min-width: 2.2rem;
  margin-right: 1.1rem;
  padding-right: 0.65rem;
  color: var(--text-muted);
  opacity: 0.45;
  user-select: none;
  -webkit-user-select: none;
  border-right: 1px solid var(--border-hairline);
  text-align: right;
  font-size: 0.8em;
}

.chroma .cl {
  flex: 1;
  min-width: 0;
}

/* Code Copy Button */
.code-copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background-color: var(--bg-card);
  border: 1px solid var(--border-hairline);
  cursor: pointer;
  opacity: 0;
  transition: all 0.18s ease;
  z-index: 5;
  user-select: none;
}

.code-copy-btn svg {
  flex-shrink: 0;
}

.highlight:hover .code-copy-btn {
  opacity: 0.95;
}

.code-copy-btn:hover {
  opacity: 1 !important;
  color: var(--text-primary);
  border-color: var(--border-subtle);
  background-color: var(--bg-surface-elevated);
}

.code-copy-btn.copied {
  color: #10b981 !important;
  border-color: rgba(16, 185, 129, 0.4);
  background-color: rgba(16, 185, 129, 0.08);
  opacity: 1 !important;
}

@media (hover: none) {
  .code-copy-btn {
    opacity: 0.8;
  }
}

/* Chroma Dynamic Theme Palette: Light Mode */
[data-theme="light"] .highlight {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}
[data-theme="light"] .chroma { color: #1e293b; }
[data-theme="light"] .chroma .k,
[data-theme="light"] .chroma .kd,
[data-theme="light"] .chroma .kn,
[data-theme="light"] .chroma .kr { color: #cf222e; }
[data-theme="light"] .chroma .kc,
[data-theme="light"] .chroma .kp,
[data-theme="light"] .chroma .kt { color: #0550ae; }
[data-theme="light"] .chroma .nc,
[data-theme="light"] .chroma .ne { color: #953800; font-weight: 600; }
[data-theme="light"] .chroma .nf,
[data-theme="light"] .chroma .fm { color: #8250df; font-weight: 500; }
[data-theme="light"] .chroma .nn { color: #24292f; }
[data-theme="light"] .chroma .s,
[data-theme="light"] .chroma .sa,
[data-theme="light"] .chroma .sb,
[data-theme="light"] .chroma .sc,
[data-theme="light"] .chroma .s1,
[data-theme="light"] .chroma .s2 { color: #0a3069; }
[data-theme="light"] .chroma .c,
[data-theme="light"] .chroma .ch,
[data-theme="light"] .chroma .cm,
[data-theme="light"] .chroma .c1,
[data-theme="light"] .chroma .cs { color: #6e7781; font-style: italic; }
[data-theme="light"] .chroma .o,
[data-theme="light"] .chroma .ow { color: #0550ae; }
[data-theme="light"] .chroma .nb,
[data-theme="light"] .chroma .bp { color: #6639ba; }
[data-theme="light"] .chroma .m,
[data-theme="light"] .chroma .mb,
[data-theme="light"] .chroma .mf,
[data-theme="light"] .chroma .mh,
[data-theme="light"] .chroma .mi,
[data-theme="light"] .chroma .mo { color: #0550ae; }
[data-theme="light"] .chroma .nv,
[data-theme="light"] .chroma .vc,
[data-theme="light"] .chroma .vg,
[data-theme="light"] .chroma .vi { color: #0550ae; }

/* Chroma Dynamic Theme Palette: Dark Mode */
[data-theme="dark"] .highlight {
  background-color: #0b0f17;
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .chroma { color: #e6edf3; }
[data-theme="dark"] .chroma .k,
[data-theme="dark"] .chroma .kd,
[data-theme="dark"] .chroma .kn,
[data-theme="dark"] .chroma .kr { color: #ff7b72; }
[data-theme="dark"] .chroma .kc,
[data-theme="dark"] .chroma .kp,
[data-theme="dark"] .chroma .kt { color: #79c0ff; }
[data-theme="dark"] .chroma .nc,
[data-theme="dark"] .chroma .ne { color: #f0883e; font-weight: 600; }
[data-theme="dark"] .chroma .nf,
[data-theme="dark"] .chroma .fm { color: #d2a8ff; font-weight: 500; }
[data-theme="dark"] .chroma .nn { color: #ff7b72; }
[data-theme="dark"] .chroma .s,
[data-theme="dark"] .chroma .sa,
[data-theme="dark"] .chroma .sb,
[data-theme="dark"] .chroma .sc,
[data-theme="dark"] .chroma .s1,
[data-theme="dark"] .chroma .s2 { color: #a5d6ff; }
[data-theme="dark"] .chroma .c,
[data-theme="dark"] .chroma .ch,
[data-theme="dark"] .chroma .cm,
[data-theme="dark"] .chroma .c1,
[data-theme="dark"] .chroma .cs { color: #8b949e; font-style: italic; }
[data-theme="dark"] .chroma .o,
[data-theme="dark"] .chroma .ow { color: #79c0ff; }
[data-theme="dark"] .chroma .nb,
[data-theme="dark"] .chroma .bp { color: #ffa657; }
[data-theme="dark"] .chroma .m,
[data-theme="dark"] .chroma .mb,
[data-theme="dark"] .chroma .mf,
[data-theme="dark"] .chroma .mh,
[data-theme="dark"] .chroma .mi,
[data-theme="dark"] .chroma .mo { color: #79c0ff; }
[data-theme="dark"] .chroma .nv,
[data-theme="dark"] .chroma .vc,
[data-theme="dark"] .chroma .vg,
[data-theme="dark"] .chroma .vi { color: #79c0ff; }

/* ==========================================================================
   HTML Semantic Tags & Tables in Markdown
   ========================================================================== */

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 1.75rem 0;
  border-radius: 8px;
  border: 1px solid var(--border-hairline);
  background-color: var(--bg-surface);
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.92rem;
  text-align: left;
}

.table-wrapper table {
  margin: 0;
}

.markdown-content th {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border-subtle);
  border-top: 1px solid var(--border-hairline);
}

.table-wrapper th {
  border-top: none;
}

.markdown-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-secondary);
}

.markdown-content tbody tr:last-child td {
  border-bottom: none;
}

.markdown-content tbody tr:nth-child(even) {
  background-color: rgba(125, 125, 125, 0.035);
}

.markdown-content tbody tr:hover {
  background-color: rgba(125, 125, 125, 0.07);
}

/* Keyboard <kbd> */
.markdown-content kbd {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.8em;
  line-height: 1.25;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-bottom: 2px solid var(--border-subtle);
  border-radius: 5px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  vertical-align: middle;
}

/* Highlight <mark> */
.markdown-content mark {
  background-color: rgba(99, 102, 241, 0.22);
  color: inherit;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  font-weight: 500;
}

[data-theme="light"] .markdown-content mark {
  background-color: rgba(99, 102, 241, 0.18);
  color: #312e81;
}

/* Abbreviations <abbr> */
.markdown-content abbr[title] {
  text-decoration: underline dotted var(--accent-indigo);
  text-underline-offset: 3px;
  cursor: help;
}

/* Accordion / Collapsible <details> & <summary> */
.markdown-content details {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 0.85rem 1.15rem;
  margin: 1.5rem 0;
  transition: border-color 0.18s ease;
}

.markdown-content details[open] {
  border-color: var(--border-subtle);
}

.markdown-content summary {
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  outline: none;
}

.markdown-content summary:hover {
  color: var(--accent-indigo);
}

.markdown-content details > *:not(summary) {
  margin-top: 0.85rem;
}

/* Math blocks styling */
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.75rem 0;
  margin: 1.5rem 0;
}

/* ==========================================================================
   Alert Callouts: Note, Tip, Important, Warning, Caution
   ========================================================================== */

.markdown-content blockquote.alert-callout {
  border-radius: 8px;
  padding: 0.95rem 1.25rem;
  margin: 1.75rem 0;
  font-style: normal;
  border: 1px solid var(--border-hairline);
  background-color: var(--bg-surface);
  transition: border-color 0.18s ease;
}

.alert-callout-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.45rem;
}

.alert-callout-header svg {
  flex-shrink: 0;
}

.alert-callout p {
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0.75rem;
  font-style: normal;
}

.alert-callout p:last-child {
  margin-bottom: 0;
}

/* 1. Note (Blue) */
.alert-callout.alert-note {
  border-left: 4px solid #3b82f6 !important;
}
.alert-callout.alert-note .alert-callout-header {
  color: #3b82f6;
}

/* 2. Tip (Emerald Green) */
.alert-callout.alert-tip {
  border-left: 4px solid #10b981 !important;
}
.alert-callout.alert-tip .alert-callout-header {
  color: #10b981;
}

/* 3. Important (Purple) */
.alert-callout.alert-important {
  border-left: 4px solid #a855f7 !important;
}
.alert-callout.alert-important .alert-callout-header {
  color: #a855f7;
}

/* 4. Warning (Amber) */
.alert-callout.alert-warning {
  border-left: 4px solid #f59e0b !important;
}
.alert-callout.alert-warning .alert-callout-header {
  color: #f59e0b;
}

/* 5. Caution (Red) */
.alert-callout.alert-caution {
  border-left: 4px solid #ef4444 !important;
}
.alert-callout.alert-caution .alert-callout-header {
  color: #ef4444;
}

/* Light Mode Overrides: Match Light Code Block Background (#f8fafc / #e2e8f0) */
[data-theme="light"] .markdown-content blockquote:not(.alert-callout) {
  background-color: #f8fafc;
  color: var(--text-secondary);
}

[data-theme="light"] .markdown-content blockquote.alert-callout {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .alert-callout.alert-note {
  border-left-color: #2563eb !important;
}
[data-theme="light"] .alert-callout.alert-note .alert-callout-header {
  color: #1d4ed8;
}

[data-theme="light"] .alert-callout.alert-tip {
  border-left-color: #059669 !important;
}
[data-theme="light"] .alert-callout.alert-tip .alert-callout-header {
  color: #047857;
}

[data-theme="light"] .alert-callout.alert-important {
  border-left-color: #9333ea !important;
}
[data-theme="light"] .alert-callout.alert-important .alert-callout-header {
  color: #7e22ce;
}

[data-theme="light"] .alert-callout.alert-warning {
  border-left-color: #d97706 !important;
}
[data-theme="light"] .alert-callout.alert-warning .alert-callout-header {
  color: #b45309;
}

[data-theme="light"] .alert-callout.alert-caution {
  border-left-color: #dc2626 !important;
}
[data-theme="light"] .alert-callout.alert-caution .alert-callout-header {
  color: #b91c1c;
}

[data-theme="light"] .markdown-content details {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .markdown-content code:not(pre code) {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .mobile-toc {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .table-wrapper {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .markdown-content th {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
}

[data-theme="light"] .giscus-placeholder {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

/* ==========================================================================
   Discussion & Replies (Giscus Integration)
   ========================================================================== */

.post-replies {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-hairline);
}

.replies-header {
  margin-bottom: 1.75rem;
}

.replies-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.replies-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
}

.replies-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

.giscus-placeholder {
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.giscus-placeholder .small-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ==========================================================================
   Blog Post & Single Article Responsive Overrides
   ========================================================================== */

@media (max-width: 820px) {
  .container-post {
    padding-top: 5.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    padding-bottom: 2.5rem;
  }
}

@media (max-width: 580px) {
  .container-post {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .post-title {
    font-size: 1.65rem;
    line-height: 1.25;
  }

  .post-meta {
    gap: 0.4rem;
    row-gap: 0.25rem;
    font-size: 0.76rem;
  }
}

