/* =========================================================
   HOMEPAGE STYLES - Stile moderno e elegante
   ========================================================= */

.home-page {
    padding: 4rem 0;
}

/* Sezioni generali */
.home-newsletter-section,
.home-latest-section,
.home-project-section,
.home-contact-section {
    margin-bottom: 6rem;
}

.home-newsletter-section:last-child,
.home-latest-section:last-child,
.home-project-section:last-child,
.home-contact-section:last-child {
    margin-bottom: 0;
}

/* Titoli sezione */
.home-section-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
    font-family: Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

.home-latest-section .home-section-title,
.home-project-section .home-section-title,
.home-contact-section .home-section-title {
    text-align: center;
}

.home-section-description {
    font-size: 1.6rem;
    color: #666;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    font-family: Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* =========================================================
   NEWSLETTER HERO (full-width, top of page)
   ========================================================= */

.home-newsletter-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    width: 100%;
    padding-bottom: 7rem;
    box-sizing: border-box;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.home-newsletter-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, var(--newsletter-overlay-opacity, 0.5));
    z-index: 1;
}

.home-newsletter-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 720px;
    padding: 4rem 3rem;
    text-align: center;
}

.home-newsletter-hero-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.5rem;
    font-family: Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

.home-newsletter-hero-description {
    font-size: 1.6rem;
    color: #fff;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    font-family: Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.home-newsletter-hero .home-newsletter-form {
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
}

.home-newsletter-hero .home-form-label {
    color: rgba(255, 255, 255, 0.95);
}

.home-newsletter-hero .home-form-input,
.home-newsletter-hero .home-form-textarea {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    color: #333;
}

.home-newsletter-hero .home-form-input::placeholder,
.home-newsletter-hero .home-form-textarea::placeholder {
    color: #666;
}

.home-newsletter-hero .home-form-note {
    color: rgba(255, 255, 255, 0.85);
}

.home-newsletter-hero .required {
    color: rgba(255, 255, 255, 0.95);
}

