/**
 * Nivasa Estates — Homepage redesign
 *
 * Implements the structural/design reference for the front page. Scoped to
 * .ne-front-page so it only affects the homepage. Colors, fonts and other
 * tokens come from the theme CSS variables (managed via the Customizer) — this
 * file only defines layout, spacing, and component structure.
 *
 * @package Nivasa_Estates
 * @since 1.2.4
 */

/* Local tint used for icon chips / avatar rings (derived from the theme primary,
   with a neutral fallback for browsers without color-mix). */
.ne-front-page {
    --ne-chip-tint: #eef4f7;
    --ne-chip-tint: color-mix( in srgb, var(--ne-primary-color) 10%, #ffffff );
    --ne-card-shadow: 0 12px 30px rgba(22, 32, 43, .09);
}

/* ==========================================================================
   Section shell + headers
   ========================================================================== */
.ne-front-page .ne-section {
    padding: 64px 0;
}
.ne-front-page .ne-home-recommended,
.ne-front-page .ne-featured-properties,
.ne-front-page .ne-home-launches,
.ne-front-page .ne-insights-section {
    background: var(--ne-background-alt);
}
.ne-front-page .ne-home-recently-viewed,
.ne-front-page .ne-home-cities,
.ne-front-page .ne-home-categories,
.ne-front-page .ne-home-types,
.ne-front-page .ne-home-solutions,
.ne-front-page .ne-home-cta {
    background: var(--ne-background);
}
/* Cities + Categories read as one block: tighten the seam between them. */
.ne-front-page .ne-home-cities { padding-bottom: 36px; }
.ne-front-page .ne-home-categories { padding-top: 8px; }

.ne-front-page .ne-section__header {
    text-align: center;
    margin-bottom: 34px;
}
.ne-front-page .ne-section__badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ne-primary-color);
    margin-bottom: 10px;
}
.ne-front-page .ne-section__title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ne-text-primary);
    margin: 0;
    line-height: 1.15;
}
.ne-front-page .ne-section__subtitle {
    font-size: 15px;
    color: var(--ne-text-secondary);
    margin: 8px auto 0;
    max-width: 560px;
}
/* Split header (text left, "View all" link right) — Recommended + Insights. */
.ne-front-page .ne-section__header--split {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    text-align: left;
    flex-wrap: wrap;
}
.ne-front-page .ne-section__header--split .ne-section__subtitle { margin-left: 0; }
.ne-front-page .ne-section__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ne-primary-color);
    text-decoration: none;
    white-space: nowrap;
}
.ne-front-page .ne-section__footer {
    text-align: center;
    margin-top: 38px;
}

/* Shared card chrome */
.ne-front-page .ne-card,
.ne-front-page .ne-property-type-card,
.ne-front-page .ne-launch-card,
.ne-front-page .ne-solution,
.ne-front-page .ne-insight-card {
    background: var(--ne-background);
    border: 1px solid var(--ne-border-color);
    border-radius: 16px;
    transition: box-shadow .2s ease, transform .2s ease;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.ne-front-page .ne-hero {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: var(--ne-primary-dark);
}
.ne-front-page .ne-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient( 90deg, rgba(12, 24, 34, .72) 0%, rgba(12, 24, 34, .5) 55%, rgba(12, 24, 34, .15) 100% );
}
.ne-front-page .ne-hero .ne-container { position: relative; z-index: 1; }
.ne-front-page .ne-hero__inner { display: block; }
.ne-front-page .ne-hero__side { display: none; } /* not part of the redesign */
.ne-front-page .ne-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #e9d9b4;
    background: rgba(176, 138, 70, .22);
    border: 1px solid rgba(229, 217, 180, .4);
    padding: 7px 14px;
    border-radius: 30px;
}
.ne-front-page .ne-hero__title {
    font-size: clamp(34px, 5vw, 58px);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.05;
    color: #fff;
    margin: 22px 0 0;
    max-width: 640px;
}
.ne-front-page .ne-hero__subtitle {
    font-size: 18px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .82);
    margin: 18px 0 0;
    max-width: 520px;
}
.ne-front-page .ne-hero__actions {
    display: flex;
    gap: 13px;
    margin-top: 32px;
    flex-wrap: wrap;
}

