:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --ink: #1f2a37;
  --muted: #5b6672;
  --primary: #0d3b66;
  --primary-soft: #e6edf4;
  --accent: #b08968;
  --line: #d8d2c7;
  --danger: #9e2a2b;
  --radius: 14px;
  --shadow: 0 14px 36px rgba(13, 59, 102, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(176, 137, 104, 0.18), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(13, 59, 102, 0.14), transparent 45%),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.container {
  width: 80%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.layout-post.container {
  width: 95%;
  max-width: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background-color: rgba(244, 241, 234, 0.9);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #1a5a95);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "Playfair Display", serif;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links a {
  color: var(--ink);
  font-weight: 600;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.62rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #1b568e);
  color: #fff;
  box-shadow: 0 10px 22px rgba(13, 59, 102, 0.24);
}

.btn-secondary {
  background-color: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

.hero {
  padding: 3.2rem 0 2.3rem;
}

.hero-panel {
  background: linear-gradient(135deg, rgba(13, 59, 102, 0.94), rgba(38, 89, 139, 0.9));
  color: #fff;
  border-radius: 20px;
  padding: clamp(1.6rem, 3vw, 3rem);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(176, 137, 104, 0.46), transparent 62%);
  right: -60px;
  top: -70px;
}

.hero h1 {
  margin: 0;
  max-width: 700px;
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.2;
  font-size: clamp(1.8rem, 4.8vw, 3rem);
}

.hero p {
  margin: 1rem 0 1.4rem;
  max-width: 670px;
  color: rgba(255, 255, 255, 0.92);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 450px));
  gap: 2.5rem;
  justify-content: center;
}

@media (min-width: 1200px) {
  .grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 480px));
  }
}

.section {
  margin: 2rem 0 2.8rem;
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.section-head a {
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
}

.section h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  letter-spacing: 0.3px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 380px));
  gap: 2.5rem;
  justify-content: center;
}

/* Limit max width of cards in wide screens to keep them centered and elegant */
@media (min-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 400px));
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(31, 42, 55, 0.06);
}

.card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f8f9fa;
}

.card-body {
  padding: 0.95rem;
}

.category-badge {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.22rem 0.58rem;
}

.card-title {
  margin: 0.55rem 0;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--ink);
}

.card-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.card-subtitle {
  color: #404f60;
  margin: 0.45rem 0 0;
}

.filters {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr auto;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.67rem 0.8rem;
  font: inherit;
  color: var(--ink);
  background-color: #fff;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: 2px solid rgba(13, 59, 102, 0.24);
  border-color: var(--primary);
}

.pager {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pill {
  border: 1px solid var(--line);
  background-color: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
}

.layout-post {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
}

.post-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
}

.post-main h1 {
  margin: 0.25rem 0 0.6rem;
  font-family: "Playfair Display", serif;
  line-height: 1.18;
}

.post-cover {
  width: 100%;
  max-width: 400px;
  display: block;
  margin: 0 auto 1.5rem;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f8f9fa;
  border-radius: 12px;
}

.post-content {
  margin-top: 1rem;
  color: #263443;
}

.post-content p {
  margin-top: 0.6rem;
}

.aside {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  height: fit-content;
}

.aside h3 {
  margin-top: 0;
}

.mini-list {
  display: grid;
  gap: 0.8rem;
}

.mini-item {
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

.mini-item:first-child {
  border-top: none;
  padding-top: 0;
}

.footer {
  border-top: 1px solid var(--line);
  margin-top: 2.5rem;
  padding: 1.5rem 0 2rem;
  color: var(--muted);
}

.empty,
.message {
  border: 1px dashed var(--line);
  background-color: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--muted);
}

.message.error {
  border-color: rgba(158, 42, 43, 0.4);
  color: var(--danger);
}

.loading {
  opacity: 0.66;
}

@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout-post {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .card-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }
}

/* ===== Breadcrumbs ===== */
.breadcrumbs {
  margin-bottom: 0.5rem;
}

.breadcrumbs ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.breadcrumbs a {
  color: var(--muted);
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  opacity: 0.5;
  user-select: none;
}

.breadcrumbs .current {
  color: var(--ink);
  font-weight: 700;
}

/* Quill.js content classes */
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }

.post-content blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin-left: 0;
  color: var(--muted);
  font-style: italic;
}
