/**
 * Featured Homes CSS - FIGMA MATCH v12.1
 * Version: 12.1 - February 2026
 * 
 * FIXES v12.1:
 * ✅ ESTIMATED COMPLETION BADGE: #5A4F42 (was using #928572)
 * 
 * UPDATES v12.0:
 * - Updated badge colors per Figma specs
 * - under-construction: #928572
 * - plan-ready-lot: #606E76
 * - for-sale: #6A8375
 * - in-contract: #666666
 * - sold: #EEEEEE (light gray)
 * - coming-soon: black text, black border, white bg
 * - estimated-completion: #5A4F42 (FIXED!)
 */

/* ========================================
   CSS VARIABLES - FIGMA COLORS
======================================== */

:root {
    --fh-dark-text: #2A2A2A;
    --fh-light-text: #666666;
    --fh-border: #E8E5DF;
    --fh-white: #FFFFFF;
    
    /* Badge Colors - UPDATED v12.1 */
    --fh-badge-under-construction: #928572;
    --fh-badge-plan-ready-lot: #606E76;
    --fh-badge-for-sale: #6A8375;
    --fh-badge-in-contract: #666666;
    --fh-badge-sold: #EEEEEE;
    --fh-badge-coming-soon-text: #2A2A2A;
    --fh-badge-coming-soon-border: #2A2A2A;
    --fh-badge-estimated-completion: #5A4F42; /* v12.1 FIX */
    
    /* Legacy - keeping for backward compatibility */
    --fh-badge-move-in: #6A8375;
    --fh-badge-promo: #F05759;
    --fh-badge-construction: #928572;
}

/* ========================================
   SECTION & CONTAINER
======================================== */

.featured-homes-section-complete {
    width: 100%;
    padding: 30px 0 80px 0;
    background: #FFFFFF;
}

.featured-homes-max-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   SECTION HEADER
======================================== */

.featured-section-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 60px;
    gap: 20px;
}

.featured-header-left {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.featured-section-title {
    color: var(--fh-dark-text);
    font-size: 40px;
    font-family: 'Sofia Sans', 'Sofia Pro', sans-serif;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
}

.featured-section-description {
    color: var(--fh-light-text);
    font-size: 18px;
    font-family: 'Afacad Flux', sans-serif;
    font-weight: 400;
    margin: 0;
    line-height: 1.5;
}

.featured-header-right {
    display: flex;
    align-items: center;
}

.featured-button-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--fh-dark-text);
    font-size: 16px;
    font-family: 'Afacad Flux', sans-serif;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.3s ease;
}

.featured-button-link:hover {
    color: #000000;
}

.featured-button-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--fh-dark-text);
    color: white;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    transition: all 0.3s ease;
}

.featured-button-link:hover .featured-button-arrow {
    background: #000000;
    transform: translateX(4px);
}

/* ========================================
   GRID LAYOUT - 3 COLUMNS
   Total: 1200px = 3×380px + 2×30px
======================================== */

.featured-grid-complete {
    display: grid;
    gap: 30px;
    margin-bottom: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    align-items: stretch;
}

.featured-grid-complete.page-transitioning {
    opacity: 0;
    transform: translateY(20px);
}

.featured-grid-complete.page-ready {
    opacity: 1;
    transform: translateY(0);
}

.featured-cols-3 {
    grid-template-columns: repeat(3, 380px);
    justify-content: center;
    gap: 30px;
}

.featured-cols-2 {
    grid-template-columns: repeat(2, 380px);
    justify-content: center;
    gap: 30px;
}

.featured-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ========================================
   PROPERTY CARD - FIGMA EXACT
======================================== */

.featured-property-item {
    display: flex;
    flex-direction: column;
    background: transparent;
    width: 380px;
    opacity: 0;
    transform: translateY(30px);
    height: 100%;
}

.featured-property-item.fade-in {
    animation: cardFadeIn 0.5s ease forwards;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.featured-property-item.fade-in:hover {
    transform: translateY(-4px) !important;
    transition: transform 0.3s ease;
}

.featured-item-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
    flex: 1;
}

/* ========================================
   IMAGE - FIGMA: 380×214px
======================================== */

