/* =========================================================
   Mâm cơm Việt – style.css
   Bảng màu lấy cảm hứng từ ba miền:
   lá dong (Bắc) – ớt chín (Trung) – sông nước (Nam)
   ========================================================= */

:root {
  /* Màu nền & chữ */
  --paper: #f2f4ec;        /* giấy dó, hơi ngả xanh lá */
  --paper-deep: #e4e9db;   /* nền phụ */
  --ink: #1e2b24;          /* mực xanh đen */
  --ink-soft: #46554c;     /* chữ phụ */
  --line: #c9d1bf;         /* đường viền */

  /* Màu ba miền */
  --bac: #2f6b45;          /* lá dong */
  --trung: #b8322a;        /* ớt chín */
  --nam: #1f6f8b;          /* sông nước */
  --nghe: #e3a72f;         /* nghệ – dùng cho viền focus */

  /* Chữ */
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;

  /* Khoảng cách */
  --gap: 1.5rem;
  --radius-lg: 20px;
  --radius-sm: 8px;
  --container: 1180px;
}

/* Chế độ "Chữ to" cho máy chiếu */
html.big-text { font-size: 118%; }

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;      /* 18px – dễ đọc khi chiếu */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, video, iframe { display: block; max-width: 100%; }

a { color: var(--nam); text-underline-offset: 3px; }

:focus-visible {
  outline: 3px solid var(--nghe);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus { top: 1rem; }

code, kbd {
  font-family: Consolas, "Courier New", monospace;
  font-size: .9em;
}
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 .35em;
  border: 1px solid currentColor;
  border-bottom-width: 2px;
  border-radius: 4px;
  text-align: center;
}

/* Nhãn cho biết phần này đang minh họa thẻ HTML nào */
.tag-chip {
  display: inline-block;
  margin: 0;
  padding: .15rem .6rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: Consolas, "Courier New", monospace;
  font-size: .85rem;
  line-height: 1.6;
  white-space: nowrap;
}

/* ================= THANH ĐIỀU HƯỚNG ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: var(--container);
  margin-inline: auto;
  padding: .75rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.nav-links {
  display: flex;
  gap: .25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-links a {
  display: block;
  padding: .5rem .85rem;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: background-color .2s;
}
.nav-links a:hover { background: var(--paper-deep); }
.nav-links a.is-current { background: var(--ink); color: var(--paper); }

.btn-text-size {
  min-height: 44px;
  padding: .45rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 600 1rem var(--font-body);
  cursor: pointer;
}
.btn-text-size[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ================= HERO ================= */
.hero { padding-top: clamp(2.5rem, 6vw, 5rem); }

.hero-text { scroll-margin-top: 6rem; }

.slogan {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.75rem, 8vw, 6.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 1rem 0 1.75rem;
  font-variation-settings: "opsz" 144;
}

.intro {
  max-width: 68ch;
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
}
.intro strong { font-weight: 700; }
.r-bac   { color: var(--bac); }
.r-trung { color: var(--trung); }
.r-nam   { color: var(--nam); }

/* Bộ ba miền – điểm nhấn chính của trang */
.triptych {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(.5rem, 1.2vw, 1rem);
  max-width: var(--container);
  margin: clamp(2rem, 5vw, 3.5rem) auto 0;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.region {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(320px, 42vw, 480px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  color: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
  isolation: isolate;
}

.region img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform .5s ease;
}
/* Phủ màu của từng miền lên ảnh */
.region::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, var(--tone) 18%, color-mix(in srgb, var(--tone) 35%, transparent) 60%, transparent);
}
.region-bac   { --tone: var(--bac); }
.region-trung { --tone: var(--trung); }
.region-nam   { --tone: var(--nam); }

.region-body {
  display: grid;
  gap: .15rem;
  padding: 1.5rem clamp(1rem, 2vw, 1.75rem) 1.75rem;
}
.region-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.1;
}
.region-taste { font-size: 1.05rem; opacity: .95; }
.region-cta {
  margin-top: .75rem;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.region:hover img,
.region:focus-visible img { transform: scale(1.05); }

/* Hiệu ứng duy nhất khi tải trang: ba miền lần lượt trồi lên */
@media (prefers-reduced-motion: no-preference) {
  .region { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
  .region-trung { animation-delay: .12s; }
  .region-nam   { animation-delay: .24s; }
  @keyframes rise {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: none; opacity: 1; }
  }
}

/* ================= SECTION CHUNG ================= */
.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}

.section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin: 0;
}

.lead { color: var(--ink-soft); margin: 0 0 1.5rem; max-width: 60ch; }

/* ================= BỘ LỌC + LƯỚI MÓN ĂN ================= */
.filters {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}

.filter {
  min-height: 44px;
  padding: .5rem 1.15rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 600 1rem var(--font-body);
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.filter:hover { border-color: var(--ink); }
.filter.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter[data-filter="bac"].is-active   { background: var(--bac);   border-color: var(--bac); }
.filter[data-filter="trung"].is-active { background: var(--trung); border-color: var(--trung); }
.filter[data-filter="nam"].is-active   { background: var(--nam);   border-color: var(--nam); }

.filter-status {
  margin: 0 0 1.5rem;
  font-size: .95rem;
  color: var(--ink-soft);
}

.dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
}

