.property-detail {
    color: var(--color-text);
    background: #fff;
}

.property-shell {
    width: min(1320px, calc(100% - 48px));
    margin-inline: auto;
}

.property-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-block: 24px 18px;
    font-size: 0.875rem;
    color: #595959;
}

.property-breadcrumb a { color: #222; }
.property-reference { margin-left: auto; }
.property-gallery { scroll-margin-top: 110px; }

.property-photo-strip {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 8px;
    height: clamp(320px, 38vw, 550px);
    overflow: hidden;
    border-radius: 10px;
    background: #f2f2f0;
}

.property-photo {
    position: relative;
    display: block;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #f2f2f0;
}

.property-photo:first-child { grid-row: 1 / -1; }
.property-photo:first-child:last-child { grid-column: 1 / -1; }
.property-photo:nth-child(2):last-child { grid-row: 1 / -1; }
.property-photo:nth-child(n+4) { display: none; }
.property-photo picture { display: contents; }
.property-photo img { position: absolute; left: 50%; top: 50%; width: var(--photo-width, 100%); height: var(--photo-height, 100%); max-width: none; object-fit: cover; transform: translate(-50%, -50%); }
.property-photo:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }

/* The ordinary View all link expands every photo without JavaScript. */
.property-gallery:target .property-photo-strip {
    height: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
}
.property-gallery:target .property-photo { display: block; grid-area: auto; aspect-ratio: 3 / 2; }