.featured-item-image {
    width: 380px;
    height: 214px;
    min-height: 214px;
    max-height: 214px;
    overflow: hidden;
    background: #f5f3f0;
    position: relative;
    flex-shrink: 0;
}

.featured-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform 0.4s ease;
}

.featured-property-item:hover .featured-item-image img {
    transform: scale(1.05);
}

/* ========================================
   CONTENT BOX - FIGMA EXACT
   Padding: 10px left/right, 15px top/bottom
======================================== */

.featured-item-content {
    background: var(--fh-white);
    border-left: 1px solid var(--fh-border);
    border-right: 1px solid var(--fh-border);
    border-bottom: none;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 100px;
}

/* ========================================
   BADGES - UPDATED v12.1 COLORS
======================================== */

.property-badges-row-figma {
    display: inline-flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 5px;
    flex-wrap: wrap;
    flex-direction: row;
}

.badge-pill-figma {
    position: relative;
    padding: 5px 15px;
    border-radius: 50px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

/* Badge Text Styles */
.badge-text-white {
    color: var(--fh-white);
    font-size: 12px;
    font-family: 'Afacad Flux', sans-serif;
    font-weight: 400;
    word-wrap: break-word;
}

.badge-text-primary {
    color: var(--fh-dark-text);
    font-size: 12px;
    font-family: 'Afacad Flux', sans-serif;
    font-weight: 400;
    word-wrap: break-word;
}

.badge-text-light {
    color: var(--fh-white);
    font-size: 12px;
    font-family: 'Afacad Flux', sans-serif;
    font-weight: 400;
    word-wrap: break-word;
}

.badge-text-bold {
    color: var(--fh-white);
    font-size: 12px;
    font-family: 'Afacad Flux', sans-serif;
    font-weight: 400;
    word-wrap: break-word;
}

/* ========================================
   BADGE COLORS - v12.1 UPDATED
======================================== */

/* Under Construction - #928572 */
.badge-under-construction,
.badge-in-construction {
    background: var(--fh-badge-under-construction) !important;
}

.badge-under-construction .badge-text-white,
.badge-under-construction .badge-text-primary,
.badge-in-construction .badge-text-white,
.badge-in-construction .badge-text-primary {
    color: var(--fh-white) !important;
}

/* ========================================
   v12.1 FIX: ESTIMATED COMPLETION - #5A4F42
======================================== */

.badge-estimated-completion {
    background: var(--fh-badge-estimated-completion) !important;
    background: #5A4F42 !important;
}

.badge-estimated-completion .badge-text-light,
.badge-estimated-completion .badge-text-bold,
.badge-estimated-completion .badge-text-white {
    color: var(--fh-white) !important;
}

/* Plan Ready Lot - #606E76 */
.badge-plan-ready-lot {
    background: var(--fh-badge-plan-ready-lot) !important;
}

.badge-plan-ready-lot .badge-text-white {
    color: var(--fh-white) !important;
}

/* For Sale - #6A8375 */
.badge-for-sale {
    background: var(--fh-badge-for-sale) !important;
}

.badge-for-sale .badge-text-white {
    color: var(--fh-white) !important;
}

/* Move-In Ready (same as For Sale) - #6A8375 */
.badge-move-in-ready {
    background: var(--fh-badge-for-sale) !important;
}

.badge-move-in-ready .badge-text-white {
    color: var(--fh-white) !important;
}

/* In Contract - #666666 */
.badge-in-contract {
    background: var(--fh-badge-in-contract) !important;
}

.badge-in-contract .badge-text-white {
    color: var(--fh-white) !important;
}

/* Sold - #EEEEEE (light gray, dark text) */
.badge-sold {
    background: var(--fh-badge-sold) !important;
    outline: none !important;
}

.badge-sold .badge-text-white,
.badge-sold .badge-text-primary {
    color: var(--fh-dark-text) !important;
}

/* Reserved - White with border */
.badge-reserved {
    background: var(--fh-white) !important;
    outline: 1px solid var(--fh-border) !important;
    outline-offset: -1px;
}

.badge-reserved .badge-text-white {
    color: var(--fh-dark-text) !important;
}

/* Coming Soon - Black text, black border, white bg */
.badge-coming-soon {
    background: var(--fh-white) !important;
    border: 1px solid var(--fh-badge-coming-soon-border) !important;
    outline: none !important;
}

.badge-coming-soon .badge-text-white,
.badge-coming-soon .badge-text-primary {
    color: var(--fh-badge-coming-soon-text) !important;
    font-family: 'Afacad Flux', sans-serif !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: normal !important;
}

/* Promo Badge - White with border */
.badge-promo {
    background: var(--fh-white) !important;
    outline: 1px solid var(--fh-border) !important;
    outline-offset: -1px;
}

.badge-promo .badge-text-white {
    color: var(--fh-dark-text) !important;
}

/* Hide on-sale badge (legacy) */
.badge-on-sale,
.badge-pill-figma.badge-on-sale {
    display: none !important;
}

/* ========================================
   TITLE & ADDRESS - FIGMA EXACT
======================================== */

.featured-item-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.featured-item-title {
    color: var(--fh-dark-text);
    font-size: 20px;
    font-family: 'Afacad Flux', sans-serif;
    font-weight: 400;
    text-transform: capitalize;
    margin: 0;
    line-height: 1.2;
    word-wrap: break-word;
}

.featured-item-address {
    color: var(--fh-light-text);
    font-size: 16px;
    font-family: 'Afacad Flux', sans-serif;
    font-weight: 400;
    line-height: 1.3;
    word-wrap: break-word;
}

/* ========================================
   SPECS BAR - FIGMA EXACT
   Height: 75px
   Borders: left, top, bottom on cells
   Last cell: outline (all 4 sides)
======================================== */

.featured-specs-row {
    display: flex;
    align-items: stretch;
    height: 75px;
    background: var(--fh-white);
    margin-top: auto;
    flex-shrink: 0;
}

.featured-spec-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 13px 10px;
    background: var(--fh-white);
    border-left: 1px solid var(--fh-border);
    border-top: 1px solid var(--fh-border);
    border-bottom: 1px solid var(--fh-border);
}

