:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --ink: #212529;
  --muted: #4b5563;
  --primary: #4f46e5;
  --primary-soft: #e0e7ff;
  --accent: #db2777;
  --line: #e5e7eb;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
  --panel-bg: var(--bg);
  --border-color: var(--line);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  padding-top: 80px;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #4338ca;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.layout-post.container {
  width: 90%;
  max-width: 1200px;
}

/* --- NAVBAR / TOPBAR --- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.brand {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
  text-decoration: none;
}

.brand span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: #4b5563;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease, transform 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

.nav-links a.active {
  color: var(--primary);
  font-weight: 600;
}

/* --- BUTTONS --- */
.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.btn-primary:hover {
  background-color: #4338ca;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}

.btn-secondary {
  background-color: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  background-color: #f9fafb;
}

/* --- HERO PANEL --- */
.hero {
  padding: 40px 0 20px 0;
}

.hero-panel {
  background: linear-gradient(135deg, #e0e7ff 0%, #ffffff 100%);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.08), transparent 70%);
  right: -50px;
  top: -50px;
  pointer-events: none;
}

.hero h1 {
  margin: 0;
  max-width: 700px;
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.25;
  color: #1f2937;
}

.hero p {
  margin: 15px 0 0 0;
  max-width: 650px;
  color: #4b5563;
  font-size: 1.1rem;
}

/* --- FILTER FORM --- */
.filters {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 15px;
  margin-bottom: 40px;
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.01);
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  color: var(--ink);
  background-color: #fff;
  outline: none;
  transition: all 0.2s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* --- CARD GRID --- */
.section {
  margin-top: 20px;
  margin-bottom: 60px;
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
  text-align: center;
}

.section-head h1,
.section-head h2 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.section-head a {
  font-size: 0.95rem;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.section-head a:hover {
  text-decoration: underline;
}

.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
}

.card-grid .card {
  width: 380px;
  max-width: 100%;
}

.grid-2 {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
}

.grid-2 .card {
  width: 450px;
  max-width: 100%;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.01);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
  border-color: var(--primary);
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background-color: #f3f4f6;
  border-bottom: 1px solid var(--line);
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.category-badge {
  align-self: flex-start;
  background-color: var(--primary-soft);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  margin-bottom: 12px;
}

.category-badge:hover {
  background-color: #dbeafe;
  color: #4338ca;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: #1f2937;
  margin-bottom: 10px;
}

.card-title a {
  color: inherit;
}

.card-title a:hover {
  color: var(--primary);
}

.card-subtitle {
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-meta {
  color: #6b7280;
  font-size: 0.85rem;
  border-top: 1px solid #f3f4f6;
  padding-top: 15px;
  margin-top: auto;
}

.card-meta a {
  color: inherit;
  font-weight: 500;
}

/* --- POST DETAIL LAYOUT --- */
.layout-post {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  margin-top: 40px;
}

.post-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.01);
}

.post-main h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  color: #1f2937;
  margin: 10px 0 20px 0;
}

.post-cover {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.post-content {
  color: #374151;
  font-size: 1.05rem;
  line-height: 1.75;
}

.post-content p {
  margin-bottom: 20px;
}

.post-content h2,
.post-content h3 {
  color: #1f2937;
  margin: 35px 0 15px 0;
  font-weight: 700;
}

.post-content ul,
.post-content ol {
  margin-bottom: 20px;
  padding-left: 20px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 10px 20px;
  margin: 20px 0;
  background-color: #f9fafb;
  color: #4b5563;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

/* --- SIDEBAR --- */
.aside {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  height: fit-content;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.01);
  position: sticky;
  top: 100px;
}

.aside h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 20px;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 10px;
}

.mini-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mini-item {
  border-top: 1px solid #f3f4f6;
  padding-top: 15px;
}

.mini-item:first-child {
  border-top: none;
  padding-top: 0;
}

.mini-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 5px;
}

.mini-item h4 a {
  color: #1f2937;
}

.mini-item h4 a:hover {
  color: var(--primary);
}

.mini-item time {
  font-size: 0.8rem;
  color: #6b7280;
}

/* --- PAGINATION & PAGER --- */
.pager {
  margin-top: 40px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.pill {
  border: 1px solid var(--line);
  background-color: #fff;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  transition: all 0.2s ease;
}

.pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pill.active {
  background-color: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

/* --- EMPTY / ERROR MESSAGES --- */
.empty,
.message {
  border: 1px dashed var(--line);
  background-color: var(--surface);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
}

.message.error {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
  background-color: #fef2f2;
}

/* --- FOOTER GLOBAL REPLICATED --- */
.footer {
  background-color: #1f2937;
  color: #f3f4f6;
  padding: 60px 5% 30px 5%;
  margin-top: 60px;
  border-top: none;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-section h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: #ffffff;
  font-weight: 600;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 12px;
}

.footer-section ul li a {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 20px;
  margin-top: 40px;
  text-align: center;
  font-size: 14px;
  color: #9ca3af;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
  .layout-post {
    grid-template-columns: 1fr;
  }
  
  .aside {
    position: static;
    margin-top: 20px;
  }
}

@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    gap: 15px;
    padding: 15px 0;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .post-main {
    padding: 20px;
  }

  .post-main h1 {
    font-size: 1.8rem;
  }
}

/* Breadcrumbs */
.breadcrumbs {
  margin-bottom: 15px;
}

.breadcrumbs ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  opacity: 0.5;
}

.breadcrumbs .current {
  color: var(--ink);
  font-weight: 700;
}

.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }
