/* ==========================================================================
   CSS Variables & Base Styles
   ========================================================================== */

:root {
  --bg: linear-gradient(135deg, #264653, #2A9D8F);
  --text: #ffffff;
  --muted: #E9C46A;
  --accent: #F4A261;
  --highlight: #E76F51;
  --primary: #2A9D8F;
  --primary-dark: #264653;
  --glass: rgba(38, 70, 83, 0.8);
  --blur: 12px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}

.yatra-one-regular {
  font-family: "Yatra One", system-ui;
  font-weight: 400;
  font-style: normal;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: linear-gradient(135deg, #1a1a1a, #264653);
    --glass: rgba(38, 70, 83, 0.9);
  }
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  padding: 0 0 2rem 0;
  overflow-x: hidden;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ==========================================================================
   Animations
   ========================================================================== */

.fade-in {
  animation: fadeInUp 1s ease both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.main-header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid rgba(233, 196, 106, 0.3);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(0.5rem, 2vw, 0.5rem) clamp(1rem, 4vw, 2rem);
  gap: 1rem;
}

.logo {
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.main-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  padding: clamp(0.4rem, 1.5vw, 0.5rem) clamp(0.6rem, 2vw, 0.7rem);
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.main-nav a:hover {
  background: rgba(244, 162, 97, 0.2);
  color: var(--highlight);
}

/* Dropdown styles */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.dropdown-toggle::after {
  content: "▼";
  font-size: 0.7em;
  transition: transform 0.2s ease;
}

.dropdown:hover .dropdown-toggle::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  border: 1px solid rgba(233, 196, 106, 0.3);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Fix dropdown hover gap and enable click-open */
.dropdown-menu {
  margin-top: 0;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border-radius: 0;
  margin: 0;
}

.dropdown-item:hover {
  background: rgba(244, 162, 97, 0.15);
  color: var(--highlight);
  transform: translateX(5px);
}

.dropdown-item:first-child {
  border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 12px 12px;
}

.search-container {
  position: relative;
  min-width: 250px;
  max-width: 350px;
  margin: 0 1rem;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--glass);
  border: 2px solid rgba(233, 196, 106, 0.3);
  border-radius: 25px;
  backdrop-filter: blur(var(--blur));
  transition: all 0.3s ease;
  overflow: hidden;
}

.search-input-wrapper:focus-within {
  border-color: var(--highlight);
  box-shadow: 0 0 0 3px rgba(231, 111, 81, 0.2);
  transform: translateY(-1px);
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

.search-input-wrapper:focus-within .search-icon {
  color: var(--highlight);
}

.search-input {
  width: 100%;
  padding: 12px 40px 12px 40px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  font-family: var(--font);
}

.search-input::placeholder {
  color: var(--muted);
  opacity: 0.8;
  font-weight: 400;
}

.search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
}

.search-clear:hover {
  background: rgba(244, 162, 97, 0.2);
  color: var(--highlight);
}

.search-clear.visible {
  display: flex;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  border: 1px solid rgba(233, 196, 106, 0.3);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  animation: slideDown 0.2s ease-out;
}

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

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid rgba(233, 196, 106, 0.1);
  transition: background 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(244, 162, 97, 0.1);
}

.search-result-item.no-results {
  color: var(--muted);
  font-style: italic;
  justify-content: center;
}

.search-result-image {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.search-result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-content h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  line-height: 1.2;
}

.search-result-content p {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--accent);
  margin-left: 1rem;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-radius: 0 0 16px 16px;
  padding: 1rem;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 200;
  border: 1px solid rgba(233, 196, 106, 0.3);
}

.mobile-nav.open {
  display: flex;
}

.mobile-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-search-container {
  width: 100%;
  margin-bottom: 1rem;
}

.mobile-search-container .search-input-wrapper {
  width: 100%;
  min-width: auto;
  max-width: none;
}

.mobile-search-container .search-input {
  font-size: 1rem;
  padding: 12px 40px 12px 40px;
}

.mobile-search-container .search-results {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  margin-top: 0.5rem;
  max-height: 300px;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
  margin: 0.25rem 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.mobile-nav-links a:hover {
  background: rgba(244, 162, 97, 0.2);
  color: var(--highlight);
}

/* ==========================================================================
   Blog Content
   ========================================================================== */

.blog-posts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
}

