:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9f9f9;
  --bg-tertiary: #f5f5f5;
  --text-primary: #111;
  --text-secondary: #333;
  --text-tertiary: #555;
  --text-quaternary: #666;
  --border-color: #e0e0e0;
  --border-light: #e6e6e6;
  --link-color: #47b1db;
  --accent-color: #47b1db;
  --code-bg: #f5f5f5;
  --code-text: #e83e8c;
  --shadow-sm: rgba(0, 0, 0, 0.1);
  --shadow-md: rgba(0, 0, 0, 0.15);
  --card-bg: #ffffff;
}

[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #242424;
  --bg-tertiary: #2a2a2a;
  --text-primary: #e8e8e8;
  --text-secondary: #d1d1d1;
  --text-tertiary: #b0b0b0;
  --text-quaternary: #999;
  --border-color: #3a3a3a;
  --border-light: #333;
  --link-color: #5fc9f0;
  --accent-color: #5fc9f0;
  --code-bg: #2a2a2a;
  --code-text: #ff79c6;
  --shadow-sm: rgba(0, 0, 0, 0.3);
  --shadow-md: rgba(0, 0, 0, 0.5);
  --card-bg: #242424;
}

html {
  height: 100%;
}

body {
  font-family: Mulish, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100%;
}

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

.site-main {
  flex: 1 0 auto;
}

.site-footer {
  flex-shrink: 0;
}

header {
  margin-bottom: 2rem;
  flex-shrink: 0;
}


.header-wrapper {
  margin: 0 auto;
  padding: 0 20px;
}

footer {
  margin-top: 100px;
  padding: 30px 0;
  background-color: var(--bg-primary);
}

a {
  color: var(--link-color);
  text-decoration: none;
}


.content {
  margin-bottom: 2rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 900px;
  padding: 0 20px;
  text-align: left !important;
}

.content h1 {
  font-size: 2.5em;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5em;
  color: var(--text-primary);
  text-align: left !important;
}

.content ul,
.content ol {
  text-align: left !important;
}

.post-content {
  max-width: 700px;
}

/* Navigation Bar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  position: relative;
}

.navbar-brand {
  font-weight: 700;
  font-size: 22px;
  z-index: 1001;
}

.navbar-brand a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}

.navbar-brand a:hover {
  border-bottom-color: var(--accent-color);
}

/* Hamburger Menu Button */
.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  transition: all 0.3s ease;
  border-radius: 3px;
}

/* Navigation Menu */
.navbar-menu {
  display: flex;
  align-items: center;
  gap: 30px;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 25px;
}

.navbar-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 25px;
}

.navbar-nav li {
  display: inline-flex;
}

.navbar-nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.navbar-nav a:hover {
  color: var(--link-color);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

a {
  text-decoration: none !important;
  color: var(--text-primary);
}

/* Search Toggle Button */
.search-toggle {
  background: none;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  color: var(--text-primary);
}

.search-toggle:hover {
  border-color: var(--link-color);
  color: var(--link-color);
  transform: scale(1.1);
}

.search-toggle svg {
  width: 20px;
  height: 20px;
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  color: var(--text-primary);
}

.theme-toggle:hover {
  border-color: var(--link-color);
  color: var(--link-color);
  transform: rotate(20deg);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.sun-icon {
  display: none;
  color: #fbbf24;
}

.moon-icon {
  display: block;
  color: #3b82f6;
}

[data-theme="dark"] .sun-icon {
  display: block;
  color: #fbbf24;
}

[data-theme="dark"] .moon-icon {
  display: none;
  color: #3b82f6;
}

.home-list {
  margin-top: 40px;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.home-list::before {
  content: '';
  position: absolute;
  left: 100px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.home-list-div {
  list-style: none;
  position: relative;
  padding-left: 0;
}

.home-list-link {
  display: flex;
  padding: 24px 0;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.home-list-link::before {
  content: '';
  position: absolute;
  left: 94px;
  top: 32px;
  width: 14px;
  height: 14px;
  background: var(--bg-primary);
  border: 3px solid var(--accent-color);
  border-radius: 50%;
  z-index: 1;
  transition: all 0.2s ease;
}

.home-list-link:hover::before {
  background: var(--accent-color);
  transform: scale(1.3);
}

.home-list-link:hover .home-list-title {
  color: var(--accent-color);
}

.home-list-image {
  display: none;
}

.home-list-date {
  position: absolute;
  left: 0;
  top: 28px;
  width: 80px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-quaternary);
}

.home-list-content {
  margin-left: 130px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-list-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-quaternary);
  font-weight: 500;
}

.home-list-project-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--accent-color);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 3px;
  text-transform: uppercase;
}

.home-list-duration::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 3px;
  background: var(--text-quaternary);
  border-radius: 50%;
  margin: 0 4px;
  vertical-align: middle;
}

