/* ========================================
   MODERN JEKYLL SITE STYLESHEET
   Enhanced Version - 2025-11-05
   ======================================== */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  --primary-color: #3a4f66;
  --secondary-color: #576a7d;
  --accent-color: #74ebd5;
  --text-dark: #2c3e50;
  --text-light: #5a6c7d;
  --bg-gradient-start: #f0d586;
  --bg-gradient-mid: #576a7d;
  --bg-gradient-end: #6b7f94;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.4);
  --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.2);
  --radius-sm: 8px;
  --radius-md: 15px;
  --radius-lg: 20px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* ========================================
   RESET AND BASE
   ======================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
  background-attachment: fixed;
  color: #2c3e50;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  line-height: 1.6;
}

/* Skip to content link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* ========================================
   GLASS CONTAINERS
   ======================================== */
.glass-container {
  background: var(--glass-bg);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md), 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 900px;
  padding: 40px 50px;
  margin-bottom: 30px;
}

.glass-container-header {
  background: var(--glass-bg);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md), 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 900px;
  padding: 20px 30px;
  margin-bottom: 30px;
}

.glass-container-footer {
  background: var(--glass-bg);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md), 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 900px;
  padding: 30px;
  margin-top: 30px;
}

/* ========================================
   NAVIGATION
   ======================================== */
/* ========================================
   NAVIGATION - MOBILE FIXES
   ======================================== */

/* Navigation Container */
/* ========================================
   NAVIGATION - MOBILE FIXES
   ======================================== */

/* Navigation Container */
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  gap: 20px;
  z-index: 1000; /* Ensure container has base z-index */
}

.site-title {
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: 2px;
  color: var(--primary-color);
  text-decoration: none;
  text-shadow: 0 2px 8px rgba(58, 79, 102, 0.3);
  transition: color var(--transition-normal);
  z-index: 1002; /* Above mobile menu */
  position: relative;
}

.site-title:hover {
  color: var(--secondary-color);
}

/* Desktop Navigation */
.site-nav {
  display: flex;
  gap: 30px;
  align-items: center;
  z-index: 1001;
}

.site-nav a {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all var(--transition-normal);
  position: relative;
  padding-bottom: 5px;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width var(--transition-normal);
}

.site-nav a:hover::after,
.site-nav a.active::after {
  width: 100%;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--primary-color);
  text-shadow: 0 2px 8px rgba(58, 79, 102, 0.3);
}

/* Mobile Navigation Toggle Button */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1003; /* Highest - always clickable */
  position: relative;
}

.hamburger {
  width: 25px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 2px;
  transition: all var(--transition-normal);
}

/* ========================================
   RESPONSIVE MOBILE NAVIGATION
   ======================================== */
@media (max-width: 768px) {
  /* Ensure header container has high z-index */
  .glass-container-header {
    position: relative;
    z-index: 1000;
  }
  
  /* Show hamburger button */
  .nav-toggle {
    display: flex;
  }
  
  /* Hide desktop nav, prepare for mobile dropdown */
  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% + 15px); /* Position below nav-container with gap */
    left: -30px; /* Align with container padding */
    right: -30px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    flex-direction: column;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    z-index: 999; /* Below toggle button but above content */
    gap: 0;
  }
  
  /* Show nav when active */
  .site-nav.active {
    display: flex;
    animation: slideDown 0.3s ease;
  }
  
  /* Mobile nav links */
  .site-nav a {
    padding: 15px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(58, 79, 102, 0.1);
    font-size: 1.1rem;
    width: 100%;
    z-index: 999;
  }
  
  .site-nav a:last-child {
    border-bottom: none;
  }
  
  /* Remove underline effect on mobile */
  .site-nav a::after {
    display: none;
  }
  
  /* Active state for mobile */
  .site-nav a.active {
    background: rgba(58, 79, 102, 0.1);
    border-radius: var(--radius-sm);
  }
  
  /* Slide down animation */
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Ensure main content is below navigation */
  .glass-container {
    position: relative;
    z-index: 1;
  }
}