.home-newsletter-hero-arrow {
    position: absolute;
    bottom: 40px;
    left: 50%;
    z-index: 2;
    display: inline-flex;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.home-newsletter-hero-arrow .icon {
    width: 28px;
    height: 28px;
    color: #fff;
}

@media (max-width: 767px) {
    .home-newsletter-hero {
        min-height: 60vh;
        padding-bottom: 6rem;
    }

    .home-newsletter-hero-content {
        padding: 3rem 2rem;
    }

    .home-newsletter-hero-title {
        font-size: 2rem;
    }

    .home-newsletter-hero-description {
        font-size: 1.5rem;
    }
}

/* =========================================================
   NEWSLETTER SECTION (sfondo come header, quando no hero)
   ========================================================= */

.home-newsletter-wrapper {
    background-color: var(--header-bg, #2f6f8f);
    border-radius: 8px;
    padding: 4rem 3rem;
    text-align: center;
}

/* Testo bianco per contrasto con sfondo header */
.home-newsletter-wrapper .home-section-title {
    color: #fff !important;
}

.home-newsletter-wrapper .home-section-description {
    color: #fff !important;
}

.home-newsletter-wrapper .home-form-label {
    color: rgba(255, 255, 255, 0.95);
}

.home-newsletter-wrapper .home-form-note {
    color: rgba(255, 255, 255, 0.85);
}

.home-newsletter-wrapper .required {
    color: rgba(255, 255, 255, 0.95);
}

/* Stile grigio originale (quando selezionato in Customizer) */
.newsletter-form-style-grey {
    background-color: #f6f6f6 !important;
}

.newsletter-form-style-grey .home-section-title {
    color: #333 !important;
}

.newsletter-form-style-grey .home-section-description {
    color: #666 !important;
}

.newsletter-form-style-grey .home-form-label {
    color: #333;
}

.newsletter-form-style-grey .home-form-note {
    color: #999;
}

.newsletter-form-style-grey .required {
    color: #2f6f8f;
}

.newsletter-form-style-grey .home-newsletter-form .home-form-submit {
    color: #fff;
    background-color: #2f6f8f;
    border: none;
}

.newsletter-form-style-grey .home-newsletter-form .home-form-submit:hover {
    background-color: #255a75;
    color: #fff;
}

.home-newsletter-form {
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
}

/* =========================================================
   LATEST POSTS SECTION
   ========================================================= */

.home-feed {
    margin-top: 2rem;
}

/* Nascondi calendario nella sezione ultime riflessioni per allineare con altre pagine */
.home-feed .feed-calendar,
.home-latest-section .feed-calendar,
.home-latest-section .post-feed .feed-calendar {
    display: none !important;
    visibility: hidden !important;
}

/* Colora il numero della nota in blu nella homepage */
.home-feed .feed-note-number,
.home-latest-section .feed-note-number,
.home-latest-section .feed-title .feed-note-number,
.home-latest-section .feed-wrapper .feed-title .feed-note-number,
.home-latest-section .post-feed .feed-title .feed-note-number,
.home-latest-section .post-feed .feed-wrapper .feed-title .feed-note-number {
    color: #2f6f8f !important;
}

.home-no-posts {
    text-align: center;
    color: #999;
    font-style: italic;
    font-size: 1.6rem;
    padding: 3rem 0;
    font-family: Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* =========================================================
   PROJECT SECTION - Sfondo teal come header (alternanza)
   ========================================================= */

/* Estende la sezione a tutta la larghezza della griglia */
.home-page .home-project-section {
    grid-column: full-start / full-end;
    background-color: var(--header-bg, #2f6f8f);
    padding: 4rem var(--gap, 3.6rem);
    margin-left: 0;
    margin-right: 0;
}

/* Contenuto centrato */
.home-project-section .home-section-title,
.home-project-section .home-project-content {
    max-width: var(--content-width, 720px);
    margin-left: auto;
    margin-right: auto;
}

/* Testo bianco per contrasto con sfondo teal */
.home-project-section .home-section-title {
    color: #fff !important;
}

.home-project-section .home-project-content,
.home-project-section .home-project-content p {
    color: #fff !important;
}

.home-project-section .home-project-content strong {
    color: rgba(255, 255, 255, 0.95);
}

/* Link nella sezione progetto - bianco per contrasto */
.home-project-section .home-project-content a {
    color: #fff !important;
    text-decoration: underline;
}

.home-project-section .home-project-content a:hover {
    opacity: 0.9;
}

.home-project-content {
    font-size: 1.6rem;
    line-height: 1.8;
    color: #333;
    font-family: Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.home-project-content p {
    margin-bottom: 1.5rem;
}

.home-project-content p:last-child {
    margin-bottom: 0;
}

.home-project-content strong {
    color: #2f6f8f;
    font-weight: 600;
}

/* =========================================================
   CONTACT SECTION
   ========================================================= */

.home-contact-form-wrapper {
    width: 100%;
    border-radius: 8px;
    padding: 4rem 3rem;
    text-align: center;
}

/* Stile blu - come newsletter */
.home-contact-form-style-blue {
    background-color: var(--header-bg, #2f6f8f);
}

.home-contact-form-style-blue .home-section-title {
    color: #fff !important;
}

.home-contact-form-style-blue .home-contact-intro {
    color: rgba(255, 255, 255, 0.9);
}

.home-contact-form-style-blue .home-form-label,
.home-contact-form-style-blue .required {
    color: rgba(255, 255, 255, 0.95);
    text-align: left;
}

.home-contact-form-style-blue .home-form-input,
.home-contact-form-style-blue .home-form-textarea {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
}

.home-contact-form-style-blue .home-form-input::placeholder,
.home-contact-form-style-blue .home-form-textarea::placeholder {
    color: #666;
}

.home-contact-form-style-blue .home-contact-form .home-form-submit {
    color: var(--header-bg, #2f6f8f);
    background-color: #fff;
    border: 2px solid var(--header-bg, #2f6f8f);
}

.home-contact-form-style-blue .home-contact-form .home-form-submit:hover {
    background-color: var(--header-bg, #2f6f8f);
    color: #fff;
}

/* Stile grigio - come newsletter */
.home-contact-form-style-grey {
    background-color: #f6f6f6;
}

.home-contact-form-style-grey .home-section-title {
    color: #333 !important;
}

.home-contact-form-style-grey .home-contact-intro {
    color: #666;
}

.home-contact-form-style-grey .home-form-label,
.home-contact-form-style-grey .required {
    color: #333;
    text-align: left;
}

.home-contact-form-style-grey .home-contact-form .home-form-submit {
    color: #fff;
    background-color: #2f6f8f;
    border: none;
}

.home-contact-form-style-grey .home-contact-form .home-form-submit:hover {
    background-color: #255a75;
    color: #fff;
}

.home-contact-content {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.home-contact-email {
    font-size: 1.6rem;
    color: #666;
    line-height: 1.7;
    margin-bottom: 3rem;
    text-align: center;
    font-family: Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.home-contact-intro {
    font-size: 1.6rem;
    color: #666;
    line-height: 1.7;
    margin-bottom: 2rem;
    text-align: center;
    font-family: Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.home-contact-link {
    color: #2f6f8f;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.home-contact-link:hover {
    color: #255a75;
    text-decoration: underline;
}

/* =========================================================
   FORM STYLES (Newsletter e Contatti)
   ========================================================= */

.home-form-group {
    margin-bottom: 2rem;
}

.home-form-label {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.8rem;
    font-family: Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.home-form-input,
.home-form-textarea {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.6rem;
    color: #333;
    background-color: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    outline: none;
    font-family: Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-form-textarea {
    resize: vertical;
    min-height: 150px;
    line-height: 1.6;
}

.home-form-input:focus,
.home-form-textarea:focus {
    border-color: #2f6f8f;
    box-shadow: 0 0 0 3px rgba(47, 111, 143, 0.1);
}

.home-form-input::placeholder,
.home-form-textarea::placeholder {
    color: #999;
}

.home-form-submit {
    width: 100%;
    padding: 15px 30px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    background-color: #2f6f8f;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    font-family: Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.5;
    min-height: 50px;
    margin-top: 1rem;
}

.home-form-submit:hover {
    background-color: #255a75;
    transform: translateY(-1px);
}

/* Pulsante newsletter invertito: sfondo bianco, testo colore header */
.home-newsletter-form .home-form-submit {
    color: var(--header-bg, #2f6f8f);
    background-color: #fff;
    border: 2px solid var(--header-bg, #2f6f8f);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.home-newsletter-form .home-form-submit:hover {
    background-color: var(--header-bg, #2f6f8f);
    color: #fff;
}

.home-form-submit:active {
    transform: translateY(0);
}

.home-form-note {
    margin-top: 1.5rem;
    font-size: 1.3rem;
    color: #999;
    text-align: center;
    line-height: 1.5;
    font-family: Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.required {
    color: #2f6f8f;
}

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

@media (max-width: 767px) {
    .home-page {
        padding: 3rem 0;
    }
    
    .home-newsletter-section,
    .home-latest-section,
    .home-project-section,
    .home-contact-section {
        margin-bottom: 4rem;
    }
    
    .home-section-title {
        font-size: 2rem;
        margin-bottom: 1.2rem;
    }
    
    .home-section-description {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .home-newsletter-wrapper {
        padding: 3rem 2rem;
    }
    
    .home-project-section {
        padding: 3rem var(--gap, 2rem);
    }

    .home-project-content {
        font-size: 1.5rem;
        line-height: 1.7;
    }
    
    .home-contact-form-wrapper {
        padding: 3rem 2rem;
    }
    
    .home-contact-email {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .home-form-input,
    .home-form-textarea {
        padding: 12px 15px;
        font-size: 1.5rem;
    }
    
    .home-form-submit {
        padding: 15px;
        font-size: 1.4rem;
        min-height: 48px;
    }
    
    .home-form-note {
        font-size: 1.2rem;
    }
}
