/* An Consignista Blog — modern, professional, friendly (standalone) */
:root {
  --bg: #f7f5f2;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --ink: #1c1917;
  --ink-soft: #44403c;
  --muted: #78716c;
  --line: #e7e5e4;
  --line-strong: #d6d3d1;
  --gold: #c4a574;
  --gold-dark: #a68b5b;
  --gold-soft: #f5efe6;
  --gold-mid: #e8d9c0;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow: 0 4px 20px rgba(28, 25, 23, 0.06), 0 1px 3px rgba(28, 25, 23, 0.04);
  --shadow-lg: 0 12px 40px rgba(28, 25, 23, 0.08), 0 4px 12px rgba(28, 25, 23, 0.04);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 1080px;
  --narrow: 820px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1917;
    --bg-elevated: #292524;
    --surface: #292524;
    --ink: #fafaf9;
    --ink-soft: #d6d3d1;
    --muted: #a8a29e;
    --line: #44403c;
    --line-strong: #57534e;
    --gold: #d4b896;
    --gold-dark: #e8d9c0;
    --gold-soft: #3d3428;
    --gold-mid: #4a3f32;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { left: 0.75rem; top: 0.75rem; }

/* ── Header ── */
.blog-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.blog-header-inner {
  width: min(var(--max), 100% - 2rem);
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.6rem 0;
}
.blog-logo img {
  height: 42px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}
.blog-nav-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  align-items: center;
}
.blog-nav-main a {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.blog-nav-main a:hover {
  color: var(--ink);
  background: var(--gold-soft);
}
.blog-nav-main a.is-active {
  color: var(--ink);
  background: var(--gold-soft);
}

.blog-wrap {
  width: min(var(--max), 100% - 2rem);
  margin-inline: auto;
}
.blog-wrap-narrow {
  width: min(var(--narrow), 100% - 2rem);
  margin-inline: auto;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}
.breadcrumb a {
  color: var(--ink-soft);
  transition: color 0.15s;
}
.breadcrumb a:hover {
  color: var(--gold-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Hero (index) ── */
.blog-hero {
  padding: 2.75rem 0 2.25rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
  position: relative;
}
.blog-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, var(--gold-soft), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.blog-hero > .blog-wrap {
  position: relative;
  z-index: 1;
}
.blog-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4.2vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.85rem;
  line-height: 1.25;
  color: var(--ink);
}
.blog-hero-lead {
  color: var(--muted);
  max-width: 36rem;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.65;
}

/* ── Card list ── */
.blog-list {
  padding: 2.25rem 0 4rem;
}

.blog-card {
  display: block;
  padding: 1.5rem 1.55rem 1.5rem 1.65rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow 0.28s var(--ease),
    border-color 0.28s var(--ease),
    transform 0.28s var(--ease);
  position: relative;
  overflow: hidden;
}
.blog-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.blog-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--gold-mid);
  transform: translateY(-2px);
}
.blog-card:hover::before {
  opacity: 1;
}
.blog-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.blog-card-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gold-dark);
  background: var(--gold-soft);
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.55rem;
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 650;
  margin: 0 0 0.45rem;
  line-height: 1.4;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.blog-card:hover .blog-card-title {
  color: var(--gold-dark);
}

.blog-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: center;
}
.blog-card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  display: inline-block;
}

.blog-card-desc {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.58;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--gold-dark);
  opacity: 0.85;
  transition: opacity 0.2s, gap 0.2s;
}
.blog-card:hover .blog-card-more {
  opacity: 1;
  gap: 0.45rem;
}

.blog-empty {
  color: var(--muted);
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--line);
}

