/*
Theme Name:  BGRE Theme
Theme URI:   https://berniegallerani.com
Author:      Real Estate Rankers
Author URI:  https://realestaterankers.com
Description: Custom WordPress theme for Bernie Gallerani Real Estate. Designed for gradual migration from Elementor — Elementor handles the site-wide header and footer; this theme owns individual page templates.
Version:     1.0.1
License:     GNU General Public License v2 or later
Text Domain: bgre-theme
*/

/* ============================================================
   ELEMENTOR HEADER COMPATIBILITY
   Hello Elementor provided position:sticky + z-index on the
   header template. Without it the hero's negative-margin
   transparent-overlay effect breaks. We replicate it here.
   ============================================================ */
header.elementor-location-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
}

/* Offset for the WP admin bar (32px desktop, 46px mobile) */
.admin-bar header.elementor-location-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar header.elementor-location-header {
        top: 46px;
    }
}

/* ============================================================
   HOMEPAGE HERO — NEGATIVE MARGIN
   Elementor stores this in post-10323.css. WP Rocket's
   "Remove Unused CSS" can strip it for logged-out visitors,
   causing a white gap above the hero. Keeping it here ensures
   it is always present regardless of caching state.
   ============================================================ */
.elementor-element-d1a6553 {
    --margin-top: -121px;
    margin-top: -121px;
}

/* ============================================================
   CSS CUSTOM PROPERTIES
   These match the brand system used across the existing site.
   ============================================================ */
:root {
    --color-primary:    #141848;
    --color-accent:     #F7D187;
    --color-dark:       #0d1038;
    --color-light-bg:   #F8F8F6;
    --color-white:      #ffffff;
    --color-text:       #333333;
    --color-text-light: #666666;
    --font-heading:     'Playfair Display', Georgia, serif;
    --font-body:        'Lato', sans-serif;
    --container-max:    1200px;
    --container-wide:   1380px;
    --section-pad:      80px;
    --transition:       0.28s ease;
}

/* ============================================================
   RESET & BASE
   Minimal reset — Elementor and the active parent theme CSS
   still apply to Elementor-managed pages. This reset only
   impacts bgre-theme custom templates.
   ============================================================ */
.bgre-page *, .bgre-page *::before, .bgre-page *::after {
    box-sizing: border-box;
}
.bgre-page img { max-width: 100%; height: auto; display: block; }
.bgre-page a { text-decoration: none; color: inherit; }
.bgre-page ul { list-style: none; margin: 0; padding: 0; }
.bgre-page button, .bgre-page input, .bgre-page textarea, .bgre-page select {
    font-family: inherit;
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.bgre-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 28px;
}
.bgre-container--wide {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 28px;
}

/* ============================================================
   SHARED BUTTONS
   ============================================================ */
.bgre-btn {
    display: inline-block;
    padding: 14px 34px;
    background: var(--color-accent);
    color: var(--color-primary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: 2px solid var(--color-accent);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}
.bgre-btn:hover {
    background: transparent;
    color: var(--color-accent);
}
.bgre-btn--ghost {
    background: transparent;
    border-color: rgba(255,255,255,0.75);
    color: #fff;
}
.bgre-btn--ghost:hover {
    background: #fff;
    color: var(--color-primary);
    border-color: #fff;
}

/* ============================================================
   SHARED TYPOGRAPHY HELPERS
   ============================================================ */
.bgre-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 14px;
}
.bgre-section-title {
    font-family: var(--font-heading);
    font-size: clamp(26px, 3.5vw, 42px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
}
.bgre-section-sub {
    font-size: 17px;
    line-height: 1.7;
    color: var(--color-text-light);
    max-width: 600px;
}

/* ============================================================
   1. HERO SECTION
   ============================================================ */
.bgre-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 540px;
    display: flex;
    align-items: center;
}
.bgre-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        rgba(13,16,56,0.88) 0%,
        rgba(13,16,56,0.65) 58%,
        rgba(13,16,56,0.30) 100%
    );
}
.bgre-hero__content {
    position: relative;
    z-index: 1;
    padding: 90px 0;
    max-width: 900px;
    text-align: center;
    margin: 0 auto;
}
.bgre-hero__location {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}
.bgre-hero__title {
    font-family: var(--font-heading);
    font-size: clamp(34px, 5vw, 60px);
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 20px;
}
.bgre-hero__sub {
    font-size: 18px;
    color: rgba(255,255,255,0.85);
    line-height: 1.65;
    margin-bottom: 38px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.bgre-hero__cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   2. IDX / LISTINGS SECTION
   ============================================================ */
.bgre-listings {
    background: var(--color-light-bg);
    padding: 64px 0 80px;
}
.bgre-listings__header {
    text-align: center;
    margin-bottom: 44px;
}
.bgre-listings__header .bgre-section-sub {
    margin: 0 auto;
    text-align: center;
}
/* Luxury section header: gold rule below header text */
.bgre-listings__header {
    position: relative;
    padding-bottom: 48px;
}
.bgre-listings__header::after {
    content: '';
    display: block;
    width: 56px;
    height: 2px;
    background: var(--color-accent);
    margin: 24px auto 0;
}

/* Let iHomeFinder breathe at full width */
.bgre-listings__feed {
    width: 100%;
}
.bgre-listings__feed > * { width: 100% !important; }

/* ============================================================
   IHF LUXURY OVERRIDES
   Targets iHomeFinder Kestrel widget classes. All scoped under
   .bgre-listings to prevent bleed onto other pages.
   NOTE: If class names differ on your account, inspect the
   live page in DevTools (right-click a listing card → Inspect)
   and update the selectors to match.
   ============================================================ */

/* Reset default chrome */
.bgre-listings .ihf-container,
.bgre-listings .ihf-results-wrapper,
.bgre-listings .ihf-main {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* ── Listing cards ──────────────────────────────────────────── */
.bgre-listings .ihf-result-item,
.bgre-listings .ihf-listing-item,
.bgre-listings .ihf-listing-card {
    background: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 14px rgba(0,0,0,0.07) !important;
    overflow: hidden !important;
    transition: box-shadow var(--transition), transform var(--transition) !important;
}
.bgre-listings .ihf-result-item:hover,
.bgre-listings .ihf-listing-item:hover,
.bgre-listings .ihf-listing-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.13) !important;
    transform: translateY(-4px) !important;
}