.featured-spec-label {
    align-self: stretch;
    text-align: center;
    color: var(--fh-light-text);
    font-size: 12px;
    font-family: 'Afacad Flux', sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    word-wrap: break-word;
}

.featured-spec-value {
    text-align: center;
    color: var(--fh-dark-text);
    font-size: 18px;
    font-family: 'Afacad Flux', sans-serif;
    font-weight: 400;
    word-wrap: break-word;
}

/* ========================================
   SPECS - 4 COLUMNS (Single Lot)
   SQ.FT: 95px, BEDS: 75px, BATHS: 75px, PRICE: flex
======================================== */

.specs-4-cols .featured-spec-sqft {
    width: 95px;
    flex: 0 0 95px;
    padding-left: 25px;
    padding-right: 25px;
}

.specs-4-cols .featured-spec-beds {
    width: 75px;
    flex: 0 0 75px;
    padding-left: 35px;
    padding-right: 35px;
}

.specs-4-cols .featured-spec-baths {
    width: 75px;
    flex: 0 0 75px;
    padding-left: 22px;
    padding-right: 22px;
}

.specs-4-cols .featured-spec-price {
    flex: 1 1 0;
    padding-left: 22px;
    padding-right: 22px;
    /* Last cell uses outline instead of individual borders */
    border-left: none;
    border-top: none;
    border-bottom: none;
    outline: 1px solid var(--fh-border);
    outline-offset: -1px;
}

/* ========================================
   SPECS - 3 COLUMNS (Community)
======================================== */

.specs-3-cols .featured-spec-col {
    flex: 1 1 0;
}

.specs-3-cols .featured-spec-sqft {
    padding-left: 25px;
    padding-right: 25px;
}

.specs-3-cols .featured-spec-units {
    padding-left: 25px;
    padding-right: 25px;
}

.specs-3-cols .featured-spec-price {
    padding-left: 22px;
    padding-right: 22px;
    /* Last cell uses outline */
    border-left: none;
    border-top: none;
    border-bottom: none;
    outline: 1px solid var(--fh-border);
    outline-offset: -1px;
}

/* ========================================
   PAGINATION DOTS
======================================== */

.featured-pagination-dots-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 60px;
}

.featured-pagination-dots-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.featured-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--fh-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.featured-dot:hover {
    background: var(--fh-light-text);
    transform: scale(1.2);
}