/* ==========================================================================
   Home search (overlaps the hero) + side image
   ========================================================================== */
.ne-front-page .ne-home-search {
    background: var(--ne-background-alt);
    padding: 0;
}
.ne-front-page .ne-home-search__grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 24px;
    align-items: stretch;
    transform: translateY(-64px);
    margin-bottom: -40px;
}
.ne-front-page .ne-home-search__card {
    background: var(--ne-background);
    border: 1px solid var(--ne-border-color);
    border-radius: 20px;
    padding: 30px 32px;
    box-shadow: 0 22px 50px rgba(22, 32, 43, .10);
}
.ne-front-page .ne-home-search__title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ne-text-primary);
    margin: 0;
}
.ne-front-page .ne-home-search__text {
    font-size: 14px;
    color: var(--ne-text-secondary);
    margin: 7px 0 20px;
}
/* Buy / List segmented control */
.ne-front-page .ne-home-search__actions {
    display: inline-flex;
    gap: 6px;
    background: var(--ne-background-alt);
    padding: 5px;
    border-radius: 11px;
    margin: 0 0 22px;
}
.ne-front-page .ne-home-search__action {
    font-size: 13.5px;
    font-weight: 700;
    padding: 9px 18px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--ne-text-secondary);
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
}
.ne-front-page .ne-home-search__action.is-active {
    background: var(--ne-background);
    color: var(--ne-primary-color);
    box-shadow: 0 2px 6px rgba(22, 32, 43, .1);
}
/* The [ne_property_search] box becomes a flat 2-column grid inside the card. */
.ne-front-page .ne-home-search .ne-search-box {
    background: transparent;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
}
.ne-front-page .ne-home-search .ne-search-box__form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: end;
}
.ne-front-page .ne-home-search .ne-search-box__field--submit {
    grid-column: 1 / -1;
}
.ne-front-page .ne-home-search .ne-search-box__field--submit .ne-btn {
    width: 100%;
    justify-content: center;
}
.ne-front-page .ne-home-search__media {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 22px 50px rgba(22, 32, 43, .10);
    min-height: 300px;
    background: var(--ne-background-alt);
}
.ne-front-page .ne-home-search__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ne-front-page .ne-home-search__image--placeholder {
    min-height: 300px;
    background: linear-gradient(135deg, var(--ne-background-alt), color-mix(in srgb, var(--ne-primary-color) 12%, #fff));
}

/* ==========================================================================
   Recommended (plugin shortcode) — theme section header drives the heading
   ========================================================================== */
.ne-front-page .ne-home-recommended .wpl-rec-title { display: none; }
.ne-front-page .ne-home-recommended .wpl-recommended-grid { gap: 22px; }

/* ==========================================================================
   Recently Viewed (plugin shortcode) — restyle the carousel into the reference
   4-up grid of compact horizontal mini-cards (image left, title/loc/price right).
   The plugin renders full vertical cards in a scroller; these overrides reshape
   that output. Scoped to the homepage section so the plugin's other placements
   (e.g. single-property pages) keep the carousel.
   ========================================================================== */
.ne-front-page .ne-home-recently-viewed .wpl-recently-viewed { margin: 0; }
/* Heading like the reference (left-aligned), kept INSIDE the plugin's container
   so it hides together with the strip when the visitor has no history. */
.ne-front-page .ne-home-recently-viewed .wpl-rec-title {
    display: block;
    text-align: left;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--ne-text-primary);
    margin: 0 0 18px;
}
/* Drop the carousel chrome and lay the items out as a 4-column grid. */
.ne-front-page .ne-home-recently-viewed .wpl-rv-carousel { position: static; }
.ne-front-page .ne-home-recently-viewed .wpl-rv-nav { display: none !important; }
.ne-front-page .ne-home-recently-viewed .wpl-rv-track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    overflow: visible;
    padding: 0;
}
.ne-front-page .ne-home-recently-viewed .wpl-rv-track > a {
    flex: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 13px;
    background: var(--ne-background);
    border: 1px solid var(--ne-border-color);
    border-radius: 13px;
    padding: 10px;
    overflow: hidden;
    text-decoration: none;
}
.ne-front-page .ne-home-recently-viewed .wpl-card-image-modern {
    width: 74px;
    height: 62px;
    flex: 0 0 auto;
    border-radius: 9px;
    overflow: hidden;
    position: relative;
}
.ne-front-page .ne-home-recently-viewed .wpl-card-image-modern img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ne-front-page .ne-home-recently-viewed .wpl-image-gradient { display: none; }
.ne-front-page .ne-home-recently-viewed .wpl-card-body-modern {
    display: block;
    padding: 0;
    min-width: 0;
}
.ne-front-page .ne-home-recently-viewed .wpl-card-title-modern {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ne-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ne-front-page .ne-home-recently-viewed .wpl-card-location-modern {
    font-size: 11.5px;
    color: var(--ne-text-muted);
    margin-top: 2px;
    gap: 3px;
}
.ne-front-page .ne-home-recently-viewed .wpl-card-location-modern .dashicons { display: none; }
.ne-front-page .ne-home-recently-viewed .wpl-card-footer-modern {
    display: block;
    margin-top: 5px;
}
.ne-front-page .ne-home-recently-viewed .wpl-card-price-modern {
    font-size: 14px;
    font-weight: 800;
    color: var(--ne-primary-color);
}
.ne-front-page .ne-home-recently-viewed .wpl-btn-view-modern { display: none; }

@media (max-width: 992px) {
    .ne-front-page .ne-home-recently-viewed .wpl-rv-track { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .ne-front-page .ne-home-recently-viewed .wpl-rv-track { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Cities — circular avatars
   ========================================================================== */
.ne-front-page .ne-home-cities__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 42px;
}
.ne-front-page .ne-city-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 13px;
    text-decoration: none;
}
.ne-front-page .ne-city-chip__media {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--ne-chip-tint);
    box-shadow: 0 8px 22px rgba(22, 32, 43, .08);
    display: block;
}
.ne-front-page .ne-city-chip__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ne-front-page .ne-city-chip__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ne-chip-tint);
    color: var(--ne-primary-color);
    font-size: 30px;
    font-weight: 800;
}
.ne-front-page .ne-city-chip__name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ne-text-primary);
}

