:root {
  --primary: #1F4F46;
  --accent:  #C8643D;
  --bg:      #F4EFE6;
  --bg-translucent: rgba(244, 239, 230, 0.85);
  --card:    #FFFFFF;
  --ink:     #1A1A1A;
  --muted:   #6B6B6B;
  --border:  #E6E2DA;
  --border-strong: #C8C2B6;

  --serif: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max-width: 1080px;
  --gutter: 32px;
  --gutter-mobile: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ext-mark {
  display: inline-block;
  margin-left: 0.3em;
  font-size: 0.72em;
  transform: translateY(-0.18em);
}

/* ── Header ──────────────────────────────────────────────── */
.page-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.page-logo {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.15s ease;
}
.page-logo:hover { color: var(--primary); }

.page-header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.page-nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
}
.page-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 400;
  transition: color 0.15s ease;
}
.page-nav a:hover { color: var(--primary); }
.page-nav a.is-current {
  color: var(--primary);
  font-weight: 500;
}

/* ── Language switcher ───────────────────────────────────── */
.page-lang {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.page-lang-opt {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
}
.page-lang-opt:hover { color: var(--ink); }
.page-lang-opt.is-active {
  color: var(--primary);
  font-weight: 600;
}
.page-lang-opt:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}
.page-lang-sep {
  width: 1px;
  height: 12px;
  background: var(--border-strong);
}

/* ── Intro ───────────────────────────────────────────────── */
.news-intro {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 96px var(--gutter) 40px;
}
.news-eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}
.news-heading {
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.04;
  color: var(--ink);
  margin: 0 0 20px;
}
.news-subtitle {
  max-width: 620px;
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}
.news-count {
  margin: 28px 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.news-count[hidden] { display: none; }

/* ── Sticky controls (search + chips) ────────────────────── */
.news-controls {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-translucent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.news-controls[hidden] { display: none; }
.news-controls-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.news-search {
  position: relative;
  flex: 0 0 280px;
  display: flex;
  align-items: center;
}
.news-search-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.news-search-input {
  width: 100%;
  height: 36px;
  padding: 0 28px 0 22px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}
.news-search-input::placeholder { color: var(--muted); }
.news-search-input:focus { border-bottom-color: var(--ink); }
.news-search-input::-webkit-search-cancel-button { display: none; }

.news-chips {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  padding: 0 4px;
}
.news-chips::-webkit-scrollbar { display: none; }

.news-chip {
  flex: 0 0 auto;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease, opacity 0.12s ease;
  white-space: nowrap;
}
.news-chip:hover { border-color: var(--ink); }
.news-chip:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}
.news-chip.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.news-chip[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.news-chip-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.news-chip-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

/* ── Main wrapper ────────────────────────────────────────── */
.news-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) 96px;
}

/* ── Featured hero (single dominant post) ────────────────── */
.news-featured {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px var(--gutter) 28px;
}
.news-featured[hidden] { display: none; }

.news-hero {
  display: grid;
  grid-template-columns: 55fr 45fr;
  gap: 52px;
  padding: 0;
  text-decoration: none;
  color: inherit;
  align-items: start;
}
.news-hero-img-wrap {
  overflow: hidden;
  border-radius: 6px;
}
.news-hero-cover {
  aspect-ratio: 3 / 2;
  width: 100%;
  background: var(--border);
  overflow: hidden;
  position: relative;
  border-radius: 6px;
}
.news-hero-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.news-hero:hover .news-hero-cover img { transform: scale(1.02); }
.news-hero-cover--swatch {
  background: var(--primary);
}
.news-hero-cover--swatch::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 20px 20px;
}
.news-hero-body {
  padding-top: 8px;
}

