/* ==========================================
   DuongPhiLo · Site Styles
   Editorial literary design — paper + bordeaux
   Logo: Merriweather · Display: Lora · Body: Source Serif 4
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900&family=Lora:ital,wght@0,400..700;1,400..700&family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&family=Cormorant+Garamond:ital,wght@0,400..700;1,400..700&display=swap');

:root {
  /* Paper & ink palette (DPPL inspired) */
  --paper: #f4efe6;
  --paper-deep: #ebe4d5;
  --paper-darker: #e0d8c5;
  --vellum: #faf7f2;
  --parchment: #f5f0e8;

  --ink: #2a2420;
  --ink-body: #4a3f35;
  --ink-muted: #6b5d50;
  --ink-faded: #8a7b6b;
  --smoke: #a89585;

  /* Accents — bordeaux + warm tones */
  --bordeaux: #5e1f1f;
  --bordeaux-soft: #7a3030;
  --incense: #c4a882;
  --ember: #d4956a;
  --amber: #c78c4e;

  /* Rules */
  --rule: #d4ccbe;
  --rule-soft: #e2dac9;

  /* Typography */
  --font-logo: "Merriweather", Georgia, "Times New Roman", serif;
  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-article-display: "Cormorant Garamond", Georgia, serif;

  /* Layout */
  --measure: 42rem;          /* intro/list ~798px @ 19px, ~84 chars */
  --measure-wide: 64rem;     /* sections, list pages */
  --measure-narrow: 32rem;
  --measure-reading: 48rem;  /* post body ~912px @ 19px, ~76 chars (upper limit reading) */
  --measure-article: 1280px; /* DPPL rich layout */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--paper);
  color: var(--ink-body);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, rgba(94, 31, 31, 0.03) 0%, transparent 50%),
    var(--paper);
  overflow-x: hidden;
}

/* ==========================================
   TYPOGRAPHY DEFAULTS
   ========================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
}

a {
  color: var(--bordeaux);
  text-decoration: none;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
}

a:hover {
  opacity: 0.85;
}

p {
  margin-bottom: 1.2rem;
}

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

/* ==========================================
   HEADER · MASTHEAD
   ========================================== */
header.site {
  border-bottom: 1px solid var(--rule);
  padding: 2.5rem 2rem 1.5rem;
  max-width: var(--measure-wide);
  margin: 0 auto;
  text-align: center;
}

.site-title {
  font-family: var(--font-logo);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  display: inline-block;
}

.site-title .accent {
  color: var(--bordeaux);
}

.site-tagline {
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-faded);
  margin-top: 1rem;
}

nav.site {
  margin-top: 1.2rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

nav.site a {
  color: var(--ink-muted);
}

nav.site a:hover {
  color: var(--bordeaux);
  opacity: 1;
}

nav.site a.active {
  color: var(--bordeaux);
  border-bottom: 1px solid var(--bordeaux-soft);
  padding-bottom: 2px;
}

/* ==========================================
   INTRO (homepage)
   ========================================== */
.intro {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.75rem 2rem 1.25rem;
  text-align: center;
}

.intro p {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink-muted);
  font-style: italic;
}

.page-header {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
  text-align: center;
}

.page-header .eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-faded);
  margin-bottom: 0.8rem;
  display: block;
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin-bottom: 1rem;
  font-style: italic;
}

.page-header p {
  color: var(--ink-muted);
  font-style: italic;
}

/* ==========================================
   SECTIONS
   ========================================== */
.section {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

.section-narrow {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
}

.section-head .meta {
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faded);
  margin-left: auto;
}