/* ==========================================================================
   Quick Property Categories — image tiles
   ========================================================================== */
.ne-front-page .ne-home-categories__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.ne-front-page .ne-category-tile {
    position: relative;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    display: block;
    text-decoration: none;
}
.ne-front-page .ne-category-tile__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--ne-primary-dark);
}
.ne-front-page .ne-category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(12, 24, 34, .78) 0%, rgba(12, 24, 34, .05) 60%);
}
.ne-front-page .ne-category-tile__label {
    position: absolute;
    left: 18px;
    bottom: 16px;
    z-index: 1;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
}

/* ==========================================================================
   Featured properties grid ([ne_properties] cards)
   ========================================================================== */
.ne-front-page .ne-featured-properties .ne-property-grid,
.ne-front-page .ne-featured-properties .ne-properties-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ==========================================================================
   Explore by Property Type — horizontal pills
   ========================================================================== */
.ne-front-page .ne-property-types__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.ne-front-page .ne-property-type-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 18px;
    align-items: center;
    text-align: left;
    padding: 22px 24px;
    border-radius: 14px;
    text-decoration: none;
}
.ne-front-page .ne-property-type-card:hover { box-shadow: var(--ne-card-shadow); transform: translateY(-2px); }
.ne-front-page .ne-property-type-card__icon {
    grid-row: 1 / span 2;
    width: 52px;
    height: 52px;
    border-radius: 13px;
    background: var(--ne-chip-tint);
    color: var(--ne-primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ne-front-page .ne-property-type-card__icon svg { width: 24px; height: 24px; }
.ne-front-page .ne-property-type-card__count {
    grid-column: 2;
    align-self: end;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ne-text-primary);
}
.ne-front-page .ne-property-type-card__name {
    grid-column: 2;
    align-self: start;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ne-text-secondary);
}

/* ==========================================================================
   New Launches
   ========================================================================== */
