/* Blog Theme - Matching Main Website with Neutral Grays */
:root {
  --bg: #0e0f14;
  --surface: #141622;
  --surface-2: #0f111a;
  --text: #e8e8ef;
  --muted: #a5a7b5;
  --accent-400: #9ca3af;
  --accent-500: #6b7280;
  --accent-600: #4b5563;
  --ring: rgba(75, 85, 99, 0.45);
  --card: rgba(255,255,255,0.06);
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-1: 0 10px 30px rgba(0,0,0,0.25);
  --gap: clamp(16px, 3vw, 28px);
}

/* Light scheme */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7fb;
    --surface: #ffffff;
    --surface-2: #f2f3f8;
    --text: #16171d;
    --muted: #5a5d72;
    --accent-400: #6b7280;
    --accent-500: #4b5563;
    --accent-600: #374151;
    --card: rgba(0,0,0,0.05);
    --shadow-1: 0 10px 30px rgba(28,28,33,0.10);
  }
}

/* Manual DARK override */
:root[data-theme="dark"] {
  --bg: #0c0d12;
  --surface: #131521;
  --surface-2: #0e0f17;
  --text: #e9e9ef;
  --muted: #a9abb8;
  --accent-400: #9ca3af;
  --accent-500: #6b7280;
  --accent-600: #4b5563;
  --ring: rgba(75, 85, 99, 0.45);
}

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

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.blog-container {
  max-width: 100%;
  padding: 20px;
}

.blog-header {
  text-align: center;
  margin-bottom: 32px;
}

.blog-header h1 {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--accent-600), var(--accent-400));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.blog-posts {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.blog-post {
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--muted);
}

.post-date {
  background: var(--card);
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.post-title {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
  line-height: 1.3;
}

.post-content {
  color: var(--muted);
  line-height: 1.7;
}

.post-content p {
  margin-bottom: 16px;
}

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

.loading, .no-posts {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-style: italic;
}

/* Navigation Buttons */
.blog-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.nav-btn {
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.nav-btn:hover {
  background: color-mix(in oklab, var(--surface) 75%, transparent);
  transform: translateY(-1px);
}

.nav-btn.active {
  background: var(--accent-600);
  color: white;
  border-color: var(--accent-600);
}

/* Back Navigation */
.back-nav {
  margin-bottom: 24px;
}

.back-btn {
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.back-btn:hover {
  background: color-mix(in oklab, var(--surface) 75%, transparent);
  transform: translateX(-2px);
}

/* Single Post View */
.single-post {
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-1);
}

.single-post .post-title {
  font-size: clamp(24px, 4vw, 36px);
  margin-bottom: 20px;
}

.single-post .post-meta {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid color-mix(in oklab, var(--text) 8%, transparent);
}

.single-post-view .post-content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}

/* ===== Asterisk Links & Resource Buttons ===== */
.asterisk-link {
  color: var(--accent-500);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 3px;
  padding: 1px 2px;
}

.asterisk-link:hover {
  background: var(--accent-500);
  color: white;
  transform: scale(1.05);
}

.post-links {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--card);
}

.post-links h3 {
  color: var(--text);
  font-size: 1.1rem;
  margin: 0 0 1rem 0;
  font-weight: 600;
}

.link-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.link-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--card);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

.link-button:hover {
  background: var(--accent-500);
  color: white;
  border-color: var(--accent-500);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.link-button.highlighted {
  background: var(--accent-500);
  color: white;
  border-color: var(--accent-500);
  animation: highlight-pulse 2s ease-in-out;
}

/* Ensure button elements inherit all link-button styles */
button.link-button {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-align: left;
  text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--card);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button.link-button:hover {
  background: var(--accent-500);
  color: white;
  border-color: var(--accent-500);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Italic styling for disabled/unavailable resources */
button.link-button[data-disabled="true"] .link-text {
  font-style: italic;
}

/* Disclaimer Footer */
.disclaimer-footer {
  background: #fbbf24;
  color: #1f2937;
  padding: 1rem 0;
  text-align: center;
  font-weight: 500;
  font-size: 0.875rem;
  margin-top: 2rem;
}

.disclaimer-footer p {
  margin: 0;
}

/* Enlightenment Footer */
.enlightenment-footer {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #fbbf24;
  color: #1f2937;
  padding: 0.75rem 1.5rem;
  border-radius: 1rem 1rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 90%;
  width: auto;
  text-align: center;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  transition: bottom 0.3s ease;
  z-index: 1000;
}

.enlightenment-footer.visible {
  bottom: 0;
}

.enlightenment-footer-content {
  line-height: 1.4;
}


@keyframes highlight-pulse {
  0%, 100% { 
    background: var(--accent-500);
    transform: scale(1);
  }
  50% { 
    background: var(--accent-600);
    transform: scale(1.02);
  }
}

.link-icon {
  font-size: 1.1rem;
  opacity: 0.8;
}

.link-text {
  flex: 1;
}

/* ===== Not Available Popup ===== */
.not-available-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.not-available-overlay.show {
  opacity: 1;
  visibility: visible;
}

.not-available-popup {
  background: var(--surface);
  border: 1px solid var(--card);
  border-radius: var(--radius-lg);
  max-width: 400px;
  width: 90vw;
  box-shadow: var(--shadow-2);
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.not-available-overlay.show .not-available-popup {
  transform: scale(1) translateY(0);
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0 1.5rem;
}

.popup-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
}

.popup-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.popup-close:hover {
  color: var(--text);
  background: var(--card);
}

.popup-content {
  padding: 1rem 1.5rem 1.5rem 1.5rem;
}

.popup-content p {
  margin: 0 0 0.75rem 0;
  color: var(--text);
  line-height: 1.5;
}

.popup-content p:last-child {
  margin-bottom: 0;
}

/* Mobile responsiveness for link buttons */
@media (max-width: 480px) {
  .link-button {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  .link-icon {
    font-size: 1rem;
  }
  
  .not-available-popup {
    max-width: 350px;
  }
  
  .popup-header {
    padding: 1.25rem 1.25rem 0 1.25rem;
  }
  
  .popup-content {
    padding: 1rem 1.25rem 1.25rem 1.25rem;
  }
}

/* Clickable Posts */
.blog-post {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .blog-container {
    padding: 16px;
  }
  
  .blog-post, .single-post {
    padding: 20px;
  }
  
  .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .blog-nav {
    flex-direction: column;
    gap: 8px;
  }
  
  .nav-btn {
    width: 100%;
  }
}
