/* Linh Meo public site: white and ivory, dark text, red for prices and actions,
   gold for small accents (text in gold uses the darker #946a0e). */
:root {
  --red: #c62828;
  --red-dark: #a51f1f;
  --gold: #946a0e;
  --gold-line: #c69214;
  --text: #222;
  --muted: #5f5f5f;
  --line: #e7e1d6;
  --ivory: #fffaf2;
  --soft: #faf5ec;
  --zalo: #0068ff;
  --radius: 12px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--red);
}

svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.18em;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: 46px;
  padding: 0.55em 1.1em;
  border: 2px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn-red {
  background: var(--red);
  color: #fff;
}

.btn-red:hover {
  background: var(--red-dark);
}

.btn-zalo {
  background: var(--zalo);
  color: #fff;
}

.btn-outline {
  background: #fff;
  border-color: var(--red);
  color: var(--red);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  margin-right: auto;
}

.logo img {
  border-radius: 10px;
}

.logo span {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.logo b {
  color: var(--red);
  font: 700 1.45rem/1.05 Georgia, "Times New Roman", serif;
  letter-spacing: 0.02em;
}

.logo small {
  color: var(--gold);
  font: 700 0.68rem/1.2 Georgia, "Times New Roman", serif;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 0.25rem;
}

.nav a,
.menu nav a {
  padding: 0.55rem 0.8rem;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
}

.nav a.active {
  color: var(--red);
  box-shadow: inset 0 -3px 0 var(--red);
  border-radius: 0;
}

.header-call {
  min-height: 42px;
}

.menu {
  display: none;
  position: relative;
}

.menu summary {
  list-style: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 10px;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu summary span,
.menu summary span::before,
.menu summary span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  position: relative;
  content: "";
}

.menu summary span::before {
  position: absolute;
  top: -7px;
}

.menu summary span::after {
  position: absolute;
  top: 7px;
}

.menu nav {
  position: absolute;
  right: 0;
  top: 52px;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.menu nav a.active {
  color: var(--red);
}

/* Home hero */
.hero {
  min-height: 430px;
  background: radial-gradient(ellipse 60% 75% at 6% 24%, rgba(255, 250, 240, 0.96) 0, rgba(255, 250, 240, 0.8) 50%, rgba(255, 250, 240, 0) 100%),
    #f9e2bd url(/img/nha-trang.svg) center bottom / cover no-repeat;
}

.hero-brand {
  padding-top: 44px;
  padding-bottom: 96px;
}

.hero-brand img {
  border-radius: 15px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.hero h1 {
  margin: 0.25em 0 0;
  color: var(--red);
  font: 700 clamp(3rem, 10vw, 6.2rem) / 0.95 Georgia, "Times New Roman", serif;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.65);
}

.hero h1 span {
  display: block;
  margin-top: 0.3em;
  color: var(--gold);
  font-size: 0.32em;
  letter-spacing: 0.06em;
}

.pill {
  display: inline-flex;
  margin: 1rem 0 0;
  padding: 0.4em 1.15em;
  border: 2px solid var(--gold-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--red);
  font-weight: 700;
  font-size: 1.1rem;
}

/* Finder (home search card) */
.finder {
  position: relative;
  margin-top: -64px;
}

.finder > .type-switch,
.finder > form {
  background: #fff;
}

.type-switch {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 12px 12px 0 0;
}

.type-switch a {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  white-space: nowrap;
  min-height: 46px;
  padding: 0.5em 1.4em;
  border-radius: 9px;
  background: var(--soft);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.type-switch a.active {
  background: var(--red);
  color: #fff;
}

.finder-form,
.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
  border-radius: 0 12px 12px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.filters {
  background: #fff;
  border-radius: 12px;
  margin: 1rem 0;
}

.finder-form label,
.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 0;
}

select,
input[type="search"] {
  width: 100%;
  min-height: 46px;
  padding: 0.5rem 0.7rem;
  border: 1px solid #c9c2b6;
  border-radius: 9px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  color: var(--text);
}

/* Blocks */
.block {
  margin: 2.2rem auto;
}

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.block-head h2 {
  margin: 0 0 0.9rem;
  font-size: 1.45rem;
}

.block-head a {
  white-space: nowrap;
  font-weight: 600;
  text-decoration: none;
}

.cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.cat:hover {
  border-color: var(--gold-line);
}

.cat-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fbf0d8;
  color: var(--gold);
}

.cat-icon svg {
  width: 30px;
  height: 30px;
}

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

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: box-shadow 0.15s;
}

.card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.card-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--soft);
}

.card-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tag {
  display: inline-block;
  padding: 0.15em 0.6em;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.tag-rent {
  background: var(--red);
}

.tag-sale {
  background: #1f1f1f;
}

.card-photo .tag {
  position: absolute;
  left: 0.6rem;
  top: 0.6rem;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem 0.85rem;
}

.card-body h3 {
  margin: 0;
  font-size: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price {
  margin: 0;
  color: var(--red);
  font-weight: 800;
  font-size: 1.15rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.8rem;
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
}

.card-code {
  color: var(--muted);
  font-size: 0.78rem;
}

.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.contact-band {
  margin-top: 2.5rem;
  padding: 2rem 0;
  background: #fff;
  border-top: 3px solid var(--gold-line);
  text-align: center;
}

.contact-band h2 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
}

.contact-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

/* List page */
.breadcrumb {
  margin: 1rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--muted);
}

