/* =====================================================
   SGP HOMEPAGE — homepage-styles.css
   Place at: /wp-content/themes/my-theme-child/sgp/homepage-styles.css
   ===================================================== */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue:       #2563eb;
    --blue-dark:  #1d4ed8;
    --blue-light: #eff6ff;
    --sale-green: #16a34a;
    --rent-orange:#ea580c;
    --dark:       #111827;
    --mid:        #374151;
    --grey:       #6b7280;
    --light:      #f9fafb;
    --border:     #e5e7eb;
    --white:      #ffffff;
    --shadow:     0 4px 20px rgba(0,0,0,.08);
    --shadow-lg:  0 8px 40px rgba(0,0,0,.14);
    --radius:     12px;
    --radius-sm:  8px;
    --serif:      'Playfair Display', Georgia, 'Times New Roman', serif;
    --sans:       'DM Sans', 'Segoe UI', system-ui, sans-serif;
}

body { font-family: var(--sans); color: var(--dark); }

.sgp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── SECTION HEADERS ── */
.sgp-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 32px;
}

.sgp-section-head.centered {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sgp-section-title {
    font-family: var(--serif);
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.sgp-section-sub {
    font-size: 15px;
    color: var(--grey);
    max-width: 520px;
}

.sgp-view-all {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s;
    flex-shrink: 0;
    margin-left: 20px;
}
.sgp-view-all:hover { color: var(--blue-dark); }

/* ════════════════════════════════
   HERO SECTION
════════════════════════════════ */
.sgp-hero {
    position: relative;
    min-height: 580px;
    background: var(--dark) center/cover no-repeat;
    display: flex;
    align-items: center;
    padding: 80px 24px 60px;
}

.sgp-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(17,24,39,.82) 0%, rgba(17,24,39,.55) 100%);
}

.sgp-hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.sgp-hero-title {
    font-family: var(--serif);
    font-size: clamp(36px, 6vw, 68px);
    font-weight: 700;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 14px;
    letter-spacing: -.5px;
}

.sgp-hero-sub {
    font-size: clamp(15px, 2vw, 18px);
    color: rgba(255,255,255,.75);
    margin-bottom: 36px;
    font-weight: 400;
}

/* Search Bar */
.sgp-hero-search {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto 32px;
}

.sgp-search-tabs {
    display: flex;
    background: #1f2937;
}

.sgp-stab {
    padding: 12px 28px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,.5);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--sans);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all .2s;
    letter-spacing: .3px;
}

.sgp-stab.active,
.sgp-stab:hover {
    color: var(--white);
    border-bottom-color: var(--blue);
}

.sgp-hero-form { width: 100%; }

.sgp-hero-fields {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 12px 12px 12px 0;
}

.sgp-hf {
    flex: 1;
    min-width: 0;
    padding: 0 14px;
    display: flex;
    align-items: center;
}

.sgp-hf-divider {
    border-left: 1px solid var(--border);
}

.sgp-hf-select {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: var(--sans);
    color: var(--dark);
    cursor: pointer;
    outline: none;
    padding: 6px 0;
}

.sgp-hf-price {
    gap: 6px;
    flex: 1.2;
}

.sgp-price-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: var(--sans);
    color: var(--dark);
    outline: none;
    min-width: 0;
    padding: 6px 0;
}

.sgp-price-input::placeholder { color: #9ca3af; }

.sgp-price-sep {
    color: var(--grey);
    font-size: 13px;
    flex-shrink: 0;
}

.sgp-hero-search-btn {
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--sans);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    margin: 4px;
    transition: background .2s;
}

.sgp-hero-search-btn:hover { background: var(--blue-dark); }

/* Stats */
.sgp-hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.sgp-stat {
    text-align: center;
    padding: 0 28px;
}

.sgp-stat strong {
    display: block;
    font-family: var(--serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
}

.sgp-stat span {
    font-size: 13px;
    color: rgba(255,255,255,.6);
    text-transform: uppercase;
    letter-spacing: .8px;
}

.sgp-stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,.2);
    flex-shrink: 0;
}

/* ════════════════════════════════
   FEATURED LISTINGS
════════════════════════════════ */
.sgp-featured {
    padding: 72px 0;
    background: var(--light);
}

/* Type filter tabs */
.sgp-type-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.sgp-type-tab {
    padding: 9px 20px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--white);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--sans);
    color: var(--grey);
    cursor: pointer;
    transition: all .2s;
}

.sgp-type-tab:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.sgp-type-tab.active {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
    font-weight: 600;
}