.property-gallery-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-block: 12px;
    color: #595959;
    font-size: 0.875rem;
}
.property-gallery-open { padding: 10px 16px; border: 1px solid #d8d8d5; border-radius: 6px; color: #111; font-weight: 650; }
.property-gallery-open:hover { background: #f5f5f3; }
.property-no-photos { display: grid; place-content: center; text-align: center; min-height: 260px; border-radius: 10px; background: #f5f5f3; color: #666; }
.property-no-photos > span { font-size: 3rem; }
.property-no-photos p { margin: 0; font-size: 1rem; }
.property-demo-notice { margin: 0 0 12px; padding: 12px 16px; border: 1px solid #b00020; color: #8b0000; font-weight: 700; }
.property-photo-demo { position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; background: #8b0000; color: #fff; font-size: 0.8rem; }

.property-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-rows: auto 1fr;
    gap: 0 56px;
    margin-top: 26px;
}
.property-summary { grid-column: 1; padding-bottom: 28px; }
.property-summary .property-status { margin: 0 0 10px; color: #62625d; font-size: 0.8rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.property-summary .property-price { margin: 0 0 12px; font-size: clamp(1.9rem, 3vw, 2.65rem); line-height: 1.15; font-weight: 750; }
.property-summary h1 { margin: 0 0 10px; font-size: clamp(1.35rem, 2.2vw, 1.9rem); line-height: 1.3; letter-spacing: -0.02em; }
.property-summary .property-location { margin: 0; color: #62625d; font-size: 1rem; }
.property-facts { display: flex; flex-wrap: wrap; gap: 22px 32px; margin: 26px 0 0; padding-top: 22px; border-top: 1px solid #e6e6e3; }
.property-facts > div { display: flex; flex-direction: column-reverse; gap: 3px; }
.property-facts dt { color: #62625d; font-size: 0.8rem; }
.property-facts dd { margin: 0; font-size: 1.2rem; font-weight: 650; }
.property-contact { grid-column: 2; grid-row: 1 / 3; position: sticky; top: 112px; align-self: start; padding: 26px; border: 1px solid #e1e1dd; border-radius: 10px; box-shadow: 0 5px 22px rgb(0 0 0 / 4%); }
.property-contact h2 { margin: 0 0 22px; font-size: 1.2rem; line-height: 1.35; }
.property-agent { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.property-agent img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.property-agent p { margin: 0; color: #62625d; }
.property-agent .property-agent-name { font-size: 1.05rem; font-weight: 700; color: #111; }
.property-contact > p { color: #62625d; line-height: 1.6; }
.property-action { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 46px; padding: 12px 14px; border: 1px solid #d8d8d5; border-radius: 6px; color: #111; background: #fff; text-align: center; font-size: 0.875rem; font-weight: 650; line-height: 1.4; }
.property-contact .property-action + .property-action { margin-top: 10px; }
.property-action:hover { background: #f2f2ef; }
.property-action-primary { border-color: #111; background: #111; color: #fff; }
.property-action-primary:hover { background: #333; color: #fff; }
.property-contact .property-contact-reference { margin: 18px 0 0; font-size: 0.75rem; text-align: center; }
.property-information { grid-column: 1; min-width: 0; }
.property-information > section { padding-block: 28px; border-top: 1px solid #e6e6e3; }
.property-information h2, .property-related h2 { margin: 0 0 20px; font-size: 1.4rem; line-height: 1.35; }
.property-description { line-height: 1.8; overflow-wrap: anywhere; }
.property-description p, .property-description li { font-size: 1rem; line-height: 1.8; color: #41413e; }
.property-description .property-intro { font-weight: 600; }
.property-description .rich-text { color: #41413e; }
.property-features ul { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.property-features li { padding: 7px 14px; border-radius: 5px; background: #f5f5f3; font-size: 0.9rem; }
.property-overview dl { margin: 0; }
.property-overview dl > div { display: grid; grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr); gap: 20px; padding-block: 11px; border-bottom: 1px solid #efefec; font-size: 0.95rem; }
.property-overview dt { color: #62625d; }
.property-overview dd { margin: 0; overflow-wrap: anywhere; }
.property-related { padding-block: 36px 64px; border-top: 1px solid #e6e6e3; margin-top: 30px; }
.property-mobile-contact { display: none; }

.property-viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #fafaf8; color: #111; }
.property-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; }
.property-viewer::backdrop { background: rgb(0 0 0 / 70%); }
.property-viewer-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 24px; border-bottom: 1px solid #e1e1dd; }
.property-viewer-title { margin: 0; font-size: 1rem; font-weight: 600; }
.property-viewer button { font: inherit; cursor: pointer; }
.property-viewer-close { min-height: 44px; padding: 8px 16px; border: 1px solid #d8d8d5; border-radius: 6px; background: #fff; }
.property-viewer-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 16px 72px; touch-action: pan-y pinch-zoom; }
.property-viewer-frame { position: relative; width: 100%; height: 100%; min-height: 0; overflow: hidden; }
.property-viewer-image { position: absolute; max-width: none; }
.property-viewer-frame[hidden] { display: none; }
.property-viewer-image[hidden], .property-viewer-error[hidden] { display: none; }
.property-viewer-error { text-align: center; padding: 24px; }
.property-viewer-prev, .property-viewer-next { position: absolute; top: calc(50% - 24px); width: 48px; height: 48px; border: 1px solid #d8d8d5; border-radius: 50%; background: #fff; color: #111; font-size: 1.8rem !important; }
.property-viewer-prev { left: 12px; }
.property-viewer-next { right: 12px; }
.property-viewer button:disabled { visibility: hidden; }
.property-viewer-caption { text-align: center; margin: 0; padding: 8px 24px; font-size: 0.875rem; }
.property-viewer-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 24px 18px; }
.property-viewer-thumb { flex: 0 0 88px; padding: 3px; border: 2px solid transparent; border-radius: 5px; background: transparent; }
.property-viewer-thumb span { position: relative; display: block; height: 56px; overflow: hidden; border-radius: 2px; }
.property-viewer-thumb img { position: absolute; left: 50%; top: 50%; width: var(--photo-width, 100%); height: var(--photo-height, 100%); max-width: none; object-fit: cover; transform: translate(-50%, -50%); }
.property-viewer-thumb[aria-current="true"] { border-color: #111; }
.property-viewer-open { overflow: hidden; }
.property-detail :focus-visible, .property-viewer :focus-visible { outline: 3px solid #91661f; outline-offset: 3px; }
.property-detail .property-photo:focus-visible { outline: 3px solid #fff; outline-offset: -6px; box-shadow: inset 0 0 0 8px #111; }

@media (max-width: 1000px) {
    .property-body { grid-template-columns: minmax(0, 1fr) 300px; column-gap: 28px; }
    .property-contact { padding: 20px; }
}

@media (max-width: 700px) {
    .property-shell { width: calc(100% - 32px); }
    .property-breadcrumb { gap: 8px; padding-block: 18px 14px; font-size: 0.8rem; }
    .property-reference { display: none; }
    .property-photo-strip, .property-gallery:target .property-photo-strip { display: flex; height: auto; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 6px; }
    .property-photo-strip::-webkit-scrollbar { display: none; }
    .property-photo, .property-photo:nth-child(n+4), .property-gallery:target .property-photo { display: block; flex: 0 0 100%; aspect-ratio: 4 / 3; scroll-snap-align: start; scroll-snap-stop: always; }
    .property-gallery-bar { gap: 8px; font-size: 0.8rem; }
    .property-gallery-open { padding: 10px 12px; }
    .property-body { display: flex; flex-direction: column; margin-top: 16px; }
    .property-summary { padding-bottom: 22px; }
    .property-facts { column-gap: 24px; row-gap: 16px; margin-top: 20px; padding-top: 18px; }
    .property-contact { position: static; width: 100%; margin-bottom: 28px; }
    .property-information > section { padding-block: 24px; }
    .property-related { padding-bottom: 32px; }
    .property-mobile-contact { display: flex; position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #e1e1dd; box-shadow: 0 -3px 16px rgb(0 0 0 / 5%); }
    .property-mobile-contact > span { font-size: 1rem; font-weight: 700; }
    .property-mobile-contact .property-action { min-width: 120px; }
    .template-listing-detail { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
    .property-viewer-header { padding: 10px 16px; }
    .property-viewer-stage { padding: 8px 0; }
    .property-viewer-prev, .property-viewer-next { width: 40px; height: 40px; background: rgb(255 255 255 / 92%); }
    .property-viewer-prev { left: 6px; }
    .property-viewer-next { right: 6px; }
    .property-viewer-thumbs { padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); }
    .property-viewer-caption { padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .property-photo-strip { scroll-behavior: auto; }
}
