/* --- Base and Homepage Styles --- */
.homepage-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 30px;
  align-items: center;
  margin-bottom: 40px;
}
.left-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.right-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
}
.profile-photo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  object-position: top;
  border-radius: 50%;
}
.right-column .site-title {
  font-size: 2em;
  margin: 0 0 15px 0;
  text-align: right;
}
.right-column .site-nav {
  text-align: right;
}
.right-column .site-nav a {
  margin: 0 0 0 15px;
  text-decoration: none;
  color: #007bff;
}
.title-link {
  text-decoration: none;
  color: inherit;
}
.title-link:hover {
  text-decoration: underline;
  color: inherit;
}
.left-column a {
  display: block;
}
.left-column a:hover .profile-photo {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

/* --- NEW: Obsidian-Inspired Color Palette --- */
:root {
  --card-bg-light: #f8f9fa;
  --card-border-light: #8892b0;
  --card-tag-bg-light: #a8b2d1;
  --card-tag-text-light: #0a192f;
  
  /* --- NEW Soothing Dark Mode Palette --- */
  --bg-dark: #111111; /* True black background */
  --card-bg-dark: #1e1e1e;
  --accent-grey-dark: #a0a0a0; /* Soothing light grey accent */
  --text-main-dark: #e2e8f0;
  --text-secondary-dark: #a0aec0;
  --tag-text-dark: #111111; /* Dark text for light grey tags */
}

/* --- Global Link Hover Effect --- */
a:hover {
  text-decoration: underline;
}

/* --- Timeline Styles (My Journey) --- */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 2rem 0 4rem 0; /* More bottom margin */
}
.timeline::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--card-border-light);
}
.timeline-item {
  position: relative;
  margin-bottom: 1.5rem; /* Tighter spacing */
  padding-left: 80px;
}
.timeline-marker {
  position: absolute;
  left: 22px;
  top: 8px;
  width: 16px;
  height: 16px;
  background: var(--card-border-light);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--card-border-light);
}
.timeline-marker.current {
  background: #28a745;
  box-shadow: 0 0 0 3px #28a745;
  animation: pulse 2s infinite;
}
.timeline-content {
  background: var(--card-bg-light);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border-left: 4px solid var(--card-border-light);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.timeline-content:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}
.company-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 10px;
}
.company-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-right: 8px;
}
.company-header h4 {
  margin: 0;
  flex-grow: 1;
  font-size: 1.15em;
  line-height: 1;
}
.timeline-date {
  color: #6c757d;
  font-size: 0.85em;
  font-weight: 500;
  background: #e9ecef;
  padding: 4px 12px;
  border-radius: 15px;
}
.role {
  color: #495057;
  margin-bottom: 0.5rem;
  font-size: 1em;
}
.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.75rem;
}
.skill-tag {
  background: var(--card-tag-bg-light);
  color: var(--card-tag-text-light);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 500;
}

/* --- Education & Certifications Grid Styles --- */
.education-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem;
margin: 2rem 0 4rem 0;
}
.education-item {
display: flex;
align-items: center;
background: var(--card-bg-light);
padding: 1rem;
border-radius: 12px;
border-left: 4px solid var(--card-border-light);
box-shadow: 0 2px 10px rgba(0,0,0,0.08);
transition: transform 0.2s ease, box-shadow 0.2s ease;
min-height: 110px;
}
.education-item:hover {
transform: translateY(-3px);
box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}
.education-logo {
width: 80px;  /* Increased logo size */
height: 80px;
object-fit: contain;
margin-right: 1rem;
flex-shrink: 0;
}
.education-content {
text-align: left;
}
.education-content h4 {
margin: 0 0 4px 0;
color: #212529;
font-size: 1.05em;
line-height: 1.3;
}
.education-content p {
margin: 0;
color: #6c757d;
font-size: 0.9em;
}

/* --- Essays List Styles --- */
.essays-simple-list {
  max-width: 800px;
  margin: 2rem 0;
}
.essay-simple-item {
  display: flex;
  align-items: baseline;
  margin-bottom: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e9ecef;
}
.essay-simple-date {
  color: #6c757d;
  font-size: 0.9em;
  font-weight: 500;
  min-width: 100px;
  margin-right: 1rem;
}
.essay-simple-separator {
  color: #6c757d;
  margin: 0 1rem;
}
.essay-simple-title {
  color: #212529;
  text-decoration: none;
  font-size: 1.1em;
  font-weight: 500;
  flex-grow: 1;
}
.essay-simple-title:hover {
  color: #007bff;
  text-decoration: underline;
}