/* ── Listing photo ──────────────────────────────────────────── */
.bgre-listings .ihf-listing-photo,
.bgre-listings .ihf-image-container,
.bgre-listings .ihf-thumb {
    overflow: hidden !important;
}
.bgre-listings .ihf-listing-photo img,
.bgre-listings .ihf-image-container img,
.bgre-listings .ihf-thumb img {
    width: 100% !important;
    height: 220px !important;
    object-fit: cover !important;
    transition: transform 0.45s ease !important;
    display: block !important;
}
.bgre-listings .ihf-result-item:hover .ihf-listing-photo img,
.bgre-listings .ihf-listing-item:hover .ihf-listing-photo img,
.bgre-listings .ihf-listing-card:hover .ihf-listing-photo img,
.bgre-listings .ihf-result-item:hover .ihf-image-container img {
    transform: scale(1.05) !important;
}

/* ── Status badge ───────────────────────────────────────────── */
.bgre-listings .ihf-listing-status,
.bgre-listings .ihf-status-label,
.bgre-listings .ihf-badge {
    background: var(--color-primary) !important;
    color: var(--color-accent) !important;
    font-family: var(--font-body) !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    padding: 4px 10px !important;
    border-radius: 0 !important;
    border: none !important;
}

/* ── Price ──────────────────────────────────────────────────── */
.bgre-listings .ihf-listing-price,
.bgre-listings .ihf-price,
.bgre-listings [class*="price"] {
    font-family: var(--font-heading) !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: var(--color-primary) !important;
    letter-spacing: 0 !important;
}

/* ── Address ────────────────────────────────────────────────── */
.bgre-listings .ihf-listing-address,
.bgre-listings .ihf-address,
.bgre-listings [class*="address"] {
    font-family: var(--font-body) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--color-text) !important;
}

/* ── Beds / baths / sqft ────────────────────────────────────── */
.bgre-listings .ihf-listing-summary,
.bgre-listings .ihf-prop-summary,
.bgre-listings .ihf-stats,
.bgre-listings .ihf-beds-baths {
    font-family: var(--font-body) !important;
    font-size: 13px !important;
    color: var(--color-text-light) !important;
    border-top: 1px solid #f0f0ee !important;
    padding-top: 10px !important;
    margin-top: 10px !important;
}

/* ── CTA buttons ────────────────────────────────────────────── */
.bgre-listings .ihf-btn,
.bgre-listings a.ihf-detail-link,
.bgre-listings .ihf-result-item a[class*="btn"],
.bgre-listings .ihf-listing-item a[class*="btn"] {
    background: var(--color-primary) !important;
    color: #fff !important;
    font-family: var(--font-body) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    border: 2px solid var(--color-primary) !important;
    border-radius: 0 !important;
    padding: 11px 22px !important;
    display: inline-block !important;
    transition: background var(--transition), color var(--transition) !important;
}
.bgre-listings .ihf-btn:hover,
.bgre-listings a.ihf-detail-link:hover,
.bgre-listings .ihf-result-item a[class*="btn"]:hover {
    background: transparent !important;
    color: var(--color-primary) !important;
}

