/* Public pages: the home page and the Property page (/property/<id>). Page-only styles stay inline in each page. */
:root {
    --bg-color: #FFFFFF;
    --text-main: #111111;
    --text-muted: #666666;
    --accent-green: #2D5A27;
    --light-green: #F4F7F4;
    --line: #EEEEEE;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Prompt', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.8;
    font-weight: 300;
}
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 24px;
}
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 120px;
}
.logo {
    font-weight: 500;
    font-size: 1.2rem;
    letter-spacing: 1px;
    color: var(--accent-green);
    text-decoration: none;
}
.nav { display: flex; align-items: center; gap: 20px; }
.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--text-main);
    padding-bottom: 2px;
}
.nav-page { color: var(--text-main); text-decoration: none; font-size: 0.9rem; }
.nav-page:hover, .nav-page.active { color: var(--accent-green); }
.nav-page.active { font-weight: 500; }
.lang { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; }
.lang.active { color: var(--accent-green); font-weight: 500; }
.btn {
    display: inline-block;
    background-color: var(--accent-green);
    color: #FFFFFF;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
section { margin-bottom: 140px; }
.section-title {
    font-size: 0.85rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 40px;
}
.footer-link { color: inherit; }
.footer-version { font-size: 0.75rem; color: var(--text-muted); }
.site-footer {
    border-top: 1px solid var(--line);
    padding-top: 40px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Property cards */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.listing {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--bg-color);
    min-width: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.listing:hover { border-color: #D6E2D4; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06); }
.listing:hover .listing-title { color: var(--accent-green); }
.listing[hidden], .listing-none[hidden] { display: none; }
.listing-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    background-color: var(--light-green);
}
.listing-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.listing-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    line-height: 1.5;
}
.listing-project {
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent-green);
}
.listing-title {
    font-size: 1.05rem;
    font-weight: 400;
    overflow-wrap: anywhere;
}
.listing-link { color: inherit; text-decoration: none; }
/* The title link covers the whole card, so a click anywhere opens the Property page. */
.listing-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.listing-link:focus-visible { outline: none; }
.listing:focus-within { outline: 2px solid var(--accent-green); outline-offset: 2px; }
.listing-line, .listing-meta span, .contact-item, .listing-price {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.listing-line, .listing-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.listing-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
}
.listing-line i, .listing-meta i { color: var(--accent-green); font-size: 0.8rem; }
.listing-prices { display: flex; flex-direction: column; gap: 2px; }
.listing-price { flex-wrap: wrap; font-size: 0.95rem; }
.listing-price strong { font-weight: 500; }
.listing-price-label { font-size: 0.8rem; color: var(--text-muted); }
.listing-remark { font-size: 0.8rem; color: var(--text-muted); }
.listing-updated { font-size: 0.75rem; }
.listing-updated i { color: var(--text-muted); }
.listing-none {
    grid-column: 1 / -1;
    padding: 40px 16px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed #DDDDDD;
    border-radius: 12px;
}

/* The listing's User and their contact */
.listing-contact {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.listing-contact a { position: relative; z-index: 2; }
.contact-person {
    display: flex;
    align-items: center;
    gap: 10px;
}
.contact-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--light-green);
    color: var(--accent-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    flex-shrink: 0;
    overflow: hidden;
}
.contact-avatar img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.contact-name {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    line-height: 1.3;
    min-width: 0;
    overflow-wrap: anywhere;
}
.contact-label { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }
.contact-socials {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.contact-social {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-green);
    text-decoration: none;
}
.contact-social:hover { background-color: var(--light-green); }
.contact-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
}
.contact-item {
    font-size: 0.85rem;
    color: var(--text-main);
    text-decoration: none;
    overflow-wrap: anywhere;
}
a.contact-item:hover { color: var(--accent-green); }
.contact-item i { color: var(--accent-green); }
.listing-contact.is-big { margin-top: 0; padding-top: 0; border-top: 0; gap: 14px; }
.listing-contact.is-big .contact-avatar { width: 44px; height: 44px; font-size: 1.1rem; }
.listing-contact.is-big .contact-name { font-size: 1.05rem; }
.listing-contact.is-big .contact-links { flex-direction: column; align-items: stretch; gap: 8px; }
.listing-contact.is-big .contact-item {
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 50px;
    font-size: 0.95rem;
}
.listing-contact.is-big a.contact-item:hover { border-color: var(--accent-green); }
.contact-none { font-size: 0.9rem; color: var(--text-muted); }

/* Search and filters above the cards */
.listing-tools {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}
.search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: 46px;
    border: 1px solid #E5E5E5;
    border-radius: 50px;
    color: var(--text-muted);
}
.search-field:focus-within { border-color: var(--accent-green); }
.search-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
}
.listing-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.filter-label {
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}
/* Price filter: rent or sale within 20% of the typed price; the range shows beside it. */
.price-filter { display: inline-flex; align-items: center; gap: 8px; }
.price-input {
    width: 170px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    background-color: var(--bg-color);
    font: inherit;
    font-size: 0.85rem;
    color: var(--text-main);
}
.price-range { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.filter-select {
    height: 34px;
    padding: 0 10px;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    background-color: var(--bg-color);
    font: inherit;
    font-size: 0.85rem;
    color: var(--text-main);
    max-width: 240px;
}
.chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.chip, .filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #E5E5E5;
    border-radius: 50px;
    background-color: var(--bg-color);
    font: inherit;
    font-size: 0.8rem;
    color: var(--text-main);
    cursor: pointer;
}
.chip:hover { border-color: var(--accent-green); }
.chip.is-active {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
    color: #FFFFFF;
}
.filter-reset {
    margin-left: auto;
    border-color: transparent;
    color: var(--text-muted);
}
.filter-reset:hover { color: var(--accent-green); }
.listing-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.listing-count strong { font-weight: 500; color: var(--text-main); }

