/*
 * Property detail page.
 *
 * Scoped to this one screen and loaded through the layout's `styles` stack, so
 * nothing here can reach the rest of the front site. Every rule is prefixed
 * `psx-` for the same reason — `styles.css` is 391KB of generic class names and
 * a plain `.gallery` or `.meta` would collide with it.
 */

:root {
    --psx-accent: #05af78;
    --psx-accent-soft: rgba(5, 175, 120, .1);
    --psx-ink: #1d2a3b;
    --psx-muted: #6b7490;
    --psx-line: #e7ebf1;
    --psx-surface: #fff;
    --psx-radius: 14px;
    --psx-shadow: 0 2px 14px rgba(29, 42, 59, .07);
}

/* ---------------------------------------------------------------- breadcrumb */

.psx-crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    padding: 1rem 0 .25rem;
    font-size: .85rem;
    color: var(--psx-muted);
}

.psx-crumbs a {
    color: var(--psx-muted);
    text-decoration: none;
}

.psx-crumbs a:hover {
    color: var(--psx-accent);
}

.psx-crumbs__sep {
    opacity: .5;
}

.psx-crumbs__current {
    color: var(--psx-ink);
    font-weight: 500;
    /* A long title must not push the row onto a second line. */
    max-width: 22rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ------------------------------------------------------------------- gallery */

/*
 * One large image with three stacked beside it. A grid rather than two floated
 * columns, so the right-hand column always matches the height of the left and
 * the tiles keep their proportions whatever the source images are.
 */
.psx-gallery {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(3, 1fr);
    gap: .6rem;
    height: 27rem;
}

.psx-gallery__tile {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--psx-radius);
    background: #eef1f5;
}

.psx-gallery__tile:first-child {
    grid-row: span 3;
}

.psx-gallery__tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.psx-gallery__tile:hover img {
    transform: scale(1.04);
}

/* A single tile keeps the whole strip rather than leaving a gap beside it. */
.psx-gallery--single {
    grid-template-columns: 1fr;
}

.psx-gallery__count,
.psx-gallery__more {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    backdrop-filter: blur(4px);
}

.psx-gallery__count {
    left: .8rem;
    bottom: .8rem;
    padding: .35rem .7rem;
    border-radius: 999px;
    background: rgba(29, 42, 59, .65);
    color: #fff;
    font-size: .8rem;
    font-weight: 500;
    pointer-events: none;
}

/* The overlay covers the last visible tile, so the count it shows is the
   number of images the visitor cannot see yet — this tile included. */
.psx-gallery__more {
    inset: 0;
    justify-content: center;
    background: rgba(29, 42, 59, .58);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 600;
}

.psx-gallery__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    height: 100%;
    color: var(--psx-muted);
    background: #f4f6f9;
    border-radius: var(--psx-radius);
}

.psx-gallery__empty i {
    font-size: 2rem;
    opacity: .45;
}

/* --------------------------------------------------------------------- cards */

.psx-card {
    background: var(--psx-surface);
    border: 1px solid var(--psx-line);
    border-radius: var(--psx-radius);
    box-shadow: var(--psx-shadow);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.psx-card__head {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--psx-line);
}

.psx-card__head i {
    color: var(--psx-accent);
}

.psx-card__head h2,
.psx-card__head h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--psx-ink);
}

.psx-card__body {
    padding: 1.25rem;
}

/* -------------------------------------------------------------------- header */

.psx-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.psx-head__title {
    margin: 0 0 .4rem;
    font-size: 1.55rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--psx-ink);
}

.psx-head__address {
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    color: var(--psx-muted);
    font-size: .95rem;
}

.psx-head__address i {
    margin-top: .2rem;
    color: var(--psx-accent);
}

/* chips: id, published date, view count */
.psx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .85rem;
    padding: 0;
    list-style: none;
}

.psx-chips li {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: #f3f5f8;
    color: var(--psx-muted);
    font-size: .8rem;
    white-space: nowrap;
}

.psx-chips li i {
    font-size: .85rem;
}

.psx-chips .psx-chip--accent {
    background: var(--psx-accent-soft);
    color: var(--psx-accent);
    font-weight: 600;
}

/* ------------------------------------------------------------------- actions */

.psx-actions {
    display: flex;
    gap: .4rem;
}

.psx-actions button {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .8rem;
    border: 1px solid var(--psx-line);
    border-radius: 999px;
    background: #fff;
    color: var(--psx-muted);
    font-size: .85rem;
    line-height: 1;
    cursor: pointer;
    transition: color .2s, border-color .2s;
}