/* ── Search / filter bar ────────────────────────────────────── */
.bgre-listings .ihf-search-form,
.bgre-listings .ihf-search-bar,
.bgre-listings .ihf-refine-bar,
.bgre-listings .ihf-search-criteria {
    background: #fff !important;
    border: 1px solid #e8e6e0 !important;
    border-radius: 4px !important;
    padding: 18px 24px !important;
    margin-bottom: 32px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
}
.bgre-listings .ihf-search-form input[type="text"],
.bgre-listings .ihf-search-form input[type="number"],
.bgre-listings .ihf-search-form select {
    font-family: var(--font-body) !important;
    font-size: 14px !important;
    border: 1px solid #ddd !important;
    border-radius: 2px !important;
    color: var(--color-text) !important;
    background: #fafaf8 !important;
    padding: 9px 12px !important;
    transition: border-color var(--transition) !important;
}
.bgre-listings .ihf-search-form input:focus,
.bgre-listings .ihf-search-form select:focus {
    border-color: var(--color-accent) !important;
    outline: none !important;
    background: #fff !important;
}
.bgre-listings .ihf-search-form button[type="submit"],
.bgre-listings .ihf-search-submit,
.bgre-listings .ihf-btn-search {
    background: var(--color-primary) !important;
    color: #fff !important;
    font-family: var(--font-body) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    border: none !important;
    border-radius: 2px !important;
    padding: 11px 28px !important;
    cursor: pointer !important;
    transition: background var(--transition) !important;
}
.bgre-listings .ihf-search-form button[type="submit"]:hover,
.bgre-listings .ihf-btn-search:hover {
    background: var(--color-accent) !important;
    color: var(--color-primary) !important;
}

/* ── Sort / results count bar ───────────────────────────────── */
.bgre-listings .ihf-results-header,
.bgre-listings .ihf-results-bar,
.bgre-listings .ihf-sort-bar {
    font-family: var(--font-body) !important;
    font-size: 13px !important;
    color: var(--color-text-light) !important;
    border-bottom: 1px solid #e8e6e0 !important;
    padding-bottom: 14px !important;
    margin-bottom: 24px !important;
}

/* ── Pagination ─────────────────────────────────────────────── */
.bgre-listings .ihf-pager,
.bgre-listings .ihf-pagination,
.bgre-listings [class*="pager"] {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 40px !important;
    flex-wrap: wrap !important;
}
.bgre-listings .ihf-pager a,
.bgre-listings .ihf-pagination a,
.bgre-listings [class*="pager"] a,
.bgre-listings .ihf-pager span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 10px !important;
    font-family: var(--font-body) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--color-primary) !important;
    border: 1px solid #ddd !important;
    border-radius: 2px !important;
    transition: all var(--transition) !important;
    text-decoration: none !important;
}
.bgre-listings .ihf-pager a:hover,
.bgre-listings .ihf-pagination a:hover {
    background: var(--color-primary) !important;
    color: #fff !important;
    border-color: var(--color-primary) !important;
}
.bgre-listings .ihf-pager .active,
.bgre-listings .ihf-pagination .active,
.bgre-listings [class*="pager"] .current {
    background: var(--color-primary) !important;
    color: var(--color-accent) !important;
    border-color: var(--color-primary) !important;
}

/* ============================================================
   3. EXPLORE MORE (PROMO CARDS)
   ============================================================ */
.bgre-explore {
    background: var(--color-primary);
    padding: var(--section-pad) 0;
}
.bgre-explore__header {
    text-align: center;
    margin-bottom: 52px;
}
.bgre-explore__header .bgre-section-title { color: #fff; }
.bgre-explore__header .bgre-section-sub {
    color: rgba(255,255,255,0.58);
    margin: 0 auto;
    text-align: center;
}
.bgre-explore__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}
.bgre-explore-card {
    display: block;
    overflow: hidden;
    border: 1px solid rgba(247,209,135,0.18);
    background: rgba(255,255,255,0.03);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.bgre-explore-card:hover {
    transform: translateY(-5px);
    border-color: rgba(247,209,135,0.5);
    box-shadow: 0 18px 44px rgba(0,0,0,0.38);
}
.bgre-explore-card__img {
    height: 215px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}
.bgre-explore-card__img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 45%, rgba(13,16,56,0.5) 100%);
    transition: var(--transition);
}
.bgre-explore-card:hover .bgre-explore-card__img::after {
    background: linear-gradient(to bottom, transparent 25%, rgba(13,16,56,0.68) 100%);
}
.bgre-explore-card__body {
    padding: 26px 26px 30px;
}
.bgre-explore-card__tag {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 9px;
}
.bgre-explore-card__title {
    font-family: var(--font-heading);
    font-size: 21px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 10px;
}
.bgre-explore-card__desc {
    font-size: 14px;
    color: rgba(255,255,255,0.56);
    line-height: 1.65;
    margin-bottom: 20px;
}
.bgre-explore-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-accent);
    transition: gap var(--transition);
}
.bgre-explore-card:hover .bgre-explore-card__cta { gap: 13px; }
.bgre-explore-card__cta::after { content: '→'; }

