/* ==========================================================================
   ZeroDowntime Journal - Custom Design System & CSS Rules
   Aesthetics: Unique "System Status Uptime" Premium Dev Journal
   Theme: High-contrast light slate, thin lines, glowing green status accents
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Root Tokens & Global Settings
   -------------------------------------------------------------------------- */
:root {
  /* Colors - Pure Dark Theme */
  --bg-main: #000000;
  --bg-card: #0a0a0a;
  --bg-widget: #0a0a0a;
  --border-clean: #1f1f1f;
  --border-focus: #3b82f6;
  
  --text-primary: #ffffff;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  
  --accent-green: #10b981;
  --accent-blue: #3b82f6;
  --accent-rose: #e11d48;
  
  /* Fonts */
  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;
  
  /* Metrics */
  --radius-lg: 16px;
  --radius-md: 8px;
  --radius-sm: 8px;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.6);
  --shadow-focus: 0 0 0 3px rgba(16, 185, 129, 0.2);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-main: #ffffff;
  --bg-card: #ffffff;
  --bg-widget: #ffffff;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --border-clean: #e5e7eb;
  --border-focus: #3b82f6;
  --accent-green: #059669;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.75;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. Sleek Header & Glowing System Status
   -------------------------------------------------------------------------- */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-clean);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo-accent {
  color: var(--accent-green);
  font-weight: 800;
  margin-right: 1px;
}

.logo-text {
  color: var(--text-primary);
  font-weight: 800;
}

.logo-sub {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: 6px;
  border-left: 1px solid var(--border-clean);
  padding-left: 6px;
  font-family: var(--font-mono);
}

/* Live Operational Status breathing dot indicator */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-green);
  margin-left: 12px;
}

.status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
  animation: breathing-pulse 2s infinite ease-in-out;
}

@keyframes breathing-pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px var(--accent-green); }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-smooth);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-main);
}

.nav-admin-link {
  color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.05);
  font-weight: 600;
}

.nav-admin-link:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-blue);
}

.nav-logout-btn {
  background: transparent;
  border: 1px solid var(--border-clean);
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-smooth);
}

.nav-logout-btn:hover {
  background: rgba(225, 29, 72, 0.05);
  color: var(--accent-rose);
  border-color: rgba(225, 29, 72, 0.2);
}

/* --------------------------------------------------------------------------
   3. Tech Hero / Operational welcome Banner
   -------------------------------------------------------------------------- */
.app-main-content {
  flex: 1;
  padding: 2.5rem 0;
}

.main-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.journal-hero {
  border-bottom: 2px solid var(--text-primary);
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--text-primary);
  color: var(--bg-main);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.text-gradient {
  color: var(--accent-green);
  border-bottom: 3px double var(--accent-green);
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   4. High-Performance Two-Column Workspace Layout
   -------------------------------------------------------------------------- */
.journal-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media(min-width: 900px) {
  .journal-main-grid {
    grid-template-columns: 1fr 310px;
  }
}

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

.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

@media(min-width: 900px) {
  .sidebar-column {
    position: sticky;
    top: 5.5rem;
    height: fit-content;
  }
}

/* Control Panel Widgets */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.widget-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.widget-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border-clean);
}

/* Search widget field */
.sidebar-search-form .search-input-wrapper {
  position: relative;
  width: 100%;
}

.sidebar-search-form .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.sidebar-search-form .search-input-field {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-clean);
  color: var(--text-primary);
  padding: 0.5rem 1rem 0.5rem 2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-smooth);
}

.sidebar-search-form .search-input-field:focus {
  border-color: var(--border-focus);
  background: #fff;
  box-shadow: var(--shadow-focus);
}

.sidebar-search-form .clear-search-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

/* Date Archives & Sorting filters */
.sorting-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.sorting-label, .archive-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.sorting-btns {
  display: flex;
  background: var(--bg-main);
  border: 1px solid var(--border-clean);
  padding: 0.15rem;
  border-radius: var(--radius-sm);
}

.sort-btn {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition-smooth);
}

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

.active-sort {
  color: #fff !important;
  background: var(--text-primary) !important;
}

/* Nested Archive Tree Styles */
.archive-tree {
  margin-top: 1rem;
  padding-top: 0.85rem;
}

.all-archives-link {
  margin-bottom: 0.75rem;
}

.archive-link-all {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  border: 1px solid var(--border-clean);
  transition: var(--transition-smooth);
  text-transform: uppercase;
}

.archive-link-all:hover {
  color: var(--accent-green);
  border-color: var(--accent-green);
}

.archive-link-active {
  color: #fff !important;
  background: var(--accent-green) !important;
  border-color: var(--accent-green) !important;
}

.archive-year-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.archive-year-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.archive-year-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.archive-month-list {
  list-style: none;
  padding-left: 1.15rem;
  border-left: 1px dashed var(--border-clean);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.archive-month-item {
  display: block;
}

.archive-month-link {
  text-decoration: none;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition-smooth);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
}

.archive-month-link:hover {
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.05);
}

.month-link-active {
  color: var(--accent-green) !important;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.05) !important;
}

