/* Hostaway Listings Filter - frontend styles */

.half-wrap { font-family: inherit; }

.half-title {
    font-size: 28px;
    margin: 0 0 20px;
    color: #1a1a1a;
}

.half-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    padding: 20px;
    background: #f7f7f7;
    border-radius: 8px;
    margin-bottom: 24px;
    align-items: end;
}

.half-field { display: flex; flex-direction: column; }
.half-field label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}
.half-field select,
.half-field input[type="text"],
.half-field input[type="number"] {
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}
.half-field--price .half-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.half-field--price input[type="range"] { flex: 1; }
.half-price-value {
    font-size: 14px;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

.half-field--actions { justify-self: end; }
.half-reset {
    padding: 10px 18px;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background .15s;
}
.half-reset:hover { background: #efefef; }

.half-results-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.half-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(var(--half-cols, 3), 1fr);
}
.half-grid[data-cols="1"] { --half-cols: 1; }
.half-grid[data-cols="2"] { --half-cols: 2; }
.half-grid[data-cols="3"] { --half-cols: 3; }
.half-grid[data-cols="4"] { --half-cols: 4; }

@media (max-width: 900px) {
    .half-grid { --half-cols: 2 !important; }
}
@media (max-width: 600px) {
    .half-grid { --half-cols: 1 !important; }
    .half-filters { grid-template-columns: 1fr 1fr; }
}

.half-card {
    position: relative;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.half-card--linked { cursor: pointer; }
.half-card__link {
    position: absolute;
    inset: 0;
    z-index: 2;
    text-indent: -9999px;
    overflow: hidden;
}
.half-card--linked:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.14);
}
.half-card:hover:not(.half-card--linked) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.half-card__image {
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    background-color: #eee;
}
.half-card__image--empty { background: linear-gradient(135deg, #eee, #ddd); }

.half-card__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.half-card__title {
    margin: 0 0 6px;
    font-size: 17px;
    line-height: 1.3;
    color: #1a1a1a;
}
.half-card__location {
    margin: 0 0 12px;
    font-size: 13px;
    color: #777;
}
.half-card__meta {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #555;
}
.half-card__meta li {
    padding: 3px 8px;
    background: #f0f0f0;
    border-radius: 4px;
}
.half-card__footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.half-card__price {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 17px;
}
.half-card__price small {
    font-weight: 400;
    color: #777;
    font-size: 12px;
}
.half-card__btn {
    padding: 8px 16px;
    background: #1a1a1a;
    color: #fff !important;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.half-card__btn:hover { background: #333; }

.half-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
}
.half-pagination button {
    padding: 8px 14px;
    border: 1px solid #d0d0d0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.half-pagination button:hover:not(:disabled) { background: #f0f0f0; }
.half-pagination button[aria-current="true"] {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}
.half-pagination button:disabled { opacity: .4; cursor: not-allowed; }

.half-empty, .half-error {
    padding: 40px 20px;
    text-align: center;
    background: #f7f7f7;
    border-radius: 8px;
    color: #666;
}
.half-error { background: #ffe5e5; color: #b00020; }

.half-loading { opacity: .5; pointer-events: none; transition: opacity .15s; }

/* ---- Single listing page ---- */
.half-single { max-width: 1100px; margin: 0 auto; padding: 20px; }
.half-single__back {
    display: inline-block;
    margin-bottom: 16px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
}
.half-single__back:hover { color: #1a1a1a; }
.half-single__title {
    font-size: 32px;
    margin: 0 0 8px;
    color: #1a1a1a;
    line-height: 1.2;
}
.half-single__location {
    margin: 0 0 16px;
    color: #777;
    font-size: 16px;
}
.half-single__meta {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 15px;
    color: #444;
}
.half-single__meta strong { color: #1a1a1a; }

.half-single__gallery {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    margin-bottom: 32px;
    border-radius: 12px;
    overflow: hidden;
}
.half-single__gallery-item {
    overflow: hidden;
    background: #eee;
    aspect-ratio: 4 / 3;
}
.half-single__gallery-item--main {
    grid-row: 1 / 3;
    grid-column: 1;
    aspect-ratio: auto;
}
.half-single__gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@media (max-width: 700px) {
    .half-single__gallery {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        aspect-ratio: auto;
    }
    .half-single__gallery-item:not(.half-single__gallery-item--main) { display: none; }
    .half-single__gallery-item--main { aspect-ratio: 4 / 3; }
}

.half-single__body {
    display: grid;
    grid-template-columns: 1fr 540px;
    gap: 40px;
}
@media (max-width: 1100px) {
    .half-single__body { grid-template-columns: 1fr; }
}
.half-single__content h2 {
    font-size: 22px;
    margin: 0 0 12px;
    color: #1a1a1a;
}
.half-single__content > * + h2 { margin-top: 32px; }
.half-single__description, .half-single__rules {
    color: #444;
    line-height: 1.6;
}

.half-single__sidebar {
    background: #f7f7f7;
    padding: 24px;
    border-radius: 12px;
    height: fit-content;
    position: sticky;
    top: 20px;
}
.half-single__price {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}
.half-single__price-amount {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}
.half-single__price-unit {
    color: #777;
    margin-left: 4px;
}
.half-single__calendar {
    min-height: 400px;
    width: 100%;
    overflow-x: auto;
}
.half-single__calendar #hostaway-calendar-widget { width: 100%; }
.half-single__calendar #hostaway-calendar-widget > div { max-width: 100%; }
.half-single__no-calendar {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
}
.half-single__no-calendar code {
    background: #efefef;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* ---- Single listing: force full-width, kill theme sidebar ---- */
/* When our listing renders inside a themed blog/page template that has a
   sidebar, neutralise it. We scope everything to .half-single-page (added
   to <body>) so we never affect other pages. */

body.half-single-page .sidebar,
body.half-single-page #secondary,
body.half-single-page .widget-area,
body.half-single-page aside.widget-area {
    display: none !important;
}

/* Make the main content column full width regardless of the theme's grid.
   Covers Bootstrap-style col-* classes and common theme wrappers. */
body.half-single-page [class*="col-xl-8"],
body.half-single-page [class*="col-lg-7"],
body.half-single-page [class*="col-md-8"],
body.half-single-page .blog-details-page-right .col-xl-8,
body.half-single-page .content-area,
body.half-single-page .site-main,
body.half-single-page #primary {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Hide the now-empty sidebar column so it doesn't reserve space. */
body.half-single-page [class*="col-xl-4"],
body.half-single-page [class*="col-lg-5"] {
    display: none !important;
}

/* Remove the card chrome the blog template wraps around our content. */
body.half-single-page .blog__card,
body.half-single-page .blog-card-three,
body.half-single-page .blog__card-content,
body.half-single-page .blog-details__content,
body.half-single-page .blog-details {
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
}

/* The plugin's gallery wrapper sometimes ends up with a stray empty <p>
   from wpautop; tidy spacing. */
.half-single__gallery > p:empty,
.half-single__content p:empty { display: none; }

/* Tighten the price block (theme line-breaks were splitting amount/unit). */
.half-single__price { line-height: 1.2; }
.half-single__price br { display: none; }
.half-single__price-unit { margin-left: 6px; }
