/* CSS Variables for Theme Support */
:root {
  --bg-primary: #e6e4e3;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255,255,255,0.5);
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #6a6a6a;
  --border-color: #9a9a9a;
  --border-light: #e0e0e0;
  --accent: #063f18;
  --accent-light: #0a5c25;
  --shadow-color: rgba(0,0,0,0.12);
  --overlay-gradient: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
}

[data-theme="dark"] {
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --bg-card: rgba(30,30,30,0.8);
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-muted: #888888;
  --border-color: #333333;
  --border-light: #2a2a2a;
  --accent: #2ecc71;
  --accent-light: #27ae60;
  --shadow-color: rgba(0,0,0,0.4);
  --overlay-gradient: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header Navigation */
.header-nav {
  background-color: #063f18;
  padding: 20px 0;
  border-bottom: 1px solid #052f12;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
  margin-left: 60px;
}

.nav-links a {
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s;
  font-weight: 500;
}

.nav-links a:hover {
  color: #d0d0d0;
}

/* Hero Section */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px 40px;
}

.hero-cover {
  width: 100%;
  height: 400px;
  border-radius: 8px;
  margin-bottom: 60px;
  overflow: hidden;
  position: relative;
}

.hero-image-link {
  text-decoration: none;
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.hero-background-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.hero-image-link:hover .hero-background-image {
  transform: scale(1.05);
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.hero-title {
  padding: 40px;
  color: #ffffff;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  transition: text-decoration 0.2s;
}

.hero-image-link:hover .hero-title {
  text-decoration: underline;
}

/* Posts Container */
.posts-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.post-card {
  display: flex;
  gap: 30px;
  padding: 40px 0;
  border-bottom: 1px solid #9a9a9a;
}

.post-card:first-child {
  padding-top: 0;
}

.post-card:last-child {
  border-bottom: none;
}

.post-image {
  width: 200px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 6px;
}

.post-image img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  transition: transform 0.3s ease;
}

.post-image a:hover img {
  transform: scale(1.1);
}

.post-content {
  flex: 1;
}

.post-category {
  color: #4a4a4a;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  font-weight: 600;
}

.post-category a {
  color: #4a4a4a;
  text-decoration: none;
  transition: color 0.2s;
}

.post-category a:hover {
  color: #063f18;
}

.post-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.post-title a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s;
}

.post-title a:hover {
  color: #1a1a1a;
  text-decoration: underline;
}

.post-excerpt {
  color: #4a4a4a;
  font-size: 16px;
  margin-bottom: 15px;
  line-height: 1.6;
}

.post-meta {
  display: flex;
  gap: 15px;
  color: #6a6a6a;
  font-size: 14px;
}

/* Individual Post Page */
.post-detail {
  max-width: 800px;
  margin: 60px auto;
  padding: 0 20px;
}

.post-header {
  margin-bottom: 40px;
}

.post-detail .post-title {
  font-size: 48px;
  margin-bottom: 20px;
}