.section-head .meta a {
  color: inherit;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.section-head .meta a:hover {
  color: var(--bordeaux);
  opacity: 1;
}

/* ==========================================
   ORNAMENT (divider giữa các section)
   ========================================== */
.ornament {
  text-align: center;
  color: var(--ink-faded);
  font-size: 1.2rem;
  margin: 3rem auto;
  max-width: var(--measure-wide);
  letter-spacing: 1em;
  padding-left: 1em;
  font-family: var(--font-display);
}

/* ==========================================
   POST CARD VARIANTS
   ========================================== */

/* Common */
.post-tags {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--bordeaux);
  margin-bottom: 0.8rem;
  font-weight: 600;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
}

.post-tags a {
  color: inherit;
  border-bottom: 1px solid transparent;
}

.post-tags a:hover {
  border-bottom-color: var(--bordeaux-soft);
  opacity: 1;
}

.post-tags .sep {
  color: var(--ink-faded);
  opacity: 0.5;
}

.post-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  transition: color 0.2s;
  color: var(--ink);
}

.post-excerpt {
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 1.2rem;
}

.post-meta {
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faded);
  display: flex;
  gap: 1rem;
  align-items: center;
}

.post-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-faded);
  display: inline-block;
}

/* HERO CARD (overlay style — cho "Mới nhất") ─────────────────────── */
.hero-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 4px 24px rgba(42, 36, 32, 0.12);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.hero-card:hover {
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(42, 36, 32, 0.22);
}

.hero-card-large { aspect-ratio: 16 / 9; }
.hero-card-small { aspect-ratio: 3 / 2; }

.hero-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(0.06) saturate(0.97);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.15) 45%,
    rgba(0, 0, 0, 0.78) 100%);
  pointer-events: none;
}

.hero-card-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.2rem 1.4rem 1.1rem;
  z-index: 1;
}

.hero-card-large .hero-card-content {
  padding: 2rem 2.2rem 1.8rem;
}

.hero-card-content .post-title {
  color: var(--paper);
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
  margin: 0.55rem 0 0.8rem;
  line-height: 1.25;
}

.hero-card-large .post-title { font-size: 1.85rem; }
.hero-card-small .post-title { font-size: 1.05rem; margin-bottom: 0; }

.hero-card:hover .post-title {
  color: var(--paper);
}

/* FEATURED GRID — 1 large + 2 small stacked */
.featured-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
}

.featured-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 1.25rem;
  min-width: 0;
}

.featured-side .hero-card-small {
  aspect-ratio: auto;
  height: 100%;
  min-height: 0;
}

/* Tag badge overlay style */
.post-tag-badge {
  display: inline-block;
  background: rgba(0, 0, 0, 0.55);
  color: var(--paper);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

/* Author meta (avatar + name + date + reading time) — overlay version */
.post-author-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.02em;
}

.post-author-meta .author-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.post-author-meta .author-name {
  font-weight: 500;
}

.post-author-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  display: inline-block;
}

.post-author-meta time {
  color: rgba(255, 255, 255, 0.75);
}

/* Muted variant — cho key-post + post-item (không trên ảnh) */
.post-author-meta--muted {
  color: var(--ink-faded);
  margin-top: 0.8rem;
}

.post-author-meta--muted .author-avatar {
  border-color: var(--rule);
}

.post-author-meta--muted .dot {
  background: var(--ink-faded);
}

.post-author-meta--muted time {
  color: var(--ink-faded);
}

/* KEY SECTION LAYOUT — sidebar categories trái + posts phải ────────── */
.key-section-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: start;
}

.category-sidebar {
  position: sticky;
  top: 5rem;
  align-self: start;
}

/* Cả title sidebar VÀ heading bên phải đều ở row 1 grid → border-bottom
   của cả hai nằm cùng level → mép trên thumbnail align với line border */
.key-col-title,
.key-col-head {
  margin: 0 0 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.key-col-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
}

.key-col-head {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
}

.key-col-head h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  margin: 0;
}

.key-col-head .meta {
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faded);
  margin-left: auto;
}

.cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--ink-body);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.cat-btn:hover {
  background: var(--vellum);
  color: var(--bordeaux);
}

