/**
 * MIP Property Listings — grid + single styling.
 * Bootstrap 5 is provided by the theme; this only adds the listing-specific
 * bits, chiefly the status treatment (§7.1) built to stay WCAG 2.2 AA (§20.1):
 * the banner is a SOLID background with large, bold, high-contrast text, and
 * status is always carried as real text (badge + banner), never color alone.
 */

.mip-card__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #e9ecef;
}
.mip-card__media img,
.mip-card__noimg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mip-card__noimg {
    background: repeating-linear-gradient(45deg, #e9ecef, #e9ecef 12px, #dee2e6 12px, #dee2e6 24px);
}

/* --- Under Contract & Sold: blur + dim the image ---------------------- */
.is-under-contract .mip-card__media img,
.is-sold .mip-card__media img {
    filter: blur(4px);
    opacity: 0.55;
    transform: scale(1.05); /* hide blurred edges */
}

/* --- The status banner: solid, centered, high-contrast --------------- */
.mip-card__banner {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    text-align: center;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.5rem 0.75rem;
    z-index: 2;
}
.mip-card__banner--lg {
    font-size: clamp(1.75rem, 4vw, 3rem);
    padding: 0.75rem 1rem;
}
/* Colored but "somewhat opaque" — the image reads through, alpha kept high
   enough that the large bold text still holds contrast (revisit in §20 pass). */
.is-under-contract .mip-card__banner {
    background: rgba(255, 193, 7, 0.85);  /* amber */
    color: #212529;                       /* dark text */
}
.is-sold .mip-card__banner {
    background: rgba(176, 42, 55, 0.82);  /* darkened red */
    color: #ffffff;
}

/* Corner status tag (Available cards, which carry no banner) — a pill badge:
   green (from Bootstrap's text-bg-success) with fully rounded ends. */
.mip-card__tag {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    z-index: 3;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.4em 0.8em;
    border-radius: 50rem;                     /* rounded pill ends */
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28); /* lift it off the photo */
}

