/* ============================================================
   TAN Off-Market Listings — Pixel-perfect SIDX card match
   Version 1.5.0
   ============================================================ */

/* ── Google Fonts (match site fonts) ─────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond&family=Poppins:wght@400;600&family=Montserrat:wght@400;700&display=swap');

/* ── Hide the theme hero section on the TAN listings page ───────
   The hero (Welcome / Luxury Back Bay / View All Listings) is a
   bare <section> element that is the direct parent of .btn-gold.
   We hide it specifically on page-id-385 (the TAN page).
   ─────────────────────────────────────────────────────────────── */
body.page-id-385 section:has(.btn-gold),
body.page-id-385 .tan-listings-wrap ~ section:has(.btn-gold) {
    display: none !important;
}

/* Fallback for browsers without :has() support — hide by position */
body.page-id-385 > main > section:first-of-type:not(:has(.tan-listings-wrap)),
body.page-id-385 .site-content > section:first-of-type:not(:has(.tan-listings-wrap)) {
    display: none !important;
}

/* ── Break out of the theme's 800px article constraint ───────
   The theme forces article { max-width: 800px; padding: 60px }
   We override this specifically for pages containing the TAN grid
   using the same full-width breakout technique as SIDX.
   ─────────────────────────────────────────────────────────────── */
body:has(.tan-listings-wrap) article,
body:has(.tan-listings-wrap) .entry-content,
body:has(.tan-listings-wrap) .post-content,
body:has(.tan-listings-wrap) .page-content {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ── Page wrapper ─────────────────────────────────────────── */
.tan-listings-wrap {
    max-width: 1265px;
    margin: 0 auto;
    padding: 0 20px 40px;
    font-family: Poppins, -apple-system, sans-serif;
}

.tan-listings-header {
    text-align: center;
    margin-bottom: 24px;
}

.tan-listings-header p {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin: 0;
}

.tan-listings-header a {
    color: #c9a96e;
    text-decoration: none;
}

/* ── Grid — matches SIDX 3-column layout ──────────────────── */
.tan-listings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .tan-listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 580px) {
    .tan-listings-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Card — matches SIDX card ─────────────────────────────── */
.tan-card {
    display: flex;
    flex-direction: column;
    background: #111111;
    border: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    cursor: default;
}

/* ── Thumbnail — exactly 300px tall like SIDX ─────────────── */
.tan-thumbnail {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: #1a1a1a;
}

/* ── Gallery slides ───────────────────────────────────────── */
.tan-gallery {
    position: relative;
    width: 100%;
    height: 100%;
}

.tan-gallery-slide {
    display: none;
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.tan-gallery-slide.active {
    display: block;
}

.tan-gallery-slide img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Gallery arrow controls — appear on hover ─────────────── */
.tan-gallery-prev,
.tan-gallery-next {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.55);
    color: rgba(255,255,255,0.85);
    border: none;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 14px;
    padding: 0;
}

.tan-gallery-prev { left: 6px; }
.tan-gallery-next { right: 6px; }

.tan-thumbnail:hover .tan-gallery-prev,
.tan-thumbnail:hover .tan-gallery-next {
    opacity: 1;
}

/* ── Ribbon (OFF-MLS TIL ...) — top-left of thumbnail ─────── */
.tan-ribbons {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
}

.tan-ribbon {
    display: inline-block;
    font-family: Montserrat, sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #c9a96e;
    background: linear-gradient(145deg, #1a1a1a 0%, #2a2a2a 40%, #1a1a1a 100%);
    padding: 5px 14px;
}

/* ── Thumbnail bottom actions bar (photo counter) ─────────── */
.tan-thumbnail-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 5px;
    z-index: 5;
}

.tan-gallery-position {
    font-size: 14px;
    font-family: "Helvetica Neue", Roboto, Helvetica, Arial, sans-serif;
    color: rgba(255,255,255,0.85);
    background: rgba(0,0,0,0.4);
    padding: 2px 6px;
    border-radius: 2px;
}

/* ── Details section — padding exactly 16px 20px ─────────── */
.tan-details {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: #111111;
    flex: 1;
}

/* ── Price row: price left + button right ────────────────── */
.tan-price-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0;
}

/* ── Price — 24px EB Garamond, white ─────────────────────── */
.tan-price {
    font-family: "EB Garamond", Georgia, serif;
    font-size: 24px;
    font-weight: 400;
    color: #ffffff;
    line-height: 44.8px;
    margin: 0 0 0 0;
}

/* ── Gold "Request Information" button ─────────────────── */
.tan-request-btn {
    display: inline-block;
    font-family: Poppins, -apple-system, sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #111111;
    background: linear-gradient(135deg, #c9a96e 0%, #b8935a 50%, #c9a96e 100%);
    padding: 8px 12px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.15s;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.tan-request-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #111111;
    text-decoration: none;
}

/* ── Sale type row: "FOR SALE  OFF-MARKET" ───────────────── */
.tan-sale-type-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.tan-sale-type {
    font-family: "Helvetica Neue", Roboto, Helvetica, Arial, sans-serif;
    font-size: 9.8px;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.tan-off-market-badge {
    font-family: Montserrat, sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #c9a96e;
    border: 1px solid rgba(201,169,110,0.4);
    padding: 2px 6px;
}

/* ── Info blocks: Beds / Baths / Sqft — horizontal row ────── */
.tan-info-blocks {
    display: flex;
    flex-direction: row;
    gap: 24px;
    flex-wrap: nowrap;
    margin-bottom: 10px;
}

.tan-info-block {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0;
}

.tan-info-value {
    font-family: Poppins, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin-right: 3px;
}

.tan-info-title {
    font-family: Poppins, -apple-system, sans-serif;
    font-size: 9px;
    font-weight: 400;
    color: rgba(255,255,255,0.3);
    text-transform: capitalize;
    letter-spacing: 0.5px;
    align-self: flex-end;
    margin-bottom: 1px;
}

/* ── Address heading — 12px Poppins uppercase ─────────────── */
.tan-listing-heading {
    font-family: Poppins, -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 19.2px;
    margin: 0 0 8px 0;
}

.tan-listing-heading em {
    font-style: normal;
    display: block;
    color: rgba(255,255,255,0.3);
    font-size: 10px;
    letter-spacing: 1.5px;
    margin-top: 2px;
}

/* ── Agent attribution — small muted text at bottom ──────── */
.tan-agent-attribution {
    display: block !important;
    visibility: visible !important;
    font-family: Poppins, -apple-system, sans-serif;
    font-size: 9px;
    font-weight: 400;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.3px;
    line-height: 1.4;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── Empty state ──────────────────────────────────────────── */
.tan-no-listings {
    text-align: center;
    padding: 60px 20px;
    font-family: Poppins, -apple-system, sans-serif;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ── Footer disclaimer ────────────────────────────────────── */
.tan-listings-footer {
    margin-top: 32px;
    text-align: center;
    font-family: Poppins, -apple-system, sans-serif;
    font-size: 10px;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.5px;
    line-height: 1.6;
}