/* --- Homepage Recent Posts Section --- */
.homepage-content-wrapper {
display: flex;
flex-direction: column;
width: 100%;
gap: 2rem;
}
.about-section, .recent-posts-section {
width: 100%;
}
.section-separator {
border: none;
border-top: 1px solid #e0e0e0;
margin: 1rem 0;
}
.recent-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.recent-posts-column {
  min-width: 0;
}
.post-item {
  margin-bottom: 0.25rem;
  line-height: 1.2;
}
.posts-list .post-item a {
  text-decoration: none; 
  color: #007bff;
}

/* --- Single Post Styles --- */
.post-title {
  color: #9b8bb4; /* Obsidian purple */
  font-size: 1em; /* Same size as body text */
  font-weight: bold;
  margin: 0 0 0.5rem 0;
}

/* --- Consolidated Dark Mode Styles --- */
@media (prefers-color-scheme: dark) {
  body {
      background-color: var(--bg-dark);
      color: var(--text-main-dark);
  }
  
  .right-column .site-nav a {
      color: var(--accent-grey-dark); /* Soothing grey for nav links */
  }

  /* Education items */
  .education-item {
      background: var(--card-bg-dark);
      border-left-color: var(--accent-grey-dark); /* Soothing grey border */
  }
  .education-content h4 {
      color: var(--text-main-dark);
  }
  .education-content p {
      color: var(--text-secondary-dark);
  }
  
  /* Essays list */
  .essay-simple-item {
      border-bottom-color: #4a5568;
  }
  .essay-simple-date,
  .essay-simple-separator {
      color: var(--text-secondary-dark);
  }
  .essay-simple-title {
      color: var(--text-main-dark);
  }
  .essay-simple-title:hover {
      color: var(--accent-grey-dark);
  }
  
  /* Timeline */
  .timeline-content {
      background: var(--card-bg-dark);
      color: var(--text-main-dark);
      border-left-color: var(--accent-grey-dark); /* Soothing grey border */
  }
  .timeline-date {
      background: #4a5568;
      color: var(--text-main-dark);
  }
  .role, .timeline-content p {
      color: var(--text-secondary-dark);
  }
  .company-header h4 {
      color: var(--text-main-dark);
  }
  .skill-tag {
      background: var(--accent-grey-dark); /* Soothing grey tags */
      color: var(--tag-text-dark);
  }
  .timeline::before {
      background: var(--accent-grey-dark);
  }
  .timeline-marker {
      background: var(--accent-grey-dark);
      box-shadow: 0 0 0 3px var(--accent-grey-dark);
      border-color: var(--card-bg-dark);
  }
  .timeline-marker.current {
      background: #68d391;
      box-shadow: 0 0 0 3px #68d391;
  }
  .right-column .site-nav a:hover {
    color: var(--text-main-dark);
}

.posts-list .post-item a {
    color: var(--accent-grey-dark);
}

.posts-list .post-item a:hover {
    color: var(--text-main-dark);
}
}

/* --- Consolidated Mobile Responsive Styles --- */
@media (max-width: 768px) {
  .recent-posts-grid {
    grid-template-columns: 1fr;
  }
  .homepage-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 20px;
  }
  .right-column {
    align-items: center;
  }
  .right-column .site-title,
  .right-column .site-nav {
    text-align: center;
  }
  .right-column .site-nav a {
    margin: 0 7px;
  }
  .profile-photo {
    width: 100px;
    height: 100px;
  }
  .education-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* --- Animations --- */