.ne-front-page .ne-home-launches__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.ne-front-page .ne-launch-card {
    display: block;
    overflow: hidden;
    text-decoration: none;
}
.ne-front-page .ne-launch-card:hover { box-shadow: var(--ne-card-shadow); transform: translateY(-2px); }
.ne-front-page .ne-launch-card__media {
    display: block;
    height: 170px;
    background-size: cover;
    background-position: center;
    background-color: var(--ne-background-alt);
}
.ne-front-page .ne-launch-card__content { display: block; padding: 16px 18px 18px; }
.ne-front-page .ne-launch-card__title {
    display: block;
    font-size: 15.5px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--ne-text-primary);
}
.ne-front-page .ne-launch-card__subtitle {
    display: block;
    font-size: 12.5px;
    color: var(--ne-text-muted);
    margin-top: 3px;
}

/* ==========================================================================
   Complete Real Estate Solutions
   ========================================================================== */
.ne-front-page .ne-home-solutions__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    text-align: left;
}
.ne-front-page .ne-solution { padding: 24px; border-radius: 15px; }
.ne-front-page .ne-solution:hover { box-shadow: var(--ne-card-shadow); transform: translateY(-2px); }
.ne-front-page .ne-solution__icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--ne-chip-tint);
    color: var(--ne-primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.ne-front-page .ne-solution__icon svg { width: 22px; height: 22px; }
.ne-front-page .ne-solution__title {
    font-size: 16px;
    font-weight: 800;
    color: var(--ne-text-primary);
    margin: 0;
}
.ne-front-page .ne-solution__text {
    font-size: 13.5px;
    color: var(--ne-text-secondary);
    line-height: 1.55;
    margin: 7px 0 0;
}

/* ==========================================================================
   Insights
   ========================================================================== */
.ne-front-page .ne-insights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.ne-front-page .ne-insight-card { overflow: hidden; }
.ne-front-page .ne-insight-card:hover { box-shadow: var(--ne-card-shadow); transform: translateY(-2px); }
.ne-front-page .ne-insight-card__image { height: 180px; overflow: hidden; }
.ne-front-page .ne-insight-card__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ne-front-page .ne-insight-card__content { padding: 18px 20px 20px; }

/* ==========================================================================
   CTA banner
   ========================================================================== */
.ne-front-page .ne-home-cta__banner {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    padding: 52px 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
    background-size: cover;
    background-position: center;
    background-color: var(--ne-primary-color);
}
.ne-front-page .ne-home-cta__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(12, 24, 34, .82), rgba(12, 24, 34, .35));
}
.ne-front-page .ne-home-cta__content { position: relative; z-index: 1; }
.ne-front-page .ne-home-cta__title {
    color: #fff;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0;
}
.ne-front-page .ne-home-cta__text {
    color: rgba(255, 255, 255, .85);
    font-size: 15.5px;
    margin: 10px 0 0;
    max-width: 520px;
}
.ne-front-page .ne-home-cta__actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 13px;
    flex-wrap: wrap;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
    .ne-front-page .ne-home-search__grid { grid-template-columns: 1fr; transform: none; margin-bottom: 0; }
    .ne-front-page .ne-home-search { padding: 48px 0; }
    .ne-front-page .ne-home-search__media { min-height: 220px; }
    .ne-front-page .ne-home-categories__grid { grid-template-columns: repeat(2, 1fr); }
    .ne-front-page .ne-property-types__grid,
    .ne-front-page .ne-home-launches__grid,
    .ne-front-page .ne-home-solutions__grid,
    .ne-front-page .ne-insights-grid,
    .ne-front-page .ne-featured-properties .ne-property-grid,
    .ne-front-page .ne-featured-properties .ne-properties-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .ne-front-page .ne-section { padding: 44px 0; }
    .ne-front-page .ne-section__title { font-size: 26px; }
    .ne-front-page .ne-home-search .ne-search-box__form { grid-template-columns: 1fr; }
    .ne-front-page .ne-home-categories__grid,
    .ne-front-page .ne-property-types__grid,
    .ne-front-page .ne-home-launches__grid,
    .ne-front-page .ne-home-solutions__grid,
    .ne-front-page .ne-insights-grid,
    .ne-front-page .ne-featured-properties .ne-property-grid,
    .ne-front-page .ne-featured-properties .ne-properties-grid { grid-template-columns: 1fr; }
    .ne-front-page .ne-home-cities__grid { gap: 26px; }
    .ne-front-page .ne-city-chip__media { width: 76px; height: 76px; }
    .ne-front-page .ne-home-cta__banner { padding: 36px 28px; }
    .ne-front-page .ne-section__header--split { align-items: flex-start; }
}