/* Cards Grid */
.sgp-featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.sgp-fcard {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .22s, box-shadow .22s;
}

.sgp-fcard:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.sgp-fcard-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.sgp-fcard-img {
    height: 200px;
    background: #e5e7eb center/cover no-repeat;
    position: relative;
    overflow: hidden;
}

.sgp-fcard-nophoto {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}

.sgp-fcard-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    font-family: var(--sans);
}

.sgp-fcard-badge + .sgp-fcard-badge {
    left: auto;
    right: 12px;
}

.sgp-fcard-badge.sale { background: var(--sale-green); color: #fff; }
.sgp-fcard-badge.rent { background: var(--rent-orange); color: #fff; }
.sgp-fcard-badge.unit { background: #7c3aed; color: #fff; }

.sgp-fcard-body {
    padding: 16px 18px 18px;
}

.sgp-fcard-title {
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sgp-fcard-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--grey);
    margin-bottom: 10px;
}

.sgp-fcard-price {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.sgp-fcard-specs {
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: var(--grey);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sgp-fcard-specs span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sgp-fcard-agent {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--mid);
    font-weight: 500;
}

.sgp-fcard-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    font-family: var(--serif);
}

/* No listings & placeholder */
.sgp-no-listings, .sgp-placeholder-notice {
    grid-column: 1/-1;
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
    font-size: 15px;
    color: var(--grey);
}

.sgp-no-listings a, .sgp-placeholder-notice a {
    color: var(--blue);
    font-weight: 600;
}

/* ════════════════════════════════
   WHY CHOOSE US
════════════════════════════════ */
.sgp-why {
    padding: 72px 0;
    background: var(--white);
}

.sgp-why-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.sgp-why-card {
    text-align: center;
    padding: 32px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: box-shadow .2s, transform .2s, border-color .2s;
}

.sgp-why-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--blue);
}

.sgp-why-icon {
    width: 60px;
    height: 60px;
    background: var(--blue-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: var(--blue);
    transition: background .2s;
}

.sgp-why-card:hover .sgp-why-icon {
    background: var(--blue);
    color: #fff;
}

.sgp-why-card h3 {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.sgp-why-card p {
    font-size: 14px;
    color: var(--grey);
    line-height: 1.7;
}

/* ════════════════════════════════
   LATEST NEWS
════════════════════════════════ */
.sgp-news {
    padding: 72px 0;
    background: var(--light);
}

.sgp-news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-bottom: 36px;
}

.sgp-news-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .22s, box-shadow .22s;
}

.sgp-news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.sgp-news-img {
    height: 180px;
    background: #e5e7eb center/cover no-repeat;
}

.sgp-news-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}

.sgp-news-img-link { display: block; }

.sgp-news-body { padding: 16px 18px 20px; }

.sgp-news-title {
    font-family: var(--serif);
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.45;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
}

.sgp-news-card a { text-decoration: none; }
.sgp-news-card a:hover .sgp-news-title { color: var(--blue); }

.sgp-news-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--grey);
    margin-bottom: 10px;
}

.sgp-news-excerpt {
    font-size: 13px;
    color: var(--grey);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sgp-news-cta {
    text-align: center;
}

.sgp-outline-btn {
    display: inline-block;
    padding: 13px 36px;
    border: 2px solid var(--blue);
    border-radius: var(--radius-sm);
    color: var(--blue);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--sans);
    text-decoration: none;
    transition: all .2s;
}

.sgp-outline-btn:hover {
    background: var(--blue);
    color: var(--white);
}

/* ════════════════════════════════
   CONTACT SECTION
════════════════════════════════ */
.sgp-contact {
    position: relative;
    padding: 80px 24px;
    background: var(--dark) center/cover no-repeat;
}

.sgp-contact-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.58);
}

.sgp-contact .sgp-container {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
}

.sgp-contact-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px 44px;
    width: 100%;
    max-width: 700px;
    box-shadow: var(--shadow-lg);
}

.sgp-contact-card h2 {
    font-family: var(--serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
    text-align: center;
}

.sgp-contact-card > p {
    font-size: 14px;
    color: var(--grey);
    text-align: center;
    margin-bottom: 24px;
}

.sgp-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.sgp-cf-full {
    grid-column: 1 / -1;
}

.sgp-cf-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--grey);
    margin-bottom: 6px;
    font-family: var(--sans);
}

.sgp-cf-group input,
.sgp-cf-group select,
.sgp-cf-group textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 14px;
    font-family: var(--sans);
    color: var(--dark);
    background: var(--white);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    resize: vertical;
}

