/**
 * Feather PM Listings — front-end styles.
 * Matches the existing featherpm.com palette:
 *   cream background, coral red accents, sage green CTAs,
 *   serif headlines, sans-serif body.
 *
 * All custom properties are namespaced --fpm-* so the host theme
 * can override them without bleed.
 */

:root {
    --fpm-bg:           #f6f1e7;          /* page cream */
    --fpm-surface:      #ffffff;          /* card surface */
    --fpm-text:         #1c1c1c;          /* near-black body */
    --fpm-muted:        #6b6b6b;          /* secondary text */
    --fpm-accent:       #c14a4a;          /* coral red — links, headlines */
    --fpm-accent-dark:  #a23939;
    --fpm-cta:          #3c5a4a;          /* sage / forest green */
    --fpm-cta-dark:     #2c4538;
    --fpm-border:       #e5dccb;          /* warm border */
    --fpm-shadow:       0 1px 2px rgba(20, 20, 20, .04),
                        0 8px 24px rgba(20, 20, 20, .06);
    --fpm-shadow-hover: 0 4px 8px rgba(20, 20, 20, .06),
                        0 16px 40px rgba(20, 20, 20, .10);
    --fpm-radius:       6px;
    --fpm-radius-lg:    10px;
    --fpm-font-display: Georgia, "Playfair Display", "Times New Roman", serif;
    --fpm-font-body:    inherit;          /* inherit theme body font */
    --fpm-max-width:    1200px;
}

/* -------- Container & shared typography -------- */
.fpm-listings-section,
.fpm-detail {
    max-width: var(--fpm-max-width);
    margin: 0 auto;
    padding: 2rem 1.25rem;
    color: var(--fpm-text);
    font-family: var(--fpm-font-body);
}

.fpm-listings-section h2,
.fpm-listings-section h3,
.fpm-detail h1,
.fpm-detail h2,
.fpm-detail h3 {
    font-family: var(--fpm-font-display);
    color: var(--fpm-text);
    font-weight: 600;
    line-height: 1.2;
}

/* -------- Filters -------- */
.fpm-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    padding: 1rem 1.25rem;
    margin-bottom: 1.75rem;
    background: var(--fpm-surface);
    border: 1px solid var(--fpm-border);
    border-radius: var(--fpm-radius);
}

.fpm-filter {
    display: flex;
    flex-direction: column;
    flex: 1 1 160px;
    min-width: 140px;
}

.fpm-filter label {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--fpm-muted);
    margin-bottom: .35rem;
    font-weight: 600;
}

.fpm-filter select,
.fpm-filter input[type="search"] {
    appearance: none;
    -webkit-appearance: none;
    background: var(--fpm-surface);
    border: 1px solid var(--fpm-border);
    border-radius: var(--fpm-radius);
    padding: .6rem .8rem;
    font-size: .95rem;
    color: var(--fpm-text);
    font-family: inherit;
    transition: border-color .15s ease;
}

.fpm-filter select:focus,
.fpm-filter input:focus {
    outline: none;
    border-color: var(--fpm-accent);
}

.fpm-filter select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b6b6b' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .8rem center;
    padding-right: 2rem;
}

.fpm-reset {
    background: transparent;
    border: 1px solid var(--fpm-border);
    color: var(--fpm-muted);
    border-radius: var(--fpm-radius);
    padding: .6rem 1rem;
    font-size: .9rem;
    cursor: pointer;
    transition: all .15s ease;
    font-family: inherit;
}

.fpm-reset:hover {
    border-color: var(--fpm-accent);
    color: var(--fpm-accent);
}

/* -------- Grid -------- */
.fpm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* -------- Card -------- */
.fpm-card {
    background: var(--fpm-surface);
    border: 1px solid var(--fpm-border);
    border-radius: var(--fpm-radius-lg);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: var(--fpm-shadow);
    display: flex;
    flex-direction: column;
}

.fpm-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--fpm-shadow-hover);
}

.fpm-card.is-hidden {
    display: none;
}

.fpm-card-link {
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.fpm-card-link:hover,
.fpm-card-link:focus {
    color: inherit;
    text-decoration: none;
}

.fpm-card-photo {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--fpm-border);
}

.fpm-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.fpm-card:hover .fpm-card-photo img {
    transform: scale(1.03);
}

.fpm-card-photo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--fpm-border), var(--fpm-bg));
}

.fpm-badge {
    position: absolute;
    top: .75rem;
    left: .75rem;
    background: var(--fpm-cta);
    color: #fff;
    padding: .25rem .65rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-radius: 999px;
}

.fpm-card-body {
    padding: 1.1rem 1.25rem .5rem;
    flex-grow: 1;
}

.fpm-card-rent {
    font-family: var(--fpm-font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--fpm-text);
    line-height: 1;
    margin-bottom: .35rem;
}

.fpm-per {
    font-size: .85rem;
    color: var(--fpm-muted);
    font-weight: 400;
}

.fpm-card-title {
    margin: 0 0 .15rem;
    font-size: 1.05rem;
    color: var(--fpm-text);
    font-family: var(--fpm-font-body);
    font-weight: 600;
}

.fpm-card-address {
    margin: 0 0 .85rem;
    font-size: .9rem;
    color: var(--fpm-muted);
}

.fpm-card-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
    font-size: .9rem;
    color: var(--fpm-text);
}

.fpm-card-meta li {
    color: var(--fpm-muted);
}

.fpm-card-meta strong {
    color: var(--fpm-text);
    font-weight: 600;
}