/* --- Enticement badges over the image (Tier 1) ----------------------- */
.mip-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.02em;
    padding: 0.64em 1.4em;   /* doubled from 0.32em 0.7em */
    border-radius: 50rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
    color: #fff;
}
/* "Just Listed" — top-right, distinct blue (not the green/amber/red statuses). */
.mip-badge--new {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 3;
    background: #0a58c2;
}
/* Condition + Section 8 grouped bottom-left, wrapping if both present. */
.mip-badges {
    position: absolute;
    bottom: 0.6rem;
    left: 0.6rem;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-width: calc(100% - 1.2rem);
}
.mip-badge--condition { background: rgba(33, 37, 41, 0.85); }
.mip-badge--section8  { background: #b02a37; }  /* red — AA on white text */

/* This theme's Bootstrap predates the text-bg-* utilities (5.2+), so our status
   badges render with no background. Supply the colors explicitly, scoped to our
   own markup so nothing else on the site is affected. */
.mip-pl .text-bg-success,  .mip-single .text-bg-success  { background-color: #198754; color: #fff; }
.mip-pl .text-bg-warning,  .mip-single .text-bg-warning  { background-color: #ffc107; color: #212529; }
.mip-pl .text-bg-danger,   .mip-single .text-bg-danger   { background-color: #dc3545; color: #fff; }
.mip-pl .text-bg-secondary,.mip-single .text-bg-secondary{ background-color: #6c757d; color: #fff; }

/* --- Card body ------------------------------------------------------- */
.mip-card {
    border-radius: 1.75rem;  /* larger, more circular corners */
    overflow: hidden;        /* clip the image to the rounded top */
    border: 3px solid transparent;
    transition: box-shadow 0.15s ease;
}
/* Card border echoes the status color (green = available, amber = under
   contract, red = sold). Status is still carried as text too (§20.1). */
.is-available.mip-card      { border-color: #198754; }
.is-under-contract.mip-card { border-color: #ffc107; }
.is-sold.mip-card           { border-color: #b02a37; }
.mip-card:hover,
.mip-card:focus-within { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); }

/* Sales Price row: label left, figure right. */
.mip-card__price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.mip-card__price-label {
    color: #6c757d;
    font-size: 1.25rem;      /* enlarged to match the price figure */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.mip-card__price { font-size: 1.25rem; font-weight: 700; }

/* Beds / baths / sqft — three equal columns, left / center / right, with a
   faint divider underneath separating the facts from the address. */
.mip-card__facts {
    margin: 0.35rem 0 0.6rem;
    padding-bottom: 0.6rem;
    color: #495057;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

/* Address panel — tinted 15% of the card's status color (green available /
   amber under contract / red sold). Wraps the street + city/state/zip. */
.mip-card__address {
    margin-top: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.6rem;
}
.is-available .mip-card__address      { background: rgba(25, 135, 84, 0.15); }
.is-under-contract .mip-card__address { background: rgba(255, 193, 7, 0.15); }
.is-sold .mip-card__address           { background: rgba(176, 42, 55, 0.15); }

/* The street ("123 Main Street") is the linked heading — centered, enlarged. */
.mip-card__title { margin: 0; font-size: 1.4rem; font-weight: 600; text-align: center; line-height: 1.2; }
.mip-card__title a { text-decoration: none; }

/* Not <address>: that element is for the contact info of the article/author,
   not a described location. Plain text; centered, enlarged in step with the
   street heading (same relative sizing as before). */
.mip-card__addr { font-size: 1.15rem; color: #6c757d; margin: 0.05rem 0 0; text-align: center; line-height: 1.2; }

/* Pagination — more breathing room above the grid and wider hit targets. */
.mip-pl-pagination { margin-top: 2.5rem; }
.mip-pl-pagination .page-link { padding-left: 1.1rem; padding-right: 1.1rem; }

/* Visible focus for keyboard users (§20.3). */
.mip-card__title a:focus-visible,
.mip-pl-pagination .page-link:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

/* --- Single page ----------------------------------------------------- */
/* Brand purple, pulled from the theme's Bootstrap primary so it stays in sync. */
.mip-single { --mip-purple: var(--bs-primary, #5d2267); }

/* Hero heading — scaled down from Bootstrap's large display-4 and width-capped
   so long titles wrap onto multiple lines instead of stretching edge to edge. */
.mip-single-hero .display-4 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); max-width: 48rem; margin-left: auto; margin-right: auto; }
.mip-single-hero .lead { max-width: 60rem; margin-left: auto; margin-right: auto; }

/* Header: full-address title (h2 sized like an h1) + matching-size price. */
.mip-single__head { margin: 0.5rem 0 1.5rem; }
.mip-single__title,
.mip-single__price { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 700; line-height: 1.15; margin: 0; }
.mip-single__price { white-space: nowrap; }

/* Space below the main image + details block, before the About section. */
.mip-single__overview { margin-bottom: 3rem; }

/* Main hero photo — larger curved corners. */
.mip-single__hero { margin: 0; border-radius: 1.25rem; overflow: hidden; cursor: zoom-in; }
.mip-single__hero.mip-card__media { aspect-ratio: 16 / 9; }

/* Fact cards — centered, brand-purple outline, rounded. Two-up: the short
   numeric facts (beds/baths/sqft/year) sit half-width; Type/Parking span full.
   In the narrow xl sidebar (and on phones) that's two columns; while the block
   is stacked full-width below xl, the numeric cards flow four-across so they
   don't stretch into two huge halves. */
.mip-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (min-width: 576px) and (max-width: 1199.98px) {
    .mip-facts { grid-template-columns: repeat(4, 1fr); }
}
.mip-fact--wide { grid-column: 1 / -1; }
.mip-fact {
    text-align: center;
    border: 1px solid var(--mip-purple);
    border-radius: 0.9rem;
    padding: 0.85rem 0.6rem;
}
.mip-fact__value { display: block; font-size: 1.4rem; font-weight: 700; line-height: 1.15; color: var(--mip-purple); }
.mip-fact__label { display: block; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; color: #6c757d; margin-top: 0.15rem; }
.mip-fact__note { display: block; font-size: 0.72rem; color: #6c757d; margin-top: 0.25rem; }

/* About — bigger heading, breathing room above. */
.mip-single__about-row { margin-top: 2.5rem; }
.mip-single__about-heading { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; margin-bottom: 1rem; }
.mip-single__lead { margin-bottom: 1rem; }

/* "Property Listed By" heading above the agent credit. */
.mip-single__credit-heading { font-size: 1rem; font-weight: 500; margin: 0 0 0.5rem; }

/* Property features — brand-purple outlined pills in the About sidebar. */
.mip-single__features-heading { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; }
.mip-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.mip-pill {
    display: inline-block;
    font-size: 0.8rem;
    line-height: 1.3;
    padding: 0.35rem 0.8rem;
    border-radius: 50rem;
    border: 1px solid var(--mip-purple);
    background: rgba(93, 34, 103, 0.06);
    color: var(--mip-purple);
}

/* Agent details + contact form band near the foot of the page — a rounded
   container tinted with the page-header background (brand-secondary-light).
   The agent column is centered vertically & horizontally; the form sits beside
   it. Agent photo is enlarged with a thin brand-purple ring. */
.mip-single__agent-section {
    margin-top: 3rem;
    padding: clamp(1.5rem, 4vw, 3rem);
    border-radius: 1.75rem;
}
.mip-single__agent-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}
.mip-single__agent-heading { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; margin-bottom: 1.25rem; }
.mip-single__agent-photo { width: 220px; height: 220px; object-fit: cover; display: block; margin: 0 auto 1rem; max-width: 100%; border: 3px solid var(--mip-purple); }
.mip-single__agent-name { margin-bottom: 0.75rem; }
/* Blurb + call/text buttons sit under the license line, with clear padding
   between the license and the action buttons. */
.mip-single__agent-blurb { margin: 0 auto 1.5rem; max-width: 32rem; }
.mip-single__agent-actions { margin-top: 1.75rem; }

/* Photo gallery — bigger heading, breathing room, rounded thumbs. Portrait and
   landscape shots sit in their own rows so heights never go ragged. */
.mip-single__amenities,
.mip-single__gallery { margin-top: 3rem; }
.mip-single__gallery-heading { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; margin-bottom: 1.25rem; }
.mip-gallery { margin-bottom: 0; }
.mip-gallery + .mip-gallery { margin-top: 1.5rem; }
.mip-gallery__item { display: block; overflow: hidden; border-radius: 1rem; cursor: zoom-in; }
.mip-gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
.mip-gallery--landscape .mip-gallery__item img { aspect-ratio: 4 / 3; }
.mip-gallery--portrait  .mip-gallery__item img { aspect-ratio: 3 / 4; }
.mip-gallery__item:hover img,
.mip-gallery__item:focus-visible img { transform: scale(1.04); }
.mip-gallery__item:focus-visible { outline: 3px solid var(--mip-purple); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .mip-gallery__item img { transition: none; } }

/* --- Lightbox -------------------------------------------------------- */
body.mip-lb-open { overflow: hidden; }
.mip-lb {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.9);
}
.mip-lb[hidden] { display: none; }
.mip-lb__stage { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 92vw; }
.mip-lb__img {
    max-width: 92vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.mip-lb__cap { color: #fff; margin: 0.75rem 0 0; font-size: 0.95rem; text-align: center; }
.mip-lb__close {
    position: absolute;
    top: 0.75rem;
    right: 1.25rem;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 2.75rem;
    line-height: 1;
    cursor: pointer;
}
.mip-lb__nav {
    flex: none;
    width: 3.25rem;
    height: 3.25rem;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 2.25rem;
    line-height: 1;
    cursor: pointer;
}
.mip-lb__nav:hover { background: rgba(255, 255, 255, 0.28); }
.mip-lb__prev { margin-right: 1rem; }
.mip-lb__next { margin-left: 1rem; }
.mip-lb__nav[hidden] { display: none; }
.mip-lb__close:focus-visible,
.mip-lb__nav:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (max-width: 575px) {
    .mip-lb__nav { position: absolute; top: 50%; transform: translateY(-50%); margin: 0; }
    .mip-lb__prev { left: 0.5rem; }
    .mip-lb__next { right: 0.5rem; }
}

.mip-pl-error,
.mip-pl-empty { padding: 1rem; color: #6c757d; }

/* Respect reduced-motion preferences (§20.1). */
@media (prefers-reduced-motion: reduce) {
    .mip-card { transition: none; }
}