.featured-dot.active {
    background: var(--fh-dark-text);
}

.featured-dot:active {
    transform: scale(0.85);
    transition: transform 0.1s ease;
}

/* ========================================
   RESPONSIVE - LARGE DESKTOP (1440px+)
======================================== */

@media (min-width: 1320px) {
    .featured-homes-max-container {
        max-width: 1320px;
        padding: 0 60px;
    }
}

/* ========================================
   RESPONSIVE - DESKTOP (1024px - 1319px)
======================================== */

@media (max-width: 1319px) and (min-width: 1024px) {
    .featured-homes-max-container {
        max-width: 1200px;
        padding: 0 40px;
    }
    
    .featured-cols-3,
    .featured-cols-2 {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .featured-property-item {
        width: 100%;
    }
    
    .featured-item-image {
        width: 100%;
        height: 0;
        min-height: 0;
        max-height: none;
        padding-bottom: 56.3%; /* 214/380 = 0.563 */
        position: relative;
    }
    
    .featured-item-image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* ========================================
   RESPONSIVE - TABLET (768px - 1023px)
======================================== */

@media (max-width: 1023px) and (min-width: 768px) {
    .featured-homes-section-complete {
        padding: 30px 0 60px 0;
    }
    
    .featured-homes-max-container {
        padding: 0 30px;
    }
    
    .featured-section-header {
        margin-bottom: 40px;
        gap: 15px;
    }
    
    .featured-section-title {
        font-size: 32px;
    }
    
    .featured-cols-3,
    .featured-cols-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .featured-property-item {
        width: 100%;
    }
    
    .featured-item-image {
        width: 100%;
        height: 0;
        min-height: 0;
        max-height: none;
        padding-bottom: 56.3%;
        position: relative;
    }
    
    .featured-item-image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* ========================================
   RESPONSIVE - MOBILE (<768px)
======================================== */

@media (max-width: 767px) {
    .featured-homes-section-complete {
        padding: 30px 0 0 0;
    }
    
    .featured-homes-max-container {
        padding: 0;
    }
    
    .featured-section-header {
        padding: 0 20px;
        gap: 15px;
        margin-bottom: 30px;
    }
    
    .featured-section-title {
        font-size: 28px;
    }
    
    .featured-section-description {
        font-size: 16px;
    }
    
    /* Mobile: Solo card mode with swipe */
    .featured-grid-complete {
        display: flex !important;
        flex-direction: row;
        gap: 15px;
        padding: 0 20px;
        overflow-x: hidden;
        overflow-y: visible;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        width: 100%;
        transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        will-change: transform;
        align-items: flex-start;
    }
    
    .featured-grid-complete.page-transitioning,
    .featured-grid-complete.page-ready {
        opacity: 1;
        transform: none;
    }
    
    .featured-property-item {
        flex: 0 0 calc(100% - 40px);
        width: calc(100% - 40px);
        max-width: calc(100% - 40px);
        scroll-snap-align: start;
        scroll-snap-stop: always;
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        margin-right: 0;
        height: auto;
    }
    
    .featured-property-item:last-child {
        margin-right: 0;
    }
    
    .featured-item-image {
        width: 100%;
        height: 0;
        min-height: 0;
        max-height: none;
        padding-bottom: 56.3%;
        position: relative;
    }
    
    .featured-item-image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .featured-item-content {
        padding: 15px 10px;
        min-height: auto;
        flex: none;
    }
    
    .featured-item-info {
        flex: none;
    }
    
    .property-badges-row-figma {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 5px;
        min-height: auto;
    }
    
    .badge-pill-figma {
        padding: 4px 12px;
    }
    
    .badge-text-white,
    .badge-text-primary,
    .badge-text-light,
    .badge-text-bold {
        font-size: 11px;
    }
    
    .featured-item-title {
        font-size: 18px;
    }
    
    .featured-item-address {
        font-size: 14px;
    }
    
    /* MOBILE SPECS - 4 cols become 2x2 grid */
    .featured-specs-row {
        margin-top: 0;
        height: auto;
    }
    
    .specs-4-cols {
        flex-wrap: wrap;
    }
    
    .specs-4-cols .featured-spec-col {
        flex: 1 1 50% !important;
        min-width: 50% !important;
        max-width: 50% !important;
        width: auto !important;
        padding: 15px 10px !important;
        border-left: 1px solid var(--fh-border) !important;
        border-top: 1px solid var(--fh-border) !important;
        border-bottom: 1px solid var(--fh-border) !important;
        outline: none !important;
    }
    
    .specs-4-cols .featured-spec-col:nth-child(even) {
        border-right: 1px solid var(--fh-border) !important;
    }
    
    .specs-4-cols .featured-spec-col:nth-child(1),
    .specs-4-cols .featured-spec-col:nth-child(2) {
        border-bottom: none !important;
    }
    
    .specs-3-cols {
        flex-wrap: nowrap;
    }
    
    .specs-3-cols .featured-spec-col {
        flex: 1 1 33.33% !important;
        min-width: 0 !important;
        padding: 12px 8px !important;
    }
    
    .specs-3-cols .featured-spec-label {
        font-size: 10px;
    }
    
    .specs-3-cols .featured-spec-value {
        font-size: 16px;
    }
    
    .featured-pagination-dots-wrapper {
        margin-top: 30px;
        margin-bottom: 60px;
        padding: 0 20px;
    }
    
    .featured-pagination-dots-container {
        gap: 8px;
    }
    
    .featured-dot {
        width: 8px;
        height: 8px;
    }
}

/* ========================================
   SMALL MOBILE (<480px)
======================================== */

@media (max-width: 480px) {
    .featured-section-title {
        font-size: 24px;
    }
    
    .badge-pill-figma {
        padding: 3px 10px;
    }
    
    .badge-text-white,
    .badge-text-primary,
    .badge-text-light,
    .badge-text-bold {
        font-size: 10px;
    }
    
    .featured-item-title {
        font-size: 16px;
    }
    
    .featured-item-address {
        font-size: 13px;
    }
    
    .specs-4-cols .featured-spec-label,
    .specs-3-cols .featured-spec-label {
        font-size: 10px;
    }
    
    .specs-4-cols .featured-spec-value {
        font-size: 16px;
    }
    
    .specs-3-cols .featured-spec-value {
        font-size: 14px;
    }
}

/* ========================================
   TOUCH/SWIPE ACTIVE STATE
======================================== */

@media (max-width: 767px) {
    .featured-grid-complete.is-dragging {
        cursor: grabbing;
        scroll-behavior: auto;
    }
    
    .featured-grid-complete.is-dragging .featured-property-item {
        pointer-events: none;
    }
    
    .featured-property-item.is-active {
        opacity: 1;
    }
    
    .featured-property-item.is-next {
        opacity: 0.7;
    }
}

/* ========================================
   WORDPRESS/ACF IMAGE FIXES
======================================== */

.featured-item-image img,
.featured-item-image .wp-post-image,
.featured-item-image picture img {
    max-width: none !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    object-fit: cover !important;
}

.featured-item-image.no-image {
    background: linear-gradient(135deg, #E8E5DF 0%, #F5F3F0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-item-image.no-image::after {
    content: '🏠';
    font-size: 48px;
    opacity: 0.3;
}

/* ========================================
   SPECS BAR - FIXED COLUMN WIDTHS
   All columns need proper padding that fits within their width
======================================== */

/* SQ. FT. - 95px width */
.featured-specs-row.specs-4-cols .featured-spec-sqft {
    width: 95px !important;
    flex: 0 0 95px !important;
    padding: 13px 15px !important;
}

/* BEDS - 75px width - FIXED! */
.featured-specs-row.specs-4-cols .featured-spec-beds {
    width: 75px !important;
    flex: 0 0 75px !important;
    padding: 13px 10px !important;
}

/* BATHS - 75px width */
.featured-specs-row.specs-4-cols .featured-spec-baths {
    width: 75px !important;
    flex: 0 0 75px !important;
    padding: 13px 10px !important;
}

/* PRICE - flexible */
.featured-specs-row.specs-4-cols .featured-spec-price {
    flex: 1 1 0 !important;
    padding: 13px 15px !important;
}

/* Ensure text doesn't wrap */
.featured-spec-label,
.featured-spec-value {
    white-space: nowrap !important;
    overflow: visible !important;
}