/* width + border-box: see .location-page in locations/location.css - same flex-item sizing. */
.property-page {
    width: 100%;
    box-sizing: border-box;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px var(--primary-margin-bottom);
}

/* A desktop's first screen: the header, the photos, and the bar with the dates and the button at
   its foot. The photos used to fill the whole window, which left the button just below it with
   nothing to say it was there (2026-10-11). 75px is the bar's height on one line; the photos give
   up that much, and never grow past their own 3:2 shape (main/style.css). Below 993px the bar is
   a card under a short photo and already on the first screen. */
@media (min-width: 993px) {
    .property-first-screen {
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 75px);
    }

    .property-first-screen header {
        flex-shrink: 0;
    }

    .property-first-screen .container.top.hero {
        flex: 0 1 auto;
        min-height: 320px;
    }

    /* Once scrolled to, the bar stays at the top of the window for the rest of the page: the
       price and the button when dates are chosen, the search fields when the page was opened
       without any. */
    .toolbar-sticky-bar.pinned {
        position: sticky;
        top: 0;
        z-index: 900;
    }
}

/* A phone's bar is a 190px card: too much of the screen to keep there. It scrolls away as before,
   and this strip comes up from the foot of the screen in its place (book_bar.js). */
.property-book-strip {
    display: none;
}

@media (max-width: 992px) {
    .property-book-strip {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        box-sizing: border-box;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        border-top: 1px solid #e6eaee;
        box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.14);
        visibility: hidden;
        transform: translateY(100%);
        transition: transform 0.2s ease-out, visibility 0.2s;
    }

    .property-book-strip.visible {
        visibility: visible;
        transform: none;
    }

    .property-book-strip-price {
        display: flex;
        flex-direction: column;
        line-height: 1.15;
        white-space: nowrap;
    }

    .property-book-strip-price.stale {
        display: none;
    }

    .property-book-strip-amount {
        font-family: var(--primary-font);
        font-size: 1.4rem;
        color: var(--primary-color);
    }

    .property-book-strip-label {
        font-family: var(--secondary-font);
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--secondary-color);
    }

    .property-book-strip-button {
        flex: 1 1 auto;
        max-width: 320px;
        height: 48px;
        margin-left: auto;
        border: none;
        border-radius: 10px;
        background: var(--primary-color);
        color: #fff;
        font-size: 1rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        cursor: pointer;
    }

    /* No price beside it (no dates yet, or dates not on sale): the button takes the whole strip. */
    .property-book-strip-button:only-child {
        max-width: none;
    }

    .property-book-strip-button:active {
        background: var(--primary-color-dark);
    }

    /* Room for the strip over the last lines of the footer. */
    .property-book-strip ~ .site-footer {
        padding-bottom: 92px;
    }
}

.property-back-to-search {
    display: block;
    max-width: 1200px;
    margin: 24px auto 0;
    padding: 0 20px;
    color: var(--primary-color);
    font-family: var(--secondary-font);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.property-back-to-search:hover {
    text-decoration: underline;
}

.property-page h1 {
    margin-bottom: 48px;
}

/* The same size as a complex's page on a phone (locations/location.css): the global 51.2px left a long apartment title oversized. */
@media (max-width: 768px) {
    .property-page h1 {
        font-size: clamp(2rem, 9vw, 3.2em);
        line-height: 1.15;
    }
}

.property-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    margin: 0 auto 56px;
    padding: 16px 0;
    border-top: 1px solid #ebebeb;
    border-bottom: 1px solid #ebebeb;
}

.property-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 28px;
}

.property-stat:not(:last-child) {
    border-right: 1px solid #ebebeb;
}

.property-stat-value {
    font-family: var(--primary-font);
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--primary-color);
    line-height: 1;
}

.property-stat-unit {
    font-size: 0.5em;
}

.property-stat-label {
    margin-top: 6px;
    font-family: var(--secondary-font);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--secondary-color);
    white-space: nowrap;
}

/* Five in a row (with Size) is 720px wide with the full 28px gaps, and 600px with 16px ones (measured
   in Firefox, 4 November 2026), plus the page's 20px margins. So the gaps tighten below 780px, and
   below 640px the stats go two by two, a fifth centred on its own line. */
@media (max-width: 780px) {
    .property-stat {
        padding: 0 16px;
    }
}