.home-list-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  margin: 0;
  transition: color 0.2s ease;
}

.home-list-summary {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-tertiary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-list-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.home-list-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 3px;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

/* Timeline Starting Point */
.home-list-start {
  opacity: 0.7;
}

.home-list-link-static {
  display: flex;
  padding: 24px 0;
  color: var(--text-secondary);
  position: relative;
}

.home-list-link-static::before {
  content: '';
  position: absolute;
  left: 94px;
  top: 28px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent-color);
  z-index: 2;
}

.home-list-start-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-tertiary);
  font-style: italic;
  margin: 0;
}

.home-list-start-subtext {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-quaternary);
  margin: 0 0 0 0;
  opacity: 0.8;
}

/* Responsive post listings */
@media (max-width: 768px) {
  .home-list::before {
    left: 20px;
  }

  .home-list-link::before {
    left: 14px;
    top: 24px;
    width: 12px;
    height: 12px;
    border-width: 2px;
  }

  .home-list-date {
    position: static;
    width: auto;
    text-align: left;
    margin-left: 50px;
    margin-bottom: 4px;
    font-size: 12px;
  }

  .home-list-link {
    flex-direction: column;
    padding: 20px 0;
  }

  .home-list-content {
    margin-left: 50px;
  }

  .home-list-title {
    font-size: 17px;
  }

  .home-list-summary {
    font-size: 13px;
  }

  .home-list-tags {
    display: none;
  }

  .home-list-link-static::before {
    left: 14px;
    top: 24px;
    width: 12px;
    height: 12px;
    border-width: 2px;
  }
}

.content p {
  font-size: 17px;
  line-height: 27px;
  letter-spacing: normal;
  font-weight: 300;
}