/* Index CTA */
.blog-index-cta {
  margin-top: 2.5rem;
  padding: 2rem 1.75rem;
  background: var(--ink);
  color: #fafaf9;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.blog-index-cta h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 650;
  color: #fff;
  letter-spacing: -0.02em;
}
.blog-index-cta p {
  margin: 0 0 1.25rem;
  opacity: 0.88;
  font-size: 0.98rem;
  max-width: 28rem;
  margin-inline: auto;
  margin-bottom: 1.25rem;
}
.blog-index-cta .btn-cta {
  display: inline-block;
  padding: 0.8rem 1.7rem;
  background: var(--gold);
  color: #1c1917;
  font-weight: 650;
  font-size: 0.92rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.01em;
  transition: background 0.2s, transform 0.2s;
}
.blog-index-cta .btn-cta:hover {
  background: var(--gold-dark);
  color: #fff;
  transform: translateY(-1px);
}

/* ── Article ── */
.post {
  padding: 1.85rem 0 3.75rem;
}
.post-header {
  margin-bottom: 1.65rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--line);
}
.post-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.8vw, 2rem);
  font-weight: 700;
  line-height: 1.28;
  margin: 0 0 0.75rem;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.post-meta {
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  align-items: center;
}
.post-meta time {
  font-variant-numeric: tabular-nums;
}

