/* ==========================================================================
   Airbnb-style listing layout for the room pages
   ========================================================================== */

/* --------------------------------------------------------------------------
   Photo mosaic — one large left, four small right
   -------------------------------------------------------------------------- */

.listing-photos {
    position: relative;
    width: 90%;
    max-width: var(--wrap);
    margin: 0 auto 34px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: repeat(2, 1fr);
    gap: 8px;
    aspect-ratio: 2 / 1;
}

.listing-photos a {
    display: block;
    overflow: hidden;
    background-color: var(--cream-deep);
    position: relative;
}

.listing-photos a:first-child {
    grid-row: span 2;
}

.listing-photos img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease, transform 0.6s ease;
}

.listing-photos a:hover img {
    filter: brightness(0.9);
}

.show-all-photos {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--paper);
    border: 1px solid var(--ink);
    color: var(--ink);
    font-family: var(--body);
    font-size: 0.76rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 11px 18px;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.show-all-photos:hover {
    background: var(--ink);
    color: var(--paper);
}

/* --------------------------------------------------------------------------
   Listing header: title, rating, location
   -------------------------------------------------------------------------- */

.listing-head {
    width: 90%;
    max-width: var(--wrap);
    margin: 0 auto 26px;
}

.listing-head h1 {
    font-family: var(--body);
    font-weight: 400;
    font-size: clamp(1.3rem, 3.2vw, 1.85rem);
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 12px;
}

.listing-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.listing-facts .sep {
    color: var(--rule-strong);
}

.listing-facts .rating {
    color: var(--moss-dark);
    white-space: nowrap;
}

.listing-facts a {
    color: var(--ink-soft);
    text-underline-offset: 4px;
}

/* --------------------------------------------------------------------------
   Two-column listing body
   -------------------------------------------------------------------------- */

.listing-body {
    width: 90%;
    max-width: var(--wrap);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 64px;
    align-items: start;
}

.listing-main > section {
    padding: 30px 0;
    border-bottom: 1px solid var(--rule);
}

.listing-main > section:last-child {
    border-bottom: 0;
}

.listing-main h2 {
    font-family: var(--body);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.92rem;
    font-weight: 400;
    color: var(--ink);
    margin-bottom: 18px;
}

.listing-main p {
    line-height: 1.9;
    margin-bottom: 16px;
}

.listing-main p:last-child {
    margin-bottom: 0;
}

/* Host row */
.host-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
    border-bottom: 1px solid var(--rule);
}

.host-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--moss);
    color: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--display);
    font-size: 1.3rem;
    flex-shrink: 0;
}

.host-row .host-name {
    font-family: var(--body);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--ink);
}

.host-row .host-meta {
    font-size: 0.88rem;
    color: var(--ink-muted);
}

/* Highlights */
.highlights {
    list-style: none;
    display: grid;
    gap: 20px;
}

.highlights li {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.highlights i {
    color: var(--moss);
    font-size: 1.05rem;
    width: 24px;
    text-align: center;
    margin-top: 4px;
    flex-shrink: 0;
}

.highlights strong {
    display: block;
    font-weight: 400;
    color: var(--ink);
    font-size: 0.98rem;
}

.highlights span {
    font-size: 0.9rem;
    color: var(--ink-muted);
    line-height: 1.6;
}

/* Sleeping arrangement cards */
.sleeping {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.sleeping .bed-card {
    border: 1px solid var(--rule);
    padding: 20px;
    background: var(--paper);
}

.sleeping .bed-card i {
    font-size: 1.2rem;
    color: var(--moss);
    display: block;
    margin-bottom: 12px;
}

.sleeping .bed-card strong {
    display: block;
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--ink);
    margin-bottom: 4px;
}

.sleeping .bed-card span {
    font-size: 0.88rem;
    color: var(--ink-muted);
}

/* Amenity preview: two columns, then a button for the rest */
.amenity-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 32px;
    margin-bottom: 26px;
}

.amenity-preview li {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.96rem;
    padding: 5px 0;
}

.amenity-preview i {
    color: var(--moss);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.amenity-preview li.is-absent {
    color: var(--ink-muted);
    text-decoration: line-through;
    text-decoration-color: var(--rule-strong);
}

.amenity-preview li.is-absent i {
    color: var(--rule-strong);
}

/* --------------------------------------------------------------------------
   Booking card
   -------------------------------------------------------------------------- */

.booking-card {
    position: sticky;
    top: 24px;
    background: var(--paper);
    border: 1px solid var(--rule-strong);
    box-shadow: var(--shadow-soft);
    padding: 26px 24px;
}

.bc-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.bc-price {
    font-family: var(--body);
    font-size: 1.05rem;
    color: var(--ink);
}

.bc-price small {
    font-size: 0.82rem;
    color: var(--ink-muted);
}

.bc-rating {
    font-size: 0.86rem;
    color: var(--ink-muted);
    white-space: nowrap;
}

.bc-rating .star {
    color: var(--moss);
}

/* Date + guest fields, drawn as one bordered block like Airbnb's */
.bc-fields {
    border: 1px solid var(--rule-strong);
    margin-bottom: 16px;
}

.bc-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.bc-date {
    background: transparent;
    border: 0;
    border-right: 1px solid var(--rule-strong);
    border-bottom: 1px solid var(--rule-strong);
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    font-family: var(--body);
    width: 100%;
    transition: background-color 0.2s ease;
}

.bc-date:last-child {
    border-right: 0;
}

.bc-date:hover {
    background: var(--cream-soft);
}

.bc-date span {
    display: block;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--ink-muted);
    margin-bottom: 3px;
}