.blog-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  border: 1px solid rgba(233, 196, 106, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  width: 100%;
  overflow: hidden;
  min-height: 380px;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  border-color: rgba(244, 162, 97, 0.4);
}

@media (hover: none) {
  .blog-card:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(233, 196, 106, 0.2);
  }
}

.blog-card-image {
  width: 100%;
  height: 220px;
  overflow: hidden;
  position: relative;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.08);
}

.blog-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.blog-card h2 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 1rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(233, 196, 106, 0.1);
}

.blog-card-author {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

.blog-card-date {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination-container {
  margin-top: 3rem;
  padding: 2rem;
  border-radius: 20px;
  backdrop-filter: blur(var(--blur));
  background: var(--glass);
  border: 1px solid rgba(233, 196, 106, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.pagination-info {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  color: var(--muted);
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--accent);
  background: var(--glass);
  color: var(--text);
  border-radius: 8px;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(var(--blur));
  min-width: 100px;
  text-decoration: none;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(244, 162, 97, 0.2);
  border-color: var(--highlight);
  color: var(--highlight);
  transform: translateY(-2px);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--muted);
  color: var(--muted);
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.page-number {
  padding: clamp(0.4rem, 1.5vw, 0.6rem) clamp(0.8rem, 2vw, 1rem);
  border: 1px solid var(--accent);
  background: var(--glass);
  color: var(--text);
  border-radius: 6px;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(var(--blur));
  min-width: 40px;
  text-align: center;
  text-decoration: none;
}

.page-number:hover {
  background: rgba(244, 162, 97, 0.2);
  border-color: var(--highlight);
  color: var(--highlight);
  transform: translateY(-1px);
}

.page-number.active {
  background: var(--accent);
  color: var(--primary-dark);
  border-color: var(--accent);
  font-weight: 700;
}

.page-number.active:hover {
  background: var(--highlight);
  border-color: var(--highlight);
  color: var(--text);
}

.page-ellipsis {
  color: var(--muted);
  font-weight: 600;
  padding: 0 0.5rem;
  user-select: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background: transparent;
  border-top: 1px solid rgba(233, 196, 106, 0.2);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.footer-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--highlight);
}

.footer-social {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.social-link {
  color: var(--text);
  text-decoration: none;
  font-size: 1.5rem;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.social-link:hover {
  color: var(--highlight);
  background: rgba(244, 162, 97, 0.2);
}

/* ==========================================================================
   Blog Post Template Styles
   ========================================================================== */

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

/* Post Header */
.post-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 3rem 2rem;
  border-radius: 20px;
  backdrop-filter: blur(var(--blur));
  background: var(--glass);
  border: 1px solid rgba(233, 196, 106, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.post-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.post-category,
.post-date,
.post-read-time {
  background: rgba(244, 162, 97, 0.2);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(244, 162, 97, 0.3);
}

.post-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.post-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.post-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(42, 157, 143, 0.1);
  border: 1px solid rgba(42, 157, 143, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 400px;
  margin: 0 auto;
}

.author-avatar {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.author-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.author-name {
  font-weight: 600;
  color: var(--accent);
  font-size: 1.1rem;
}

.author-role {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Featured Image */
.post-featured-image {
  margin: 2rem 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Post Content */
.post-content {
  padding: 3rem 2rem;
  border-radius: 20px;
  backdrop-filter: blur(var(--blur));
  background: var(--glass);
  border: 1px solid rgba(233, 196, 106, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  margin-bottom: 3rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
  overflow-x: auto;
}

.post-content h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--accent);
  margin: 2rem 0 1.5rem 0;
  line-height: 1.3;
}

.post-content h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--highlight);
  margin: 2rem 0 1rem 0;
  line-height: 1.4;
}

.post-content p {
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.post-content ul,
.post-content ol {
  margin: 1.5rem 0 1.5rem 2rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.post-content li {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 0.75rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.post-content a {
  color: var(--highlight);
  text-decoration: none;
  word-break: break-all;
  overflow-wrap: break-word;
}

.post-content a:hover {
  text-decoration: underline;
}

.post-content strong {
  color: var(--accent);
  font-weight: 600;
}

/* Inline code styling */
.post-content code {
  background: linear-gradient(135deg, rgba(244, 162, 97, 0.15), rgba(233, 196, 106, 0.1));
  color: var(--highlight);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(244, 162, 97, 0.2);
  backdrop-filter: blur(2px);
  letter-spacing: 0.025em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}



/* Code block container styling */
.post-content pre {
  background: linear-gradient(135deg, 
    rgba(38, 70, 83, 0.95), 
    rgba(26, 26, 26, 0.95)
  );
  border-radius: 16px;
  padding: 1.75rem;
  margin: 2rem 0;
  overflow-x: auto;
  border: 1px solid rgba(233, 196, 106, 0.2);
  backdrop-filter: blur(var(--blur));
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
}

/* Code block pseudo-elements for enhanced glass effect */
.post-content pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(233, 196, 106, 0.5), 
    transparent
  );
  border-radius: 16px 16px 0 0;
}

.post-content pre::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 12px;
  width: 12px;
  height: 12px;
  background: rgba(244, 162, 97, 0.6);
  border-radius: 50%;
  box-shadow: 
    -20px 0 0 rgba(233, 196, 106, 0.6),
    -40px 0 0 rgba(231, 111, 81, 0.6);
}

/* Code within pre blocks */
.post-content pre code {
  background: none;
  color: #e8e6e3;
  padding: 0;
  border: none;
  font-size: 0.875rem;
  line-height: 1.6;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-weight: 400;
  letter-spacing: 0.025em;
  display: block;
}

/* Enhanced scrollbar for code blocks */
.post-content pre::-webkit-scrollbar {
  height: 8px;
}

.post-content pre::-webkit-scrollbar-track {
  background: rgba(233, 196, 106, 0.1);
  border-radius: 8px;
}

.post-content pre::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, 
    rgba(244, 162, 97, 0.6), 
    rgba(233, 196, 106, 0.6)
  );
  border-radius: 8px;
  border: 2px solid rgba(38, 70, 83, 0.5);
}

.post-content pre::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, 
    rgba(244, 162, 97, 0.8), 
    rgba(233, 196, 106, 0.8)
  );
}

/* Firefox scrollbar */
.post-content pre {
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 162, 97, 0.6) rgba(233, 196, 106, 0.1);
}