/* Post Article Container */
.post-article {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Post Header */
.post-header {
  margin-bottom: 1em;
  text-align: center;
}

.post-title {
  font-size: 2.75em;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em 0;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.post-meta {
  font-size: 14px;
  color: var(--text-quaternary);
  margin-bottom: 1.5em;
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  row-gap: 12px;
}

.post-meta-separator {
  margin: 0 4px;
}

.post-summary {
  font-size: 1.3em;
  line-height: 1.6;
  color: var(--text-tertiary);
  font-style: italic;
  margin: 1.5em auto 0;
  max-width: 680px;
  border-left: 5px solid var(--accent-color);
  padding-left: 20px;
  text-align: left;
}

.post-image {
  margin: 0 auto 3em;
  max-width: 100%;
}

.post-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Post Content Typography - Inspired by ghuntley.com */
.post-content {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.post-content p {
  font-size: 19px;
  line-height: 1.75;
  letter-spacing: -0.003em;
  font-weight: 400;
  margin-bottom: 1.75em;
  color: var(--text-secondary);
}

.post-content h1 {
  font-size: 2.5em;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 2em;
  margin-bottom: 0.5em;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.post-content h2 {
  font-size: 2em;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.75em;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.post-content h3 {
  font-size: 1.5em;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  color: var(--text-secondary);
}

.post-content h4 {
  font-size: 1.25em;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: var(--text-secondary);
}

.post-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 1.5em;
  margin: 2em 0;
  font-style: italic;
  color: var(--text-tertiary);
  font-size: 1.1em;
  line-height: 1.7;
}

.post-content blockquote p {
  margin-bottom: 1em;
}

.post-aside {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-color);
  border-radius: 6px;
  padding: 1em 1.5em;
  margin: 2em 0;
  font-size: 0.95em;
  color: var(--text-tertiary);
  line-height: 1.65;
}

.post-aside p {
  margin-bottom: 0.5em;
}

.post-aside p:last-child {
  margin-bottom: 0;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.75em;
  padding-left: 1.5em;
}

.post-content li {
  font-size: 19px;
  line-height: 1.75;
  margin-bottom: 0.5em;
  color: var(--text-secondary);
}

.post-content code {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

.post-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1.5em;
  overflow-x: auto;
  margin: 2em 0;
  line-height: 1.5;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.95em;
}

.post-content a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.post-content a:hover {
  border-bottom-color: var(--link-color);
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 2em 0;
  border-radius: 4px;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 3em 0;
}

.post-content strong,
.post-content b {
  font-weight: 600;
  color: var(--text-primary);
}

.post-content em,
.post-content i {
  font-style: italic;
}

h1 {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.3;
  margin-top: 10px;
  color: var(--text-primary);
}

h2 {
  margin-top: 40px;
  /* font-weight: 800; */
  line-height: 1.3;
  color: var(--text-primary);
}


.date {
  color: var(--text-quaternary);
  font-size: 12px;
  font-weight: 800;
}

.terms-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.terms-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.terms-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.terms-item {
  display: inline-block;
}

.terms-item a {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.terms-item a:hover {
  background: var(--accent-color);
  color: var(--bg-primary);
  border-color: var(--accent-color);
}

.copyright {
  font-size: 14px;
  color: var(--text-quaternary);
}

.main-image {
  min-width: 720px;
  max-width: 1200px;
}

.cover-content {
  max-width: 500px;
}

@media screen and (min-width: 768px) {
	.cover-content {
		max-width: 90%
		}
	}

.cover-image {
  color: var(--accent-color);
}

.cover-intro {
  text-align: center;
  margin-top: 40px;
}

/* Social Media Links */
.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 10px;
  padding-top: 10px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.social-link:hover {
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 4px 12px var(--shadow-md);
}

.social-link svg {
  width: 20px;
  height: 20px;
}

/* Brand-specific hover colors */
.social-link.github:hover {
  background: #181717;
  border-color: #181717;
}

.social-link.youtube:hover {
	background: #FF0000;
	border-color: #000000;
}

.social-link.twitter:hover {
  background: #000000;
  border-color: #000000;
}

.social-link.facebook:hover {
  background: #1877F2;
  border-color: #1877F2;
}

.social-link.linkedin:hover {
  background: #0A66C2;
  border-color: #0A66C2;
}

.social-link.instagram:hover {
  background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF, #515BD4);
  border-color: #E4405F;
}

.social-link.tiktok:hover {
  background: #000000;
  border-color: #000000;
}

.social-link.snapchat:hover {
  background: #FFFC00;
  border-color: #FFFC00;
  color: #000000;
}

.summary {
  font-size: 18px;
  line-height: 1.5;
  margin-top: 20px;
  color: var(--text-tertiary);
  font-style: italic;
  max-width: 700px;
  margin: 0 auto 30px auto;
  border-left: 5px solid var(--link-color);
  padding-left: 20px;
}

/* Tag Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  justify-content: flex-start;
  margin: 40px 0;
  line-height: 2;
}

.tag-cloud-item {
  display: inline-block;
  padding: 8px 16px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 20px;
  transition: all 0.3s ease;
  border: 2px solid var(--border-color);
  font-weight: 500;
}

.tag-cloud-item:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow-sm);
}

.tag-count {
  font-size: 0.85em;
  opacity: 0.7;
  margin-left: 4px;
}

/* Tag weights for word cloud effect */
.tag-weight-1 {
  font-size: 0.9em;
  opacity: 0.7;
}

.tag-weight-2 {
  font-size: 1em;
  opacity: 0.8;
}

.tag-weight-3 {
  font-size: 1.15em;
  opacity: 0.9;
}

.tag-weight-4 {
  font-size: 1.35em;
  font-weight: 600;
}

.tag-weight-5 {
  font-size: 1.6em;
  font-weight: 700;
}

/* Term page (individual tag/category) */
.term-description {
  font-size: 1.1em;
  color: var(--text-tertiary);
  margin-bottom: 2em;
  padding-bottom: 1em;
  border-bottom: 1px solid var(--border-color);
}

.no-posts {
  font-size: 1.1em;
  color: var(--text-tertiary);
  text-align: center;
  padding: 3em 0;
}

/* Featured Projects Section */
.featured-section {
  margin-top: 60px;
  margin-bottom: 60px;
}

.featured-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.featured-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-quaternary);
  margin: 0;
  text-align: left;
}

.carousel-controls {
  display: flex;
  gap: 10px;
}

.carousel-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--text-quaternary);
  padding: 0;
  line-height: 1;
}

.carousel-btn:hover {
  border-color: var(--link-color);
  color: var(--link-color);
  background: var(--bg-secondary);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: var(--border-color);
  color: var(--text-quaternary);
}

.carousel-btn:disabled:hover {
  border-color: var(--border-color);
  color: var(--text-quaternary);
  background: var(--bg-primary);
}

.carousel-container {
  overflow: hidden;
  position: relative;
  padding-bottom: 20px;
}

.featured-carousel {
  display: flex;
  gap: 20px;
  transition: transform 0.4s ease;
  scroll-behavior: smooth;
  padding-top: 10px;
}

.featured-carousel .featured-card {
  flex: 0 0 calc(33.333% - 14px);
  min-width: calc(33.333% - 14px);
}

/* Projects list page specific styling */

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

/* Responsive grid for projects page */
@media (max-width: 1024px) {
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }

  .featured-card {
    width: 70%;
    margin: 0 auto;
  }
}

.featured-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  transition: transform 0.2s ease;
  background: var(--card-bg);
  box-shadow: 0 2px 8px var(--shadow-sm);
}

.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px var(--shadow-md);
}

.featured-image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.featured-no-image {
  background: var(--accent-color);
}

.featured-overlay {
  width: 100%;
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
}