.dish {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.dish[hidden] { display: none; }

.dish-btn {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.dish-photo {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  background: var(--paper-deep);
}

.dish-body {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1.1rem 1.25rem 1.35rem;
  flex: 1;
  border-top: 5px solid var(--tone, var(--ink));
}
.dish[data-region~="bac"]   .dish-body { --tone: var(--bac); }
.dish[data-region~="trung"] .dish-body { --tone: var(--trung); }
.dish[data-region~="nam"]   .dish-body { --tone: var(--nam); }

.dish-region {
  font-size: .9rem;
  font-weight: 600;
  color: var(--tone);
}

.dish-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.dish-summary {
  margin: 0;
  font-size: 1rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dish-more {
  margin-top: auto;
  padding-top: .5rem;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.dish-btn:hover .dish-name { text-decoration: underline; text-decoration-thickness: 2px; }

/* ================= HỘP THOẠI MÓN ĂN ================= */
.dish-dialog {
  width: min(760px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--ink);
  overflow: auto;
}
.dish-dialog::backdrop { background: rgb(30 43 36 / .7); }

.dish-dialog img {
  width: 100%;
  max-height: 48vh;
  object-fit: cover;
}
.dialog-body { padding: 1.5rem clamp(1.25rem, 4vw, 2.25rem) 2rem; }
.dialog-region { margin: 0; font-weight: 600; color: var(--tone, var(--ink)); }
.dish-dialog h3 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.15;
  margin: .25rem 0 1rem;
}
.dish-dialog p:last-child { margin: 0; max-width: 68ch; }

.dialog-close-form { position: sticky; top: 0; height: 0; z-index: 2; }
.dialog-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 10px rgb(0 0 0 / .25);
}
.dialog-close svg { width: 24px; height: 24px; stroke: var(--ink); stroke-width: 2.5; fill: none; }

@media (prefers-reduced-motion: no-preference) {
  .dish-dialog[open] { animation: pop .28s cubic-bezier(.2, .8, .2, 1); }
  @keyframes pop {
    from { transform: translateY(16px) scale(.97); opacity: 0; }
    to   { transform: none; opacity: 1; }
  }
}

/* ================= ÂM THANH ================= */
.section-audio { background: var(--ink); color: var(--paper); border-top: 0; }
.section-audio .tag-chip { background: var(--paper); color: var(--ink); }

.audio-player {
  margin: 1.75rem 0 0;
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  flex-wrap: wrap;
}

.play-btn {
  flex: none;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 0;
  background: var(--nghe);
  color: var(--ink);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .1rem;
  cursor: pointer;
  font: 700 1rem var(--font-body);
  transition: transform .15s;
}
.play-btn:active { transform: scale(.96); }
.play-btn svg { width: 48px; height: 48px; fill: currentColor; }
.play-btn .i-pause { display: none; }
.play-btn.is-playing .i-play { display: none; }
.play-btn.is-playing .i-pause { display: block; }
.section-audio :focus-visible { outline-color: var(--paper); }

.audio-info { flex: 1 1 320px; display: grid; gap: 1rem; }
.audio-info figcaption { display: grid; gap: .2rem; }
.audio-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
}
.audio-source { opacity: .8; font-size: 1rem; }
.audio-info audio { width: 100%; }

/* ================= VIDEO + IFRAME ================= */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: var(--gap);
  margin-top: 1.75rem;
}

.media-frame { margin: 0; }
.media-frame video,
.media-frame iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: var(--radius-lg);
  background: #000;
}
.media-frame figcaption {
  margin-top: .75rem;
  font-size: 1rem;
  color: var(--ink-soft);
}

/* Phương án dự phòng khi YouTube không nhúng được (mở bằng file://) */
.yt-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
}
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.yt-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: .8rem 1.4rem;
  border-radius: 999px;
  background: #c4302b;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.yt-note {
  margin: .75rem 0 0;
  padding: .75rem 1rem;
  border-left: 4px solid var(--nghe);
  background: #fff;
  font-size: .95rem;
}

/* ================= BẢNG THÀNH VIÊN ================= */
.table-wrap {
  margin-top: 1.75rem;
  overflow-x: auto;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: #fff;
}

.members {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}
.members caption {
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: .95rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.members th,
.members td {
  padding: .9rem 1.25rem;
  text-align: left;
  vertical-align: top;
}
.members thead th {
  background: var(--paper-deep);
  font-weight: 700;
  font-size: 1rem;
  border-bottom: 2px solid var(--ink);
}
.members tbody tr + tr td { border-top: 1px solid var(--line); }
.members tbody tr:hover { background: var(--paper); }
.members td:first-child,
.members th:first-child { width: 4.5rem; text-align: center; font-variant-numeric: tabular-nums; }
.members td:nth-child(2) { font-weight: 600; }

/* ================= CHÂN TRANG ================= */
.site-footer {
  background: var(--paper-deep);
  border-top: 1px solid var(--line);
  padding-block: 2rem;
  font-size: 1rem;
  color: var(--ink-soft);
}
.footer-inner p { margin: .25rem 0; }

/* ================= ĐIỆN THOẠI ================= */
@media (max-width: 760px) {
  .nav { gap: .75rem; }
  .nav-links { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav-links a { white-space: nowrap; }

  .triptych { grid-template-columns: 1fr; }
  .region { min-height: 220px; border-radius: var(--radius-lg); }
}
