/* ==========================================================================
   EDITORIAL & BLOG SYSTEM — LẨU TREO XÓM LÀO (Cẩm nang Trại Mát & Đà Lạt)
   Mobile-First Responsive Tables, Typography, Accordion & Related Carousel
   ========================================================================== */

body.no-thumb-bar {
  padding-bottom: 0;
}

.ed-hero {
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 0%, rgba(207, 95, 44, 0.08), transparent 65%), var(--bg);
}

@media (min-width: 960px) {
  .ed-hero {
    padding: 64px 0 48px;
  }
}

.ed-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--text-3);
}

@media (min-width: 640px) {
  .ed-crumb {
    margin-bottom: 18px;
    font-size: 13px;
  }
}

.ed-crumb a {
  color: var(--text-2);
  padding: 4px 0;
  transition: color 0.2s ease;
}

.ed-crumb a:hover {
  color: var(--gold);
}

.ed-hero-inner {
  max-width: 780px;
}

.ed-hero .h1 {
  font-size: clamp(1.7rem, 6.2vw, 2.85rem);
  line-height: 1.15;
}

@media (min-width: 960px) {
  .ed-hero .h1 {
    font-size: clamp(2.5rem, 4.2vw, 3.45rem);
    line-height: 1.08;
  }
}

.ed-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-3);
}

.ed-meta span + span::before {
  content: "·";
  margin-right: 10px;
  color: var(--text-3);
}

@media (min-width: 640px) {
  .ed-meta {
    margin-top: 14px;
    font-size: 13px;
  }
}

/* AEO Quick Summary Box ("Tóm tắt nhanh") */
.aeo-box {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(214, 179, 115, 0.34);
  background: linear-gradient(155deg, rgba(66, 36, 20, 0.34) 0%, rgba(28, 22, 19, 0.94) 100%);
}

@media (min-width: 640px) {
  .aeo-box {
    margin-top: 26px;
    padding: 20px 22px;
  }
}

.aeo-label {
  display: inline-block;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.aeo-box p {
  font-size: 14px;
  line-height: 1.64;
  color: var(--cream);
}

@media (min-width: 640px) {
  .aeo-box p {
    font-size: 14.5px;
    line-height: 1.68;
  }
}

/* Blog Hub Grid */
.ed-hub {
  padding: 28px 0 64px;
}

@media (min-width: 760px) {
  .ed-hub {
    padding: 48px 0 84px;
  }
}

.ed-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  margin: 0 -22px 24px;
  padding: 0 22px 4px;
  scrollbar-width: none;
}

.ed-filters::-webkit-scrollbar {
  display: none;
}

.ed-filters .chip {
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .ed-filters {
    flex-wrap: wrap;
    overflow: visible;
    margin: 0 0 32px;
    padding: 0;
  }
}

.ed-grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 760px) {
  .ed-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1080px) {
  .ed-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }
}

.ed-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.ed-card:hover {
  border-color: rgba(214, 179, 115, 0.55);
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.38);
}

.ed-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
}

.ed-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.ed-card:hover .ed-card-media img {
  transform: scale(1.04);
}

.ed-card-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(17, 13, 11, 0.84);
  border: 1px solid rgba(214, 179, 115, 0.36);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--gold);
}

.ed-card-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

@media (min-width: 640px) {
  .ed-card-body {
    padding: 20px 22px 24px;
    gap: 10px;
  }
}

.ed-card-body h2 {
  font-family: var(--serif);
  font-size: 1.34rem;
  font-weight: 600;
  line-height: 1.22;
  color: var(--cream);
}

@media (min-width: 640px) {
  .ed-card-body h2 {
    font-size: 1.48rem;
  }
}

.ed-card-body p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
  flex: 1;
}

.ed-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gold);
}

/* Article Layout */
.ed-article {
  padding: 28px 0 56px;
}

@media (min-width: 960px) {
  .ed-article {
    padding: 44px 0 80px;
  }
}

.ed-prose {
  max-width: 780px;
}

.ed-prose h2 {
  font-family: var(--serif);
  font-size: clamp(1.44rem, 5vw, 2.2rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--cream);
  margin: 30px 0 12px;
}