.psx-actions button:hover {
    color: var(--psx-accent);
    border-color: var(--psx-accent);
}

.psx-actions button.is-done {
    color: var(--psx-accent);
    border-color: var(--psx-accent);
}

/* --------------------------------------------------------------------- price */

.psx-price {
    text-align: right;
}

.psx-price__value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--psx-accent);
}

.psx-price__unit {
    margin-top: .2rem;
    color: var(--psx-muted);
    font-size: .9rem;
}

/* --------------------------------------------------------------------- agent */

.psx-agent__top {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.psx-agent__avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--psx-accent-soft);
}

.psx-agent__name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--psx-ink);
}

.psx-agent__role {
    color: var(--psx-muted);
    font-size: .82rem;
}

.psx-agent__actions {
    display: grid;
    gap: .5rem;
    margin-top: 1rem;
}

.psx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .7rem 1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity .2s;
}

.psx-btn:hover {
    opacity: .9;
    text-decoration: none;
}

.psx-btn--primary {
    background: var(--psx-accent);
    color: #fff;
}

.psx-btn--primary:hover {
    color: #fff;
}

.psx-btn--wa {
    background: #25d366;
    color: #fff;
}

.psx-btn--wa:hover {
    color: #fff;
}

.psx-btn--ghost {
    border-color: var(--psx-line);
    background: #fff;
    color: var(--psx-ink);
}

.psx-btn--ghost:hover {
    color: var(--psx-accent);
    border-color: var(--psx-accent);
}

/* ------------------------------------------------------------------- sidebar */

.psx-sticky {
    position: sticky;
    top: 1.5rem;
}

/* ------------------------------------------------- mobile call bar (phone only) */

/*
 * The agent card sits below a long page on a phone, so the price and the call
 * button follow the visitor down instead.
 */
.psx-callbar {
    display: none;
}

@media (max-width: 991.98px) {
    .psx-callbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: .7rem 1rem;
        padding-bottom: calc(.7rem + env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid var(--psx-line);
        box-shadow: 0 -3px 16px rgba(29, 42, 59, .1);
    }

    .psx-callbar__price {
        font-size: 1.15rem;
        font-weight: 700;
        color: var(--psx-accent);
        line-height: 1.15;
    }

    .psx-callbar__label {
        display: block;
        color: var(--psx-muted);
        font-size: .72rem;
        font-weight: 400;
    }

    /* Clears the fixed bar so the last card is never trapped behind it. */
    .psx-page-pad {
        padding-bottom: 5.5rem;
    }
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 1199.98px) {
    .psx-gallery {
        height: 21rem;
    }
}

@media (max-width: 767.98px) {
    .psx-head__title {
        font-size: 1.25rem;
    }

    .psx-price {
        text-align: left;
    }

    .psx-crumbs__current {
        max-width: 12rem;
    }
}

/* ------------------------------------------------------------- quick facts */

/*
 * The theme's `_prtis_list_header` row is built for exactly three items and
 * wraps badly on the fourth, so the facts strip lays itself out here instead.
 */
.psx-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.psx-facts li {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.psx-facts__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    border-radius: 10px;
    background: var(--psx-accent-soft);
    color: var(--psx-accent);
}

.psx-facts__icon img {
    width: 1.1rem;
    height: 1.1rem;
}

.psx-facts__value {
    display: block;
    font-weight: 600;
    color: var(--psx-ink);
    line-height: 1.2;
}

.psx-facts__label {
    display: block;
    font-size: .8rem;
    color: var(--psx-muted);
}

/* ------------------------------------------------------------------- specs */

.psx-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.psx-specs li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: .6rem 0;
    border-bottom: 1px dashed var(--psx-line);
    color: var(--psx-ink);
}

.psx-specs li strong {
    font-weight: 400;
    color: var(--psx-muted);
}

/* --------------------------------------------------------------------- map */

.psx-map__address {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin: 0 0 .9rem;
    color: var(--psx-muted);
    font-size: .9rem;
    line-height: 1.45;
}

.psx-map__address i {
    margin-top: .15rem;
    color: var(--psx-accent);
}

/*
 * The frame keeps its own aspect so the card does not jump while the tiles
 * load, and clips the iframe to the card's corner radius.
 */
.psx-map {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--psx-line);
    border-radius: calc(var(--psx-radius) - 4px);
    background: #eef1f5;
}

.psx-map iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.psx-map__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .9rem;
}

/* Tall, narrow phones get a squarer map; 16/9 leaves it too short to read. */
@media (max-width: 575.98px) {
    .psx-map {
        aspect-ratio: 4 / 3;
    }
}