/* ============================================================
   4. CONTACT FORM SECTION
   ============================================================ */
.bgre-contact {
    position: relative;
    background-size: cover;
    background-position: center;
    padding: var(--section-pad) 0;
}
.bgre-contact__overlay {
    position: absolute;
    inset: 0;
    background: rgba(13,16,56,0.80);
}
.bgre-contact__inner {
    position: relative;
    z-index: 1;
    max-width: 820px;
    margin: 0 auto;
    padding: 0 28px;
    text-align: center;
}
.bgre-contact__kicker {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-accent);
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.bgre-contact__title {
    font-family: var(--font-heading);
    font-size: clamp(26px, 4vw, 46px);
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    line-height: 1.15;
    white-space: nowrap;
    margin-bottom: 40px;
}

/* ---- Form fields ---- */
.bgre-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}
.bgre-form__input,
.bgre-form__textarea {
    width: 100%;
    padding: 16px 18px;
    background: rgba(255,255,255,0.96);
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition), background var(--transition);
    -webkit-appearance: none;
    border-radius: 0;
}
.bgre-form__input::placeholder,
.bgre-form__textarea::placeholder {
    color: #aaa;
}
.bgre-form__input:focus,
.bgre-form__textarea:focus {
    border-color: var(--color-accent);
    background: #fff;
}
.bgre-form__textarea {
    resize: vertical;
    min-height: 120px;
}
.bgre-form__acceptance {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 4px 0;
}
.bgre-form__acceptance input[type="checkbox"] {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 3px;
    accent-color: var(--color-accent);
    cursor: pointer;
}
.bgre-form__acceptance label {
    font-size: 13px;
    color: rgba(255,255,255,0.72);
    line-height: 1.55;
    cursor: pointer;
}
.bgre-form__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 17px 28px;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: 2px solid var(--color-primary);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    margin-top: 4px;
}
.bgre-form__submit:hover {
    background: #1e2660;
    border-color: #1e2660;
}
.bgre-form__submit i { font-size: 13px; }
/* Success / error notices */
.bgre-form__notice {
    display: none;
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    color: #fff;
}
.bgre-form__notice.is-visible { display: block; }
.bgre-form__notice--success {
    background: rgba(247,209,135,0.15);
    border: 1px solid var(--color-accent);
}
.bgre-form__notice--error {
    background: rgba(200,50,50,0.15);
    border: 1px solid rgba(255,110,110,0.5);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .bgre-explore__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
    /* Contact title: allow wrapping on narrow viewports where nowrap
       would overflow the screen */
    .bgre-contact__title {
        white-space: normal;
        font-size: clamp(24px, 5.5vw, 38px);
        letter-spacing: 1px;
    }
}

@media (max-width: 768px) {
    :root { --section-pad: 56px; }

    /* Hero */
    .bgre-hero { min-height: 400px; }
    .bgre-hero__content { padding: 60px 0; }

    /* Listings */
    .bgre-listings { padding: 48px 0 60px; }
    .bgre-listings__header { margin-bottom: 32px; }

    /* Explore grid: single column */
    .bgre-explore__grid { grid-template-columns: 1fr; }

    /* Contact */
    .bgre-contact__inner { padding: 0 20px; }
}

@media (max-width: 600px) {
    /* Tighten container padding on small phones */
    .bgre-container,
    .bgre-container--wide { padding: 0 18px; }

    /* Hero */
    .bgre-hero { min-height: 360px; }
    .bgre-hero__sub { font-size: 16px; }

    /* Form */
    .bgre-form__input,
    .bgre-form__textarea { padding: 14px 14px; font-size: 16px; /* prevents iOS zoom */ }
    .bgre-form__submit { padding: 15px 20px; font-size: 14px; }

    /* Section headings */
    .bgre-section-sub { font-size: 15px; }

    /* Explore cards */
    .bgre-explore-card__img { height: 185px; }
}

@media (max-width: 480px) {
    .bgre-hero__cta { flex-direction: column; align-items: center; }
    .bgre-hero__content { text-align: center; }
}