.post-featured-image {
  margin-bottom: 40px;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.image-credit {
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: 32px;
  font-weight: 300;
  letter-spacing: 0.2px;
}

.post-body {
  font-size: 18px;
  line-height: 1.8;
  color: #2a2a2a;
  margin-bottom: 60px;
}

.post-body p {
  margin-bottom: 20px;
}

/* Blockquotes - Site-wide */
.post-body blockquote,
blockquote {
  background: linear-gradient(135deg, #f0f7f2 0%, #e8f4eb 100%);
  border-left: 5px solid #063f18;
  margin: 30px 0;
  padding: 25px 30px;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  font-size: 1.1em;
  color: #2a2a2a;
}

.back-link {
  color: #063f18;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
}

.back-link:hover {
  text-decoration: underline;
}

/* Read More Section */
.read-more-section {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 2px solid var(--border-light);
}

.read-more-section h2 {
  font-size: 1.8em;
  color: var(--text-primary);
  margin-bottom: 30px;
}

.read-more-posts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.read-more-card {
  background: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.read-more-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px var(--shadow-color);
}

.read-more-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.read-more-content {
  padding: 15px;
}

.read-more-category {
  display: inline-block;
  background: #063f18;
  color: white;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.7em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.read-more-content h3 {
  font-size: 1em;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.read-more-content h3 a {
  color: var(--text-primary);
  text-decoration: none;
}

.read-more-content h3 a:hover {
  text-decoration: underline;
}

.read-more-meta {
  font-size: 0.8em;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .read-more-posts {
    grid-template-columns: 1fr;
  }
}

[data-theme="dark"] .read-more-category {
  background: #2ecc71;
  color: #1a1a1a;
}

/* Admin Panel Styles */
.admin-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 40px;
  background-color: #ffffff;
  border-radius: 8px;
}

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

.admin-header h1 {
  font-size: 32px;
  color: #1a1a1a;
}

/* Buttons */
.btn-primary {
  background-color: #063f18;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  border: none;
  cursor: pointer;
  font-size: 15px;
}

.btn-primary:hover {
  background-color: #052f12;
}

.btn-secondary {
  background-color: #9a9a9a;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin-left: 10px;
}

.btn-secondary:hover {
  background-color: #7a7a7a;
}

.btn-edit {
  background-color: #4a90e2;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  margin-right: 10px;
  display: inline-block;
}

.btn-delete {
  background-color: #e74c3c;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  border: none;
  cursor: pointer;
  display: inline-block;
}

/* Admin Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
}

.admin-table thead {
  background-color: #f5f5f5;
}

.admin-table th {
  text-align: left;
  padding: 15px;
  font-weight: 600;
  color: #1a1a1a;
  border-bottom: 2px solid #e0e0e0;
}

.admin-table td {
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.admin-table tr:hover {
  background-color: #f9f9f9;
}

.actions {
  white-space: nowrap;
}

/* Forms */
.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #1a1a1a;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: #063f18;
}

textarea.form-control {
  resize: vertical;
  min-height: 200px;
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #666;
}

[data-theme="dark"] .form-hint {
  color: #888;
}

.form-group.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-group.checkbox input[type="checkbox"] {
  width: auto;
}

.form-actions {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid #e0e0e0;
}

.current-image {
  margin-top: 15px;
  padding: 15px;
  background-color: #f5f5f5;
  border-radius: 6px;
}

.current-image p {
  margin-bottom: 10px;
  font-weight: 600;
}

/* Error Messages */
.error-messages {
  background-color: #ffe6e6;
  border: 1px solid #ff4d4d;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 30px;
}

.error-messages h2 {
  color: #cc0000;
  font-size: 18px;
  margin-bottom: 10px;
}

.error-messages ul {
  margin-left: 20px;
  color: #cc0000;
}

/* Notices */
.notice {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 15px 20px;
  border-radius: 6px;
  margin: 20px auto;
  max-width: 1200px;
  text-align: center;
}

/* Footer */
.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  border-top: 1px solid #9a9a9a;
  text-align: center;
  color: #6a6a6a;
  font-size: 14px;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
  /* Mobile Menu */
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-container {
    flex-wrap: wrap;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
  }

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

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 12px 0;
    font-size: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  /* Hero Section */
  .hero {
    padding: 30px 15px 20px;
  }

  .hero-cover {
    height: 250px;
    margin-bottom: 30px;
  }

  .hero-title {
    font-size: 24px;
    padding: 15px;
  }

  /* Posts */
  .posts-container {
    padding: 0 15px 40px;
  }

  .post-card {
    flex-direction: column;
    padding: 25px 0;
    gap: 15px;
  }

  .post-image {
    width: 100%;
  }

  .post-image img {
    height: 180px;
  }

  .post-title {
    font-size: 20px;
  }

  .post-excerpt {
    font-size: 15px;
  }

  .post-meta {
    flex-wrap: wrap;
    font-size: 13px;
  }

  /* Individual Post */
  .post-detail {
    margin: 30px auto;
    padding: 0 15px;
  }

  .post-detail .post-title {
    font-size: 28px;
  }

  .post-detail .post-category {
    font-size: 12px;
  }

  .post-body {
    font-size: 16px;
    line-height: 1.7;
  }

  .post-body blockquote,
  blockquote {
    padding: 20px;
    margin: 20px 0;
    font-size: 1em;
  }

  /* Admin */
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .admin-container {
    margin: 20px;
    padding: 20px;
  }

  .admin-table {
    font-size: 14px;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 8px;
  }

  /* Footer */
  .footer {
    padding: 30px 15px;
    font-size: 13px;
  }

  /* Forms */
  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* About Container Mobile */
@media (max-width: 768px) {
  .about-container {
    margin: 20px 15px;
    padding: 25px 20px;
  }

  .about-container h1 {
    font-size: 28px;
  }

  .about-content {
    font-size: 16px;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .hero-cover {
    height: 200px;
  }

  .hero-title {
    font-size: 20px;
    padding: 12px;
  }

  .post-title {
    font-size: 18px;
  }

  .post-detail .post-title {
    font-size: 24px;
  }

  .logo-image {
    height: 32px;
  }

  .about-container {
    margin: 15px 10px;
    padding: 20px 15px;
  }

  .about-container h1 {
    font-size: 24px;
  }
}

/* About Page */
.about-container {
  max-width: 800px;
  margin: 40px auto;
  padding: 40px 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.about-container h1 {
  font-size: 36px;
  margin-bottom: 30px;
  color: #063f18;
}

.about-content {
  font-size: 18px;
  line-height: 1.8;
  color: #333;
}

.form-help {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}

/* Logo Image Styling */
.logo-image {
  height: 40px;
  width: auto;
  display: block;
}

.logo:hover .logo-image {
  opacity: 0.9;
}

/* ========================================
   MODERN VISUAL ENHANCEMENTS
   ======================================== */

/* Reading Progress Bar */
.reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0,0,0,0.1);
  z-index: 1000;
}

.reading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #063f18, #0a5c25);
  width: 0%;
  transition: width 0.1s ease-out;
}

/* Scroll Animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Enhanced Post Card Hover */
.post-card {
  transition: transform 0.3s ease;
}

.post-card:hover {
  transform: translateY(-4px);
}

.post-card .post-image {
  border-radius: 8px;
  overflow: hidden;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #063f18;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(6, 63, 24, 0.3);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: #0a5c25;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(6, 63, 24, 0.4);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}

/* Enhanced Hero Section */
.hero-cover {
  height: 500px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.hero-title {
  font-size: 48px;
  letter-spacing: -1px;
}

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

/* Enhanced Typography for Post Detail */
.post-detail .post-title {
  font-size: 52px;
  letter-spacing: -1.5px;
  line-height: 1.15;
}

.post-detail .post-category {
  font-size: 14px;
  letter-spacing: 1.5px;
  color: #063f18;
  font-weight: 700;
}

/* Smooth Image Loading */
.post-image img,
.hero-background-image,
.post-featured-image img {
  background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
}

/* Footer Enhancement */
.footer {
  background: linear-gradient(to top, rgba(0,0,0,0.03), transparent);
}

.footer a {
  color: #063f18;
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Nav link hover animation */
.nav-links a {
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #ffffff;
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Responsive adjustments for enhancements */
@media (max-width: 768px) {
  .hero-cover {
    height: 300px;
  }

  .hero-title {
    font-size: 28px;
  }

  .post-detail .post-title {
    font-size: 32px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }

  .post-card:hover {
    transform: none;
  }

  .nav-links a::after {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 22px;
  }

  .post-detail .post-title {
    font-size: 26px;
  }
}

/* ========================================
   DARK MODE STYLES
   ======================================== */

/* Theme Toggle Button */
.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  margin-left: 5px;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.1);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  color: #d0d0d0;
  transition: color 0.2s ease;
}

.theme-toggle:hover svg {
  color: #ffffff;
}

/* Sun icon (shown in dark mode) */
.theme-toggle .sun-icon {
  display: none;
}

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

[data-theme="dark"] .theme-toggle .moon-icon {
  display: none;
}

/* Dark Mode Element Overrides */
[data-theme="dark"] .post-card {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .post-title a {
  color: var(--text-primary);
}

[data-theme="dark"] .post-category {
  color: var(--text-secondary);
}

[data-theme="dark"] .post-category a {
  color: var(--text-secondary);
}

[data-theme="dark"] .post-category a:hover {
  color: var(--accent);
}

[data-theme="dark"] .post-excerpt {
  color: var(--text-secondary);
}

[data-theme="dark"] .post-meta {
  color: var(--text-muted);
}

[data-theme="dark"] .hero-overlay {
  background: var(--overlay-gradient);
}

[data-theme="dark"] .post-body {
  color: var(--text-secondary);
}

[data-theme="dark"] .post-body blockquote,
[data-theme="dark"] blockquote {
  background: linear-gradient(135deg, #1a2e1f 0%, #162618 100%);
  border-left-color: var(--accent);
  color: var(--text-secondary);
}

[data-theme="dark"] .admin-container {
  background-color: var(--bg-secondary);
}

[data-theme="dark"] .admin-header h1 {
  color: var(--text-primary);
}

[data-theme="dark"] .admin-table {
  background-color: var(--bg-secondary);
}

[data-theme="dark"] .admin-table thead {
  background-color: #2a2a2a;
}

[data-theme="dark"] .admin-table th {
  color: var(--text-primary);
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .admin-table td {
  border-bottom-color: var(--border-light);
}

[data-theme="dark"] .admin-table tr:hover {
  background-color: #252525;
}

[data-theme="dark"] .form-group label {
  color: var(--text-primary);
}

[data-theme="dark"] .form-control {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus {
  border-color: var(--accent);
}

[data-theme="dark"] .footer {
  border-top-color: var(--border-color);
  color: var(--text-muted);
  background: linear-gradient(to top, rgba(255,255,255,0.02), transparent);
}

[data-theme="dark"] .footer a {
  color: var(--accent);
}

[data-theme="dark"] .notice {
  background-color: #1a3d2a;
  border-color: #2ecc71;
  color: #90EE90;
}

[data-theme="dark"] .back-to-top {
  background: var(--accent);
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

[data-theme="dark"] .back-to-top:hover {
  background: var(--accent-light);
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

[data-theme="dark"] .reading-progress-bar {
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

[data-theme="dark"] .btn-primary {
  background-color: var(--accent);
}

[data-theme="dark"] .btn-primary:hover {
  background-color: var(--accent-light);
}

[data-theme="dark"] .about-container {
  background: var(--bg-secondary);
  box-shadow: 0 2px 4px var(--shadow-color);
}

[data-theme="dark"] .about-container h1 {
  color: var(--accent);
}

[data-theme="dark"] .about-content {
  color: var(--text-secondary);
}

[data-theme="dark"] .back-link {
  color: var(--accent);
}

[data-theme="dark"] .post-detail .post-category {
  color: var(--accent);
}

/* ========================================
   SEARCH OVERLAY
   ======================================== */

.search-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  margin-left: auto;
}

.search-toggle:hover {
  background: rgba(255,255,255,0.1);
}

.search-toggle svg {
  width: 22px;
  height: 22px;
  color: #d0d0d0;
  transition: color 0.2s ease;
}

.search-toggle:hover svg {
  color: #ffffff;
}

.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-overlay-content {
  width: 100%;
  max-width: 700px;
  padding: 0 20px;
}

.search-close {
  position: absolute;
  top: 30px;
  right: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.search-close svg {
  width: 32px;
  height: 32px;
  color: #ffffff;
}

.search-close:hover {
  background: rgba(255,255,255,0.1);
}

.search-input-wrapper {
  position: relative;
  margin-bottom: 30px;
}

.search-input-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  color: #888;
}

#search-input {
  width: 100%;
  padding: 20px 20px 20px 60px;
  font-size: 20px;
  border: none;
  border-radius: 12px;
  background: #1e1e1e;
  color: #ffffff;
  outline: none;
}

#search-input::placeholder {
  color: #666;
}

#search-input:focus {
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.3);
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-result-item {
  display: block;
  padding: 20px;
  background: #1e1e1e;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.search-result-item:hover {
  background: #2a2a2a;
  transform: translateX(5px);
}

.search-result-category {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #2ecc71;
  margin-bottom: 5px;
}

.search-result-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
}

.search-result-excerpt {
  font-size: 14px;
  color: #888;
  line-height: 1.5;
}

.search-placeholder,
.search-loading,
.search-no-results,
.search-error {
  text-align: center;
  padding: 40px;
  color: #666;
}

.search-hint {
  text-align: center;
  margin-top: 30px;
  color: #666;
  font-size: 14px;
}

.search-hint kbd {
  display: inline-block;
  padding: 4px 8px;
  background: #333;
  border-radius: 4px;
  font-family: monospace;
  color: #fff;
  margin: 0 3px;
}

/* ========================================
   KEYBOARD NAVIGATION
   ======================================== */

.post-card.keyboard-focus {
  outline: 3px solid var(--accent, #063f18);
  outline-offset: 5px;
  background: var(--bg-card, rgba(255,255,255,0.5));
}

[data-theme="dark"] .post-card.keyboard-focus {
  outline-color: #2ecc71;
}

/* ========================================
   STICKY CATEGORY PILLS
   ======================================== */

.sticky-category-pills {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  z-index: 90;
  padding: 12px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s ease;
}

/* Only show sticky pills on mobile */
@media (max-width: 768px) {
  .sticky-category-pills {
    display: block;
  }
}

.sticky-category-pills.visible {
  transform: translateY(0);
  opacity: 1;
}

.sticky-pills-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.category-pill {
  display: inline-block;
  padding: 8px 20px;
  background: #063f18;
  color: #ffffff;
  border-radius: 25px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.category-pill:hover {
  background: #0a5c25;
  transform: translateY(-2px);
}

/* Dark mode for sticky pills */
[data-theme="dark"] .sticky-category-pills {
  background: rgba(30,30,30,0.95);
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

[data-theme="dark"] .category-pill {
  background: #2ecc71;
  color: #1a1a1a;
}

[data-theme="dark"] .category-pill:hover {
  background: #27ae60;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .search-overlay {
    padding-top: 60px;
  }

  .search-close {
    top: 15px;
    right: 15px;
  }

  #search-input {
    font-size: 16px;
    padding: 16px 16px 16px 50px;
  }

  .search-input-icon {
    left: 16px;
    width: 20px;
    height: 20px;
  }

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

  .sticky-category-pills {
    top: 60px;
    padding: 10px 0;
  }

  .sticky-pills-container {
    gap: 8px;
  }

  .category-pill {
    padding: 6px 14px;
    font-size: 13px;
  }
}