.cat-btn.active {
  background: var(--bordeaux);
  color: var(--paper);
  border-color: var(--bordeaux);
}

.cat-btn.active .cat-count {
  color: rgba(255, 255, 255, 0.75);
}

.cat-btn .cat-count {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-faded);
  margin-left: 0.6rem;
}

.filter-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--ink-faded);
  font-style: italic;
}

/* KEY POSTS — thumbnail trái + text phải, ảnh = text width và stretch height */
.key-posts {
  display: grid;
  gap: 0;
}

.key-post {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule-soft);
  color: inherit;
  align-items: stretch;
  min-height: 240px;
}

.key-post:first-child { padding-top: 0; }
.key-post:last-child { border-bottom: none; }

/* JS filter: post.hidden = true → cần override .key-post { display: grid } */
.key-posts > [hidden] { display: none; }

.key-post:hover { opacity: 1; }
.key-post:hover .post-title { color: var(--bordeaux); }

.key-post-image {
  background: var(--paper-deep);
  overflow: hidden;
  border-radius: 4px;
  position: relative;
  min-height: 220px;
}

.key-post-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(94, 31, 31, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.key-post-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(0.08) saturate(0.95);
}

.key-post-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.key-post-body .post-tag-badge {
  background: var(--bordeaux);
  color: var(--paper);
  margin-bottom: 0.75rem;
  align-self: flex-start;
}

.key-post-body .post-title {
  font-size: 1.5rem;
  margin: 0.4rem 0 0.7rem;
  line-height: 1.3;
}

.key-post-body .post-excerpt {
  margin-bottom: 0;
}

/* CATEGORIES (Chủ đề) — chip grid ─────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.category-chip {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  background: var(--vellum);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  color: inherit;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.category-chip:hover {
  opacity: 1;
  background: var(--paper-deep);
  border-color: var(--bordeaux-soft);
}

.category-chip:hover .cat-name {
  color: var(--bordeaux);
}

.category-chip .cat-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

.category-chip .cat-count {
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faded);
}

/* POST LIST — text-only stream */
.post-list {
  max-width: var(--measure);
  margin: 0 auto;
}

.post-list .post-item {
  display: block;
  color: inherit;
  border-bottom: 1px solid var(--rule-soft);
  padding: 2.5rem 0;
}

.post-list .post-item:first-child {
  padding-top: 0;
}

.post-list .post-item:last-child {
  border-bottom: none;
}

.post-list .post-item:hover .post-title {
  color: var(--bordeaux);
}

.post-list .post-item:hover {
  opacity: 1;
}

.post-list .post-item .post-title {
  font-size: 1.6rem;
}

/* ==========================================
   ARCHIVE — chronological compact
   ========================================== */
.archive-year {
  margin-bottom: 3rem;
}

.archive-year h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--ink-faded);
  font-style: italic;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.archive-list {
  list-style: none;
}

.archive-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1.5rem;
  align-items: baseline;
}

.archive-list li:last-child {
  border-bottom: none;
}

.archive-list .archive-date {
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faded);
}

.archive-list a {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
}

.archive-list a:hover {
  color: var(--bordeaux);
  opacity: 1;
}

/* ==========================================
   TAG CLOUD
   ========================================== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin-bottom: 3rem;
  padding: 1.5rem 0;
}

.tag-cloud a {
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--rule);
  background: transparent;
}

.tag-cloud a:hover {
  color: var(--bordeaux);
  border-color: var(--bordeaux-soft);
  background: rgba(94, 31, 31, 0.04);
  opacity: 1;
}

/* ==========================================
   ARTICLE PAGE — when not using DPPL template
   ========================================== */
.post-page {
  max-width: var(--measure-reading);
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
}

.post-page .post-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}

.post-page .post-header .post-tags {
  justify-content: center;
  margin-bottom: 1.5rem;
}