/* Syntax highlighting enhancements */
.highlight .c   { color: #75715e; font-style: italic; }   /* Comment */
.highlight .k   { color: #66d9ef; }                        /* Keyword */
.highlight .kd  { color: #66d9ef; }                        /* Keyword Declaration */
.highlight .kn  { color: #f92672; }                        /* Keyword Namespace */
.highlight .kp  { color: #66d9ef; }                        /* Keyword Pseudo */
.highlight .kr  { color: #66d9ef; }                        /* Keyword Reserved */
.highlight .kt  { color: #66d9ef; }                        /* Keyword Type */
.highlight .ld  { color: #e6db74; }                        /* Literal Date */
.highlight .m   { color: #ae81ff; }                        /* Literal Number */
.highlight .s   { color: #e6db74; }                        /* Literal String */
.highlight .na  { color: #a6e22e; }                        /* Name Attribute */
.highlight .nb  { color: #f8f8f2; }                        /* Name Builtin */
.highlight .nc  { color: #a6e22e; }                        /* Name Class */
.highlight .no  { color: #66d9ef; }                        /* Name Constant */
.highlight .nd  { color: #a6e22e; }                        /* Name Decorator */
.highlight .ni  { color: #f8f8f2; }                        /* Name Entity */
.highlight .ne  { color: #a6e22e; }                        /* Name Exception */
.highlight .nf  { color: #a6e22e; }                        /* Name Function */
.highlight .nl  { color: #f8f8f2; }                        /* Name Label */
.highlight .nn  { color: #f8f8f2; }                        /* Name Namespace */
.highlight .nx  { color: #a6e22e; }                        /* Name Other */
.highlight .py  { color: #f8f8f2; }                        /* Name Property */
.highlight .nt  { color: #f92672; }                        /* Name Tag */
.highlight .nv  { color: #f8f8f2; }                        /* Name Variable */
.highlight .ow  { color: #f92672; }                        /* Operator Word */
.highlight .w   { color: #f8f8f2; }                        /* Text Whitespace */
.highlight .mf  { color: #ae81ff; }                        /* Literal Number Float */
.highlight .mh  { color: #ae81ff; }                        /* Literal Number Hex */
.highlight .mi  { color: #ae81ff; }                        /* Literal Number Integer */
.highlight .mo  { color: #ae81ff; }                        /* Literal Number Oct */
.highlight .sb  { color: #e6db74; }                        /* Literal String Backtick */
.highlight .sc  { color: #e6db74; }                        /* Literal String Char */
.highlight .sd  { color: #e6db74; }                        /* Literal String Doc */
.highlight .s2  { color: #e6db74; }                        /* Literal String Double */
.highlight .se  { color: #ae81ff; }                        /* Literal String Escape */
.highlight .sh  { color: #e6db74; }                        /* Literal String Heredoc */
.highlight .si  { color: #e6db74; }                        /* Literal String Interpol */
.highlight .sx  { color: #e6db74; }                        /* Literal String Other */
.highlight .sr  { color: #e6db74; }                        /* Literal String Regex */
.highlight .s1  { color: #e6db74; }                        /* Literal String Single */
.highlight .ss  { color: #e6db74; }                        /* Literal String Symbol */
.highlight .bp  { color: #f8f8f2; }                        /* Name Builtin Pseudo */
.highlight .vc  { color: #f8f8f2; }                        /* Name Variable Class */
.highlight .vg  { color: #f8f8f2; }                        /* Name Variable Global */
.highlight .vi  { color: #f8f8f2; }                        /* Name Variable Instance */
.highlight .il  { color: #ae81ff; }                        /* Literal Number Integer Long */
.highlight .o   { color: #f92672; }                        /* Operator */

/* Language-specific code block styling */
.post-content pre[class*="language-python"]::after,
.post-content .highlight-python::after {
  content: 'Python';
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 0.7rem;
  color: rgba(244, 162, 97, 0.8);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-content pre[class*="language-javascript"]::after,
.post-content .highlight-javascript::after {
  content: 'JavaScript';
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 0.7rem;
  color: rgba(233, 196, 106, 0.8);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-content pre[class*="language-bash"]::after,
.post-content .highlight-bash::after {
  content: 'Bash';
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 0.7rem;
  color: rgba(231, 111, 81, 0.8);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Copy button styling for code blocks */
.post-content pre {
  position: relative;
}

.copy-code-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, rgba(244, 162, 97, 0.9), rgba(233, 196, 106, 0.9));
  color: rgba(38, 70, 83, 0.9);
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
  opacity: 0;
  transform: translateY(-2px);
}

.post-content pre:hover .copy-code-btn {
  opacity: 1;
  transform: translateY(0);
}

.copy-code-btn:hover {
  background: linear-gradient(135deg, rgba(244, 162, 97, 1), rgba(233, 196, 106, 1));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(244, 162, 97, 0.3);
}

.copy-code-btn:active {
  transform: translateY(0);
}

.copy-code-btn.copied {
  background: linear-gradient(135deg, rgba(42, 157, 143, 0.9), rgba(38, 70, 83, 0.9));
  color: #fff;
}

.copy-code-btn.copied::after {
  content: ' ✓';
}

/* Responsive code blocks */
@media (max-width: 768px) {
  .post-content pre {
    padding: 1rem;
    margin: 1.5rem -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .post-content pre::after {
    top: 6px;
    right: 8px;
    width: 8px;
    height: 8px;
    box-shadow: 
      -16px 0 0 rgba(233, 196, 106, 0.6),
      -32px 0 0 rgba(231, 111, 81, 0.6);
  }
}

/* Math rendering styles */
.katex {
  color: var(--text);
  font-size: 1.1em;
}

.katex-display {
  margin: 2rem 0;
  text-align: center;
  background: rgba(233, 196, 106, 0.05);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(233, 196, 106, 0.1);
  backdrop-filter: blur(var(--blur));
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

.katex-display .katex {
  color: var(--accent);
  min-width: max-content;
}

/* Inline math */
.katex-inline {
  background: rgba(244, 162, 97, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(244, 162, 97, 0.2);
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Handle any KaTeX overflow globally */
.katex {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

.katex .katex-html {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

/* Custom scrollbar styling for math formulas */
.katex-display::-webkit-scrollbar,
.katex::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.katex-display::-webkit-scrollbar-track,
.katex::-webkit-scrollbar-track {
  background: rgba(233, 196, 106, 0.1);
  border-radius: 10px;
}

.katex-display::-webkit-scrollbar-thumb,
.katex::-webkit-scrollbar-thumb {
  background: rgba(244, 162, 97, 0.5);
  border-radius: 10px;
}

.katex-display::-webkit-scrollbar-thumb:hover,
.katex::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 162, 97, 0.8);
}

/* Firefox scrollbar */
.katex-display,
.katex {
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 162, 97, 0.5) rgba(233, 196, 106, 0.1);
}

/* Images and media content */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Handle long URLs and links */
.post-content a {
  word-break: break-all;
  overflow-wrap: break-word;
}

/* Handle tables if any */
.post-content table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  display: block;
  white-space: nowrap;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.post-content table td,
.post-content table th {
  padding: 0.75rem;
  border: 1px solid rgba(233, 196, 106, 0.2);
  white-space: normal;
  word-wrap: break-word;
}

/* Post Footer */
.post-footer {
  padding: 2rem;
  border-radius: 20px;
  backdrop-filter: blur(var(--blur));
  background: var(--glass);
  border: 1px solid rgba(233, 196, 106, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  margin-bottom: 3rem;
}

.post-tags {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tag-label {
  color: var(--muted);
  font-weight: 600;
}

.post-tag {
  background: rgba(233, 196, 106, 0.2);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid rgba(233, 196, 106, 0.3);
}

.post-tag:hover {
  background: rgba(233, 196, 106, 0.3);
  border-color: rgba(233, 196, 106, 0.5);
  transform: translateY(-1px);
}

/* Post Navigation */
.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--text);
  padding: 1rem;
  border-radius: 12px;
  background: rgba(42, 157, 143, 0.1);
  border: 1px solid rgba(42, 157, 143, 0.2);
  transition: all 0.3s ease;
  flex: 1;
  min-width: 200px;
}

.nav-link:hover {
  background: rgba(42, 157, 143, 0.2);
  border-color: rgba(42, 157, 143, 0.4);
  transform: translateY(-2px);
}

.nav-arrow {
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: bold;
}

.nav-text {
  display: flex;
  flex-direction: column;
}

.nav-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
}

.nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.prev-post {
  text-align: left;
}

.next-post {
  text-align: right;
  flex-direction: row-reverse;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* ==========================================================================
   Mobile & Responsive Styles
   ========================================================================== */

/* Tablet and small desktop */
@media (max-width: 1024px) {
  .header-container {
    max-width: 100%;
    padding: 0.75rem 1.5rem;
  }
  
  main {
    max-width: 100%;
    padding: 0 1.5rem;
  }
  
  .blog-posts {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .pagination-controls {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .page-numbers {
    order: 3;
    flex-basis: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }
}

/* Mobile landscape and small tablets */
@media (max-width: 900px) {
  .header-container {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    position: relative;
  }
  
  .logo {
    font-size: 1.3rem;
  }
  
  .main-nav {
    display: none;
  }
  
  .search-container {
    display: none;
  }
  
  .hamburger {
    display: block;
    order: 2;
    margin-left: auto;
  }
  
  main {
    padding: 0 1rem;
    margin-top: 1rem;
  }
  
  .blog-posts {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
  }
  
  .blog-card {
    min-height: 280px;
  }
  
  .blog-card-image {
    height: 140px;
  }
  
  .blog-card-content {
    padding: 1rem;
  }
  
  .blog-card h2 {
    font-size: 1.1rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
  }
  
  .blog-card p {
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .section-description {
    font-size: 1rem;
  }
}

/* Mobile portrait */
@media (max-width: 768px) {
  .header-container {
    padding: 0.5rem 1rem;
  }
  
  .logo {
    font-size: 1.2rem;
  }
  
  .search-container {
    display: none;
  }
  
  .search-input {
    padding: 0.65rem 2.5rem 0.65rem 2rem;
    font-size: 0.95rem;
  }
  
  .search-icon {
    font-size: 0.9rem;
  }
  
  .search-clear {
    font-size: 1.2rem;
  }
  
  main {
    padding: 0 0.75rem;
    margin-top: 0.75rem;
  }
  
  .blog-posts {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
  }
  
  .blog-card {
    min-height: auto;
    max-width: none;
    margin: 0;
  }
  
  .blog-card-image {
    height: 180px;
    width: 100%;
  }
  
  .blog-card-content {
    padding: 1.25rem;
  }
  
  .blog-card h2 {
    font-size: 1.3rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
  
  .blog-card p {
    font-size: 0.95rem;
    line-height: 1.5;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
  
  .blog-card-meta {
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
  }
  
  .section-header {
    margin-bottom: 2rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .section-description {
    font-size: 0.95rem;
  }
  
  .pagination-container {
    padding: 1.5rem 0.75rem;
    margin: 2rem 0 0 0;
  }
  
  .pagination-controls {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .page-numbers {
    order: 1;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }
  
  .pagination-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  .page-number {
    min-width: 2.5rem;
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .header-container {
    padding: 0.5rem 0.75rem;
  }
  
  .logo {
    font-size: 1.1rem;
  }
  
  main {
    padding: 0 0.5rem;
  }
  
  .blog-posts {
    gap: 1rem;
    margin: 0 -0.5rem;
    margin-bottom: 2rem;
  }

  .pagination-container {
    padding: 1.25rem 0.5rem;
    margin: 1.5rem 0 0 0;
    border-radius: 15px;
  }

  .pagination-controls {
    gap: 0.75rem;
  }

  .pagination-btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }

  .page-numbers {
    gap: 0.2rem;
  }

  .page-number {
    padding: 0.5rem 0.7rem;
    font-size: 0.8rem;
  }
  
  .blog-card {
    margin: 0 0.5rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .blog-card-content {
    padding: 1rem;
  }
  
  .blog-card h2 {
    font-size: 1.2rem;
  }
  
  .blog-card p {
    font-size: 0.9rem;
  }
  
  .section-title {
    font-size: 1.6rem;
  }
  
  .search-results {
    margin: 0 -0.75rem;
  }
  
  .search-result-item {
    padding: 0.75rem;
  }
}

/* Fix mobile navigation */
.mobile-nav {
  background: var(--glass);
  border-top: 1px solid rgba(233, 196, 106, 0.2);
  backdrop-filter: blur(var(--blur));
}

.mobile-nav.open {
  max-height: 100vh;
  overflow-y: auto;
}

.mobile-content {
  padding: 1rem;
}

.mobile-search-container {
  margin-bottom: 1.5rem !important;
  display: block !important;
  position: relative;
  width: 100%;
}

.mobile-search-container .search-input-wrapper {
  width: 100%;
  max-width: none;
  display: flex;
  align-items: center;
  position: relative;
}

.mobile-search-container .search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 2.5rem;
  font-size: 1rem;
  border: 1px solid rgba(233, 196, 106, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  box-sizing: border-box;
}

.mobile-search-container .search-icon {
  position: absolute;
  left: 0.75rem;
  z-index: 10;
  color: var(--muted);
  pointer-events: none;
}

.mobile-search-container .search-clear {
  position: absolute;
  right: 0.5rem;
  z-index: 10;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  width: auto;
  height: auto;
  min-width: auto;
  min-height: auto;
  padding: 0.25rem;
  font-size: 1.2rem;
  display: none;
}

.mobile-search-container .search-clear.visible {
  display: block;
}

.mobile-search-container .search-results {
  position: static;
  width: 100%;
  max-width: none;
  margin-top: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(233, 196, 106, 0.2);
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  max-height: 60vh;
  overflow-y: auto;
  z-index: 1000;
}

.mobile-search-container .search-result-item {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(233, 196, 106, 0.1);
}

.mobile-search-container .search-result-item:last-child {
  border-bottom: none;
}

.mobile-search-container .search-result-content h3 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.mobile-search-container .search-result-content p {
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Post content responsive styles */
@media (max-width: 768px) {
  .post-container {
    padding: 1rem 0.75rem;
    margin: 0 -0.75rem;
  }
  
  .post-header {
    padding: 1.5rem 1rem;
  }
  
  .post-title {
    font-size: 1.8rem;
    line-height: 1.3;
  }
  
  .post-subtitle {
    font-size: 1rem;
  }
  
  .post-meta {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }
  
  .post-featured-image {
    margin: 1rem -0.75rem 2rem;
    border-radius: 0;
  }
  
  .post-content {
    padding: 0 1rem;
  }
  
  .post-content h2,
  .post-content h3,
  .post-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
  }
  
  .post-content h2 {
    font-size: 1.5rem;
  }
  
  .post-content h3 {
    font-size: 1.3rem;
  }
  
  .post-content h4 {
    font-size: 1.1rem;
  }
  
  .post-content p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
  }
  
  .post-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem;
    border-left-width: 3px;
  }
  
  .post-content ul,
  .post-content ol {
    padding-left: 1.25rem;
  }
  
  .post-footer {
    padding: 2rem 1rem 1rem;
  }
  
  .post-navigation {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-link {
    text-align: center;
  }
  
  .nav-link.prev-post,
  .nav-link.next-post {
    flex-direction: column;
  }
  
  .nav-arrow {
    font-size: 1.2rem;
    margin: 0;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .post-container {
    margin: 0 -0.5rem;
    padding: 0.75rem 0.5rem;
  }
  
  .post-header {
    padding: 1rem 0.75rem;
  }
  
  .post-title {
    font-size: 1.6rem;
  }
  
  .post-content {
    padding: 0 0.75rem;
  }
  
  .post-content h2 {
    font-size: 1.4rem;
  }
  
  .post-content h3 {
    font-size: 1.2rem;
  }
  
  .post-footer {
    padding: 1.5rem 0.75rem 1rem;
  }
  .blog-card h2 {
    font-size: 0.95rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  
  .blog-card p {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  
  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  
  .footer-links {
    order: 2;
    gap: 1.5rem;
  }
  
  .footer-social {
    order: 3;
  }
}

/* Table of Contents */
.table-of-contents {
  position: fixed;
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--glass), rgba(38, 70, 83, 0.95));
  border: 1px solid rgba(233, 196, 106, 0.3);
  border-radius: 16px;
  backdrop-filter: blur(var(--blur));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 280px;
  max-height: 70vh;
  overflow: hidden;
  z-index: 100;
  transition: all 0.3s ease;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(233, 196, 106, 0.1);
  border-bottom: 1px solid rgba(233, 196, 106, 0.2);
}

.toc-header h3 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

.toc-toggle {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.toc-toggle:hover {
  background: rgba(244, 162, 97, 0.2);
}

.toc-icon {
  font-size: 1rem;
}

.toc-content {
  padding: 1rem;
  overflow-y: auto;
  max-height: 60vh;
}

.toc-content nav > ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-content ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-content ul ul {
  margin-left: 1rem;
  padding-top: 0.25rem;
}

.toc-content li {
  margin: 0.25rem 0;
}

.toc-content a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1.4;
  display: block;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}

.toc-content a:hover {
  color: var(--accent);
  background: rgba(244, 162, 97, 0.1);
  border-left-color: var(--accent);
}

.toc-content a.active {
  color: var(--highlight);
  background: rgba(231, 111, 81, 0.1);
  border-left-color: var(--highlight);
  font-weight: 500;
}

/* TOC collapsed state */
.table-of-contents.collapsed .toc-content {
  display: none;
}

.table-of-contents.collapsed {
  width: auto;
}

/* TOC scrollbar */
.toc-content::-webkit-scrollbar {
  width: 4px;
}

.toc-content::-webkit-scrollbar-track {
  background: rgba(233, 196, 106, 0.1);
  border-radius: 2px;
}

.toc-content::-webkit-scrollbar-thumb {
  background: rgba(244, 162, 97, 0.5);
  border-radius: 2px;
}

.toc-content::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 162, 97, 0.7);
}

/* Responsive TOC */
@media (max-width: 1200px) {
  .table-of-contents {
    right: 1rem;
    max-width: 250px;
  }
}

@media (max-width: 968px) {
  .table-of-contents {
    position: static;
    transform: none;
    right: auto;
    top: auto;
    margin: 2rem auto;
    max-width: 100%;
    left: 0;
  }
  
  .table-of-contents.collapsed {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .table-of-contents {
    margin: 1rem 0;
    border-radius: 12px;
    border: 1px solid rgba(233, 196, 106, 0.3);
    max-width: calc(100% - 2rem);
    width: auto;
  }
  
  .toc-header {
    padding: 1rem;
  }
  
  .toc-content {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .table-of-contents {
    margin: 1rem 0;
    max-width: 100%;
  }
  
  .toc-header h3 {
    font-size: 0.85rem;
  }
  
  .toc-content a {
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
  }
}

/* Pinned Posts Section */
.pinned-posts-section {
  margin-bottom: 4rem;
  padding: 0 1rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.section-description {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0;
  opacity: 0.9;
}

.regular-posts-header {
  margin-bottom: 2rem;
}

.regular-posts-section {
  margin-bottom: 2rem;
}

.regular-posts-header .section-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.pin-icon {
  font-size: 1.2em;
  filter: hue-rotate(30deg);
}

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

.blog-card.pinned-card {
  position: relative;
  background: linear-gradient(135deg, 
    rgba(244, 162, 97, 0.15), 
    rgba(233, 196, 106, 0.1)
  );
  border: 2px solid rgba(244, 162, 97, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-5px);
  transition: all 0.3s ease;
}

.blog-card.pinned-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border-color: rgba(244, 162, 97, 0.4);
}

.pinned-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, var(--accent), var(--highlight));
  color: var(--primary-dark);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.pinned-badge .pin-icon {
  font-size: 0.9em;
  animation: pinBounce 2s ease-in-out infinite;
}

@keyframes pinBounce {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(10deg) scale(1.1); }
}

.pinned-card .blog-card-content h3 {
  color: var(--highlight);
  font-size: 1.4rem;
  line-height: 1.3;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.pinned-card .blog-card-image {
  position: relative;
  overflow: hidden;
}

.pinned-card .blog-card-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(244, 162, 97, 0.1), 
    rgba(233, 196, 106, 0.05)
  );
  z-index: 1;
}

.pinned-card .blog-card-image img {
  transition: transform 0.3s ease;
}

.pinned-card:hover .blog-card-image img {
  transform: scale(1.05);
}

/* Responsive pinned posts */
@media (max-width: 1024px) {
  .pinned-posts-grid {
    gap: 1.5rem;
    max-width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .pinned-posts-section {
    margin-bottom: 3rem;
    padding: 0 0.75rem;
  }
  
  .pinned-posts-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin: 0;
    max-width: 100%;
    padding: 0;
  }
  
  .blog-card.pinned-card {
    margin: 0;
    border-radius: 16px;
    border: 2px solid rgba(244, 162, 97, 0.3);
    transform: none;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  
  .blog-card.pinned-card:hover {
    transform: translateY(-2px);
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .regular-posts-header .section-title {
    font-size: 1.8rem;
  }
  
  .pinned-badge {
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }
}

@media (max-width: 480px) {
  .pinned-posts-section {
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
  }
  
  .pinned-posts-grid {
    padding: 0;
    gap: 1rem;
    margin: 0;
  }
  
  .blog-card.pinned-card {
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
  }
  
  .pinned-badge {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .section-description {
    font-size: 0.9rem;
  }
  
  .section-header {
    margin-bottom: 2rem;
  }
}

/* Additional responsive fixes */
@media (max-width: 768px) {
  /* Footer responsive */
  .main-footer {
    padding: 2rem 1rem 1rem;
  }
  
  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  
  .footer-social {
    justify-content: center;
  }
  
  /* About page responsive */
  .about-container,
  .legal-content {
    margin: 1rem -0.75rem;
    padding: 1.5rem 1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  /* Search results mobile optimization */
  .search-result-item {
    padding: 0.75rem;
  }
  
  .search-result-image img {
    width: 50px;
    height: 50px;
  }
  
  .search-result-content h3 {
    font-size: 0.95rem;
  }
  
  .search-result-content p {
    font-size: 0.85rem;
  }
}

/* Ensure proper viewport behavior */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Touch targets for mobile */
@media (max-width: 768px) {
  button,
  .btn,
  a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .hamburger {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
  
  .search-clear {
    width: 44px;
    height: 44px;
  }
}