/* =====================================================
   FN Leads Manager — Home App  (slug: homeapp)
   ===================================================== */

/* ---- CONTENITORE GENERALE ---- */
.fnha-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding-bottom: 40px;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ---- SECTION BASE ---- */
.fnha-section {
    background: #fff;
    overflow: hidden;
}

.fnha-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px 10px;
    border-bottom: 1px solid #f0f2f5;
}
.fnha-section-icon {
    font-size: 1.15rem;
    line-height: 1;
}
.fnha-section-title {
    margin: 0;
    font-size: .98rem;
    font-weight: 800;
    color: var(--fnlm-blue, #003580);
    flex: 1;
}
.fnha-section-more {
    font-size: .8rem;
    font-weight: 700;
    color: var(--fnlm-blue, #003580);
    text-decoration: none;
    opacity: .65;
    transition: opacity .2s;
    white-space: nowrap;
}
.fnha-section-more:hover { opacity: 1; }

/* ============================================================
   SEZIONE VIDEO — scorrimento orizzontale stile Stories
   ============================================================ */
.fnha-video-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 12px 16px 14px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.fnha-video-scroll::-webkit-scrollbar { display: none; }

.fnha-video-card {
    flex: 0 0 110px;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    display: block;
    text-decoration: none;
    aspect-ratio: 9 / 16;
    background: #1a2235;
    box-shadow: 0 3px 12px rgba(0,0,0,.22);
    transition: transform .18s ease, box-shadow .18s ease;
}
.fnha-video-card:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(0,0,0,.32);
}

.fnha-video-thumb {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.fnha-video-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.28);
    font-size: 2rem;
}

.fnha-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,.88);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #003580;
    font-size: .88rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.28);
    pointer-events: none;
}
.fnha-video-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 8px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,.72));
    pointer-events: none;
}
.fnha-video-title {
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1.3;
    display: block;
}

/* ============================================================
   SEZIONE NOTIZIE — griglia 2 colonne
   ============================================================ */
.fnha-news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #f0f2f5;
}

.fnha-news-card {
    background: #fff;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background .15s;
}
.fnha-news-card:hover { background: #f8f9fb; }

.fnha-news-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-color: #e4e8f0;
}
.fnha-news-img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c0c8d8;
    font-size: 1.6rem;
}
.fnha-news-body {
    padding: 10px 12px 13px;
    flex: 1;
}
.fnha-news-date {
    font-size: .68rem;
    color: #9aa5b1;
    margin-bottom: 4px;
    font-weight: 600;
    letter-spacing: .02em;
}
.fnha-news-title {
    font-size: .88rem;
    font-weight: 800;
    color: var(--fnlm-text, #1a2235);
    line-height: 1.35;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.fnha-news-excerpt {
    font-size: .76rem;
    color: #6b7280;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Prima notizia (featured): occupa entrambe le colonne */
.fnha-news-card:first-child {
    grid-column: 1 / -1;
    flex-direction: row;
}
.fnha-news-card:first-child .fnha-news-img {
    width: 42%;
    flex: 0 0 42%;
    aspect-ratio: auto;
    min-height: 120px;
}
.fnha-news-card:first-child .fnha-news-body {
    flex: 1;
    padding: 14px 16px;
}
.fnha-news-card:first-child .fnha-news-title {
    font-size: 1rem;
    -webkit-line-clamp: 4;
}

/* ============================================================
   SEZIONE CANALI
   ============================================================ */
.fnha-channels-list {
    padding: 4px 0;
}
.fnha-channel-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 18px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f2f5;
    transition: background .15s;
}
.fnha-channel-card:last-child { border-bottom: none; }
.fnha-channel-card:hover { background: #f8f9fb; }

.fnha-channel-emoji {
    font-size: 1.6rem;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef1fb;
    border-radius: 12px;
    line-height: 1;
}
.fnha-channel-info {
    flex: 1 1 auto;
    min-width: 0;
}
.fnha-channel-name {
    font-size: .94rem;
    font-weight: 800;
    color: var(--fnlm-text, #1a2235);
}
.fnha-channel-desc {
    font-size: .76rem;
    color: #6b7280;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fnha-channel-arrow {
    color: #c0c8d8;
    font-size: .82rem;
    flex: 0 0 auto;
}

/* ============================================================
   PULSANTI PERSONALIZZATI
   ============================================================ */
.fnha-section--buttons {
    background: transparent;
}
.fnha-buttons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
}

.fnha-custom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex: 1 1 100%;
    min-width: 0;
    border-radius: 18px;
    font-weight: 800;
    text-decoration: none !important;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.16), 0 1px 3px rgba(0,0,0,.10);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    line-height: 1.25;
    letter-spacing: .01em;
}

/* Larghezza: riga intera / mezza riga */
.fnha-custom-btn--full { flex-basis: 100%; }
.fnha-custom-btn--half { flex-basis: calc(50% - 6px); }

/* Taglie: altezze minime ben distinte */
.fnha-custom-btn--sm { min-height: 42px; }
.fnha-custom-btn--md { min-height: 56px; }
.fnha-custom-btn--lg { min-height: 70px; }

.fnha-custom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0,0,0,.24);
    filter: brightness(1.05);
}
.fnha-custom-btn:active {
    transform: translateY(1px) scale(.98);
    box-shadow: 0 2px 6px rgba(0,0,0,.16);
    filter: brightness(.96);
}
.fnha-custom-btn i { font-size: .9em; }

/* ============================================================
   PULSANTE ISCRIVITI
   ============================================================ */
.fnha-section--subscribe {
    background: transparent;
    text-align: center;
    padding: 6px 16px 12px;
}

.fnha-subscribe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, #003580 0%, #0050c8 100%);
    color: #fff !important;
    border-radius: 16px;
    font-size: 1.08rem;
    font-weight: 800;
    text-decoration: none !important;
    box-shadow: 0 6px 24px rgba(0,53,128,.38);
    transition: transform .15s ease, box-shadow .15s ease;
    letter-spacing: .01em;
}
.fnha-subscribe-btn i { font-size: 1.1rem; }
.fnha-subscribe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 28px rgba(0,53,128,.48);
}
.fnha-subscribe-btn:active { transform: translateY(0); }

.fnha-subscribe-sub {
    margin: 8px 0 0;
    font-size: .8rem;
    color: var(--fnlm-gray, #6b7280);
    font-style: italic;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    .fnha-wrap { gap: 4px; }
    .fnha-video-card { flex: 0 0 96px; }

    /* Su schermi molto stretti la prima notizia torna verticale */
    .fnha-news-card:first-child { flex-direction: column; }
    .fnha-news-card:first-child .fnha-news-img {
        width: 100%;
        flex: none;
        aspect-ratio: 16 / 9;
        min-height: unset;
    }

    .fnha-section-head { padding: 12px 14px 8px; }
    .fnha-channel-card { padding: 11px 14px; }
    .fnha-buttons-grid { padding: 10px 12px; gap: 10px; }
    .fnha-custom-btn--half { flex-basis: calc(50% - 5px); }
    .fnha-subscribe-btn { font-size: 1rem; padding: 16px 20px; }
    .fnha-section--subscribe { padding: 6px 12px 10px; }
}