@media (min-width: 640px) {
  .ed-prose h2 {
    margin: 40px 0 14px;
  }
}

.ed-prose h2[id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.ed-prose h3 {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 600;
  color: var(--gold);
  margin: 24px 0 10px;
}

.ed-prose p {
  margin-bottom: 15px;
  font-size: 15px;
  line-height: 1.72;
  color: var(--text);
}

@media (min-width: 640px) {
  .ed-prose p {
    margin-bottom: 16px;
    font-size: 15.5px;
    line-height: 1.78;
  }
}

.ed-prose ul,
.ed-prose ol {
  margin: 0 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.ed-prose li {
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--text-2);
}

@media (min-width: 640px) {
  .ed-prose li {
    font-size: 15px;
    line-height: 1.7;
  }
}

.ed-prose li strong {
  color: var(--cream);
  font-weight: 500;
}

/* Table of Contents (Touch-Friendly Mobile Tap Targets) */
.ed-toc {
  margin: 0 0 22px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

@media (min-width: 640px) {
  .ed-toc {
    padding: 18px 22px;
  }
}

.ed-toc ol {
  margin: 6px 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ed-toc li {
  line-height: 1.4;
}

.ed-toc a {
  display: block;
  padding: 7px 0;
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.2s ease;
}

.ed-toc a:hover {
  color: var(--gold);
}

/* Figures & Centered Portrait Video */
.ed-figure {
  margin: 22px 0;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}

@media (min-width: 640px) {
  .ed-figure {
    margin: 28px 0;
  }
}

.ed-figure img,
.ed-figure video {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
}

.ed-figure figcaption {
  padding: 11px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-3);
  border-top: 1px solid var(--line);
}

.ed-video-portrait {
  max-width: 340px;
  margin: 24px auto;
}

@media (min-width: 640px) {
  .ed-video-portrait {
    margin: 28px 0;
  }
}

/* ==========================================================================
   RESPONSIVE EDITORIAL TABLES (Zero Clipping & Zero Crushed Columns on Mobile)
   ========================================================================== */
.ed-table-wrap {
  margin: 20px 0 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.ed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.ed-table th,
.ed-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.ed-table th {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(244, 236, 225, 0.03);
}

.ed-table td {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.ed-table tr:last-child td {
  border-bottom: 0;
}

/* Compact 3-Column Tabular Table (12-Month Sunset Table: Single-Line Flush on 375px+) */
@media (max-width: 679px) {
  .ed-table-compact th,
  .ed-table-compact td {
    padding: 10px 9px;
    font-size: 13px;
    white-space: nowrap;
  }
  .ed-table-compact th {
    font-size: 10.5px;
    letter-spacing: 0.05em;
  }
  .ed-table-compact td:first-child {
    color: var(--cream);
    font-weight: 500;
  }
  .ed-table-compact td:last-child,
  .ed-table-compact th:last-child {
    text-align: right;
  }
  .ed-table-compact td:last-child {
    color: var(--gold);
    font-weight: 500;
  }
}

/* Stacked Editorial Cards for Descriptive 3-Col & 4-Col Tables on Mobile */
@media (max-width: 679px) {
  .ed-table-cards {
    display: block;
    width: 100%;
  }
  .ed-table-cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .ed-table-cards tbody {
    display: block;
  }
  .ed-table-cards tr {
    display: grid;
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
  }
  .ed-table-cards tbody tr:last-child {
    border-bottom: 0;
  }
  .ed-table-cards td {
    display: block;
    padding: 0;
    border: 0;
  }

  /* Menu Price Table (Món | Giá | Ghi chú) */
  .ed-table-menu tr {
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    align-items: baseline;
  }
  .ed-table-menu td:nth-child(1) {
    font-size: 15px;
    font-weight: 500;
    color: var(--cream);
  }
  .ed-table-menu td:nth-child(2) {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--gold);
    white-space: nowrap;
    text-align: right;
  }
  .ed-table-menu td:nth-child(3) {
    grid-column: 1 / -1;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-2);
  }

  /* Train Schedule Table (Chuyến | Chiều | Giờ) */
  .ed-table-schedule tr {
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    align-items: center;
  }
  .ed-table-schedule td:nth-child(1) {
    grid-row: 1;
    grid-column: 1;
    justify-self: start;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(214, 179, 115, 0.12);
    border: 1px solid rgba(214, 179, 115, 0.34);
    font-size: 12px;
    font-weight: 500;
    color: var(--gold);
  }
  .ed-table-schedule td:nth-child(3) {
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
    font-size: 14px;
    font-weight: 500;
    color: var(--cream);
    white-space: nowrap;
  }
  .ed-table-schedule td:nth-child(2) {
    grid-row: 2;
    grid-column: 1 / -1;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-2);
  }

  /* 4-Col Budget Combo Table (Số người | Gợi ý | Tổng | Bình quân) */
  .ed-table-combo tr {
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 16px;
  }
  .ed-table-combo td:nth-child(1) {
    grid-column: 1 / -1;
    font-family: var(--serif);
    font-size: 1.28rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--cream);
  }
  .ed-table-combo td:nth-child(2) {
    grid-column: 1 / -1;
    font-size: 14px;
    line-height: 1.58;
    color: var(--text-2);
  }
  .ed-table-combo td:nth-child(3),
  .ed-table-combo td:nth-child(4) {
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
  }
  .ed-table-combo td:nth-child(3) {
    color: var(--cream);
  }
  .ed-table-combo td:nth-child(4) {
    color: var(--gold);
    text-align: right;
  }
  .ed-table-combo td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
  }
}