.bc-date strong {
    display: block;
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--ink-muted);
}

.bc-date.is-set strong {
    color: var(--ink);
}

.bc-guests {
    position: relative;
}

.bc-guests span {
    position: absolute;
    top: 10px;
    left: 14px;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--ink-muted);
    pointer-events: none;
}

.bc-guests select {
    width: 100%;
    border: 0;
    background: transparent;
    font-family: var(--body);
    font-size: 0.95rem;
    color: var(--ink);
    padding: 26px 36px 11px 14px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23756c5e' stroke-width='1.5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 11px;
}

.bc-guests select:focus {
    outline: 2px solid var(--moss);
    outline-offset: -2px;
}

/* The calendar folds out inside the card */
.bc-calendar {
    border: 1px solid var(--rule);
    padding: 16px 14px;
    margin-bottom: 16px;
    background: var(--cream-soft);
}

.bc-calendar .calendar-selection,
.bc-calendar .calendar-legend {
    font-size: 0.74rem;
}

.bc-calendar .calendar-months {
    grid-template-columns: 1fr;
}

.bc-submit {
    display: block;
    width: 100%;
    text-align: center;
}

.bc-note {
    text-align: center;
    font-size: 0.82rem;
    color: var(--ink-muted);
    margin-top: 14px;
    line-height: 1.6;
}

.bc-summary {
    text-align: center;
    font-size: 0.88rem;
    color: var(--ink);
    padding: 12px 0 0;
    margin-top: 12px;
    border-top: 1px solid var(--rule);
}

.bc-clear {
    display: block;
    width: 100%;
    background: none;
    border: 0;
    font-family: var(--body);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--ink-muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
    margin-top: 12px;
}

.bc-clear:hover {
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   Reviews with a rating breakdown
   -------------------------------------------------------------------------- */

.rating-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px 44px;
    margin-bottom: 34px;
}

.rating-bar {
    display: grid;
    grid-template-columns: 1fr 90px 32px;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.rating-bar .track {
    height: 4px;
    background: var(--cream-deep);
    position: relative;
}

.rating-bar .track i {
    position: absolute;
    inset: 0 auto 0 0;
    background: var(--moss);
}

.rating-bar .score {
    text-align: right;
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {
    .listing-body {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* Booking comes first on a small screen — nobody should have to scroll
       past the whole description to find the date picker. */
    .listing-body > aside {
        order: -1;
    }

    .booking-card {
        position: static;
        margin-bottom: 30px;
    }
}

@media (max-width: 700px) {
    /* Mosaic collapses to a single lead photo plus the button */
    .listing-photos {
        width: 100%;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        aspect-ratio: 4 / 3;
        gap: 0;
        margin-bottom: 22px;
    }

    .listing-photos a:not(:first-child) {
        display: none;
    }

    .listing-photos a:first-child {
        grid-row: span 1;
    }

    .show-all-photos {
        right: 12px;
        bottom: 12px;
        font-size: 0.72rem;
        padding: 10px 14px;
    }

    .listing-head,
    .listing-body {
        width: 88%;
    }

    .amenity-preview {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .rating-bar {
        grid-template-columns: 1fr 70px 30px;
    }
}

/* --------------------------------------------------------------------------
   Modal (full amenities list)
   -------------------------------------------------------------------------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 180;
    background: rgba(20, 18, 15, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.modal[hidden] {
    display: none;
}

body.modal-open {
    overflow: hidden;
}

.modal-panel {
    background: var(--paper);
    border: 1px solid var(--rule-strong);
    max-width: 760px;
    width: 100%;
    max-height: 86vh;
    overflow-y: auto;
    padding: 34px 36px 40px;
    position: relative;
}

.modal-panel h2 {
    font-family: var(--body);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--ink);
    margin-bottom: 26px;
    padding-right: 44px;
}

.modal-close {
    position: absolute;
    top: 22px;
    right: 24px;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid var(--rule-strong);
    color: var(--ink);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.modal-close:hover {
    background: var(--ink);
    color: var(--paper);
}

/* The trigger only appears once JS can open the modal */
[data-modal-open][hidden] {
    display: none;
}

.link-button {
    background: none;
    border: 0;
    border-bottom: 1px solid var(--ink);
    padding: 0 0 3px;
    font-family: var(--body);
    font-size: 0.88rem;
    letter-spacing: 1px;
    color: var(--ink);
    cursor: pointer;
}

.link-button:hover {
    color: var(--moss-dark);
    border-bottom-color: var(--moss-dark);
}

@media (max-width: 700px) {
    .modal {
        padding: 0;
    }

    .modal-panel {
        max-height: 100vh;
        height: 100%;
        padding: 30px 22px 40px;
    }
}