.fpm-card-cta {
    display: block;
    padding: .85rem 1.25rem 1rem;
    color: var(--fpm-accent);
    font-weight: 600;
    font-size: .9rem;
    border-top: 1px solid var(--fpm-border);
    margin-top: .5rem;
    transition: color .15s ease;
}

.fpm-card:hover .fpm-card-cta {
    color: var(--fpm-accent-dark);
}

/* -------- Empty / no-match states -------- */
.fpm-empty,
.fpm-no-matches {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--fpm-muted);
    background: var(--fpm-surface);
    border: 1px dashed var(--fpm-border);
    border-radius: var(--fpm-radius);
}

.fpm-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--fpm-accent);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

/* ============================================================
   DETAIL PAGE
   ============================================================ */

.fpm-breadcrumb {
    font-size: .85rem;
    color: var(--fpm-muted);
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.fpm-breadcrumb a {
    color: var(--fpm-muted);
    text-decoration: none;
}

.fpm-breadcrumb a:hover {
    color: var(--fpm-accent);
}

.fpm-detail-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 2rem;
    align-items: start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--fpm-border);
}

@media (max-width: 768px) {
    .fpm-detail-header {
        grid-template-columns: 1fr;
    }
}

.fpm-detail-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin: 0 0 .35rem;
    line-height: 1.15;
}

.fpm-detail-address {
    margin: 0 0 1.25rem;
    font-size: 1.05rem;
    color: var(--fpm-muted);
}

.fpm-detail-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.fpm-detail-meta li {
    display: flex;
    flex-direction: column;
}

.fpm-meta-num {
    font-family: var(--fpm-font-display);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1;
    color: var(--fpm-text);
}

.fpm-meta-label {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--fpm-muted);
    margin-top: .35rem;
}

.fpm-detail-cta {
    background: var(--fpm-surface);
    border: 1px solid var(--fpm-border);
    border-radius: var(--fpm-radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--fpm-shadow);
}

.fpm-detail-rent {
    font-family: var(--fpm-font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--fpm-text);
    line-height: 1;
    margin-bottom: .5rem;
}

.fpm-deposit {
    font-size: .85rem;
    color: var(--fpm-muted);
    margin: 0 0 .5rem;
}

.fpm-available {
    font-size: .9rem;
    color: var(--fpm-cta);
    font-weight: 600;
    margin: 0 0 1rem;
}

.fpm-apply-btn {
    display: block;
    width: 100%;
    padding: .9rem 1.5rem;
    background: var(--fpm-cta);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: .9rem;
    transition: background .15s ease, transform .15s ease;
    border: 0;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
}

.fpm-apply-btn:hover,
.fpm-apply-btn:focus {
    background: var(--fpm-cta-dark);
    transform: translateY(-1px);
    color: #fff !important;
}

.fpm-cta-note {
    font-size: .75rem;
    color: var(--fpm-muted);
    margin: .75rem 0 0;
}

/* -------- Gallery -------- */
.fpm-gallery {
    margin-bottom: 2.5rem;
}

.fpm-gallery-main {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--fpm-radius-lg);
    background: var(--fpm-border);
    margin-bottom: .75rem;
}

.fpm-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fpm-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: .5rem;
}

.fpm-thumb {
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--fpm-radius);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    background: var(--fpm-border);
    transition: border-color .15s ease, transform .15s ease;
}

.fpm-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fpm-thumb.is-active {
    border-color: var(--fpm-accent);
}

.fpm-thumb:hover {
    transform: translateY(-1px);
}

/* -------- Body grid -------- */
.fpm-detail-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (max-width: 900px) {
    .fpm-detail-body {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.fpm-section {
    margin-bottom: 2.5rem;
}

.fpm-section-compact {
    margin-bottom: 1.5rem;
}

.fpm-section h2 {
    font-size: 1.4rem;
    margin: 0 0 1rem;
    color: var(--fpm-accent);
}

.fpm-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--fpm-text);
}

.fpm-description p {
    margin: 0 0 1rem;
}

.fpm-amenities {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .65rem 1.25rem;
}

.fpm-amenities li {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .95rem;
    color: var(--fpm-text);
}

.fpm-check {
    color: var(--fpm-cta);
    flex-shrink: 0;
}

.fpm-map-wrap {
    border-radius: var(--fpm-radius-lg);
    overflow: hidden;
    border: 1px solid var(--fpm-border);
}

/* -------- Sidebar -------- */
.fpm-detail-sidebar {
    align-self: start;
    position: sticky;
    top: 90px;
}

.fpm-sidebar-card {
    background: var(--fpm-surface);
    border: 1px solid var(--fpm-border);
    border-radius: var(--fpm-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--fpm-shadow);
    text-align: center;
}

.fpm-divider {
    border: 0;
    border-top: 1px solid var(--fpm-border);
    margin: 1.25rem 0;
}

.fpm-contact-line {
    margin: .25rem 0;
    font-size: .95rem;
    color: var(--fpm-text);
}

.fpm-contact-line a {
    color: var(--fpm-accent);
    text-decoration: none;
}

.fpm-contact-line a:hover {
    text-decoration: underline;
}

/* -------- Back link -------- */
.fpm-back-link {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--fpm-border);
}

.fpm-back-link a {
    color: var(--fpm-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
}

.fpm-back-link a:hover {
    text-decoration: underline;
}

/* -------- Mobile tweaks -------- */
@media (max-width: 600px) {
    .fpm-detail-meta {
        gap: 1.5rem;
    }
    .fpm-meta-num {
        font-size: 1.4rem;
    }
    .fpm-grid {
        grid-template-columns: 1fr;
    }
}
