/* ==========================================================================
   Qurno Astro - HTML/CSS/JS Theme
   Design System & Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Google Fonts Import
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Crete+Round:ital@0;1&family=Work+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* --------------------------------------------------------------------------
   CSS Custom Properties (Theme Variables)
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette - Light Mode */
  --bg-body: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-muted: #f3f4f6;
  --bg-accent: #f3f4f6;
  
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;
  
  --brand-primary: #2563eb;
  --brand-primary-hover: #1d4ed8;
  --brand-accent: #10b981;
  --brand-accent-hover: #059669;
  
  --border-color: #e5e7eb;
  --border-color-hover: #d1d5db;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Typography */
  --font-serif: 'Crete Round', serif;
  --font-sans: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Layout */
  --container-max-width: 1240px;
  --header-height: 80px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Dark Theme Overrides */
html.dark {
  --bg-body: #0b0f17;
  --bg-surface: #151c28;
  --bg-surface-elevated: #1e293b;
  --bg-muted: #1e293b;
  --bg-accent: #1e3a8a;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-inverse: #0f172a;
  
  --brand-primary: #60a5fa;
  --brand-primary-hover: #3b82f6;
  --brand-accent: #34d399;
  --brand-accent-hover: #10b981;
  
  --border-color: #1e293b;
  --border-color-hover: #334155;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
   Layout Containers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.main-content {
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 5rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: 2.3fr 1fr;
    gap: 3.5rem;
  }
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

html.dark .header {
  background-color: rgba(11, 15, 23, 0.85);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--brand-primary), #8b5cf6);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: bold;
}

/* Nav Menu */
.header-nav {
  display: none;
}

@media (min-width: 992px) {
  .header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color var(--transition-fast);
}

.nav-link:hover, .nav-item.active .nav-link {
  color: var(--brand-primary);
}

/* Dropdown Menu */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: -1rem;
  min-width: 200px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-fast);
  z-index: 110;
}

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

.dropdown-item {
  display: block;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.dropdown-item:hover, .dropdown-item.active {
  background-color: var(--bg-muted);
  color: var(--brand-primary);
}

/* Header Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background-color: transparent;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background-color: var(--bg-muted);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  background-color: var(--bg-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.search-trigger-btn:hover {
  border-color: var(--border-color-hover);
  color: var(--text-primary);
  background-color: var(--bg-surface);
}

.search-key-hint {
  font-size: 0.75rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  color: var(--text-muted);
}

html.dark .search-key-hint {
  background-color: var(--bg-body);
}

/* Mobile Menu Toggle */
.mobile-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

@media (min-width: 992px) {
  .mobile-nav-toggle {
    display: none;
  }
}

/* Mobile Drawer Nav */
.mobile-drawer {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-surface);
  z-index: 99;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  overflow-y: auto;
}

.mobile-drawer.is-open {
  transform: translateX(0);
}

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

.mobile-nav-link {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Hero & Featured Section
   -------------------------------------------------------------------------- */
.hero-section {
  margin-bottom: 3.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 992px) {
  .hero-grid {
    grid-template-columns: 1.7fr 1fr;
  }
}

/* Hero Main Card */
.featured-card {
  position: relative;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
}

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

.featured-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--bg-muted);
}

.featured-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.featured-card:hover .featured-img-wrap img {
  transform: scale(1.04);
}