.post-page .post-header h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.post-page .post-header .post-meta {
  justify-content: center;
}

.post-page .post-content {
  font-size: 1.1rem;
  line-height: 1.75;
}

.post-page .post-content > *:first-child {
  margin-top: 0;
}

.post-page .post-content h2,
.post-page .post-content h3 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.post-page .post-content h2 { font-size: 1.6rem; }
.post-page .post-content h3 { font-size: 1.3rem; font-style: italic; color: var(--ink-muted); }

.post-page .post-content p {
  margin-bottom: 1.5rem;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.post-page .post-content blockquote {
  border-left: 3px solid var(--bordeaux);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--ink-muted);
}

.post-page .post-content img {
  margin: 2rem auto;
  display: block;
}

.post-page .post-content hr {
  border: none;
  text-align: center;
  margin: 3rem auto;
  height: 1.5rem;
}

.post-page .post-content hr::before {
  content: "◆ ◆ ◆";
  letter-spacing: 1em;
  padding-left: 1em;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--ink-faded);
}

/* ==========================================
   POST PAGE — DPPL TEMPLATE (rich layout)
   When article HTML is exported from ghost-editor with DPPL
   ========================================== */
.post-page-rich {
  max-width: var(--measure-article);
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.post-page-rich .post-header {
  text-align: center;
  margin-bottom: 2rem;
}

/* DPPL HTML rendered inside .dppl-article wrapper from html-generator.js */
/* Editor đã sinh sẵn class + inline <style>, ta KHÔNG override để giữ nguyên */

/* ==========================================
   POST FOOTER — related, prev/next
   ========================================== */
.post-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3rem 2rem;
  border-top: 1px solid var(--rule);
}

.post-footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.post-footer-nav .nav-prev,
.post-footer-nav .nav-next {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  color: inherit;
}

.post-footer-nav .nav-next {
  text-align: right;
}

.post-footer-nav .nav-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faded);
  display: block;
  margin-bottom: 0.5rem;
}

.post-footer-nav .nav-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
  font-weight: 500;
}

.post-footer-nav a:hover .nav-title {
  color: var(--bordeaux);
}

.post-footer-nav a:hover {
  opacity: 1;
  background: rgba(94, 31, 31, 0.02);
}

.related-posts {
  margin-top: 3rem;
}

.related-posts h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

/* ==========================================
   ABOUT PAGE
   ========================================== */
.about-content {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 5rem 2rem 6rem;
}

.about-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin-bottom: 2rem;
  font-style: italic;
  font-weight: 500;
}

.about-content p {
  font-size: 1.1rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.about-content .signature {
  margin-top: 3rem;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-faded);
  font-size: 1.5rem;
  font-weight: 500;
}

/* ==========================================
   NEWSLETTER CTA
   ========================================== */
