/* ===== Light Theme ===== */

:root {
  /* Primary Backgrounds */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  
  /* Text Colors */
  --text-primary: #1e293b;    /* Headings, body */
  --text-secondary: #475569;  /* Meta, captions */
  --text-muted: #94a3b8;      /* Placeholder, disabled */
  
  /* Borders & Dividers */
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  
  /* Accent Colors */
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-success: #22c55e;
  --accent-warning: #f59e0b;
  --accent-highlight: #dbeafe;
  
  /* Shadows (untuk depth) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* ===== DARK MODE ===== */
html.dark h1, 
html.dark h2, 
html.dark h3 {
  color: #f8fafc;
}
html.dark {
  /* Primary Backgrounds */
  --bg-primary: #0f172a;      
  --bg-secondary: #1e293b;    
  --bg-tertiary: #334155;        
  
  /* Text Colors */
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  /* Borders & Dividers */
  --border-light: #334155;    
  --border-medium: #475569;   
  
  /* Accent Colors */
  --accent-primary: #60a5fa;  
  --accent-primary-hover: #93c5fd; 
  --accent-success: #4ade80;
  --accent-warning: #fbbf24;
  --accent-highlight: rgba(96, 165, 250, 0.2); 
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* Base Styles */
body {
  font-family: "Space Grotesk", "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6em;
  color: var(--text-primary);
  background: var(--bg-primary);
  margin: 0;
  padding: 0;
}

h1, h2, h3 {
  color: var(--text-primary);
  font-weight: 500;
  letter-spacing: -0.5px;
}

h1 { margin-bottom: 10px; font-size: 26px; }
h2 { margin-bottom: 8px; font-size: 24px; }
h3, h4 { margin-bottom: 5px; font-size: 20px; }

a, a:link, a:active {
  text-decoration: none;
  color: var(--accent-primary);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

hr {
  margin: 25px 0;
  border: 0;
  border-top: 1px solid var(--border-light);
}

blockquote {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--accent-primary);
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--text-primary);
  position: relative;
}

blockquote::before {
  content: '"';
  font-family: Georgia, serif;
  font-size: 2.5rem;
  color: var(--accent-primary-hover);
  position: absolute;
  left: 12px;
  top: 8px;
  opacity: 0.2;
}

blockquote p {
  margin: 0;
  line-height: 1.7;
}

blockquote cite {
  margin-top: 0.75rem;
  font-style: normal;
  font-weight: 500;
  color: var(--accent-primary-hover);
  font-size: 0.85rem;
  display: block;
}

code {
  background: var(--border-light);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 0.2em 0.4em;
  font-size: 0.9em;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 500;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border-medium);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

tr:hover td {
  background: var(--bg-primary);
}

@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

.container {
  display: flex;
  max-width: 900px;
  margin: 0 auto;
  padding: 25px;
  gap: 35px;
}

.sidebar {
  flex: 0 0 220px;
}

.fixed-condition {
  position: sticky;
  top: 25px;
}

.logo {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 20px auto;
}

.search {
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.search input[type="text"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  font-size: 16px;
  margin-bottom: 20px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.search input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-highlight);
}

.search input[type="text"]::placeholder {
  color: var(--text-muted);
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

/* Divider with Star */
.nav-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  opacity: 0.5;
}

.divider-line {
  width: 60px;
  height: 1px;
  background: var(--border-medium);
}

.divider-icon {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .mobile-only {
    display: flex;
    margin-top: 20px;
  }
}

@media (min-width: 1024px) {
  .sidebar-nav {
    grid-template-columns: 1fr;
  }
  .nav-item {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.2s ease;
    border: 1px solid var(--border-light);
  }
  .nav-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
  }
}

@media (max-width: 1023px) {
  .logo {
    width: 75%;
  }
  .sidebar-nav {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .nav-item {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light);
  }
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: var(--text-primary);
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.nav-icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.nav-text {
  font-weight: 600;
  text-transform: uppercase;
  transition: transform 0.2s ease;
  font-size: 0.9rem;
}

.nav-hover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-tertiary);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-item:hover .nav-hover {
  opacity: 1;
}

.nav-item:hover .nav-icon {
  transform: scale(1.1);
}

.nav-item:hover .nav-text {
  transform: translateX(4px);
  color: var(--accent-primary-hover);
}

.nav-item:hover .nav-icon path {
  fill: var(--accent-primary-hover);
}

@media (max-width: 480px) {
  .nav-link { padding: 12px; }
  .nav-icon { width: 18px; height: 18px; margin-right: 8px; }
}

.main-content {
  flex: 1;
  min-width: 0;
}

.main-layout .post {
  padding: 10px 0;
}

.post-header {
  margin-bottom: 1.25rem;
}

.post-header hr {
  border: 0;
  height: 1px;
  background: var(--border-light);
  margin: 0.5rem 0;
}

.breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  font-size: 0.75rem;
  padding: 0;
  margin: 0;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--accent-primary);
  text-decoration: none;
}

.post-title {
  font-size: 1.75rem;
  line-height: 1.25;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  font-weight: 600;
  letter-spacing: -0.5px;
  position: relative;
  padding-bottom: 0.5rem;
}

.post-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-highlight));
  border-radius: 2px;
}

.post-meta-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.post-meta-author,
.post-meta-date {
  display: flex;
  font-size: 0.85rem;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-tertiary);
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  transition: background 0.2s ease;
  border: 1px solid var(--border-light);
}

.post-meta-author:hover,
.post-meta-date:hover {
  background: var(--border-light);
}

.author-name,
.date-text {
  font-weight: 500;
  color: var(--text-secondary);
}

.post-meta-separator {
  width: 1px;
  height: 16px;
  background: var(--border-medium);
}

.post-content {
  line-height: 1.7;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.post-content p {
  margin-bottom: 1.25rem;
}

/* Images */
.featured-image {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin: 0 0 1.75rem 0;
  box-shadow: var(--shadow-md);
}

.post-image {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  margin: 1.75rem auto 0.5rem auto;
  box-shadow: var(--shadow-md);
}

.post-image-caption {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 0.25rem auto 1.5rem auto;
  max-width: 90%;
}

@media (max-width: 768px) {
  .featured-image { margin-bottom: 1.5rem; }
  .post-image { margin: 1.25rem auto 0.4rem auto; }
  .post-image-caption { margin-bottom: 1.25rem; }
}

.post-related {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.post-related h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.post-related ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.6rem;
}

.post-related li {
  margin-bottom: 0;
}

.post-related a {
  display: block;
  padding: 0.6rem 0.8rem;
  background: var(--bg-tertiary);
  border-radius: 4px;
  color: var(--accent-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid var(--border-light);
}

.post-related a:hover {
  background: var(--border-light);
  color: var(--accent-primary-hover);
  border-color: var(--border-medium);
}

@media (max-width: 768px) {
  .main-content .post { padding: 20px 0; }
  .post-related ul { grid-template-columns: 1fr; }
}

footer {
  margin-top: 30px;
  padding-top: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

footer nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

footer nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

footer nav a:hover {
  color: var(--accent-primary);
}

/* Pagination */
.pagination-container {
  margin: 2.5rem 0;
  width: 100%;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pagination .page-item {
  margin: 0;
  flex-shrink: 0;
}

.pagination .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.pagination .page-item.active .page-link {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.pagination .page-link:hover {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
}

.pagination .page-item.active .page-link:hover {
  background: var(--accent-primary-hover);
  color: #ffffff;
}

.pagination .page-item.disabled .page-link {
  background: var(--bg-primary);
  color: var(--text-muted);
  border-color: var(--border-light);
  pointer-events: none;
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    padding: 20px 15px;
  }
  .sidebar {
    flex: 1;
    margin-bottom: 25px;
  }
  .fixed-condition {
    position: static;
  }
  footer {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  footer nav ul {
    justify-content: center;
  }
}

.ads { margin: 20px 0; }
.desktop-only { display: none; }
@media (min-width: 992px) {
  .desktop-only { display: block; margin-top: 20px; }
}

/* ===== HOME LIST STYLES ===== */
.home-post-list {
    width: 100%;
    margin: 2rem 0 2.5rem 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

.home-post-item {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-secondary);
    overflow: hidden;
    transition: box-shadow 0.3s, border-color 0.3s, background 0.3s;
}

.home-post-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
    background: var(--bg-tertiary);
}

.home-post-image {
    width: 100%;
    height: 170px;
    overflow: hidden;
    background: var(--border-light); 
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}

.home-post-item:hover .home-post-image img {
    transform: scale(1.04);
}

.home-post-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.home-post-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.home-post-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.home-post-title a:hover {
    color: var(--accent-primary);
}

/* Desktop - 2 columns (Original) */
@media (min-width: 768px) {
    .home-post-list {
        grid-template-columns: repeat(2, 1fr);
    }
    .home-post-image {
        height: 170px;
    }
}

/* Mobile (Original) */
@media (max-width: 480px) {
    .home-post-image {
        height: 130px;
    }
}

/* ===== CATEGORY LIST STYLES ===== */
.category-post-list {
    width: 100%;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.category-post-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-secondary);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.category-post-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.category-post-thumb {
    width: 80px;
    min-width: 80px;
    height: 65px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--border-light);
}

.category-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.category-post-item:hover .category-post-thumb img {
    transform: scale(1.05);
}

.category-post-body {
    flex: 1;
    min-width: 0;
}

.category-post-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.category-post-title a {
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.category-post-title a:hover {
    color: var(--accent-primary);
}

/* Desktop - 2 columns */
@media (min-width: 768px) {
    .category-post-list {
        grid-template-columns: repeat(2, 1fr);
    }
}