@media (max-width: 640px) {
    .property-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        width: auto;
        margin-left: 20px;
        margin-right: 20px;
        gap: 20px 0;
    }

    .property-stat {
        padding: 0;
        border-right: none !important;
    }

    .property-stat:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

.property-blurb {
    max-width: 720px;
    margin: 0 auto 80px;
    text-align: center;
    line-height: 1.7;
    font-size: 1em;
    color: rgb(80, 80, 80);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* "About the apartment" (properties/about.py): running prose, so set left, unlike the centred
   blurb above it. */
.property-about {
    max-width: 720px;
    margin: 0 auto 50px;
    line-height: 1.7;
    color: rgb(80, 80, 80);
}

.property-about h2 {
    margin: 0 0 20px;
    text-align: center;
}

.property-about p {
    margin: 0 0 14px;
}

.property-features {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    justify-items: center;
    gap: 40px 48px;
    max-width: 800px;
    margin: 0 auto 40px;
}

.property-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.property-feature-icon {
    width: 42px;
    height: 42px;
}

.property-feature-label {
    font-family: var(--secondary-font);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--secondary-color);
    text-align: center;
}

@media (max-width: 768px) {
    .property-features {
        grid-template-columns: repeat(4, 1fr);
        gap: 28px 24px;
    }

    .property-feature-icon {
        width: 36px;
        height: 36px;
    }

    .property-feature-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    /* minmax(0, 1fr), not 1fr: a plain 1fr column can't be narrower than its longest word, so one
       long label widened its column and pushed the third column off a 320px screen (2026-10-04).
       Three equal columns that always fit instead. */
    .property-features {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px 16px;
    }
}

/* Past two rows on a desktop (ten), two on a tablet (eight) and three on a phone (nine), the
   tiles wait behind "Show all" (property_page.js adds .collapsed; 19 November 2026). */
.property-features.collapsed .property-feature:nth-child(n+11) {
    display: none;
}

@media (max-width: 768px) {
    .property-features.collapsed .property-feature:nth-child(n+9) {
        display: none;
    }
}

@media (max-width: 480px) {
    .property-features.collapsed .property-feature:nth-child(n+9) {
        display: flex;
    }

    .property-features.collapsed .property-feature:nth-child(n+10) {
        display: none;
    }
}

.property-features-more {
    margin: -8px 0 40px;
    text-align: center;
}

.property-features-more button {
    border: none;
    background: none;
    padding: 4px 0;
    font-family: var(--secondary-font);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: underline;
    color: var(--secondary-color);
    cursor: pointer;
}

/* How far the beach and the town are (properties/where.py), between the price and the blurb:
   centred like both, the pin leading its first line. */
.property-where-line {
    max-width: 640px;
    margin: 0 auto 40px;
    text-align: center;
    text-wrap: balance;
    font-family: var(--secondary-font);
    font-size: 1rem;
    line-height: 1.6;
    color: rgb(80, 80, 80);
}

.property-where-line-icon {
    width: 20px;
    height: 20px;
    margin-right: 6px;
    vertical-align: -4px;
}

@media (max-width: 640px) {
    .property-where-line {
        margin-left: 20px;
        margin-right: 20px;
    }
}

.property-intro-divider {
    width: 60px;
    height: 3px;
    margin: 0 auto 50px;
    background: var(--secondary-color-soft-dark, #f2d48a);
}

/* "From €93 a night", under the apartment's figures, and the link down to the table. */
.property-from-price {
    margin: -24px 0 48px;
    text-align: center;
    font-family: var(--secondary-font);
    font-size: 1rem;
    color: rgb(80, 80, 80);
}

.property-from-price .price-value {
    font-family: var(--primary-font);
    font-size: 1.5rem;
    color: var(--primary-color);
}

.property-from-price a {
    margin-left: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--secondary-color);
}

/* What a week costs, month by month (properties/utils.py::monthly_from_prices). The top margin
   the link above scrolls to leaves room for the bar a desktop keeps at the top of the window. */
.property-prices {
    max-width: 560px;
    margin: 0 auto 50px;
    text-align: center;
    scroll-margin-top: 100px;
}

/* The same room above the calendar, for the search's "more dates on its calendar" link. */
.property-calendar {
    scroll-margin-top: 100px;
}