.category-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background-color: var(--brand-primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.category-badge.badge-tech { background-color: #3b82f6; }
.category-badge.badge-ai { background-color: #8b5cf6; }
.category-badge.badge-earth { background-color: #10b981; }
.category-badge.badge-life { background-color: #f59e0b; }

.featured-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.featured-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .featured-title {
    font-size: 2.1rem;
  }
}

.featured-title a:hover {
  color: var(--brand-primary);
}

.featured-excerpt {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Author Meta */
.post-author-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.author-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border-color);
}

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

.author-name {
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--text-primary);
}

.post-date-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

/* Hero Sidebar (Right Column of Hero) */
.hero-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Welcome Widget Card */
.welcome-widget {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.welcome-avatar-lg {
  width: 95px;
  height: 95px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  border: 2px solid var(--border-color);
}

.welcome-text-wrap {
  display: flex;
  flex-direction: column;
}

.welcome-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.welcome-bio {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-link {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.social-link:hover {
  background-color: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Post Feed & Filter Bar
   -------------------------------------------------------------------------- */
.section-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

@media (min-width: 640px) {
  .section-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--text-primary);
}

.filter-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--bg-muted);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background-color: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

/* Article Cards Grid */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.post-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.post-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: var(--bg-muted);
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.post-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  line-height: 1.35;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

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

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pagination */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 3.5rem;
}

.page-btn {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(.disabled) {
  background-color: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.page-indicator {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
}


/* --------------------------------------------------------------------------
   Sidebar Widgets
   -------------------------------------------------------------------------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.widget {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

.widget-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--brand-primary);
}

/* Popular Posts Widget */
.widget-posts-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.widget-post-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.widget-post-thumb {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.widget-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-fast);
}

.widget-post-item:hover .widget-post-thumb img {
  transform: scale(1.08);
}

.widget-post-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.widget-post-title a:hover {
  color: var(--brand-primary);
}

/* Shopping / Recommended Products Widget */
.shopping-products-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.product-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.product-item:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.product-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background-color: var(--bg-muted);
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-fast);
}

.product-item:hover .product-thumb img {
  transform: scale(1.08);
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.product-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.2rem;
}

.product-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.product-buy-badge {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--bg-muted);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.product-item:hover .product-buy-badge {
  background-color: var(--brand-primary);
  color: #ffffff;
}

/* Categories List Widget */
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-muted);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.category-item:hover {
  background-color: var(--bg-accent);
  color: var(--brand-primary);
}

.category-count {
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  color: var(--text-muted);
}

/* Newsletter Widget */
.newsletter-widget {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
}

.newsletter-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-primary {
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  background-color: var(--brand-primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Tags Cloud Widget */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-item {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-muted);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.tag-item:hover {
  background-color: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

/* --------------------------------------------------------------------------
   Single Post Page (Interna do Post)
   -------------------------------------------------------------------------- */
.post-header {
  max-width: 840px;
  margin: 0 auto 2.5rem auto;
  text-align: center;
}

.post-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.post-breadcrumb a:hover {
  color: var(--brand-primary);
}

.post-main-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .post-main-title {
    font-size: 3rem;
  }
}

.post-author-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.post-hero-image-wrap {
  max-width: 1000px;
  margin: 0 auto 3rem auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.post-hero-image-wrap img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.post-img-caption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-style: italic;
}

/* Article Body Typography */
.article-container {
  max-width: 800px;
  margin: 0 auto;
}

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

.article-content p {
  margin-bottom: 1.75rem;
}

.article-content h2 {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  color: var(--text-primary);
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.article-content h3 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--text-primary);
  margin-top: 2.25rem;
  margin-bottom: 0.85rem;
  line-height: 1.35;
}

.article-content blockquote {
  position: relative;
  margin: 2.25rem 0;
  padding: 1.75rem 2rem;
  background-color: var(--bg-muted);
  border-left: 4px solid var(--brand-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.6;
}

.article-content blockquote cite {
  display: block;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin-top: 1rem;
}

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

.article-content ul {
  list-style: disc;
}

.article-content ol {
  list-style: decimal;
}

.article-content li {
  margin-bottom: 0.6rem;
}

/* Callout Box */
.callout-box {
  background-color: var(--bg-accent);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 2rem 0;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.callout-icon {
  font-size: 1.5rem;
  color: var(--brand-primary);
  flex-shrink: 0;
}

.callout-body {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.callout-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

/* Code Snippet */
.code-block-wrap {
  position: relative;
  background-color: #0f172a;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  overflow-x: auto;
  color: #f8fafc;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #1e293b;
  color: #94a3b8;
  font-size: 0.8rem;
}

.copy-code-btn {
  font-size: 0.75rem;
  color: #cbd5e1;
  background: #1e293b;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.copy-code-btn:hover {
  background: #334155;
  color: #ffffff;
}

/* Post Footer & Share */
.post-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

@media (min-width: 640px) {
  .post-footer-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.post-share {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.share-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* Author Box */
.author-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 3rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
  .author-box {
    flex-direction: row;
    align-items: center;
  }
}

.author-box-avatar {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.author-box-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.author-box-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--text-primary);
}

.author-box-bio {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Post Navigation (Prev/Next) */
.post-nav-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 3rem 0;
}

@media (min-width: 640px) {
  .post-nav-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.post-nav-card {
  padding: 1.5rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.post-nav-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

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

.post-nav-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-primary);
}

/* Comments Section */
.comments-section {
  margin-top: 4rem;
}

.comments-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.comment-item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.comment-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: var(--brand-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.comment-content {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.comment-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comment-author {
  font-weight: 600;
  color: var(--text-primary);
}

.comment-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.comment-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.comment-form-wrap {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Search Modal Overlay
   -------------------------------------------------------------------------- */
.search-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  justify-content: center;
  padding-top: 10vh;
  padding-left: 1rem;
  padding-right: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.search-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.search-dialog {
  width: 100%;
  max-width: 680px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 75vh;
  transform: translateY(-20px);
  transition: transform var(--transition-normal);
}

.search-modal.is-open .search-dialog {
  transform: translateY(0);
}

.search-header-bar {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--text-primary);
  outline: none;
}

.search-close-btn {
  color: var(--text-muted);
  font-size: 1.25rem;
}

.search-close-btn:hover {
  color: var(--text-primary);
}

.search-results-list {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-result-item {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-muted);
  transition: all var(--transition-fast);
}

.search-result-item:hover {
  background-color: var(--bg-accent);
}

.search-result-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.search-result-snippet {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding-top: 4rem;
  padding-bottom: 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3.5rem;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
  }
}

.footer-brand-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  line-height: 1.6;
  max-width: 320px;
}

.footer-widget-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--brand-primary);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
  }
}

.back-to-top-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--bg-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.back-to-top-btn:hover {
  background-color: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

/* --------------------------------------------------------------------------
   Main Content 2-Column Grid Layout & Sticky Sidebar
   -------------------------------------------------------------------------- */
.content-layout {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

@media (min-width: 992px) {
  .content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 2.5rem;
    align-items: start;
  }
}

.posts-column {
  min-width: 0;
}

.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 90px;
}

/* --------------------------------------------------------------------------
   Custom Markdown & Pre/Code Blocks Styling (Light & Dark Mode)
   -------------------------------------------------------------------------- */
[data-custom-markdown="1"] {
  font-family: inherit;
  line-height: 1.75;
}

[data-custom-markdown="1"] h1, 
[data-custom-markdown="1"] h2, 
[data-custom-markdown="1"] h3, 
[data-custom-markdown="1"] h4, 
[data-custom-markdown="1"] h5, 
[data-custom-markdown="1"] h6 {
  margin-top: 1.8rem;
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

[data-custom-markdown="1"] p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

[data-custom-markdown="1"] blockquote {
  border-left: 4px solid var(--brand-primary) !important;
  padding: 0.75rem 1.25rem !important;
  margin: 1.5rem 0 !important;
  background-color: var(--bg-muted) !important;
  color: var(--text-secondary) !important;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
  font-style: italic !important;
}

[data-custom-markdown="1"] pre {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border: 1px solid var(--border-color) !important;
  padding: 1.25rem !important;
  border-radius: var(--radius-md) !important;
  overflow-x: auto !important;
  margin: 1.5rem 0 !important;
  font-family: SFMono-Regular, Consolas, 'Fira Code', Monaco, monospace !important;
  font-size: 0.9rem !important;
  line-height: 1.6 !important;
  box-shadow: var(--shadow-sm) !important;
}

[data-custom-markdown="1"] code {
  font-family: SFMono-Regular, Consolas, 'Fira Code', Monaco, monospace !important;
  font-size: 88% !important;
  background-color: var(--bg-muted) !important;
  padding: 0.2em 0.45em !important;
  border-radius: 4px !important;
  border: 1px solid var(--border-color) !important;
  color: #ec4899 !important;
}

[data-custom-markdown="1"] pre code {
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: inherit !important;
  font-size: 0.9rem !important;
}

/* Dark Mode Overrides for [data-custom-markdown="1"] pre */
html.dark [data-custom-markdown="1"] pre,
.dark [data-custom-markdown="1"] pre {
  background-color: #111827 !important;
  color: #f3f4f6 !important;
  border-color: #1f2937 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

html.dark [data-custom-markdown="1"] code,
.dark [data-custom-markdown="1"] code {
  background-color: #1f2937 !important;
  color: #f472b6 !important;
  border-color: #374151 !important;
}

html.dark [data-custom-markdown="1"] pre code,
.dark [data-custom-markdown="1"] pre code {
  background-color: transparent !important;
  color: #f3f4f6 !important;
  border: none !important;
}

html.dark [data-custom-markdown="1"] blockquote,
.dark [data-custom-markdown="1"] blockquote {
  background-color: #1f2937 !important;
  color: #9ca3af !important;
  border-left-color: var(--brand-primary) !important;
}


