/* ==========================================================================
   Components dùng chung
   ========================================================================== */

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 24px;
  border-radius: var(--radius-pill); border: 2px solid transparent;
  font-weight: 700; font-size: 1rem; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn .icon { width: 20px; height: 20px; }

.btn--primary { background: var(--color-primary); color: var(--color-dark); box-shadow: 0 6px 16px rgba(217, 151, 15, 0.3); }
.btn--primary:hover { background: var(--color-primary-dark); color: var(--color-dark); }

.btn--outline { border-color: var(--color-heading); color: var(--color-heading); background: rgba(255, 255, 255, 0.6); }
.btn--outline:hover { background: var(--color-heading); color: #fff; }

.btn--light { border-color: rgba(255, 255, 255, 0.7); color: #fff; }
.btn--light:hover { background: #fff; color: var(--color-dark); }

.btn--sm { min-height: 40px; padding: 8px 20px; font-size: 0.9375rem; }
.btn--lg { min-height: 58px; padding: 10px 28px; }

/* Nút đặt cơm 2 dòng (tiêu đề + số điện thoại) */
.btn--call { gap: 12px; padding-inline: 22px 28px; text-align: left; }
.btn__stack { display: flex; flex-direction: column; line-height: 1.2; }
.btn__stack small { font-size: 0.75rem; font-weight: 500; }

/* ---------- Carousel thực đơn ---------- */
.carousel { position: relative; }
.carousel__viewport {
  display: flex; gap: var(--carousel-gap, 16px);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none;
  padding: 6px 2px 18px; margin: -6px -2px 0;
}
.carousel__viewport::-webkit-scrollbar { display: none; }
.carousel__slide {
  flex: 0 0 calc((100% - var(--carousel-gap, 16px) * (var(--per-view, 5) - 1)) / var(--per-view, 5));
  scroll-snap-align: start;
  display: flex;
}

.carousel__nav { display: flex; gap: 10px; }
.carousel__btn {
  width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--color-heading); color: var(--color-heading); background: var(--color-surface);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), opacity 0.2s;
}
/* Chỉ áp hover cho thiết bị có chuột – tránh nút bị "kẹt hover" sau khi chạm trên mobile */
@media (hover: hover) {
  .carousel__btn:hover:not(:disabled) { background: var(--color-heading); color: #fff; }
}
.carousel__btn:disabled { opacity: 0.35; cursor: default; }
.carousel__btn .icon { width: 22px; height: 22px; }

.carousel__dots { display: flex; justify-content: center; gap: 2px; margin-top: 6px; }
.carousel__dot { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.carousel__dot::before {
  content: ""; width: 9px; height: 9px; border-radius: var(--radius-pill);
  background: var(--color-border); transition: width 0.3s var(--ease), background 0.3s var(--ease);
}
.carousel__dot[aria-current="true"]::before { width: 24px; background: var(--color-primary); }

/* ---------- Thẻ món: ảnh là chính, tên bên dưới, không shadow ---------- */
.dish-card {
  display: flex; flex-direction: column; width: 100%;
  text-align: center;
}
.dish-card__media {
  aspect-ratio: 4 / 3; overflow: hidden;           /* = tỉ lệ ảnh gốc 640x480 => không cắt món */
  border-radius: var(--radius-md); background: var(--color-surface-alt);
}
.dish-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: var(--focus, center);
  transition: transform 0.6s var(--ease);
}
@media (hover: hover) {
  .dish-card:hover .dish-card__media img { transform: scale(1.04); }
}
.dish-card__body { padding: 12px 4px 0; }
.dish-card__title { font-size: 1.125rem; font-weight: 600; }

/* ---------- Danh sách tiện ích (about) ---------- */
.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.feature-list li { display: flex; align-items: center; gap: 10px; font-size: 0.875rem; line-height: 1.4; }
.feature-list .icon { width: 20px; height: 20px; color: var(--color-primary); stroke-width: 1.7; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 500;
  display: grid; place-items: center;
  padding: 56px 16px;
  background: rgba(20, 15, 15, 0.94);
  opacity: 0; visibility: hidden; transition: opacity 0.25s var(--ease), visibility 0s linear 0.25s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity 0.25s var(--ease); }
.lightbox__figure { max-width: min(1200px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lightbox__img { max-height: calc(100vh - 160px); width: auto; border-radius: var(--radius-sm); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.lightbox__caption { color: var(--color-on-dark); font-size: var(--text-small); text-align: center; }
.lightbox__btn {
  position: absolute; width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(255, 255, 255, 0.12);
}
.lightbox__btn:hover { background: var(--color-primary); color: var(--color-dark); }
.lightbox__btn .icon { width: 24px; height: 24px; }
.lightbox__close { top: 14px; right: 14px; }
.lightbox__prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 14px; top: 50%; transform: translateY(-50%); }
body.has-lightbox { overflow: hidden; }

/* ---------- Thẻ bài viết (archive/search) ---------- */
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.post-card {
  display: flex; flex-direction: column;
  background: var(--color-surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.post-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.05); }
.post-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card__title { font-size: 1.25rem; }
.post-card__title a { text-decoration: none; }
.post-card__excerpt { color: var(--color-muted); font-size: 0.9375rem; }
.post-card__more { margin-top: auto; font-weight: 700; color: var(--color-accent); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.post-card__more .icon { width: 18px; height: 18px; transition: transform 0.2s var(--ease); }
.post-card__more:hover .icon { transform: translateX(3px); }

.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: var(--text-small); color: var(--color-muted); }
.post-meta span { display: inline-flex; align-items: center; gap: 6px; }
.post-meta .icon { width: 16px; height: 16px; }
.post-meta a { color: var(--color-accent); text-decoration: none; font-weight: 600; }
.page-hero .post-meta { color: var(--color-on-dark-muted); margin-top: 14px; }
.page-hero .post-meta a { color: var(--color-primary); }

/* Danh sách kết quả tìm kiếm */
.result-list { display: grid; gap: 20px; }
.result-item {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start;
  padding: 16px; background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.result-item__media { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4 / 3; }
.result-item__media img { width: 100%; height: 100%; object-fit: cover; }
.result-item__title { font-size: 1.1875rem; margin: 6px 0 8px; }
.result-item__title a { text-decoration: none; }
.result-item mark { background: rgba(242, 177, 46, 0.35); color: inherit; padding: 0 2px; border-radius: 3px; }

/* Phân trang */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.pagination a,
.pagination span {
  min-width: 44px; height: 44px; padding: 0 12px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; font-weight: 600; background: var(--color-surface); border: 1px solid var(--color-border);
}
.pagination [aria-current="page"] { background: var(--color-heading); color: #fff; border-color: var(--color-heading); }
.pagination a:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ---------- Sidebar widgets ---------- */
.sidebar { display: grid; gap: 24px; position: sticky; top: calc(var(--header-h) + 24px); }
.widget { background: var(--color-surface); border-radius: var(--radius-md); padding: 22px; box-shadow: var(--shadow-sm); }
.widget__title { font-size: 1.125rem; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--color-surface-alt); }
.widget ul { display: grid; gap: 10px; }
.widget li a { text-decoration: none; }
.widget--cta { background: var(--color-dark); color: var(--color-on-dark); }
.widget--cta .widget__title { color: #fff; border-color: rgba(255, 255, 255, 0.12); }
.widget--cta p { color: var(--color-on-dark-muted); font-size: 0.9375rem; margin-bottom: 16px; }
.widget--cta .btn { width: 100%; }
.widget--cta .btn + .btn { margin-top: 10px; }
.widget-posts li { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; }
.widget-posts img { width: 72px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); }
.widget-posts a { font-weight: 600; font-size: 0.9375rem; line-height: 1.4; }

/* Form tìm kiếm */
.search-form { display: flex; gap: 8px; }
.search-form input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px;
  border: 1px solid var(--color-border); border-radius: var(--radius-pill); background: var(--color-surface);
}
.search-form input:focus-visible { border-color: var(--color-accent); }
.search-form button {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-primary); color: var(--color-dark);
}
.search-form button .icon { width: 20px; height: 20px; }

/* ---------- Nội dung bài viết / trang ---------- */
.entry { background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: clamp(20px, 4vw, 44px); }
.entry__thumb { border-radius: var(--radius-md); overflow: hidden; margin-bottom: 28px; }
.entry__thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.prose { font-size: 1.0625rem; line-height: 1.8; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.625rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.3125rem; margin-top: 1.4em; }
.prose ul { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose figure img { border-radius: var(--radius-md); width: 100%; }
.prose figcaption { margin-top: 8px; font-size: var(--text-small); color: var(--color-muted); text-align: center; }
.prose blockquote { border-left: 4px solid var(--color-primary); padding: 4px 0 4px 18px; font-family: var(--font-heading); font-size: 1.1875rem; color: var(--color-heading); }
.prose a { color: var(--color-accent); }
.prose .note { padding: 16px 18px; border-radius: var(--radius-sm); background: var(--color-surface-alt); }

.entry-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--color-border); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag { display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--color-surface-alt); font-size: var(--text-small); text-decoration: none; }

/* ---------- Thanh gọi nhanh (mobile) ---------- */
.mobile-cta { display: none; }

/* Trang tìm kiếm */
.search-form--main { max-width: 560px; margin-bottom: 24px; }
.search-count { margin-bottom: 20px; color: var(--color-muted); }