@keyframes pulse {
  0% { box-shadow: 0 0 0 3px #28a745; }
  50% { box-shadow: 0 0 0 8px rgba(40, 167, 69, 0.3); }
  100% { box-shadow: 0 0 0 3px #28a745; }
}

/* --- Base and Homepage Styles --- */
.right-column .site-nav a:hover {
    text-decoration: underline;
}

/* --- Homepage Recent Posts Section --- */
.posts-list .post-item a {
    text-decoration: none; 
    color: #007bff;
}

.posts-list .post-item a:hover {
    text-decoration: underline;
}

/* --- Obsidian-Style Tags --- */
.obsidian-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1rem 0;
}

.obsidian-tag {
  display: inline-block;
  background: #9b8bb4; /* Obsidian purple */
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.obsidian-tag:hover {
  background: #8a7ba3; /* Slightly darker purple on hover */
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(155, 139, 180, 0.3);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .obsidian-tag {
    background: #9b8bb4; /* Keep the same purple in dark mode */
    color: #ffffff;
  }
  
  .obsidian-tag:hover {
    background: #8a7ba3;
    color: #ffffff;
  }
}
/* Style existing theme tags to look like Obsidian */
p a[href*="/tags/"] {
  display: inline-block;
  background: #9b8bb4 !important;
  color: #ffffff !important;
  padding: 4px 12px !important;
  border-radius: 12px !important;
  font-size: 0.85em !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  margin: 2px 4px 2px 0 !important;
  transition: all 0.2s ease !important;
}

p a[href*="/tags/"]:hover {
  background: #8a7ba3 !important;
  color: #ffffff !important;
  text-decoration: none !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(155, 139, 180, 0.3);
}

/* --- Blogs Page Styles --- */
.blogs-page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

.blogs-intro {
  margin-bottom: 3rem;
  color: #6c757d;
  font-size: 1.05em;
  line-height: 1.6;
}

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

.blog-column {
  display: flex;
  flex-direction: column;
}

.blog-column-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.8em;
  font-weight: 600;
}

.blog-column-title a {
  color: #212529;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-column-title a:hover {
  color: #007bff;
  text-decoration: none;
}

.blog-column-description {
  color: #6c757d;
  margin: 0 0 2rem 0;
  font-size: 0.95em;
  line-height: 1.5;
}

.blog-posts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.blog-post-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.blog-post-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.blog-post-date {
  color: #6c757d;
  font-size: 0.85em;
  font-weight: 500;
}

.blog-post-item a {
  color: #212529;
  text-decoration: none;
  font-size: 1em;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.blog-post-item a:hover {
  color: #007bff;
  text-decoration: none;
}

.blog-view-all {
  display: inline-block;
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95em;
  margin-top: auto;
  padding-top: 1rem;
  transition: color 0.2s ease;
}

.blog-view-all:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* Dark mode support for blogs page */
@media (prefers-color-scheme: dark) {
  .blogs-intro {
    color: var(--text-secondary-dark);
  }
  
  .blog-column-title a {
    color: var(--text-main-dark);
  }
  
  .blog-column-title a:hover {
    color: var(--accent-grey-dark);
  }
  
  .blog-column-description {
    color: var(--text-secondary-dark);
  }
  
  .blog-post-item {
    border-bottom-color: #4a5568;
  }
  
  .blog-post-date {
    color: var(--text-secondary-dark);
  }
  
  .blog-post-item a {
    color: var(--text-main-dark);
  }
  
  .blog-post-item a:hover {
    color: var(--accent-grey-dark);
  }
  
  .blog-view-all {
    color: var(--accent-grey-dark);
  }
  
  .blog-view-all:hover {
    color: var(--text-main-dark);
  }
}

/* Mobile responsive for blogs page */
@media (max-width: 768px) {
  .blogs-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .blog-column-title {
    font-size: 1.5em;
  }
}

/* --- Custom Collapse (Dropdown) Styles --- */
.custom-collapse {
  margin: 1.5rem 0;
  padding: 0;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  background-color: #ffffff;
}

.collapse-summary {
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  background-color: #f6f8fa;
  list-style: none;
  display: flex;
  align-items: center;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #24292e;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.custom-collapse[open] .collapse-summary {
  border-bottom-color: #e1e4e8;
}

.collapse-summary::-webkit-details-marker {
  display: none;
}

.collapse-summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 10px;
  transition: transform 0.2s ease;
  font-size: 0.8em;
}

.custom-collapse[open] .collapse-summary::before {
  transform: rotate(90deg);
}

.collapse-content {
  padding: 16px;
  overflow-y: auto;
  font-size: 0.9em; /* Smaller font for content */
}

.collapse-content table {
  font-size: 0.9em; /* Even smaller for tables if needed */
  width: 100%;
  display: block;
  overflow-x: auto;
}

/* Dark mode for collapse */
@media (prefers-color-scheme: dark) {
  .custom-collapse {
    border-color: #30363d;
    background-color: #1e1e1e;
  }
  .collapse-summary {
    background-color: #2d333b;
    color: #adbac7;
  }
  .custom-collapse[open] .collapse-summary {
    border-bottom-color: #30363d;
  }
}

/* --- Code Block Styles for ASCII Art and Diagrams --- */
pre, .highlight pre {
  background: #f6f8fa !important;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
  font-size: 13px;
  line-height: 1.45;
  color: #24292e !important;
  white-space: pre;
  word-wrap: normal;
}

code {
  font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
}

/* Ensure text inside code blocks is visible */
pre code, pre span {
  color: inherit;
}

/* Dark mode overrides for code blocks */
@media (prefers-color-scheme: dark) {
  pre, .highlight pre {
    background-color: #161b22 !important;
    border-color: #30363d;
    color: #c9d1d9 !important;
  }
}