.featured-card-title {
  color: white;
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

.external-link-icon {
  font-size: 16px;
  margin-left: 6px;
  opacity: 0.9;
}

.featured-summary {
  padding: 15px;
  font-size: 14px;
  color: var(--text-quaternary);
  line-height: 1.5;
  margin: 0;
  background: var(--card-bg);
}

.featured-card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.posts-section {
  margin-top: 60px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive */
@media (max-width: 1024px) {

  /* Carousel-specific styles at tablet size */
  .featured-carousel {
    display: flex;
    flex-direction: row;
  }

  .featured-carousel .featured-card {
    /* flex: 0 0 calc(50% - 10px);
    min-width: calc(50% - 10px); */
    scroll-snap-align: start;
    width: 300px;
    flex: 0 0 300px;
  }

  .carousel-controls {
    display: none;
  }

  .featured-carousel {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 768px) {

  /* Show hamburger menu */
  .navbar-toggle {
    display: flex;
  }

  /* Hide menu by default on mobile */
  .navbar-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-primary);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 30px 30px;
    gap: 40px;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px var(--shadow-sm);
    z-index: 1000;
    overflow-y: auto;
  }

  /* Show menu when active */
  .navbar-menu.active {
    right: 0;
  }

  /* Mobile menu overlay */
  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
  }

  body.menu-open::before {
    opacity: 1;
    visibility: visible;
  }

  body.menu-open {
    overflow: hidden;
  }

  /* Hamburger animation */
  .navbar-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .navbar-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }

  .navbar-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  /* Stack navigation items vertically */
  .navbar-nav {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 20px;
  }

  .navbar-nav ul {
    flex-direction: column;
    width: 100%;
    gap: 20px;
  }

  .navbar-nav a {
    font-size: 18px;
    width: 100%;
    padding: 10px 0;
  }

  .navbar-actions {
    width: 100%;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
  }
}

@media (max-width: 640px) {

  /* Carousel-specific mobile styles */
  .carousel-container {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .carousel-container::-webkit-scrollbar {
    display: none;
  }

  .featured-carousel {
    display: flex;
    flex-direction: row;
    padding-bottom: 10px;
    transform: none !important;
  }

  .featured-carousel .featured-card {
    width: 300px;
    flex: 0 0 300px;
  }

  /* Hide carousel controls on small mobile */
  .carousel-controls {
    display: none;
  }

  /* Post typography adjustments for mobile */
  .post-title {
    font-size: 2em;
  }

  .post-content p,
  .post-content li {
    font-size: 18px;
  }

  .post-content h1 {
    font-size: 2em;
  }

  .post-content h2 {
    font-size: 1.6em;
  }

  .post-content h3 {
    font-size: 1.3em;
  }

  .post-summary {
    font-size: 1.1em;
  }

  .post-article {
    padding: 0 15px;
  }

  .social-links {
    gap: 15px;
    flex-wrap: wrap;
  }

  .social-link {
    width: 40px;
    height: 40px;
  }

  .social-link svg {
    width: 18px;
    height: 18px;
  }

  .navbar-menu {
    width: 85%;
  }
}

/* Search Modal */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.search-modal.active {
  display: flex;
}

.search-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

.search-modal-content {
  position: relative;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  animation: slideDown 0.3s ease-out;
  overflow: hidden;
}

.search-modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input-icon {
  color: var(--text-quaternary);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  font-size: 18px;
  padding: 12px 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--text-quaternary);
}

.search-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-quaternary);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.search-close:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.search-shortcuts {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-quaternary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-shortcuts kbd {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 11px;
  color: var(--text-secondary);
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.search-empty,
.search-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-quaternary);
}

.search-empty svg,
.search-no-results svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.search-empty p,
.search-no-results p {
  margin: 0;
  font-size: 14px;
}

.search-no-results strong {
  color: var(--text-primary);
}

.search-no-results-hint {
  font-size: 12px !important;
  margin-top: 8px !important;
}

.search-result-item {
  display: block;
  padding: 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: background 0.2s ease;
  border: 1px solid transparent;
}

.search-result-item:hover,
.search-result-item:focus {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  outline: none;
}

.search-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.search-result-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.search-result-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.search-result-badge-post {
  background: var(--accent-color);
  color: white;
}

.search-result-badge-project {
  background: #10b981;
  color: white;
}

.search-result-badge-default {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.search-result-excerpt {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-tertiary);
  margin: 0 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-date {
  font-size: 12px;
  color: var(--text-quaternary);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile adjustments for search */
@media (max-width: 768px) {
  .search-modal {
    padding-top: 5vh;
  }

  .search-modal-content {
    width: 95%;
    max-height: 85vh;
    border-radius: 8px;
  }

  .search-input {
    font-size: 16px;
  }

  .search-result-item {
    padding: 12px;
  }

  .search-result-title {
    font-size: 15px;
  }

  .search-result-excerpt {
    font-size: 13px;
  }
}