/* Category cloud links widgets */
.sidebar-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sidebar-tag-link {
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-main);
  border: 1px solid var(--border-clean);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.sidebar-tag-link:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.sidebar-tag-link.tag-active {
  color: #fff !important;
  background: var(--text-primary) !important;
  border-color: var(--text-primary) !important;
}

/* Sidebar author bio details */
.sidebar-author-profile {
  text-align: center;
}

.sidebar-avatar-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 0.6rem;
  border: 1px solid var(--border-clean);
}

.sidebar-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-author-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.sidebar-author-bio {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.5;
  margin-bottom: 0.6rem;
}

.sidebar-author-socials a {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-green);
  font-weight: 600;
}

.sidebar-author-socials a:hover {
  color: var(--accent-green-hover);
}

/* --------------------------------------------------------------------------
   5. Unique Tech card list (Left Column Feed)
   -------------------------------------------------------------------------- */
.posts-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fade-up 0.5s ease-out;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

@media(min-width: 640px) {
  .post-card {
    grid-template-columns: 180px 1fr;
    align-items: center;
  }
  .post-card.no-image {
    grid-template-columns: 1fr;
    padding: 1.25rem 1.5rem;
    gap: 0;
  }
}

.post-card.no-image .card-title {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-green);
}

.card-image-wrapper {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-clean);
  background: #f1f5f9;
}

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

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

.card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-category-badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.card-title-link {
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.card-title-link:hover {
  color: var(--accent-green);
}

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

.card-read-more-btn {
  text-decoration: none;
  color: var(--accent-green);
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition-smooth);
  align-self: flex-start;
}

.card-read-more-btn:hover {
  color: var(--accent-green-hover);
  transform: translateX(2px);
}

/* Empty states */
.empty-state-card {
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.empty-state-icon {
  font-size: 2.25rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-state-message {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--text-primary);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.back-home-btn:hover {
  background: var(--accent-green);
}

/* --------------------------------------------------------------------------
   6. Premium High-Readability Serif Article View
   -------------------------------------------------------------------------- */
.post-detail-wrapper {
  max-width: 730px;
  margin: 0 auto;
  animation: fade-in 0.6s ease-out;
}

.detail-navigation {
  margin-bottom: 1.5rem;
}

.back-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-smooth);
}

.back-link:hover {
  color: var(--text-primary);
}

.detail-header {
  border-bottom: 1px solid var(--border-clean);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.detail-category {
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.detail-meta-item {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.detail-title {
  font-family: var(--font-display);
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.75px;
  color: var(--text-primary);
  margin-top: 0.5rem;
}

.detail-cover-image-wrapper {
  width: 100%;
  max-height: 380px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
  border: 1px solid var(--border-clean);
}

.detail-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Beautiful custom serif typography for long-form dev reading */
.markdown-body {
  color: #1e293b;            /* Sleek text color */
  font-family: var(--font-sans); /* Premium clean sans-serif for modern tech feeling, or you can use serif, but Inter with 1.8 line height is absolute top tier */
  line-height: 1.8;
  font-size: 1.1rem;
  margin-bottom: 4rem;
}

.markdown-body h2 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
  border-bottom: 1px solid var(--border-clean);
  padding-bottom: 0.4rem;
}

.markdown-body h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 800;
  margin-top: 1.75rem;
  margin-bottom: 0.85rem;
}

.markdown-body p {
  margin-bottom: 1.5rem;
}

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

.markdown-body li {
  margin-bottom: 0.5rem;
}

.markdown-body blockquote {
  border-left: 4px solid var(--accent-green);
  background: var(--bg-card);
  padding: 1.1rem 1.5rem;
  margin: 1.75rem 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-clean);
  border-right: 1px solid var(--border-clean);
  border-bottom: 1px solid var(--border-clean);
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Tables */
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
}

.markdown-body th, .markdown-body td {
  border: 1px solid var(--border-clean);
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
}

.markdown-body th {
  background: var(--bg-card-hover);
  font-family: var(--font-sans);
  font-weight: 600;
}

/* Beautiful dark code blocks representing real IDEs */
.markdown-body pre {
  background: #0f172a !important; /* Premium dark background */
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.75rem 0;
  overflow-x: auto;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.markdown-body pre::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  right: 0.8rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  opacity: 0.5;
  box-shadow: 0 0 6px var(--accent-green);
}

.markdown-body code {
  font-family: var(--font-mono) !important;
  font-size: 0.85rem;
  color: #38bdf8;
  padding: 0;
  background: transparent;
  border: none;
}

/* Inline single backtick blocks */
.markdown-body :not(pre) > code {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.12);
  color: var(--accent-green-hover);
  padding: 0.15rem 0.3rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

/* Author box at detail footer */
.author-profile-box {
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 4rem;
  box-shadow: var(--shadow-sm);
}

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

.author-avatar-wrapper {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-clean);
}