/* Property page */
.page-property .container { padding-top: 40px; }
.page-property .site-header { margin-bottom: 40px; }
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}
.back-link:hover { color: var(--accent-green); }
/* Desktop: photos and details on the left, the title, price and contact beside them. Phone: photos, then title,
   price and contact, then details. */
.detail {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    grid-template-areas: "gallery side" "info side";
    grid-template-rows: auto 1fr;
    gap: 0 32px;
    align-items: start;
    margin-bottom: 100px;
}
.detail-gallery { grid-area: gallery; }
.detail-info { grid-area: info; }
.detail-side { grid-area: side; }
.gallery-main {
    aspect-ratio: 4/3;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--light-green);
}
.gallery-main { position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Left and right thirds of the photo step to the previous / next photo. */
.gallery-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.gallery-nav.is-prev { left: 0; justify-content: flex-start; }
.gallery-nav.is-next { right: 0; justify-content: flex-end; }
.gallery-nav span {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.85);
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s, transform 0.2s;
}
.gallery-nav:hover span { background-color: #FFFFFF; transform: scale(1.08); }
.gallery-nav:focus-visible { outline: none; }
.gallery-nav:focus-visible span { outline: 2px solid var(--accent-green); outline-offset: 2px; }
.gallery-count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 2px 10px;
    border-radius: 50px;
    background-color: rgba(0, 0, 0, 0.55);
    color: #FFFFFF;
    font-size: 0.8rem;
    line-height: 1.6;
}
.gallery-thumbs {
    position: relative;
    display: flex;
    gap: 8px;
    margin-top: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.gallery-thumb {
    flex: 0 0 72px;
    width: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--light-green);
    cursor: pointer;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.is-active { border-color: var(--accent-green); }
.detail-block { margin-top: 32px; }
.detail-block h2 {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.spec-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background-color: var(--line);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}
.spec-list div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: var(--bg-color);
    font-size: 0.9rem;
    line-height: 1.4;
}
.spec-list dt { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); }
.spec-list dt i { color: var(--accent-green); width: 16px; text-align: center; }
.spec-list dd { text-align: right; overflow-wrap: anywhere; }
.nearby-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
}
.nearby-list li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 50px;
    background-color: var(--light-green);
    font-size: 0.85rem;
}
.nearby-list i { color: var(--accent-green); font-size: 0.75rem; }
.video-list { display: grid; gap: 12px; }
.video-list iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: 0;
    border-radius: 12px;
    display: block;
}
.detail-side {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.detail-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    line-height: 1.5;
}
.detail-card h1 {
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
/* The kicker is part of the H1, so the heading reads "Condo Rhythm Ekkamai", but keeps its own small line. */
.detail-card h1 .listing-project {
    display: block;
    margin-bottom: 10px;
    font-weight: 300;
    line-height: 1.5;
}
.detail-card .listing-prices { gap: 6px; }
.detail-card .listing-price { font-size: 1.15rem; }
.detail-card-title {
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.not-found { text-align: center; padding: 80px 0; color: var(--text-muted); }

/* About page (/about) and Service page (/service). */
.hero h1 {
    font-size: 3rem;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}
.hero h1 span { color: var(--accent-green); }
.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 40px;
}
.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}
.service-item h2 {
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 12px;
}
.service-item p { color: var(--text-muted); font-size: 0.95rem; }
.howto-intro { margin-bottom: 28px; max-width: 640px; }
.howto-intro h3 { font-size: 1.3rem; font-weight: 400; margin-bottom: 12px; }
.howto-intro p { color: var(--text-muted); font-size: 0.95rem; }
.howto-video { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 12px; background: #12302a; }
.howto-cta { margin-top: 32px; }

@media (max-width: 768px) {
    .site-header { margin-bottom: 80px; }
    .page-property .site-header { margin-bottom: 32px; }
    section { margin-bottom: 100px; }
    .listing-grid { grid-template-columns: 1fr 1fr; }
    .detail { grid-template-columns: minmax(0, 1fr); grid-template-areas: "gallery" "side" "info"; }
    .detail-side { position: static; margin-top: 24px; }
    .hero h1 { font-size: 2.2rem; }
    .services-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 560px) {
    /* Seven menu items do not fit beside the logo on a phone: the menu takes its own row and wraps. */
    .site-header { flex-wrap: wrap; row-gap: 12px; }
    .nav { width: 100%; flex-wrap: wrap; gap: 8px 18px; }
    .listing-grid { grid-template-columns: 1fr; }
    .filter-group { width: 100%; }
    .filter-select { flex: 1; max-width: none; }
    .price-filter { flex: 1; }
    .price-input { flex: 1; width: auto; min-width: 0; }
    .filter-reset { margin-left: 0; }
    .spec-list { grid-template-columns: 1fr; }
}

/* "Made with Nananda" link under the contact card of a public Property page (_lib/growth.php). */
.detail-madeby {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
}
.detail-madeby:hover { color: var(--text-main); text-decoration: underline; }

/* Room history (add-unit-history) on the Property page. */
.room-history-summary { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-weight: 500; }
.room-history-summary i { color: var(--accent-green); }
.room-history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; }
.room-history-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.room-history-list time { min-width: 7.5em; color: var(--text-muted); }
.room-history-price { margin-left: auto; }
.room-history-note { margin: 10px 0 0; font-size: 0.75rem; color: var(--text-muted); }