/* Blog Article FAQ Toggle Icon (Matches Homepage Accordion Polish) */
.ed-article .faq summary::after {
  content: "+";
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  color: var(--text-3);
  transition: transform 0.25s ease, color 0.25s ease;
}

.ed-article .faq details[open] summary::after {
  transform: rotate(45deg);
  color: var(--gold);
}

/* Editorial CTA Card (Balanced Full-Width + 2-Col Grid on Mobile) */
.ed-cta {
  margin-top: 40px;
  padding: 24px 20px;
  border-radius: var(--r-xl);
  border: 1px solid rgba(214, 179, 115, 0.34);
  background: linear-gradient(155deg, rgba(66, 36, 20, 0.44) 0%, rgba(28, 22, 19, 0.96) 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 760px) {
  .ed-cta {
    margin-top: 48px;
    padding: 34px 36px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
  }
}

.ed-cta h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.58rem;
  line-height: 1.2;
  color: var(--cream);
}

@media (min-width: 640px) {
  .ed-cta h3 {
    font-size: 1.7rem;
  }
}

.ed-cta p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

.ed-cta-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  flex-shrink: 0;
}

.ed-cta-actions .btn {
  min-height: 46px;
  padding: 0 12px;
  font-size: 13.5px;
  justify-content: center;
}

.ed-cta-actions .btn-primary {
  grid-column: 1 / -1;
  font-size: 14.5px;
}

@media (min-width: 640px) {
  .ed-cta-actions {
    display: flex;
    flex-wrap: wrap;
    width: auto;
  }
  .ed-cta-actions .btn {
    padding: 0 20px;
    font-size: 14.5px;
  }
}

/* Related Articles (Horizontal Snap Carousel on Mobile, 3-Col Grid on Desktop) */
.ed-related {
  margin-top: 44px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

@media (min-width: 760px) {
  .ed-related {
    margin-top: 56px;
    padding-top: 40px;
  }
}

.ed-related h2 {
  font-family: var(--serif);
  font-size: 1.62rem;
  margin-bottom: 18px;
  color: var(--cream);
}

@media (min-width: 640px) {
  .ed-related h2 {
    font-size: 1.8rem;
    margin-bottom: 22px;
  }
}

@media (max-width: 759px) {
  .ed-related .ed-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 82%;
    gap: 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 22px;
    margin: 0 -22px;
    padding: 0 22px 8px;
    scrollbar-width: none;
  }
  .ed-related .ed-grid::-webkit-scrollbar {
    display: none;
  }
  .ed-related .ed-card {
    scroll-snap-align: start;
  }
}