.post-body {
  font-size: 1.0625rem;
  line-height: 1.78;
  color: var(--ink-soft);
}
.post-body h2 {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 650;
  color: var(--ink);
  margin: 2.15rem 0 0.75rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.post-body h3 {
  font-size: 1.08rem;
  font-weight: 650;
  color: var(--ink);
  margin: 1.6rem 0 0.55rem;
}
.post-body p {
  margin: 0 0 1.1rem;
}
.post-body ul,
.post-body ol {
  margin: 0 0 1.2rem;
  padding-left: 1.4rem;
}
.post-body li {
  margin-bottom: 0.45rem;
}
.post-body li::marker {
  color: var(--gold);
}
.post-body strong {
  color: var(--ink);
  font-weight: 650;
}
.post-body a {
  color: var(--gold-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.post-body a:hover {
  color: var(--ink);
}

/* Tables */
.compare-table,
.price-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.35rem 0;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.compare-table th,
.compare-table td,
.price-table th,
.price-table td {
  border: 1px solid var(--line);
  padding: 0.7rem 0.9rem;
  text-align: left;
  vertical-align: top;
}
.compare-table th {
  background: var(--bg);
  font-weight: 650;
  color: var(--ink);
}
.price-table th {
  background: var(--ink);
  color: #fafaf9;
  font-weight: 650;
}
.price-table .pct {
  font-weight: 700;
  color: var(--gold-dark);
  font-size: 1.05rem;
}
.price-table tr:nth-child(even) {
  background: var(--bg);
}

.highlight {
  background: var(--gold-soft);
  border-left: 4px solid var(--gold);
  padding: 1.05rem 1.2rem;
  margin: 1.4rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
}
.highlight strong {
  color: var(--ink);
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1.4rem 0;
}
.steps li {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.15rem;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 2rem;
  height: 2rem;
  background: var(--ink);
  color: #fafaf9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Share */
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 2.15rem 0 1.15rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.share-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  margin-right: 0.25rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.48rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 550;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-soft);
  transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
}
.share-btn:hover {
  border-color: var(--gold);
  color: var(--ink);
  background: var(--gold-soft);
  box-shadow: var(--shadow-sm);
}

/* Post CTA */
.cta-box {
  margin-top: 2rem;
  padding: 1.65rem 1.5rem;
  background: var(--ink);
  color: #fafaf9;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
}
.cta-title {
  margin: 0 0 0.5rem;
  font-size: 1.18rem;
  font-weight: 650;
  color: #fff;
  letter-spacing: -0.015em;
}
.cta-box p {
  margin: 0 0 1.15rem;
  opacity: 0.88;
  font-size: 0.95rem;
}
.btn-cta {
  display: inline-block;
  padding: 0.78rem 1.55rem;
  background: var(--gold);
  color: #1c1917;
  font-weight: 650;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.01em;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.btn-cta:hover {
  background: var(--gold-dark);
  color: #fff;
  transform: translateY(-1px);
}

.post-nav {
  margin-top: 1.85rem;
  font-size: 0.92rem;
}
.post-nav a {
  color: var(--ink-soft);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s;
}
.post-nav a:hover {
  color: var(--gold-dark);
}

/* Footer */
.blog-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}
.blog-footer a {
  color: var(--ink-soft);
  transition: color 0.15s;
}
.blog-footer a:hover {
  color: var(--gold-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.blog-footer-meta {
  margin: 0.4rem 0 0;
}

/* Responsive */
@media (max-width: 640px) {
  .blog-logo img { height: 36px; }
  .blog-nav-main a {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    padding: 0.38rem 0.55rem;
  }
  .blog-hero {
    padding: 1.75rem 0 1.5rem;
  }
  .blog-hero h1 {
    font-size: 1.4rem;
  }
  .blog-card {
    padding: 1.25rem 1.2rem 1.25rem 1.3rem;
  }
  .blog-card-title {
    font-size: 1.05rem;
  }
  .post {
    padding: 1.35rem 0 2.75rem;
  }
  .post-body {
    font-size: 1rem;
    line-height: 1.72;
  }
  .compare-table,
  .price-table {
    font-size: 0.85rem;
  }
  .compare-table th,
  .compare-table td,
  .price-table th,
  .price-table td {
    padding: 0.5rem 0.55rem;
  }
  .blog-index-cta {
    padding: 1.5rem 1.25rem;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blog-card,
  .blog-nav-main a,
  .share-btn,
  .btn-cta {
    transition: none;
  }
  .blog-card:hover {
    transform: none;
  }
}

/* Wider comfortable reading + media */
.post-body {
  max-width: 48rem;
}
.post-body img,
.post-body figure img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.25rem 0;
  box-shadow: var(--shadow-sm);
}
.post-body figure {
  margin: 1.5rem 0;
}
.post-body figcaption {
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.5rem;
}
.post-body .blog-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}
.post-body .blog-video iframe,
.post-body .blog-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.post-body video.blog-video-file {
  position: static;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  display: block;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

/* Card with thumbnail — even layout */
.blog-card-with-thumb {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.15rem 1.25rem;
  align-items: start;
  padding: 1.15rem 1.25rem;
}
.blog-card-thumb {
  width: 160px;
  height: 112px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--gold-soft);
  flex-shrink: 0;
}
.blog-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  /* Giữ nét khi scale — tránh mờ do upscale/interpolation */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
  -ms-interpolation-mode: bicubic;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.blog-card-thumb-empty {
  background:
    linear-gradient(135deg, var(--gold-soft), var(--gold-mid));
  opacity: 0.55;
}
.blog-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.blog-card-body .blog-card-title {
  margin-top: 0;
}
.blog-card-body .blog-card-more {
  margin-top: auto;
  padding-top: 0.5rem;
}

/* Article: title + body same left edge */
.post .blog-wrap {
  max-width: min(var(--max), 100% - 2rem);
}
.post-header,
.post-body,
.share-row,
.cta-box,
.post-nav {
  width: 100%;
  max-width: 48rem;
}
.post-body {
  max-width: 48rem;
}

@media (max-width: 640px) {
  .blog-card-with-thumb {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .blog-card-thumb {
    width: 100%;
    height: 200px;
  }
}

/* Cover under title, before body */
.post-cover {
  margin: 0 0 1.5rem;
  max-width: 48rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--gold-soft);
  /* Không crop: hiện full ảnh, canh giữa */
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-cover img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0 auto;
  border-radius: 0;
  box-shadow: none;
}

/* Align content column with header (logo ↔ Zalo) */
.blog-header-inner,
.blog-wrap {
  width: min(var(--max), 100% - 2rem);
  margin-inline: auto;
}
.post .blog-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.post-header,
.post-cover,
.post-body,
.share-row,
.cta-box,
.post-nav,
.breadcrumb {
  width: 100%;
  max-width: 48rem;
  margin-left: 0;
  margin-right: auto;
}

/* Center the reading column under header when screen is wide */
@media (min-width: 900px) {
  .post .blog-wrap {
    align-items: center;
  }
  .post-header,
  .post-cover,
  .post-body,
  .share-row,
  .cta-box,
  .post-nav,
  .breadcrumb {
    margin-left: auto;
    margin-right: auto;
  }
}