.property-calendar h2 {
    margin: 0 0 20px;
    text-align: center;
}

.property-calendar .availability-calendar-legend {
    margin-bottom: 28px;
}

.property-prices h2 {
    margin: 0 0 20px;
}

.property-prices-table {
    width: 100%;
    margin: 24px 0 20px;
    border-collapse: collapse;
    font-family: var(--secondary-font);
    color: rgb(80, 80, 80);
}

.property-prices-table th,
.property-prices-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #ebebeb;
    text-align: right;
    white-space: nowrap;
}

.property-prices-table th:first-child {
    text-align: left;
}

.property-prices-table thead th {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--secondary-color);
}

.property-prices-table tbody th {
    font-weight: 600;
}

.property-prices-table .price-value {
    font-family: var(--primary-font);
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* The minimum stay sits back beside the prices it goes with. */
.property-prices-table .property-prices-minimum {
    font-size: 0.9rem;
    color: #777;
}

/* On a phone the headings and a run of months ("Nov 2026 - Mar 2027") take two lines, so the
   four columns fit the screen. Up to 600px (2026-11-03): between 481 and 600 the table, 560px at
   most, ran past the screen's edge in every language, by 170px in French ("Par semaine à partir de"). */
@media (max-width: 600px) {
    .property-prices-table th,
    .property-prices-table td {
        padding: 12px 6px;
    }

    .property-prices-table thead th,
    .property-prices-table tbody th {
        white-space: normal;
    }
}

.property-prices-note {
    margin: 0 0 8px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #777;
}

/* Rental licence (AL) number - a legal display requirement for a holiday-let listing in Portugal.
   Sits just under the title, pulled up into the title's own bottom margin. */
.property-licence {
    margin: -36px 0 40px;
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    letter-spacing: 0.02em;
}

/* Where the apartment is: the address, how to find the complex and where to park beside a map,
   under the calendar. The text is the complex's own (Staff > Locations). */
.property-where,
.property-siblings {
    margin-top: 70px;
}

.property-where h2,
.property-siblings h2 {
    margin: 0 0 28px;
}

.property-where-columns {
    display: flex;
    align-items: stretch;
    gap: 40px;
}

.property-where-text {
    flex: 1 1 45%;
    text-align: left;
}

.property-where-text p {
    margin: 0 0 14px;
    line-height: 1.75;
    font-family: var(--primary-font);
    color: rgb(80, 80, 80);
}

.property-where-text h3 {
    margin: 22px 0 8px;
    text-align: left;
    font-family: var(--tertiary-font);
    font-size: 1.05rem;
}

.property-where-text a,
.property-where-map-link,
.property-siblings-all a {
    color: var(--primary-color);
    font-family: var(--secondary-font);
    font-weight: 600;
    text-decoration: none;
}

.property-where-text a:hover,
.property-where-map-link:hover,
.property-siblings-all a:hover {
    text-decoration: underline;
}

.property-where-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-top: 22px;
    font-size: 0.95rem;
}

.property-where-map {
    flex: 1 1 55%;
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.property-where-map .place-map {
    flex: 1;
    height: auto;
    border-radius: 12px;
    overflow: hidden;
}

.property-where-map-link {
    margin-top: 10px;
    text-align: left;
    font-size: 0.9rem;
}

.property-siblings-all {
    margin: 36px 0 0;
    text-align: center;
}

@media (max-width: 900px) {
    .property-where-columns {
        flex-direction: column;
        gap: 24px;
    }
}

/* Neighbours from the same complex: the town and the street are the page's own, so the cards leave
   them out. On a phone they are a row to swipe through, one screen high, not four cards one under
   the other (about 2,700px; 19 November 2026, per Thomas). */
.property-siblings .card-tag,
.property-siblings .card-address {
    display: none;
}

@media (max-width: 680px) {
    /* nowrap and flex-start: .container (main/style.css) wraps and centres its children. */
    .property-siblings .container.cards.results {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: stretch;
        gap: 16px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        margin: 0 -20px;
        padding: 4px 20px 24px;
        width: auto;
        scroll-padding: 0 20px;
    }

    .property-siblings .container.cards.results .card {
        flex: 0 0 82%;
        scroll-snap-align: start;
    }

    .property-siblings .container.cards.results .card:hover {
        transform: none;
    }
}