.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.list-head h1 {
  margin: 0;
  font-size: 1.7rem;
}

.list-head .type-switch {
  border-radius: 12px;
  background: #fff;
}

.list-page .cats {
  margin-bottom: 1rem;
}

.list-page .cat {
  flex-direction: row;
  justify-content: flex-start;
  padding: 0.5rem 0.7rem;
  text-align: left;
}

.list-page .cat-icon {
  width: 40px;
  height: 40px;
}

.list-page .cat-icon svg {
  width: 22px;
  height: 22px;
}

.result-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  min-height: 1.5em;
}

.clear {
  font-weight: 600;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.pager a {
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-weight: 600;
  text-decoration: none;
}

/* Detail page */
.closed-banner {
  margin: 0.5rem 0;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: #1f1f1f;
  color: #fff;
  font-weight: 800;
  text-align: center;
  font-size: 1.1rem;
}

.detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.gallery {
  position: relative;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: var(--radius);
  background: #1f1f1f;
  scrollbar-width: none;
}

.shot {
  flex: 0 0 100%;
  scroll-snap-align: start;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  cursor: zoom-in;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shot-count {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.25em 0.7em;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.85rem;
  pointer-events: none;
}

.summary {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.summary h1 {
  margin: 0;
  font-size: 1.45rem;
}

.summary-tags {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}

.code {
  color: var(--muted);
  font-size: 0.85rem;
}

.price-big {
  font-size: 1.75rem;
}

.summary .contact-buttons {
  justify-content: flex-start;
}

.summary .contact-buttons .btn {
  flex: 1 1 auto;
}

.share {
  width: 100%;
}

.share-links {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.facts,
.desc {
  margin-top: 1.5rem;
  padding: 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.facts h2,
.desc h2 {
  margin: 0 0 0.7rem;
  font-size: 1.2rem;
}

.facts dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.25rem 1.5rem;
  margin: 0;
}

.facts dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--soft);
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.content {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.fixed-notice {
  margin: 1.25rem 0 0;
  padding: 1rem 1.1rem;
  border: 2px solid var(--gold-line);
  border-radius: var(--radius);
  background: #fff8e6;
  color: var(--red-dark);
  font-weight: 700;
  text-align: center;
}

.contact-bar {
  display: none;
}

/* Contact page and 404 */
.contact-page,
.not-found {
  padding-bottom: 3rem;
}

.contact-list {
  display: grid;
  gap: 0.6rem;
  max-width: 560px;
  padding: 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.contact-list div {
  display: flex;
  gap: 1rem;
}

.contact-list dt {
  min-width: 100px;
  color: var(--muted);
}

.contact-list dd {
  margin: 0;
  font-weight: 600;
}

.contact-page .contact-buttons {
  justify-content: flex-start;
  margin-top: 1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  background: #1f1f1f;
  color: #e9e4da;
}

.site-footer a {
  color: #ffd27a;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 1fr;
  gap: 1.5rem;
}

.footer-grid p {
  margin: 0.25rem 0;
}

.footer-grid nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-brand {
  color: #ffffff;
  font: 700 1.5rem Georgia, "Times New Roman", serif;
  letter-spacing: 0.03em;
}

.copyright {
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  padding-bottom: 5.5rem;
  border-top: 1px solid #3a3a3a;
  color: #b8b2a6;
  font-size: 0.85rem;
}

/* Photo viewer (site.js) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}

.lightbox img {
  max-width: 100vw;
  max-height: 86vh;
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  min-width: 48px;
  min-height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

.lightbox .lb-close {
  top: 12px;
  right: 12px;
}

.lightbox .lb-prev {
  left: 12px;
}

.lightbox .lb-next {
  right: 12px;
}

.lightbox .lb-count {
  position: absolute;
  bottom: 14px;
  color: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 110;
  transform: translateX(-50%);
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: #222;
  color: #fff;
}

@media (max-width: 900px) {
  .nav,
  .header-call span {
    display: none;
  }

  .header-call {
    width: 46px;
    padding: 0;
  }

  .menu {
    display: block;
  }

  .finder-form,
  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .finder-form .q,
  .filters .q,
  .finder-form .btn,
  .filters .btn {
    grid-column: 1 / -1;
  }

  .detail-top {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .logo b {
    font-size: 1.2rem;
  }

  .logo small {
    font-size: 0.56rem;
    letter-spacing: 0.03em;
  }

  .hero {
    min-height: 0;
    background: #fdf6ec url(/img/nha-trang.svg) 30% bottom / auto 52% no-repeat;
  }

  .hero-brand {
    padding-top: 28px;
    padding-bottom: 210px;
  }

  .finder {
    margin-top: -40px;
  }

  .type-switch {
    display: flex;
  }

  .type-switch a {
    flex: 1;
    justify-content: center;
  }

  .list-head .type-switch {
    width: 100%;
  }

  .finder-form,
  .filters {
    grid-template-columns: 1fr;
    border-radius: 0 0 12px 12px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .cats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .cat {
    padding: 0.75rem 0.25rem;
    font-size: 0.85rem;
  }

  .list-page .cats {
    grid-template-columns: 1fr 1fr;
  }

  .contact-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 16px calc(0.6rem + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
  }

  .contact-bar .btn {
    flex: 1;
  }

  .detail {
    padding-bottom: 5rem;
  }
}