.news-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
  font-weight: 400;
}
.news-category {
  font-weight: 500;
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.news-meta-sep {
  color: var(--border-strong);
  user-select: none;
}

.news-title {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 18px;
  transition: color 0.15s ease;
}
.news-hero:hover .news-title { color: var(--primary); }

.news-excerpt {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* ── List layout: index rows + sticky preview panel ──────── */
.news-list-layout {
  display: grid;
  grid-template-columns: 1fr 268px;
  gap: 48px;
  align-items: start;
  padding-top: 32px;
}
.news-list-layout[hidden] { display: none; }

/* ── Preview panel ───────────────────────────────────────── */
.news-preview {
  position: sticky;
  top: 80px;
}
.news-preview-frame {
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  background: var(--border);
  border-radius: 6px;
}
.news-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.news-preview-frame img.is-visible { opacity: 1; }

/* ── Dense index zone ────────────────────────────────────── */
.news-index {
  padding: 8px 0 0;
}
.news-index[hidden] { display: none; }

.news-index-cover {
  display: none;
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  background: var(--border);
  border-radius: 6px;
}

.news-index-row {
  display: grid;
  grid-template-columns: 90px 130px 1fr;
  column-gap: 24px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.1s ease;
}
.news-index-row:last-child { border-bottom: 0; }
.news-index-row:hover .news-index-title,
.news-index-row:focus-visible .news-index-title,
.news-index-row.is-previewing .news-index-title { color: var(--primary); }
.news-index-row:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

.news-index-date {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}
.news-index-category {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.news-index-body {
  display: block;
  min-width: 0;
}
.news-index-title {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  color: var(--ink);
  transition: color 0.15s ease;
}
.news-index-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 6px;
}

/* ── Empty state ─────────────────────────────────────────── */
.news-empty {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px var(--gutter) 160px;
  text-align: center;
}
.news-empty[hidden] { display: none; }
.news-empty-rule {
  width: 32px;
  height: 1px;
  background: var(--border);
  margin: 0 auto 28px;
}
.news-empty-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 10px;
}
.news-empty-note {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px;
}
.news-empty-clear {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.news-empty-clear:hover {
  background: var(--ink);
  color: var(--bg);
}
.news-empty-clear[hidden] { display: none; }

/* ── Footer ──────────────────────────────────────────────── */
.page-footer {
  border-top: 1px solid var(--border);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.page-footer .footer-meta {
  flex-basis: 100%;
  margin-top: 20px;
}
.page-footer .footer-meta p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.page-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.page-footer a:hover { color: var(--ink); }

/* ── Reveal (subtle stagger, initial render only) ────────── */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal.is-instant {
  transition: none;
  opacity: 1;
  transform: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .news-list-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .news-preview { display: none; }

  .news-index-cover { display: block; margin-bottom: 12px; }
  .news-index-row {
    display: block;
    padding: 20px 0;
  }
  .news-index-date {
    display: inline;
    margin-right: 10px;
  }
  .news-index-category {
    display: inline;
  }
  .news-index-body { margin-top: 10px; }
}

@media (max-width: 720px) {
  .page-header { padding: 16px var(--gutter-mobile); }
  .page-header-right { gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
  /* Longer Vietnamese nav labels wrap by whole word rather than mid-word. */
  .page-nav { gap: 18px; font-size: 13px; flex-wrap: wrap; justify-content: flex-end; }
  .page-nav a { white-space: nowrap; }
  .news-intro { padding: 56px var(--gutter-mobile) 28px; }
  .news-heading { font-size: 40px; }
  .news-subtitle { font-size: 16px; }
  .news-count { margin-top: 22px; }

  .news-controls-inner {
    padding: 0 var(--gutter-mobile);
    gap: 14px;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .news-search { flex: 1 1 auto; }
  .news-chips {
    mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  }

  .news-main { padding: 0 var(--gutter-mobile) 64px; }
  .news-featured { padding: 24px var(--gutter-mobile) 20px; }
  .news-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 0 32px;
  }
  .news-title { font-size: 25px; letter-spacing: -0.015em; }
  .news-excerpt { font-size: 15px; }

  .news-index-title { font-size: 17px; }
  .news-empty { padding: 32px var(--gutter-mobile) 96px; }
  .page-footer { padding: 24px var(--gutter-mobile) 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .news-hero-cover img,
  .news-preview-frame img {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
