/* =============================================================
   Đi Đâu Trời — pages.css: trang con (khám phá, khu vực, chi tiết địa điểm/bài).
   Dùng token có sẵn (tokens.css): giấy kem, mực nâu, đất nung; không đổi palette/font,
   không Tailwind. Card địa điểm dùng chung style.css (.mood-card).
   ============================================================= */

.muted { color: var(--ink-muted); }

/* The collapsed menu is an enhancement: real links remain usable without JS. */
@media (max-width: 1023px) {
  .masthead:not(.masthead--enhanced) { flex-wrap: wrap; height: auto; min-height: 82px; padding-top: 16px; }
  .masthead:not(.masthead--enhanced) .masthead__nav { display: flex; flex-wrap: wrap; order: 3; flex-basis: 100%; gap: 8px 20px; padding: 16px 0; }
  .masthead:not(.masthead--enhanced) .masthead__nav a { padding: 8px 0; }
}

/* Shared colophon: restrained ink, generous link targets and a ruled paper edge. */
.site-footer { margin-top: 64px; padding: 34px 0 24px; border-top: 1px solid #cbbda6; color: #514338; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; }
.site-footer__brand p { max-width: 26ch; margin: 16px 0 0; font-family: var(--font-editorial); font-size: 20px; line-height: 1.5; }
.site-footer__logo { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer__logo img { width: 166px; height: 36px; }
.site-footer__title { margin: 0 0 12px; font-family: var(--font-editorial); font-size: 21px; color: var(--ink-dark); }
.site-footer__group { min-width: 0; }
.site-footer__group ul { list-style: none; padding: 0; margin: 0; }
.site-footer__group a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 0; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.site-footer a:hover { color: #8a3f25; text-decoration: underline; text-underline-offset: 4px; }
.site-footer__disclosure { max-width: 92ch; margin-top: 28px; padding: 18px 0; border-top: 1px dashed #cbbda6; font-size: 13px; line-height: 1.8; }
.site-footer__disclosure a { text-decoration: underline; text-underline-offset: 3px; }
.site-footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; border-top: 1px solid var(--line); padding-top: 18px; font-size: 12.5px; line-height: 1.8; }
.site-footer__bottom .hand { font-size: 20px; white-space: nowrap; }
@media (min-width: 640px) { .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; } }
@media (min-width: 1100px) { .site-footer__grid { grid-template-columns: 1.2fr 1fr 1fr 1.2fr; gap: 40px; } }

.info-sheet { max-width: 78ch; margin: 24px 0 40px; padding: clamp(20px, 4vw, 40px); border: 1px solid var(--line); border-radius: 6px 20px 8px 6px; background: linear-gradient(135deg, #fffdf7, #f8f0e0); }
.info-review { margin: 0 0 28px; padding-bottom: 18px; border-bottom: 1px dashed #cbbda6; color: #64564b; font-size: 13px; line-height: 1.8; }
.info-section + .info-section { margin-top: 32px; }
.info-section h2 { margin: 0 0 14px; font: 700 clamp(22px, 3vw, 28px)/1.3 var(--font-editorial); color: var(--ink-dark); }
.info-section p, .info-section li { font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.info-section p + p { margin-top: 14px; }
.info-section ul { padding-left: 22px; }
.info-section li + li { margin-top: 10px; }
.info-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 18px; }
.info-links a { display: inline-flex; align-items: center; min-height: 44px; color: #8a3f25; text-decoration: underline; text-underline-offset: 4px; }

/* Account and writing pages keep the site's paper, ink and editorial typography. */
[hidden] { display: none !important; }
.auth-sheet { max-width: 560px; margin: 0 auto 48px; padding: clamp(20px, 4vw, 36px); background: #fffcf5; border: 1px solid var(--line); border-radius: 8px 24px 12px 6px; box-shadow: 4px 8px 0 #e8ddca; }
.paper-form { display: grid; gap: 18px; max-width: 720px; margin: 24px 0; }
.form-field { display: grid; gap: 7px; min-width: 0; font-weight: 600; font-size: 15px; }
.form-field input, .form-field textarea, .form-field select { width: 100%; min-width: 0; min-height: 46px; padding: 12px 14px; border: 1px solid #b8aea0; border-radius: 8px; font: 400 16px/1.6 var(--font-body); color: var(--ink-dark); background: #fffdf8; }
.form-field textarea { resize: vertical; }
.form-field input:focus-visible, .form-field textarea:focus-visible, .form-field select:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 2px; }
.form-hint { color: #64564b; font-size: 13px; line-height: 1.7; }
.form-note { padding: 12px 16px; background: #f4ead7; border-left: 3px solid var(--terracotta); font-size: 14px; line-height: 1.8; margin: 16px 0; }
.form-status { display: block; font-size: 14px; line-height: 1.7; color: #813a26; overflow-wrap: anywhere; }
.form-status:empty { display: none; }
.form-links, .form-actions, .account-nav { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-links { margin-top: 22px; font-size: 14px; }
.form-links a, .text-link { color: #8a3f25; text-decoration: underline; text-underline-offset: 3px; }
.paper-form > button { justify-self: start; }
button:disabled, [aria-disabled="true"] { opacity: .65; cursor: wait; }
.account-nav { margin-bottom: 26px; }
.account-welcome { margin: 24px 0; font-size: 18px; }
.account-post { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 24px 0; border-bottom: 1px solid var(--line); }
.account-post > div { min-width: 0; }
.account-post .section-title { font-size: 22px; margin: 8px 0 0; overflow-wrap: anywhere; }
.account-posts { margin-bottom: 24px; }
.empty-note { padding: 32px 0; color: var(--ink-muted); }
.profile-sheet { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; padding: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,252,245,.6); }
.profile-sheet > div { flex: 1; min-width: min(100%, 220px); }
.profile-bio { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 660px; }
.editor-form { max-width: 860px; }
.editor-form textarea { background: repeating-linear-gradient(#fffdf8, #fffdf8 31px, #eee6d7 32px); line-height: 32px; }
.image-picker { border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.image-picker legend { font-weight: 600; padding: 0 8px; }
[data-image-picker] { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.image-choice { display: grid; gap: 5px; width: 120px; font-size: 12px; position: relative; }
.image-choice input { position: absolute; top: 7px; left: 7px; width: 20px; height: 20px; accent-color: var(--terracotta); }
.image-choice img { width: 120px; height: 90px; object-fit: cover; border-radius: 4px; }
.image-choice:has(input:checked) img { outline: 3px solid var(--terracotta); }
.reaction-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.reaction-controls [aria-pressed="true"] { color: #893c25; background: #f2dfce; border-color: var(--terracotta); }
.reaction-controls [data-reaction-status] { flex-basis: 100%; }
@media (min-width: 1024px) { .masthead__nav [data-member-link] { display: none; } }
.post-card .reaction-controls .btn-ghost { padding: 6px 12px; font-size: 13px; }
.comment-form { max-width: none; }
@media (max-width: 639px) { .account-post { align-items: flex-start; flex-direction: column; } .auth-sheet { box-shadow: 2px 5px 0 #e8ddca; } }
@media (prefers-reduced-motion: no-preference) { .auth-sheet, .editor-form, .profile-sheet { animation: paper-in .35s ease-out both; } @keyframes paper-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } } }

.section-title {
  font-family: var(--font-editorial);
  font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.015em;
  color: var(--ink-dark);
  margin: 0 0 16px;
}
.section-title__count { font-family: var(--font-body); font-size: 16px; font-weight: 500; color: var(--ink-muted); }
@media (min-width: 640px) { .section-title { font-size: 28px; } }

.section-more { margin-top: 18px; font-size: 14.5px; }
.section-more a, .place-section p a:not([class]), .facts a {
  color: #8A3F25; text-decoration: underline; text-decoration-color: rgba(191, 90, 56, .4); text-underline-offset: 3px;
}
.section-more a:hover, .place-section p a:not([class]):hover, .facts a:hover { color: var(--terracotta); }

/* Nút phụ: viền mảnh, nền giấy */
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px;
  border: 1px solid #B8AEA0; background: rgba(250, 246, 238, .9);
  font-size: 14px; font-weight: 500; color: #2B221C;
  transition: background-color .2s, border-color .2s, color .2s;
}
.btn-ghost:hover { background: #fff; border-color: var(--terracotta); color: var(--terracotta-dark); }
.btn-primary--sm { padding: 10px 20px; font-size: 14.5px; }

/* ---------- Danh mục: tab, bộ lọc, chip, tóm tắt ---------- */
.catalog { padding-top: 8px; }

.tabs { display: flex; gap: 6px; margin: 4px 0 18px; border-bottom: 1px solid var(--line); }
.tabs__link {
  margin-bottom: -1px; padding: 10px 16px;
  font-size: 15px; font-weight: 600; color: #5A4F47;
  border-bottom: 2.5px solid transparent;
  transition: color .2s, border-color .2s;
}
.tabs__link:hover { color: var(--terracotta); }
.tabs__link[aria-current] { color: var(--ink-dark); border-bottom-color: var(--terracotta); }

.filters {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
  padding: 16px; margin-bottom: 14px;
  border-radius: 18px; border: 1px solid #E6DDD0;
  background: rgba(252, 249, 242, .92);
  box-shadow: 0 10px 26px rgba(55, 40, 25, .06);
}
.filters__field { display: grid; gap: 4px; min-width: 0; }
.filters__label { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: #5A4F47; }
.filters select, .filters input {
  width: 100%; min-height: 44px; padding: 9px 12px;
  font: inherit; font-size: 15px; color: var(--ink-dark);
  border: 1px solid #CFC4B4; border-radius: 12px; background: #FFFDF8;
}
.filters select:focus-visible, .filters input:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 1px; }
.filters__actions { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.filters__submit {
  min-height: 44px; padding: 0 22px; border-radius: 999px;
  color: #fff; font-weight: 600; background: var(--terracotta);
  transition: background-color .2s;
}
.filters__submit:hover { background: var(--terracotta-dark); }
.filters__reset { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-size: 14px; color: #5A4F47; text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 640px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters__field--grow { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr) auto; align-items: end; }
  .filters__field--grow { grid-column: auto; }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 7px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--ink-brown);
  background: #F6F1E8; border: 1px solid #E2D9CB;
  transition: border-color .2s, color .2s;
}
.chip:hover { border-color: rgba(191, 90, 56, .5); color: var(--terracotta); }
.chip[aria-current] { background: var(--terracotta); border-color: var(--terracotta); color: #fff; }

.results-meta { margin: 0 0 16px; font-size: 14px; color: var(--ink-muted); }

.mood-grid--catalog { margin-bottom: 8px; }

/* ---------- Phân trang ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 32px 0 8px; }
.pager__list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pager__link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; color: #2B221C;
  border: 1px solid #D9CDBB; background: rgba(250, 246, 238, .9);
  transition: border-color .2s, color .2s;
}
a.pager__link:hover { border-color: var(--terracotta); color: var(--terracotta-dark); }
.pager__link--current { background: var(--ink-dark); border-color: var(--ink-dark); color: var(--bg-cream); }
.pager__gap { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; color: var(--ink-muted); }

/* ---------- Card bài viết + byline ---------- */
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.post-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  border-radius: 18px; overflow: hidden;
  background: #FFFCF5; border: 1px solid #E6DDD0;
  box-shadow: 0 8px 22px rgba(40, 28, 18, .07);
}
.post-card__media { aspect-ratio: 4 / 3; background: var(--bg-cream-deep); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { display: grid; gap: 8px; padding: 16px 18px 18px; }
.post-card__kicker { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #8A7B6C; }
.post-card__title { font-family: var(--font-card); font-size: 20px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.post-card__title a:hover { color: var(--terracotta); }
.post-card__place {
  display: inline-flex; align-items: center; gap: 6px; justify-self: start; max-width: 100%;
  font-size: 13px; color: #5A4F47;
}
.post-card__place span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-card__place svg { flex-shrink: 0; color: var(--terracotta); }
.post-card__place:hover { color: var(--terracotta); }

.byline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-width: 0; font-size: 13.5px; color: var(--ink-muted); }
.byline__name { font-weight: 600; color: #2F2722; overflow-wrap: anywhere; }
a.byline__name:hover { color: var(--terracotta); }
.byline__stack { display: grid; gap: 2px; }
.byline--lg { margin-top: 14px; font-size: 14.5px; }

.avatar { flex-shrink: 0; border-radius: 999px; object-fit: cover; background: #E8D7BD; border: 1px solid #fff; }
.avatar--24 { width: 24px; height: 24px; font-size: 12px; }
.avatar--32 { width: 32px; height: 32px; font-size: 14px; }
.avatar--48 { width: 48px; height: 48px; font-size: 20px; }
.avatar--initial { display: inline-grid; place-items: center; font-weight: 600; color: #fff; background: var(--terracotta); }

/* ---------- Chi tiết địa điểm ---------- */
.place-section, .community, .comments { margin-top: 44px; }
.place__intro { padding-bottom: 18px; }

.place-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 1100px) { .place-layout { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 32px; } }

.gallery { margin: 0; }
.gallery__stage {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: 20px; background: #2C2520;
  box-shadow: 0 14px 34px rgba(40, 28, 18, .14);
}
.gallery__main { width: 100%; height: 100%; object-fit: cover; }
.gallery__stage--empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: rgba(246, 211, 136, .6);
  background: linear-gradient(165deg, #6F5A47 0%, #4A3D33 55%, #2E2621 100%);
}
.gallery__stage--empty .hand { font-size: 24px; color: rgba(255, 246, 225, .75); }
.gallery__caption { margin-top: 10px; font-size: 13px; color: var(--ink-muted); overflow-wrap: anywhere; }
.gallery__caption a { text-decoration: underline; text-underline-offset: 2px; }
.gallery__note, .notice {
  margin-top: 10px; padding: 10px 14px; border-radius: 12px;
  font-size: 13.5px; color: #5B3A1E;
  background: #FBEBD6; border: 1px solid #EBC99A;
}
.gallery__thumbs { display: flex; gap: 8px; margin: 12px 0 0; padding: 0 0 4px; list-style: none; overflow-x: auto; }
.gallery__thumb {
  display: block; width: 88px; aspect-ratio: 4 / 3; overflow: hidden; flex-shrink: 0;
  border-radius: 10px; border: 2px solid transparent; opacity: .78;
  transition: opacity .2s, border-color .2s;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb:hover { opacity: 1; }
.gallery__thumb[aria-pressed="true"] { opacity: 1; border-color: var(--terracotta); }

.place-facts {
  padding: 20px; border-radius: 20px;
  background: rgba(252, 249, 242, .95); border: 1px solid #E6DDD0;
  box-shadow: 0 10px 26px rgba(55, 40, 25, .06);
}
.place-facts__title { font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #786C61; margin-bottom: 12px; }
.facts { margin: 0; display: grid; gap: 12px; }
.facts__row { display: grid; gap: 2px; }
.facts dt { font-size: 12.5px; font-weight: 600; color: #786C61; }
.facts dd { margin: 0; font-size: 15px; color: var(--ink-dark); overflow-wrap: anywhere; }
.facts__rating { font-family: var(--font-editorial); font-size: 22px; font-weight: 700; }
.facts__hint { font-size: 12.5px; }
.place-facts__actions { margin-top: 18px; }
.place-facts__note { margin-top: 12px; font-size: 13px; }

.place__desc { max-width: 70ch; font-size: 16.5px; line-height: 1.7; color: var(--ink-brown); margin-bottom: 8px; }
.place-section .muted { font-size: 13.5px; max-width: 70ch; }

.source-list { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }
.source-list a { color: #8A3F25; text-decoration: underline; text-underline-offset: 3px; }
.source-list__hint { font-size: 13px; color: var(--ink-muted); }

.map-embed {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  padding: 18px; border-radius: 18px; border: 1px dashed #D9CDBB; background: rgba(252, 249, 242, .85);
}
.map-embed > p { flex-basis: 100%; font-size: 14.5px; color: var(--ink-brown); }
.map-embed.is-loaded { padding: 0; border-style: solid; overflow: hidden; }
.map-embed.is-loaded > p { display: none; }
.map-embed.is-loaded > a { margin: 0 0 12px 12px; }
.map-embed__frame { display: block; width: 100%; aspect-ratio: 16 / 10; border: 0; flex-basis: 100%; }
.map-embed__caption { margin-top: 8px; }

/* ---------- Chi tiết bài viết ---------- */
.post { max-width: 860px; }
.post .gallery { margin-top: 8px; }
.post-body { margin-top: 24px; font-size: 17px; line-height: 1.75; color: var(--ink-brown); }
.post-body p { white-space: pre-wrap; overflow-wrap: anywhere; }
.post-body p + p { margin-top: 1em; }
.member-rating { margin-top: 20px; font-size: 15px; }

.place-ref {
  display: flex; gap: 16px; align-items: flex-start; margin-top: 32px;
  padding: 16px; border-radius: 18px; background: rgba(252, 249, 242, .95); border: 1px solid #E6DDD0;
}
.place-ref__img { width: 96px; height: 96px; flex-shrink: 0; border-radius: 12px; object-fit: cover; }
.place-ref__body { display: grid; gap: 6px; min-width: 0; }
.place-ref__body .kicker { margin: 0; }
.place-ref__title { font-family: var(--font-card); font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.place-ref__title a:hover { color: var(--terracotta); }

.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; }
.post-actions__count { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; font-size: 14.5px; color: var(--ink-brown); }
.post-actions__count svg { color: #C2412F; }
.post-actions__status { flex-basis: 100%; font-size: 13.5px; color: var(--ink-muted); min-height: 1em; }

/* ---------- Bình luận (chỉ đọc ở phase 4) ---------- */
.comment-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.comment { padding: 14px 16px; border-radius: 16px; background: rgba(252, 249, 242, .92); border: 1px solid #E6DDD0; }
.comment__body { margin-top: 8px; font-size: 15px; line-height: 1.6; color: var(--ink-brown); white-space: pre-wrap; overflow-wrap: anywhere; }
.comments__empty { color: var(--ink-muted); }
.comments__more { margin-top: 14px; }
.comments__more, .comments__more:where(button) {
  padding: 9px 18px; border-radius: 999px; border: 1px solid #B8AEA0; background: rgba(250, 246, 238, .9);
  font-size: 14px; font-weight: 500;
}
.comments__more[disabled] { opacity: .6; cursor: progress; }
.comments__status { min-height: 1em; margin-top: 8px; font-size: 13.5px; color: var(--ink-muted); }
.comments__cta { margin-top: 12px; }