@media (max-width: 480px) {
  .site-title {
    font-size: 1.5rem;
  }
  
  .site-nav a {
    font-size: 1rem;
    padding: 12px 10px;
  }
  
  .site-nav {
    left: -20px;
    right: -20px;
  }
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--primary-color);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.3rem; }

.page-title {
  margin: 0 0 10px 0;
  font-size: 2.8rem;
  color: var(--primary-color);
  text-align: center;
  text-shadow: 0 3px 12px rgba(58, 79, 102, 0.3);
}

.page-description {
  text-align: center;
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 40px;
}

p {
  margin-bottom: 1.2rem;
  color: var(--text-dark);
}

a {
  color: var(--primary-color);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--secondary-color);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  text-align: center;
  padding: 60px 20px;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 20px;
  color: var(--primary-color);
  text-shadow: 0 4px 15px rgba(58, 79, 102, 0.3);
  animation: fadeInUp 0.8s ease;
}

.hero-description {
  font-size: 1.4rem;
  color: var(--text-light);
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.4s both;
}

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

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-block;
  z-index:1;
  padding: 12px 30px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all var(--transition-normal);
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 10px 25px;
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* ========================================
   POST CARDS (Grid Layout)
   ======================================== */
.featured-section {
  margin-top: 60px;
}

.section-title {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 40px;
  color: var(--primary-color);
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: 10px;
  display: inline-block;
  width: 100%;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.post-card {
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(58, 79, 102, 0.15);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(58, 79, 102, 0.3);
}

.post-card-header {
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(116, 235, 213, 0.3), rgba(87, 106, 125, 0.3));
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.post-card:hover .post-card-image {
  transform: scale(1.05);
}

.post-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-color);
}

.post-card-content {
  padding: 25px;
}

.post-date {
  display: block;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 10px;
  font-style: italic;
}

.post-card-title {
  margin: 0 0 15px 0;
  font-size: 1.4rem;
}

.post-card-title a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.post-card-title a:hover {
  color: var(--accent-color);
}

.post-excerpt {
  color: var(--text-light);
  margin-bottom: 15px;
  line-height: 1.6;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.tag {
  display: inline-block;
  background: rgba(58, 79, 102, 0.1);
  color: var(--primary-color);
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition-fast);
}

.tag:hover {
  background: rgba(58, 79, 102, 0.2);
}

