/* Responsive Typography & Mobile UX Enhancements */
:root {
  --font-family-base: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  line-height: 1.65;
  color: #111827;
  overflow-x: hidden;
}

/* Always Fixed Header Across All Pages */
#quarto-header, header#quarto-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9999 !important;
  transform: none !important;
  transition: none !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body.nav-fixed, body {
  padding-top: 70px !important;
}

@media (max-width: 991.98px) {
  body.nav-fixed, body {
    padding-top: 60px !important;
  }
}

/* Container responsive padding for mobile & desktop */
.quarto-container, #quarto-content {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .quarto-container, #quarto-content {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}

/* Mobile Navbar Optimization */
.navbar {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.25rem;
}

.navbar-nav .nav-link {
  font-size: 1rem;
  padding: 0.5rem 0.75rem !important;
}

/* Mobile navigation dropdown styling */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }

  .navbar-nav .nav-link {
    font-size: 1.1rem;
    padding: 0.65rem 0.5rem !important;
    color: #212529 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .navbar-nav .nav-link:last-child {
    border-bottom: none;
  }
}

/* CV Layout Styles - Left Aligned Content */
.cv-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  box-sizing: border-box;
  text-align: left !important;
}

.cv-header-block {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left !important;
}

@media (min-width: 768px) {
  .cv-header-block {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cv-title {
  font-size: 2.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
  text-align: left !important;
}

.cv-subtitle {
  font-size: 1.125rem;
  color: #4b5563;
  margin-top: 0.25rem;
  margin-bottom: 0;
  text-align: left !important;
}

.cv-contact {
  font-size: 0.875rem;
  color: #4b5563;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

@media (min-width: 768px) {
  .cv-contact {
    text-align: right !important;
  }
}

@media (max-width: 767.98px) {
  .cv-contact {
    text-align: left !important;
  }
}

.cv-contact p {
  margin: 0;
}

.cv-contact svg {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.25rem;
}

.cv-section {
  margin-top: 2rem;
  text-align: left !important;
}

.cv-section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 1rem;
  text-align: left !important;
}

.cv-entry {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  text-align: left !important;
}

@media (min-width: 768px) {
  .cv-entry {
    flex-direction: row;
    justify-content: space-between;
  }
}

.cv-entry-info {
  flex: 1;
  text-align: left !important;
}

.cv-entry-heading {
  font-weight: 600;
  color: #111827;
  margin: 0;
  text-align: left !important;
}

.cv-entry-sub {
  font-size: 0.875rem;
  color: #4b5563;
  margin-top: 0.15rem;
  margin-bottom: 0;
  text-align: left !important;
}

.cv-entry-role {
  font-size: 0.925rem;
  font-weight: 500;
  color: #374151;
  margin-top: 0.15rem;
  margin-bottom: 0.35rem;
  text-align: left !important;
}

.cv-bullet-list {
  margin-top: 0.4rem;
  margin-bottom: 0.5rem;
  padding-left: 1.25rem;
  text-align: left !important;
}

.cv-bullet-list li {
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 0.35rem;
  line-height: 1.5;
  text-align: left !important;
}

.cv-entry-date {
  font-size: 0.875rem;
  color: #6b7280;
  white-space: nowrap;
  text-align: left !important;
}

@media (min-width: 768px) {
  .cv-entry-date {
    text-align: right !important;
  }
}

.cv-skills-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left !important;
}

.cv-skill-item {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #374151;
  text-align: left !important;
}

.cv-skill-category {
  font-weight: 600;
  color: #111827;
  margin-right: 0.35rem;
}

.cv-skill-list {
  color: #4b5563;
}

@media (max-width: 640px) {
  .cv-container {
    padding: 1rem 0.5rem;
  }

  .cv-title {
    font-size: 1.75rem !important;
  }

  .cv-section-title {
    font-size: 1.35rem !important;
  }
}

/* Responsive Images, Tables, and Code Blocks */
img, svg {
  max-width: 100%;
  height: auto;
}

pre, code, table {
  max-width: 100%;
  overflow-x: auto;
}

/* Prevent fixed header from hiding the TOC */
#TOC, #quarto-margin-sidebar, .margin-sidebar {
  top: 90px !important;
  margin-top: 2rem !important;
}

/* Fix anchor links hiding under fixed header */
:target, h1, h2, h3, h4, h5, h6, section {
  scroll-margin-top: 80px !important;
}

/* ============================================================
   Blog Listing Page — Main Title & Subtitle Header
   ============================================================ */
.blog-header {
  padding: 3.5rem 0 2rem 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 2.5rem;
}

.blog-main-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.6rem 0;
}

.blog-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: #6b7280;
  font-weight: 400;
  line-height: 1.6;
  margin: 0;
  max-width: 65ch;
}

@media (max-width: 768px) {
  .blog-header {
    padding: 2rem 0 1.5rem 0;
    margin-bottom: 1.5rem;
  }
}
