/* ──────────────────────────────────────────────────────────────────────────────
   Apartment Finder — Front-end styles
   Used on single apt_listing, archive, and [apt_listings] shortcode
   ────────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --apf-bg:       #0d1117;
    --apf-bg2:      #161b27;
    --apf-bg3:      #1e2737;
    --apf-accent:   #6366f1;
    --apf-accent2:  #818cf8;
    --apf-success:  #22c55e;
    --apf-text:     #e2e8f0;
    --apf-muted:    #7c8ca1;
    --apf-border:   #2a3550;
    --apf-radius:   12px;
    --apf-shadow:   0 4px 24px rgba(0,0,0,0.4);
}

/* Grid layout */
.apf-grid {
    display: grid;
    gap: 24px;
    padding: 24px 0;
}
.apf-cols-1 { grid-template-columns: 1fr; }
.apf-cols-2 { grid-template-columns: repeat(2, 1fr); }
.apf-cols-3 { grid-template-columns: repeat(3, 1fr); }
.apf-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .apf-cols-3, .apf-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .apf-grid { grid-template-columns: 1fr !important; }
}

/* Card */
.apf-card {
    background:    var(--apf-bg2);
    border:        1px solid var(--apf-border);
    border-radius: var(--apf-radius);
    overflow:      hidden;
    transition:    transform 0.2s ease, box-shadow 0.2s ease;
    font-family:   'Inter', sans-serif;
}
.apf-card:hover {
    transform:   translateY(-4px);
    box-shadow:  var(--apf-shadow);
    border-color: var(--apf-accent);
}

/* Card image */
.apf-card__img {
    width:               100%;
    height:              200px;
    background-size:     cover;
    background-position: center;
    background-color:    var(--apf-bg3);
}
.apf-card__img--placeholder {
    background-image: linear-gradient(135deg, #1e2737 0%, #0d1117 100%);
    display:          flex;
    align-items:      center;
    justify-content:  center;
}
.apf-card__img--placeholder::after {
    content:   '🏠';
    font-size: 48px;
    opacity:   0.3;
}

/* Card body */
.apf-card__body {
    padding: 18px 20px;
}
.apf-card__title {
    font-size:   1rem;
    font-weight: 600;
    margin:      0 0 8px;
    line-height: 1.4;
}
.apf-card__title a {
    color:           var(--apf-text);
    text-decoration: none;
    transition:      color 0.15s;
}
.apf-card__title a:hover {
    color: var(--apf-accent2);
}
.apf-card__price {
    font-size:   1.15rem;
    font-weight: 700;
    color:        var(--apf-accent2);
    margin:       0 0 6px;
}
.apf-card__meta {
    font-size: 0.85rem;
    color:     var(--apf-muted);
    margin:    0 0 14px;
}
.apf-card__footer {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    border-top:      1px solid var(--apf-border);
    padding-top:     12px;
    margin-top:      auto;
}
.apf-card__source {
    font-size:     0.75rem;
    color:         var(--apf-muted);
    background:    var(--apf-bg3);
    padding:       3px 8px;
    border-radius: 99px;
}
.apf-card__ext {
    font-size:       0.8rem;
    color:           var(--apf-accent);
    text-decoration: none;
    transition:      color 0.15s;
}
.apf-card__ext:hover { color: var(--apf-accent2); }

/* Single listing */
.apf-single {
    max-width:   860px;
    margin:      40px auto;
    font-family: 'Inter', sans-serif;
    color:       var(--apf-text);
}
.apf-single__hero {
    width:         100%;
    height:        380px;
    object-fit:    cover;
    border-radius: var(--apf-radius);
    margin-bottom: 28px;
}
.apf-single__price {
    font-size:   2rem;
    font-weight: 700;
    color:       var(--apf-accent2);
    margin:      0 0 6px;
}
.apf-single__meta-table {
    width:           100%;
    border-collapse: collapse;
    margin:          20px 0;
}
.apf-single__meta-table th,
.apf-single__meta-table td {
    padding:    10px 14px;
    text-align: left;
    border:     1px solid var(--apf-border);
    font-size:  0.9rem;
}
.apf-single__meta-table th {
    background: var(--apf-bg3);
    color:      var(--apf-muted);
    font-weight: 600;
    width: 160px;
}
.apf-single__meta-table td { color: var(--apf-text); }
.apf-single__cta {
    display:       inline-block;
    margin-top:    24px;
    padding:       12px 28px;
    background:    var(--apf-accent);
    color:         #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight:   600;
    font-size:     0.95rem;
    transition:    background 0.2s;
}
.apf-single__cta:hover { background: var(--apf-accent2); }

/* Empty state */
.apf-empty {
    text-align: center;
    color:      var(--apf-muted);
    padding:    48px 0;
    font-size:  1rem;
}

/* Inline listing detail (posted by scraper) */
.cp-listing {
    font-family: 'Inter', sans-serif;
    color:       var(--apf-text);
}
.cp-listing h2 {
    font-size:   1.3rem;
    font-weight: 600;
    margin:      0 0 10px;
}
.cp-price {
    font-size:   1.2rem;
    color:       var(--apf-accent2);
    font-weight: 700;
    margin:      0 0 14px;
}