.sgp-cf-group input:focus,
.sgp-cf-group select:focus,
.sgp-cf-group textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.sgp-contact-submit {
    width: 100%;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--sans);
    cursor: pointer;
    transition: background .2s;
    letter-spacing: .3px;
}

.sgp-contact-submit:hover { background: var(--blue-dark); }
.sgp-contact-submit:disabled { background: #93c5fd; cursor: default; }

/* Form messages */
.sgp-form-message {
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--sans);
    margin-bottom: 16px;
}

.sgp-form-message.success { background: #dcfce7; color: #166534; }
.sgp-form-message.error   { background: #fee2e2; color: #991b1b; }

/* Card fade-in animation */
@keyframes sgpFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sgp-fcard { animation: sgpFadeIn .4s ease both; }
.sgp-fcard:nth-child(1) { animation-delay: .05s; }
.sgp-fcard:nth-child(2) { animation-delay: .12s; }
.sgp-fcard:nth-child(3) { animation-delay: .19s; }
.sgp-fcard:nth-child(4) { animation-delay: .26s; }

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */

/* Tablet: 1024px */
@media (max-width: 1024px) {
    .sgp-featured-grid { grid-template-columns: repeat(2, 1fr); }
    .sgp-why-grid       { grid-template-columns: repeat(2, 1fr); }
    .sgp-news-grid      { grid-template-columns: repeat(2, 1fr); }
    .sgp-hero-fields    { flex-wrap: wrap; padding: 12px; gap: 8px; }
    .sgp-hf             { flex: 1 1 45%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
    .sgp-hf-divider     { border-left: none; }
    .sgp-hero-search-btn { width: 100%; justify-content: center; margin: 0; border-radius: 8px; padding: 13px; }
}

/* Mobile: 768px */
@media (max-width: 768px) {
    .sgp-hero { min-height: 500px; padding: 60px 16px 40px; }
    .sgp-hero-title { font-size: 34px; }
    .sgp-stab { padding: 10px 18px; font-size: 13px; }
    .sgp-hero-stats { gap: 0; }
    .sgp-stat { padding: 0 16px; }
    .sgp-stat strong { font-size: 22px; }

    .sgp-featured, .sgp-why, .sgp-news { padding: 48px 0; }
    .sgp-featured-grid { grid-template-columns: 1fr; }
    .sgp-why-grid       { grid-template-columns: 1fr; }
    .sgp-news-grid      { grid-template-columns: 1fr; }

    .sgp-section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
    .sgp-view-all { margin-left: 0; }

    .sgp-contact-card { padding: 28px 20px; }
    .sgp-contact-grid { grid-template-columns: 1fr; }
    .sgp-cf-full { grid-column: 1; }

    .sgp-hf { flex: 1 1 100%; }
}

/* Small mobile: 480px */
@media (max-width: 480px) {
    .sgp-hero-title { font-size: 28px; }
    .sgp-hero-sub   { font-size: 14px; }
    .sgp-search-tabs { flex-wrap: wrap; }
    .sgp-stab { flex: 1; text-align: center; }
    .sgp-hero-stats { flex-direction: column; gap: 16px; }
    .sgp-stat-divider { width: 60px; height: 1px; }
    .sgp-type-tabs { gap: 6px; }
    .sgp-type-tab { font-size: 13px; padding: 7px 14px; }
}


/* ─────────────────────────────────────────────
   HERO SEARCH WRAPPER
   Paste this at the bottom of homepage-styles.css
   This makes the shared search-filter.php look
   correct when embedded inside the hero section.
───────────────────────────────────────────── */

.sgp-hero-search-wrapper {
    max-width: 960px;
    margin: 0 auto 32px;
    position: relative;
    z-index: 2;
}

/* Override search bar styles inside hero so it fits the dark background */
.sgp-hero-search-wrapper .sgp-search-wrap {
    border-radius: var(--radius);
    box-shadow: 0 12px 48px rgba(0,0,0,.35);
    overflow: hidden;
}

/* Keep search fields compact inside hero */
.sgp-hero-search-wrapper .sgp-search-fields {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    padding: 14px 16px;
}

.sgp-hero-search-wrapper .sgp-field-group {
    padding: 4px 10px;
}

/* Hide the active filter tags on homepage (they show on listing page instead) */
.sgp-hero-search-wrapper .sgp-active-filters {
    display: none;
}

@media (max-width: 768px) {
    .sgp-hero-search-wrapper .sgp-search-fields {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .sgp-hero-search-wrapper .sgp-search-fields {
        grid-template-columns: 1fr;
    }
}
