/* Blue Apulia Child - Homepage Styles
 * File: assets/css/components/homepage.css
 */

/* =============================
   GRIGLIE ALLOGGI HOMEPAGE
   ============================= */

/* Griglia base alloggi */
.alloggi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

/* Griglia con colonne specifiche per homepage */
.alloggi-grid.col-3 {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
}

@media (max-width: 900px) {
    .alloggi-grid.col-3 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}

@media (max-width: 600px) {
    .alloggi-grid.col-3 {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

/* CSS Variables for dynamic calculations */
:root {
    --search-bar-height: 60px;
    --hero-height: 62vh;
    /* VARIABILI SEARCH BAR DAL BACKUP */
    --ba-search-bar-height: 68px; 
    --ba-search-bar-z-index: 100; 
}

/* =============================
   HERO SEZIONE
   ============================= */

.hero-section {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: visible; /* Cambiato da hidden a visible per search bar */
    min-height: 100vh;
}

.hero-section.hero-with-search {
    min-height: 62vh;
    max-height: 62vh;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 123, 186, 0.8) 0%,
        rgba(0, 86, 160, 0.9) 100%
    );
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    padding: 0 20px;
}

.hero-title-main {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-title-sub {
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0.95;
    text-shadow: 0 1px 5px rgba(0,0,0,0.2);
}

.hero-description {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: rgba(255,255,255,0.85);
    margin-bottom: 3rem;
    line-height: 1.7;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-with-search .hero-description {
    font-size: clamp(1rem, 2vw, 1.1rem);
    margin-bottom: 1.5rem;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* =============================
   SEZIONI HOMEPAGE
   ============================= */

.section {
    padding: 4rem 0;
    z-index: -10; /* Forza dietro tutto */
}

.section-header {
    text-align: center;
    margin-top: 1.8rem;
    margin-bottom: 4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
}

.section-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #7f8c8d;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* =============================
   ALLOGGI VETRINA
   ============================= */

.homepage-alloggi-container {
    margin-top: 2rem;
}

.homepage-alloggi-container .alloggi-vetrina {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* =============================
   FEATURES GRID
   ============================= */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-card {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: #007cba;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.feature-description {
    color: #7f8c8d;
    line-height: 1.6;
}

/* =============================
   RESPONSIVE DESIGN
   ============================= */

@media (max-width: 768px) {
    .hero-section.hero-with-search {
        min-height: 50vh;
        max-height: none;
        overflow: visible;
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        background: right;
    }
    
    /* Espandi lo sfondo del hero quando la search bar è espansa */
    .hero-section.hero-with-search:has(.search-bar-expanded),
    .hero-section.hero-with-search.search-bar-expanded {
        min-height: 70vh;
    }
    
    .hero-with-search .hero-content { 
        padding: 30px 0 0 0; 
        flex-shrink: 0; 
    }
    
    .hero-with-search .hero-title-main { 
        font-size: clamp(2rem, 7vw, 2.5rem); 
        margin-bottom: 0.3rem; 
        line-height: 1.1; 
    }
    
    .hero-with-search .hero-title-sub { 
        font-size: clamp(1rem, 3vw, 1.2rem); 
        margin-bottom: 1rem; 
        line-height: 1.2; 
    }
    
    .hero-with-search .hero-description { 
        font-size: clamp(0.9rem, 2.5vw, 1rem); 
        margin-bottom: 1.5rem; 
        max-width: 400px; 
        line-height: 1.4; 
    }

    .section.default-alloggi, 
    .hero-section.hero-with-search + .section { 
        padding-top: 40px; 
        margin-top: 0; 
    }
    
    .hero-section.hero-with-search + .section.default-alloggi { 
        padding-top: 30px; 
    }

    .hero-buttons { 
        flex-direction: column; 
        align-items: center; 
    }

    .homepage-alloggi-container .alloggi-vetrina { 
        grid-template-columns: 1fr; 
        gap: 1.5rem; 
    }

    .features-grid { 
        grid-template-columns: 1fr; 
        gap: 1.5rem; 
    }

    .feature-card { 
        padding: 2rem 1.5rem; 
    }
}

@media (max-width: 480px) {
    .section-header { 
        margin-bottom: 3rem; 
    }
    
    .section { 
        padding: 3rem 0; 
    }
}

/* =============================
   BOTTONI E CALL TO ACTION
   ============================= */

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: #007cba;
    color: white;
}

.btn-primary:hover {
    background: #0056a0;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: #007cba;
}

.section-cta {
    text-align: center;
    margin-top: 3rem;
}