.read-more {
  display: inline-block;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.read-more:hover {
  color: var(--accent-color);
  transform: translateX(5px);
}

.view-all {
  text-align: center;
  margin-top: 40px;
}

.no-posts {
  text-align: center;
  color: var(--text-light);
  font-size: 1.2rem;
  padding: 40px;
}

/* ========================================
   BLOG LIST PAGE
   ======================================== */
.blog-page {
  width: 100%;
}

.posts-list-modern {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.post-item {
  display: flex;
  gap: 25px;
  padding: 25px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  border: 1px solid rgba(58, 79, 102, 0.15);
  transition: all var(--transition-normal);
}

.post-item:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(58, 79, 102, 0.3);
  box-shadow: var(--shadow-md);
  transform: translateX(5px);
}

.post-item-date {
  flex-shrink: 0;
  width: 80px;
  text-align: center;
  background: var(--primary-color);
  color: white;
  border-radius: var(--radius-sm);
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.date-day {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.date-month {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 5px;
}

.date-year {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 3px;
}

.post-item-content {
  flex: 1;
}

.post-item-title {
  margin: 0 0 12px 0;
  font-size: 1.6rem;
}

.post-item-title a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.post-item-title a:hover {
  color: var(--accent-color);
}

.post-item-excerpt {
  color: var(--text-light);
  margin-bottom: 15px;
  line-height: 1.6;
}

.post-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.post-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-small {
  display: inline-block;
  background: rgba(58, 79, 102, 0.1);
  color: var(--primary-color);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.read-more-link {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.read-more-link:hover {
  color: var(--accent-color);
  transform: translateX(3px);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state svg {
  margin-bottom: 20px;
  color: var(--secondary-color);
}

.empty-state h2 {
  color: var(--primary-color);
  margin-bottom: 10px;
}

/* ========================================
   POST LAYOUT
   ======================================== */
.post {
  max-width: 800px;
  margin: 0 auto;
}

.post-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid rgba(58, 79, 102, 0.15);
}

.post-title {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.post-meta {
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
  color: var(--text-light);
  font-size: 0.95rem;
}

.post-meta > * {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-meta svg {
  color: var(--secondary-color);
}

.post-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-dark);
}

.post-content h2 {
  margin-top: 2em;
  margin-bottom: 0.8em;
  font-size: 1.8rem;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 8px;
}

.post-content h3 {
  margin-top: 1.5em;
  margin-bottom: 0.6em;
  font-size: 1.4rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 30px 0;
  box-shadow: var(--shadow-md);
}

.post-content code {
  background: rgba(58, 79, 102, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.post-content pre {
  background: rgba(58, 79, 102, 0.08);
  padding: 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 25px 0;
  border-left: 4px solid var(--accent-color);
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 20px;
  margin: 25px 0;
  font-style: italic;
  color: var(--text-light);
}

.post-footer {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 2px solid rgba(58, 79, 102, 0.15);
}

.share-buttons {
  text-align: center;
  margin-bottom: 40px;
}

.share-buttons p {
  margin-bottom: 15px;
  color: var(--text-light);
  font-weight: 600;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  margin: 0 5px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-normal);
}

.share-btn.twitter {
  background: #1DA1F2;
  color: white;
}

.share-btn.facebook {
  background: #4267B2;
  color: white;
}

.share-btn.linkedin {
  background: #0077B5;
  color: white;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  opacity: 0.9;
}

.post-navigation {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.nav-prev,
.nav-next {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-normal);
  border: 1px solid rgba(58, 79, 102, 0.15);
}

.nav-prev:hover,
.nav-next:hover {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.nav-label {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.nav-title {
  font-weight: 600;
  color: var(--primary-color);
}

/* ========================================
   FOOTER
   ======================================== */
.footer-content {
  text-align: center;
}

.copyright {
  color: var(--text-light);
  margin-bottom: 20px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-normal);
  background: rgba(58, 79, 102, 0.1);
}

.social-links a:hover {
  background: rgba(58, 79, 102, 0.2);
  transform: translateY(-2px);
}

.footer-note {
  color: var(--text-light);
  font-size: 0.9rem;
}

.footer-note a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

.footer-note a:hover {
  text-decoration: underline;
}

/* RSS Subscribe */
.rss-subscribe {
  text-align: center;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid rgba(58, 79, 102, 0.15);
}

.rss-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 25px;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all var(--transition-normal);
}

.rss-button:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

a:focus:not(:focus-visible) {
  outline: none;
}

a:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  body {
    padding: 20px 15px;
  }
  
  .glass-container {
    padding: 25px 20px;
  }
  
  .glass-container-header {
    padding: 15px 20px;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    flex-direction: column;
    padding: 20px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 1001;
  }
  
  .site-nav.active {
    display: flex; 
    z-index: 1010;
  }
  
  .site-nav a {
    padding: 10px;
    text-align: center; 
    z-index: 1010;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .page-title {
    font-size: 2rem;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
  }
  
  .post-item {
    flex-direction: column;
  }
  
  .post-item-date {
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .post-navigation {
    grid-template-columns: 1fr;
  }
  
  .share-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .share-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .site-title {
    font-size: 1.5rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .post-title {
    font-size: 1.8rem;
  }
  
  .glass-container {
    padding: 20px 15px;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .glass-container,
  .glass-container-header,
  .glass-container-footer {
    background: white;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .nav-toggle,
  .share-buttons,
  .post-navigation {
    display: none;
  }
  
  a {
    color: blue;
    text-decoration: underline;
  }
}

/* ========================================
   MOTION PREFERENCES
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