.newsletter {
  max-width: var(--measure);
  margin: 4rem auto 0;
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.newsletter h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-style: italic;
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.newsletter p {
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.newsletter form {
  display: flex;
  gap: 0.5rem;
  max-width: 24rem;
  margin: 0 auto;
}

.newsletter input[type="email"] {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1px solid var(--rule);
  background: var(--vellum);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
}

.newsletter input[type="email"]:focus {
  outline: none;
  border-color: var(--bordeaux-soft);
}

.newsletter button,
.newsletter a.cta {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--bordeaux);
  border: 1px solid var(--bordeaux-soft);
  background: transparent;
  padding: 0.7rem 1.5rem;
  cursor: pointer;
  font-weight: 500;
}

.newsletter button:hover,
.newsletter a.cta:hover {
  background: rgba(94, 31, 31, 0.06);
  opacity: 1;
}

/* ==========================================
   FOOTER
   ========================================== */
footer.site {
  border-top: 1px solid var(--rule);
  padding: 3rem 2rem 2rem;
  text-align: center;
  color: var(--ink-faded);
  font-family: var(--font-display);
  margin-top: 4rem;
}

footer.site .footer-links {
  display: flex;
  justify-content: center;
  gap: 1.8rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
}

footer.site .footer-links a {
  color: var(--ink-muted);
}

footer.site .footer-links a:hover {
  color: var(--bordeaux);
  opacity: 1;
}

footer.site .footer-meta {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  font-style: italic;
}

/* ==========================================
   RESPONSIVE
   3 breakpoints:
   - mobile  : ≤ 720px
   - tablet  : 721 – 1024px
   - desktop : ≥ 1025px (default, no media query)
   ========================================== */

/* TABLET — 721px to 1024px ─────────────────────────────────────────── */
@media (min-width: 721px) and (max-width: 1024px) {
  /* Sidebar collapse: stack categories trên posts */
  .key-section-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .category-sidebar { position: static; }
  .key-col-title {
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    font-size: 1.1rem;
  }
  .cat-list { flex-direction: row; flex-wrap: wrap; gap: 0.4rem; }
  .cat-btn { flex: 0 1 auto; padding: 0.5rem 0.85rem; font-size: 0.9rem; }

  /* Featured grid: keep 2-col but giảm gap, side cards nhỏ hơn */
  .featured-grid { gap: 1rem; }
  .hero-card-large .post-title { font-size: 1.55rem; }
  .hero-card-small .post-title { font-size: 0.95rem; }
  .hero-card-small .hero-card-content { padding: 1rem 1.1rem 0.9rem; }

  /* Key-post: vẫn 2 cột nhưng giảm gap */
  .key-post { gap: 1.5rem; min-height: 200px; }
  .key-post-image { min-height: 180px; }
  .key-post-body .post-title { font-size: 1.3rem; }

  /* Section padding */
  .section,
  .section-narrow,
  .newsletter,
  .post-page,
  .post-page-rich,
  .about-content { padding-left: 1.75rem; padding-right: 1.75rem; }
}

/* MOBILE — ≤ 720px ─────────────────────────────────────────────────── */
@media (max-width: 720px) {
  header.site { padding: 1.5rem 1.5rem 1rem; }
  .site-title { font-size: 2rem; }
  nav.site { gap: 1.2rem; flex-wrap: wrap; }

  .intro { padding: 1.5rem 1.5rem 1rem; }
  .page-header { padding: 3rem 1.5rem 2rem; }

  .section,
  .section-narrow,
  .newsletter,
  .post-page,
  .post-page-rich,
  .about-content { padding-left: 1.5rem; padding-right: 1.5rem; }

  .key-section-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .category-sidebar { position: static; }
  .key-col-title { margin-bottom: 1rem; padding-bottom: 0.7rem; font-size: 1.1rem; }
  .cat-list { flex-direction: row; flex-wrap: wrap; gap: 0.4rem; }
  .cat-btn { flex: 0 1 auto; padding: 0.45rem 0.8rem; font-size: 0.85rem; }

  .key-post { grid-template-columns: 1fr; gap: 1.2rem; padding: 1.8rem 0; min-height: auto; }
  .key-post-image { min-height: 200px; aspect-ratio: 4 / 3; }
  .key-post-body .post-title { font-size: 1.3rem; }

  .featured-grid { grid-template-columns: 1fr; }
  .featured-side { grid-template-rows: auto auto; }
  .featured-side .hero-card-small { aspect-ratio: 16 / 9; height: auto; }

  .hero-card-large .post-title { font-size: 1.4rem; }
  .hero-card-large .hero-card-content { padding: 1.5rem 1.5rem 1.3rem; }

  .key-col-head,
  .section-head { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .key-col-head .meta,
  .section-head .meta { margin-left: 0; }

  .archive-list li { grid-template-columns: 1fr; gap: 0.3rem; }

  .post-footer-nav { grid-template-columns: 1fr; }
  .post-footer-nav .nav-next { text-align: left; }
}
