/* Updated color palette for light mode */
:root {
  /* Neutrals */
  --bg-primary: #FFFFFF;
  --bg-surface: #F7F7F8;
  --text-primary: #2C2C2C;
  --text-secondary: #6B7280;
  --border-color: #E5E7EB;

  /* Accents */
  --accent: #345C7D;        /* primary accent for links/CTAs */
  --accent-hover: #2F516C;  /* ~10% darker */
  --highlight: #C44536;     /* use sparingly */

  /* Legacy aliases for minimal code churn */
  --color-dark-red: var(--highlight);
  --color-charcoal: var(--text-primary);
  --color-light-gray: var(--bg-surface);
  --color-deep-blue: var(--accent);
  --color-warm-brown: var(--text-secondary);
  --color-dark-brown: #4A3425;
  --color-white: var(--bg-primary);
  --color-black: #000000;
  --color-dark-red-hover: var(--accent-hover);
}

/* Link styling */
a { 
  text-decoration-thickness: 2px; 
  text-underline-offset: 3px; 
  color: var(--accent);
}
a:hover { 
  text-decoration-style: wavy; 
  color: var(--accent-hover);
}

/* Headings */
.post-title, h1, h2, h3 {
  letter-spacing: -0.02em;
  color: var(--color-charcoal);
  line-height: 1.3;
  margin-bottom: 0.75em;
}

.profile .profile_inner h1 {
  font-size: 2.2rem;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  line-height: 1.2;
  max-width: 700px;
}

.profile .profile_inner span {
  font-size: 1.1rem;
  line-height: 1.5;
  /* color: var(--color-charcoal); */
  opacity: 0.9;
  max-width: 600px;
  /* margin: 0 auto 1.5rem; */
}

/* Cards / lists */
.article-list--compact .article-title {
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.4;
}

.article-list--compact .article .entry-header {
  margin-bottom: .4rem;
}

.article-list--compact .article {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
}

.article-list--compact .article .entry-title a:hover {
  color: var(--color-dark-red);
}

.article-list--compact .article .entry-content {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-charcoal);
  opacity: 0.85;
}

/* Code blocks */
.chroma { border-radius: 10px; border: 1px solid rgba(0,0,0,0.06); }
.chroma .ln { opacity: 0.6; }

/* Tag pills */
.post-tags a {
  display: block;
  background: var(--accent-light, rgba(52, 92, 125, 0.1));
  border-radius: 999px;
  padding: 0 14px;
  font-size: 14px;
  line-height: 34px;
  transition: all 0.2s ease;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 500;
  text-decoration: none !important;
}

.post-tags a:hover {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-color: var(--accent);
}

/* Terms/Tags page styling */
.terms-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
  justify-content: center;
}

.term-tag {
  display: flex;
  align-items: center;
  background: var(--accent-light, rgba(52, 92, 125, 0.1));
  border-radius: 999px;
  padding: 0 8px 0 16px;
  font-size: 14px;
  height: 36px;
  transition: all 0.2s ease;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 500;
  text-decoration: none !important;
}

.term-tag:hover {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.term-name {
  margin-right: 8px;
}

.term-count {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  min-width: 22px;
  height: 22px;
  font-size: 12px;
  font-weight: 600;
  padding: 0 4px;
}

.term-tag:hover .term-count {
  background: white;
  color: var(--accent);
}

/* Keep original terms-tags styling for backward compatibility */
.terms-tags li {
  display: inline-block;
  margin: 10px;
  font-weight: 500;
}

.terms-tags a {
  display: block;
  background: var(--accent-light, rgba(52, 92, 125, 0.1));
  border-radius: 999px;
  padding: 0 14px;
  font-size: 14px;
  line-height: 34px;
  transition: all 0.2s ease;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 500;
  text-decoration: none !important;
}

.terms-tags a:hover {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-color: var(--accent);
}

/* Hero panel */
.first-entry {
  min-height: 10px; /* Adjust this value as needed */
}

.home-info .buttons a {
  border-radius: 999px;
}

/* Profile mode improvements */
.profile {
  padding: 2rem 0;
}

.profile .profile_inner {
  /* gap: 1.2rem; */
  gap: 10px;
  max-width: 800px;
  margin: 0 auto;
}

.profile img {
  border-radius: 50%;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.profile .buttons {
  margin-top: 0.5rem;
}

/* Hide Quick Search tooltip on mobile devices */
@media (max-width: 768px) {
  .quick-search-tooltip {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .quick-search-tooltip {
    display: none !important;
  }
}


/* Images */
.post-content img {
  border-radius: 12px;
}

/* Container width and spacing tweaks */
.main { 
  max-width: 880px; 
  /* padding-top: calc(var(--gap) * 1.5); */
  /* padding-bottom: calc(var(--gap) * 1.5); */
}

/* Search UI improvements */
.search-wrapper {
  margin-bottom: 2rem;
}

.search-form {
  margin-bottom: 1.5rem;
}

.search-input {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  width: 100%;
  font-size: 1.1rem;
  transition: border-color 0.3s ease;
  color: var(--color-charcoal);
  background-color: var(--color-white);
}

.search-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(52, 92, 125, 0.15);
}

.search-results {
  margin-top: 1.5rem;
}

.search-result-item {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.search-result-item:hover,
.search-result-item.active {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.search-result-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.search-result-highlight {
  background-color: rgba(52, 92, 125, 0.2);
  padding: 0 2px;
  border-radius: 2px;
}

.search-tips {
  margin: 2rem 0;
  padding: 1rem;
  border-radius: 8px;
  background-color: var(--code-bg);
  border: 1px solid var(--border);
}

.search-tips ul {
  margin-top: 0.5rem;
  padding-left: 1.5rem;
}

.search-tips li {
  margin-bottom: 0.25rem;
}

/* Dark mode adjustments removed */

/* Command palette styles are now in command-palette.css */

/* Enhanced Navigation */
#menu a {
  position: relative;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  margin: 0 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

#menu a:hover {
  color: var(--accent);
}

#menu a span {
  position: relative;
}

#menu a span.active {
  color: var(--accent);
  font-weight: 600;
}

#menu a span::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

#menu a:hover span::after {
  width: 100%;
}

#menu a span.active::after {
  width: 100%;
}


/* Enhanced Social Icons */
.social-icons {
  margin: 0.5rem 0 1rem;
}

.social-icons a {
  display: inline-flex;
  padding: 10px;
  transition: transform 0.2s ease;
  color: var(--color-charcoal);
}

.social-icons a:hover {
  transform: translateY(-3px);
  color: var(--color-deep-blue);
}

.social-icons a svg {
  height: 24px;
  width: 24px;
  fill: currentColor;
}

/* Footer Links */
.footer-links {
  /* Remove top margin since it's now inline */
  margin-top: 0;
  /* Match the default footer font size */
  font-size: inherit;
}

.footer-links a {
  color: var(--color-charcoal);
  opacity: 0.8;
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent);
  opacity: 1;
  text-decoration: underline;
}

/* Additional Typography Improvements */
body {
  color: var(--color-charcoal);
  line-height: 1.6;
  font-size: 16px;
}

/* Mobile Typography Improvements */
@media (max-width: 640px) {
  body {
    font-size: 17px; /* Slightly larger base font for mobile */
    line-height: 1.7; /* Increased line height for better readability */
  }
  
  p {
    margin-bottom: 1.4em; /* More spacing between paragraphs */
  }
  
  h1 {
    font-size: 1.9rem;
    line-height: 1.3;
  }
  
  h2 {
    font-size: 1.6rem;
    line-height: 1.35;
  }
  
  h3 {
    font-size: 1.3rem;
    line-height: 1.4;
  }
  
  .post-content {
    padding: 0 0.5rem; /* Add some padding to post content */
  }
  
  blockquote {
    padding-left: 1rem;
    margin-left: 0.5rem;
  }
  
  pre {
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.9rem;
  }
}

p {
  margin-bottom: 1.2em;
}

h2 {
  font-size: 1.8rem;
  margin-top: 2rem;
}

h3 {
  font-size: 1.4rem;
  margin-top: 1.8rem;
}

/* Primary Button */
.button,
.home-info .buttons a.button,
.profile .buttons a.button,
a.button { 
  background: var(--accent); 
  color: #fff !important; 
  border: 1px solid transparent;
  border-radius: 999px; 
  padding: 8px 16px; 
  font-weight: 600;
  text-decoration: none !important;
}

.button:hover,
.home-info .buttons a.button:hover,
.profile .buttons a.button:hover,
a.button:hover { 
  background: var(--accent-hover); 
}

/* Secondary/Outline Button */
.button.outline,
.home-info .buttons a.button.outline,
.profile .buttons a.button.outline,
a.button.outline,
.button.secondary,
.home-info .buttons a.button.secondary,
.profile .buttons a.button.secondary,
a.button.secondary {
  background: transparent; 
  color: var(--accent) !important; 
  border: 1px solid var(--accent);
}

.button.outline:hover,
.home-info .buttons a.button.outline:hover,
.profile .buttons a.button.outline:hover,
a.button.outline:hover,
.button.secondary:hover,
.home-info .buttons a.button.secondary:hover,
.profile .buttons a.button.secondary:hover,
a.button.secondary:hover { 
  background: #EFF3F6; 
}

/* Warning Button */
.button.warn,
.home-info .buttons a.button.warn,
.profile .buttons a.button.warn,
a.button.warn { 
  background: var(--highlight); 
}

.button.warn:hover,
.home-info .buttons a.button.warn:hover,
.profile .buttons a.button.warn:hover,
a.button.warn:hover { 
  filter: brightness(0.95); 
}

/* Project-specific styles */
.project-meta {
  margin: 1rem 0;
  padding: 1rem;
  background-color: var(--bg-surface);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.project-meta-label {
  font-weight: 600;
  margin-right: 0.5rem;
  color: var(--text-secondary);
}

.project-repo,
.project-website {
  margin-bottom: 0.5rem;
}

.project-repo:last-child,
.project-website:last-child {
  margin-bottom: 0;
}

/* Project list styling */
.post-entry.project-entry {
  position: relative;
}

/* Ensure hero images are visible on tag pages */
.post-entry.tag-entry .entry-cover {
  display: block;
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 8px;
}

.post-entry.tag-entry .entry-cover img {
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

.post-entry.tag-entry:hover .entry-cover img {
  transform: scale(1.03);
}

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--accent);
}

.project-links a:hover {
  text-decoration: underline;
}

.project-links a svg {
  margin-right: 0.25rem;
  height: 16px;
  width: 16px;
}
