/*
 * Home Listings — frontend styles
 * Card grid layout with hover effects, responsive breakpoints, and
 * a clean navy + white color scheme.
 */

/* ── Design tokens ─────────────────────────────────────────────────── */
:root {
    --hl-navy:       #1a3f6f;
    --hl-navy-dark:  #122d52;
    --hl-badge-bg:   rgba(18, 45, 82, 0.88);
    --hl-accent:     #2e7d32;
    --hl-tag-bg:     #e8f0fb;
    --hl-tag-text:   #1a3f6f;
    --hl-text:       #222;
    --hl-muted:      #6b7280;
    --hl-border:     #e5e7eb;
    --hl-white:      #ffffff;
    --hl-radius:     12px;
    --hl-radius-sm:  6px;
    --hl-shadow:     0 2px 12px rgba(0, 0, 0, .10);
    --hl-shadow-hov: 0 8px 28px rgba(0, 0, 0, .16);
    --hl-gap:        24px;
    --hl-transition: .25s ease;
}

/* ── Grid ──────────────────────────────────────────────────────────── */
.hl-listings-grid {
    display: grid;
    gap: var(--hl-gap);
    margin: 32px 0;
}

.hl-columns-2 { grid-template-columns: repeat(2, 1fr); }
.hl-columns-3 { grid-template-columns: repeat(3, 1fr); }
.hl-columns-4 { grid-template-columns: repeat(4, 1fr); }

/* Collapse to 2 columns on tablet */
@media (max-width: 960px) {
    .hl-columns-3,
    .hl-columns-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Single column on mobile */
@media (max-width: 580px) {
    .hl-listings-grid { grid-template-columns: 1fr; }
}

/* ── Card shell ────────────────────────────────────────────────────── */
.hl-listing-card {
    background: var(--hl-white);
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-radius);
    box-shadow: var(--hl-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition:
        box-shadow var(--hl-transition),
        transform  var(--hl-transition);
}

.hl-listing-card:hover {
    box-shadow: var(--hl-shadow-hov);
    transform: translateY(-4px);
}

/* ── Photo area ────────────────────────────────────────────────────── */
.hl-card-image-link {
    display: block;
    text-decoration: none;
}

.hl-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;    /* consistent crop regardless of upload size */
    background: #dce4ed;
}

.hl-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .45s ease;
}

.hl-listing-card:hover .hl-card-image img {
    transform: scale(1.05);
}

/* ── Price badge (over photo) ──────────────────────────────────────── */
.hl-price-badge {
    position: absolute;
    bottom: 14px;
    left: 14px;
    background: var(--hl-badge-bg);
    color: var(--hl-white);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1;
    padding: 7px 14px;
    border-radius: var(--hl-radius-sm);
    letter-spacing: .03em;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Price-only banner when no photo is set */
.hl-price-banner {
    background: var(--hl-navy);
    padding: 16px 20px;
}

.hl-price-badge-dark {
    display: inline-block;
    color: var(--hl-white);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .03em;
}

/* ── Card body ─────────────────────────────────────────────────────── */
.hl-card-body {
    padding: 20px 22px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Title ─────────────────────────────────────────────────────────── */
.hl-card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
}

.hl-card-title a {
    color: var(--hl-navy);
    text-decoration: none;
    transition: color var(--hl-transition);
}

.hl-card-title a:hover {
    color: var(--hl-navy-dark);
    text-decoration: underline;
}

/* ── Address ───────────────────────────────────────────────────────── */
.hl-card-address {
    margin: 0;
    font-size: .83rem;
    color: var(--hl-muted);
    display: flex;
    align-items: flex-start;
    gap: 5px;
    line-height: 1.4;
}

.hl-card-address svg,
.hl-single-address svg {
    width: 13px;
    height: 13px;
    fill: var(--hl-muted);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Excerpt ───────────────────────────────────────────────────────── */
.hl-card-excerpt {
    font-size: .9rem;
    color: var(--hl-text);
    line-height: 1.65;
    margin: 0;
    flex: 1;                 /* pushes button to the bottom */

    /* Clamp long excerpts to three lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Tags ──────────────────────────────────────────────────────────── */
.hl-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hl-tag {
    display: inline-block;
    background: var(--hl-tag-bg);
    color: var(--hl-tag-text);
    font-size: .72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .05em;
    transition: background var(--hl-transition), color var(--hl-transition);
}

.hl-tag:hover {
    background: var(--hl-navy);
    color: var(--hl-white);
}

/* ── "View Details" button ─────────────────────────────────────────── */
.hl-card-btn {
    display: block;
    margin-top: 6px;
    padding: 11px 18px;
    background: var(--hl-navy);
    color: var(--hl-white) !important;
    text-decoration: none !important;
    border-radius: var(--hl-radius-sm);
    font-size: .88rem;
    font-weight: 600;
    text-align: center;
    transition: background var(--hl-transition);
}

.hl-card-btn:hover {
    background: var(--hl-navy-dark);
}

/* ── "No listings" placeholder ─────────────────────────────────────── */
.hl-no-listings {
    color: var(--hl-muted);
    font-style: italic;
    text-align: center;
    padding: 48px 0;
}

/* ── Single listing — meta header above the content ───────────────── */
.hl-single-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    background: #f3f7ff;
    border: 1px solid #d0dcf0;
    border-radius: var(--hl-radius);
    margin-bottom: 28px;
}

.hl-single-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--hl-navy);
    letter-spacing: .02em;
}

.hl-single-address {
    margin: 0;
    font-size: .9rem;
    color: var(--hl-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.hl-single-tags {
    margin-left: auto;  /* pushes tags to the right on wide screens */
}