.author-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.author-name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.author-bio {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.author-socials {
  display: flex;
  gap: 0.75rem;
}

.social-icon {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-green);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   7. Form Editors and Admin Dashboards
   -------------------------------------------------------------------------- */
.login-wrapper {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-up 0.4s ease-out;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

.login-card-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.lock-icon-wrapper {
  width: 45px;
  height: 45px;
  background: rgba(16, 185, 129, 0.05);
  color: var(--accent-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin: 0 auto 0.6rem;
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.form-group {
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
}

.form-input-wrapper {
  position: relative;
}

.form-input-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.form-input-field {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-clean);
  color: var(--text-primary);
  padding: 0.5rem 0.8rem 0.5rem 2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-smooth);
}

.form-input-field:focus {
  border-color: var(--accent-green);
  background: #fff;
  box-shadow: var(--shadow-focus);
}

.login-submit-btn {
  width: 100%;
  background: var(--text-primary);
  color: #fff;
  border: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.login-submit-btn:hover {
  background: var(--accent-green);
}

.login-card-footer {
  margin-top: 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border-clean);
  padding-top: 0.85rem;
}

.login-back-btn {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.login-back-btn:hover {
  color: var(--text-primary);
}

/* Administrative Dashboards */
.admin-dashboard-wrapper {
  animation: fade-in 0.6s ease-out;
}

.dashboard-header {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--text-primary);
  padding-bottom: 1.25rem;
}

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

.dashboard-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
}

.dashboard-header-actions {
  display: flex;
  gap: 1rem !important;
  align-items: center;
}

.dashboard-header-actions a {
  margin-right: 0.75rem !important;
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
}

.dashboard-header-actions a:last-child {
  margin-right: 0 !important;
}

.new-post-btn {
  background: var(--text-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.new-post-btn:hover {
  background: var(--accent-green);
}

/* Statistics cards widgets */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  padding: 1.15rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.stat-icon-wrapper {
  width: 35px;
  height: 35px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.stats-blue { background: rgba(37, 99, 235, 0.04); color: var(--accent-blue); border: 1px solid rgba(37, 99, 235, 0.08); }
.stats-purple { background: rgba(16, 185, 129, 0.04); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.08); }
.stats-green { background: rgba(225, 29, 72, 0.04); color: var(--accent-rose); border: 1px solid rgba(225, 29, 72, 0.08); }

.stat-number {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Table List controls */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard-table th, .dashboard-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border-clean);
  font-size: 0.85rem;
  vertical-align: middle;
}

.dashboard-table th {
  background: var(--bg-card-hover);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.table-image-thumbnail {
  width: 45px;
  height: 30px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-clean);
}

.post-title-text {
  font-weight: 700;
  color: var(--text-primary);
}

.post-excerpt-tiny {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.table-category-tag {
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.7rem;
}

.action-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-clean);
  background: var(--bg-main);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.edit-action-btn:hover {
  color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.05);
}

.delete-action-btn:hover {
  color: var(--accent-rose);
  background: rgba(225, 29, 72, 0.05);
}

/* Editor CRUD wraps */
.admin-editor-wrapper {
  animation: fade-in 0.6s ease-out;
}

.editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.editor-card-header {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-clean);
  padding-bottom: 0.85rem;
}

.editor-card-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
}

.form-errors-alert {
  background: rgba(225, 29, 72, 0.03);
  border: 1px solid rgba(225, 29, 72, 0.12);
  color: var(--accent-rose);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.form-control-input, .form-control-select, .form-control-textarea {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-clean);
  color: var(--text-primary);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-smooth);
}

.form-control-textarea {
  font-family: var(--font-mono);
}

.form-control-input:focus, .form-control-select:focus, .form-control-textarea:focus {
  border-color: var(--accent-green);
  background: #fff;
  box-shadow: var(--shadow-focus);
}

.file-upload-zone {
  border: 2px dashed var(--border-clean);
  background: var(--bg-main);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.file-upload-zone:hover {
  border-color: var(--accent-green);
}

.upload-icon {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.upload-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.btn-form-cancel {
  text-decoration: none;
  color: var(--text-secondary);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.btn-form-cancel:hover {
  color: var(--text-primary);
}

.btn-form-submit {
  background: var(--text-primary);
  color: #fff;
  border: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-form-submit:hover {
  background: var(--accent-green);
}

/* --------------------------------------------------------------------------
   8. Flash banners alerts & Footers
   -------------------------------------------------------------------------- */
.flash-messages {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.flash-alert {
  pointer-events: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 270px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.flash-notice {
  border-left: 4px solid var(--accent-green);
  color: var(--accent-green);
}

.flash-alert, .flash-error {
  border-left: 4px solid var(--accent-rose);
  color: var(--accent-rose);
}

.app-footer {
  border-top: 1px solid var(--border-clean);
  background: var(--bg-card);
  padding: 1.25rem 0;
  width: 100%;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
}

@media(min-width: 768px) {
  .footer-container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.accent-color {
  color: var(--accent-green);
  font-weight: 600;
}

.footer-tagline {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Pagination Styling
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding: 0;
}

.page-item {
  display: inline-flex;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.page-link:hover {
  background: rgba(16, 185, 129, 0.05);
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.2);
}

.page-item.active .page-link {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}

.page-item.disabled .page-link {
  opacity: 0.5;
  pointer-events: none;
  background: var(--bg-main);
}
