/* Remove heading level indicators */
h1::after,
h2::after,
h3::after,
h4::after,
h5::after,
h6::after {
  content: "" !important;
}

/* ===== HERO SECTION ===== */

/* Hero spacing scale (tuned to your requested targets) */
:root {
  --hero-space-name-subtitle: 6px;   /* Name -> Subtitle: ~8–12px */
  --hero-space-block-gap: 64px;       /* Between blocks: 2x previous (was 32px) */
}

.hero {
  padding: 4rem 1rem;
  background: transparent; /* inherits theme/body background (light/dark) */
  text-align: center;
}

.hero-container {
  max-width: 800px;
  margin: 0 auto;
}

.profile-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 2rem;
  border: 4px solid var(--primary-color, #ec42ff);
  
  /* Apply grayscale filter */
  filter: grayscale(100%) brightness(0.9);
  
  transition: filter 0.3s ease;
}

.profile-photo:hover {
  filter: grayscale(0%) brightness(1);
}

.hero-title {
  font-size: 2.5rem;
  margin-bottom: var(--hero-space-name-subtitle);
  color: var(--text-color, #24292e);
}

/* Subtitle / roles (de-emphasized) */
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-color, #24292e);
  font-weight: 400;
  line-height: 1.5;
  margin-top: 0;
  margin-bottom: 0; /* was: var(--hero-space-block-gap) */
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

/* Value prop + proof (dominant) */
.hero-tagline {
  font-size: 1.25rem;
  color: var(--primary-color, #ec42ff);
  font-weight: 400;
  margin-top: var(--hero-space-block-gap);
  margin-bottom: var(--hero-space-block-gap);  /* CHANGE FROM: 0 */
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.hero-credibility {
  margin-top: 0;
  margin-bottom: var(--hero-space-cred-buttons);
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;

  font-size: 0.95rem; /* subtle/smaller than tagline */
  font-weight: 400;   /* normal weight */
  color: var(--muted-text-color, #6a737d);
  line-height: 1.5;
  text-align: center;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--hero-space-block-gap); /* ensures equal gap vs Identity->ValueProp */
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary-color, #ec42ff);
  color: white;
}

.btn-primary:hover {
  background: #d62ee6;
  color: #fff; /* keep contrast; prevents global a:hover from tinting text */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(236, 66, 255, 0.3);
}

.btn-primary:focus,
.btn-primary:focus-visible {
  color: #fff; /* keep contrast on keyboard focus too */
}

.btn-secondary {
  background: white;
  color: var(--primary-color, #ec42ff);
  border: 2px solid var(--primary-color, #ec42ff);
}

.btn-secondary:hover {
  background: var(--primary-color, #ec42ff);
  color: white;
  transform: translateY(-2px);
}

/* ===== RECENT POSTS SECTION ===== */

.recent-posts {
  padding: 4rem 1rem;
  background: white;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.recent-posts h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 3rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.post-card {
  padding: 1.5rem;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-card h3 {
  margin-bottom: 0.5rem;
}

.post-card h3 a {
  text-decoration: none;
  color: var(--text-color, #24292e);
}

.post-card h3 a:hover {
  color: var(--primary-color, #ec42ff);
}

.post-card time {
  display: block;
  font-size: 0.875rem;
  color: #586069;
  margin-bottom: 1rem;
}

.post-card p {
  color: #586069;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.read-more {
  color: var(--primary-color, #ec42ff);
  text-decoration: none;
  font-weight: 600;
}

.read-more:hover {
  text-decoration: underline;
}

.view-all {
  display: block;
  text-align: center;
  color: var(--primary-color, #ec42ff);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
}

.view-all:hover {
  text-decoration: underline;
}

/* ===== MOBILE RESPONSIVE ===== */

@media (max-width: 768px) {
  /* Tighten hero rhythm + scale on small screens (mobile only) */
  :root {
    --hero-space-name-subtitle: 4px;
    --hero-space-block-gap: 36px;
  }

  .hero {
    padding: 2.5rem 1rem;
  }

  .profile-photo {
    width: 150px;
    height: 150px;
    margin-bottom: 1.25rem;
  }

  .hero-title {
    font-size: 1.7rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 0;  /* ADD THIS - ensure no extra space */
  }

  .hero-tagline {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-top: var(--hero-space-block-gap);   /* ADD THIS - explicit mobile value */
    margin-bottom: var(--hero-space-block-gap); /* ADD THIS - match top margin */
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
    margin-top: 0;  /* ADD THIS - space comes from .hero-tagline's margin-bottom */
  }

  /* Buttons: slightly less tall on mobile only */
  .btn {
    width: 100%;
    max-width: 300px;
    padding: 0.65rem 1.25rem; /* reduced vertical padding */
  }

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

@media (min-width: 769px) and (max-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== HEADER/NAV FIX (align to 600px column + don't cover breadcrumb) ===== */
.main-header {
  /* Match freshPink defaults; keep header fixed and let breadcrumb spacing work as designed */
  position: fixed !important;
  top: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 600px !important;
  margin: 0 auto !important;
  padding: 12px 0 !important;
  font-size: 0.8rem !important;
  font-family: var(--title-font-family) !important;

  background-color: var(--background-color) !important;
  border-bottom: none !important;
  z-index: 1000 !important;
}

.main-header nav {
  display: flex !important;
  list-style: none !important;
  justify-content: flex-start !important;
  margin: 0 !important;
  padding: 0 !important; /* freshPink has no nav padding; header provides spacing */
}

.main-header nav li {
  margin-right: 14px !important; /* freshPink spacing */
}

/* Mobile: keep the same column padding behavior as your min600.css */
@media (max-width: 600px) {
  .main-header {
    width: 100% !important;
    padding: 0px 20px !important; /* freshPink mobile header padding */
  }
  .main-header nav {
    padding: 0 !important;
  }
  .main-header nav li {
    margin-right: 10px !important;
    font-size: 1.1rem !important;
  }
}

/* ===== MOBILE MENU (collapse to /menu) ===== */
.menu-toggle {
  display: none;
}

@media (max-width: 600px) {
  .menu-toggle {
    display: inline-block;
    font-family: var(--title-font-family);
    font-size: 1.1rem;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--text-color);
    cursor: pointer;
  }

  /* Hide nav links until opened */
  .main-header nav {
    display: none !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    padding-top: 8px !important;
  }

  .main-header nav.menu-open {
    display: flex !important;
  }

  .main-header nav li {
    margin-right: 0 !important;
    font-size: 1.1rem !important;
  }
}

/* Center the copyright notice in the footer */
#footer {
  text-align: center;
}

/* ===== RESUME PAGE (scoped) ===== */

/* Match theme reading column */
.resume-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Page title ("Resume") */
.resume-header h1 {
  margin: 0 0 6px;
  font-family: var(--header-font-family);
  color: var(--text-color);
}

/* Optional subtitle from front matter (only shows if provided) */
.resume-subtitle {
  margin: 0 0 12px;
  color: var(--mgray-color);
  font-size: 0.95rem;
}

/* “Download: …” callout (first paragraph in the markdown content) */
.resume-content > p:first-of-type {
  margin: 0 0 18px;
  padding: 6px 10px;
  border-radius: 4px;
  background-color: var(--gray-color);
  color: var(--text-color);
}

.resume-content > p:first-of-type a {
  font-weight: 600;
}

.resume-content > p:first-of-type a:hover {
  color: var(--primary-color);
}

/*
  Resume sections are written as Markdown `# Heading`,
  so they render as h1 inside .resume-content.
  Style them like section headers (not like the page title).
*/
.resume-content h1 {
  margin: 22px 0 6px;
  font-size: 1.25rem;
  line-height: 1.3;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--mgray-color);
}

.resume-content ul {
  margin: 6px 0 14px;
  padding-left: 18px;
}

.resume-content li {
  margin-bottom: 6px;
}

/* Mobile-only: slightly tighter */
@media (max-width: 768px) {
  .resume-container {
    padding: 0 16px;
  }

  .resume-header h1 {
    font-size: 1.6rem;
    line-height: 1.2;
  }

  .resume-content h1 {
    font-size: 1.05rem;
    line-height: 1.25;
    margin-top: 18px;
  }
}

/* ===== RESPONSIVE IMAGES ===== */
/* Theme's min600.css only constrains images on small screens.
   Add constraint for all screen sizes to match 600px body width. */
img {
  max-width: 100%;
  height: auto;
}

/* ===== BLOG POST CONTENT LINKS ===== */
/* Override theme's no-underline default for body content */
body a {
  text-decoration: underline !important;
  text-decoration-color: var(--mgray-color, #6a737d);
  text-underline-offset: 2px;
}

body a:hover,
body a:focus {
  text-decoration-color: var(--primary-color, #ec42ff);
}

/* Remove underlines from navigation and TOC */
.main-header a,
.toc a,
.breadcrumb a,
div.post-title a,
div.page-links a {
  text-decoration: none !important;
}

/* ===== PROJECTS PAGE ===== */

/* Projects Grid - Theme-compatible card layout */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
  max-width: 100%;  /* ADD THIS LINE */
}

/* Individual card */
.project-card {
  background-color: var(--background-color);
  border: 1px solid var(--gray-color);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Dark mode shadow */
body[data-theme="dark"] .project-card:hover {
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Card image */
.project-card img {
  width: 100%;
  max-height: 300px;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  background-color: var(--background-color);
}

/* Card content */
.project-content {
  padding: 1.5rem;
}

.project-card h3 {
  margin: 0.5rem 0 1rem;
  font-size: 1.2rem;
  font-family: var(--header-font-family);
  color: var(--text-color);
  border-bottom: none;
  padding-bottom: 0;
}

/* Category badges */
.category-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-family: var(--title-font-family);
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-business { 
  background-color: #f97316; 
  color: white; 
}

.category-data-science { 
  background-color: #3b82f6; 
  color: white; 
}

.category-research { 
  background-color: #10b981; 
  color: white; 
}

.category-ai { 
  background-color: #8b5cf6; 
  color: white; 
}

/* Project details */
.project-details {
  margin-top: 1rem;
}

.project-details p {
  margin: 0.75rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.project-details strong {
  color: var(--primary-color);
  font-weight: 600;
}

.project-details ul {
  margin: 0.5rem 0 0;
  padding-left: 1.5rem;
  list-style-type: disc;
}

.project-details ul li {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Responsive: Allow 2 columns on wider screens IF needed */
@media (min-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;  /* CHANGE FROM: repeat(2, 1fr) */
  }
}

/* Mobile optimizations */
@media (max-width: 600px) {
  .project-card img {
    max-height: 250px;
    height: auto;
  }
  
  .project-content {
    padding: 1rem;
  }
  
  .project-card h3 {
    font-size: 1.1rem;
  }
  
  .project-details p,
  .project-details ul li {
    font-size: 0.85rem;
  }
}

/* ===== TABLE OF CONTENTS (TOC) RESPONSIVE BEHAVIOR ===== */
/* Hide TOC on tablets in portrait mode and smaller devices */
@media (max-width: 1024px) and (orientation: portrait), (max-width: 768px) {
  .toc {
    display: none !important;
  }
}

/* ===== STICKY FOOTER ===== */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main, .content {
  flex: 1;
}

#footer {
  margin-top: auto;
}

/* ===== BOOKTABS-STYLE MARKDOWN TABLES ===== */
/* Minimal override: only change borders, keep theme's layout behavior */

/* Heavy top & bottom borders only */
table {
  border-top: 2px solid var(--text-color) !important;
  border-bottom: 2px solid var(--text-color) !important;
}

/* Remove all row borders except thead */
tbody tr {
  border-top: none !important;
  border-bottom: none !important;
  background-color: transparent !important;
}

/* Remove zebra striping */
tbody tr:nth-child(2n) {
  background-color: transparent !important;
}

/* Remove cell borders */
th, td {
  border: none !important;
}

/* Light border below headers */
thead {
  border-bottom: none !important;
  box-shadow: inset 0 -1px 0 var(--mgray-color);
  background-color: transparent !important;
}

thead tr {
  border-top: none !important;
  border-bottom: none !important;
  background-color: transparent !important;
}

/* Dark mode compatibility */
body[data-theme="dark"] table {
  border-top-color: var(--text-color) !important;
  border-bottom-color: var(--text-color) !important;
}

body[data-theme="dark"] thead tr {
  border-bottom-color: var(--mgray-color) !important;
}

/* ===== BOOKTABS-STYLE FOR JUPYTER HTML TABLES ===== */
table.dataframe {
  width: 100% !important;
  border-top: 2px solid var(--text-color);
  border-bottom: 2px solid var(--text-color);
  border-left: none !important;
  border-right: none !important;
}

table.dataframe thead {
  border-bottom: 1px solid var(--mgray-color);
}

table.dataframe thead th,
table.dataframe tbody th,
table.dataframe td {
  border: none !important;
}

/* Remove zebra striping from notebook tables */
table.dataframe tbody tr:nth-child(2n) {
  background-color: transparent !important;
}

/* Dark mode: make transparent figures readable */
body[data-theme="dark"] img:not(.profile-photo) {
  background-color: #fff;
  opacity: 1;
}

/* === RESPONSIVE TABLES & BLOCK MATH === */
@media (max-width: 900px) {
  /* Create a scrollable wrapper for tables */
  .post-content,
  .content,
  article {
    overflow-x: visible;
  }
  
  .post-content > table,
  .content > table,
  article > table,
  p + table,
  table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Keep table structure together - tbody and thead must align */
  table thead,
  table tbody {
    display: table-header-group !important;
    width: 100% !important;
  }
  
  table tbody {
    display: table-row-group !important;
  }

  table tr {
    display: table-row !important;
  }
  
  table th,
  table td {
    display: table-cell !important;
  }

  /* Block math (KaTeX display math) */
  .katex-display {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    padding-bottom: 0.5em;
  }
}
