/* =====================================================
   FN Leads Manager — Blog della community
   ===================================================== */

.fnb-card {
    max-width: 640px;
    margin: 40px auto;
    background: rgba(255,255,255,.98);
    border-radius: 18px;
    box-shadow: var(--fnlm-shadow, 0 8px 32px rgba(0,53,128,.14));
    overflow: hidden;
}
.fnb-card--locked {
    text-align: center;
    padding: 50px 30px;
}
.fnb-card--locked i { font-size: 2rem; color: var(--fnlm-blue, #003580); margin-bottom: 14px; display: block; }
.fnb-card--locked p { font-weight: 600; color: var(--fnlm-text, #1a2235); margin-bottom: 18px; }

.fnb-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--fnlm-blue, #003580);
    color: #fff !important;
    font-weight: 700;
    font-size: .9rem;
    border-radius: 50px;
    text-decoration: none !important;
    transition: var(--fnlm-trans, all .22s ease);
    white-space: nowrap;
}
.fnb-btn:hover { background: #0060cc; transform: translateY(-1px); }
.fnb-btn--write {
    background: linear-gradient(135deg, var(--fnlm-red, #cc0000) 0%, #a10000 100%);
    box-shadow: 0 6px 18px rgba(204,0,0,.3);
}
.fnb-btn--write:hover { box-shadow: 0 10px 24px rgba(204,0,0,.4); }

/* ---- AVATAR (iniziali) ---- */
.fnb-avatar {
    width: 46px; height: 46px;
    min-width: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fnlm-blue, #003580), #0060cc);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: .5px;
}
.fnb-avatar--sm { width: 34px; height: 34px; min-width: 34px; font-size: .78rem; }
.fnb-avatar--lg { width: 72px; height: 72px; min-width: 72px; font-size: 1.5rem; }
.fnb-avatar--photo { object-fit: cover; }

/* ---- MODULO DI PUBBLICAZIONE ---- */
.fnb-write-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 26px 28px 20px;
    background: linear-gradient(135deg, var(--fnlm-blue, #003580) 0%, #0060cc 100%);
    color: #fff;
}
.fnb-write-header .fnb-avatar { background: rgba(255,255,255,.18); }
.fnb-write-header h3 { margin: 0 0 2px; font-size: 1.2rem; font-weight: 800; color: var(--fnlm-gold, #c8a040); }
.fnb-write-header p { margin: 0; font-size: .84rem; color: rgba(255,255,255,.85); }

.fnb-msg {
    margin: 18px 28px 0;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 600;
    display: none;
}
.fnb-msg--error { background: #fdecec; color: #a11212; border: 1px solid #f3c6c6; }
.fnb-msg--success { background: #e9f9ef; color: #0d7a3d; border: 1px solid #bfe9cf; }

.fnb-form { padding: 22px 28px 28px; }
.fnb-field { margin-bottom: 18px; }
.fnb-label {
    display: block;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--fnlm-text, #1a2235);
    margin-bottom: 7px;
}
.fnb-req { color: var(--fnlm-red, #cc0000); }
.fnb-optional { color: #6b7280; font-weight: 500; font-size: .82rem; }
.fnb-input, .fnb-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 15px;
    border: 1.5px solid var(--fnlm-border, #dde3ed);
    border-radius: 10px;
    font-size: .96rem;
    font-family: inherit;
    background: var(--fnlm-light, #f4f6f9);
    transition: var(--fnlm-trans, all .22s ease);
    resize: vertical;
}
.fnb-input:focus, .fnb-textarea:focus {
    outline: none;
    border-color: var(--fnlm-blue, #003580);
    background: #fff;
}
.fnb-charcount { text-align: right; font-size: .75rem; color: var(--fnlm-gray, #6b7280); margin-top: 5px; }

.fnb-upload {
    display: block;
    cursor: pointer;
}
.fnb-upload-preview {
    border: 2px dashed var(--fnlm-border, #dde3ed);
    border-radius: 14px;
    padding: 34px 18px;
    text-align: center;
    color: var(--fnlm-gray, #6b7280);
    transition: var(--fnlm-trans, all .22s ease);
    background: var(--fnlm-light, #f4f6f9);
    overflow: hidden;
}
.fnb-upload-preview:hover { border-color: var(--fnlm-blue, #003580); background: rgba(0,53,128,.04); }
.fnb-upload-preview i { font-size: 1.8rem; display: block; margin-bottom: 10px; color: var(--fnlm-blue, #003580); }
.fnb-upload-preview span { display: block; font-weight: 700; font-size: .92rem; color: var(--fnlm-text, #1a2235); }
.fnb-upload-preview small { display: block; margin-top: 4px; font-size: .76rem; }
.fnb-upload-preview.has-image { padding: 0; border-style: solid; }
.fnb-upload-preview.has-image img { display: block; width: 100%; max-height: 340px; object-fit: cover; border-radius: 12px; }

.fnb-submit {
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, var(--fnlm-red, #cc0000) 0%, #a10000 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .3px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(204,0,0,.3);
    transition: var(--fnlm-trans, all .22s ease);
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.fnb-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(204,0,0,.4); }
.fnb-submit:disabled { opacity: .7; cursor: not-allowed; }
.fnb-spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: fnb-spin .7s linear infinite;
}
.fnb-spinner--dark { border-color: rgba(0,53,128,.2); border-top-color: var(--fnlm-blue, #003580); display: inline-block; vertical-align: middle; margin-right: 8px; }
.fnb-submit.is-loading .fnb-spinner { display: inline-block; }
.fnb-submit.is-loading .fnb-btn-text { display: none; }
@keyframes fnb-spin { to { transform: rotate(360deg); } }

.fnb-verify {
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, var(--fnlm-blue, #003580) 0%, #0060cc 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .3px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,53,128,.3);
    transition: var(--fnlm-trans, all .22s ease);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-bottom: 14px;
}
.fnb-verify:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,53,128,.4); }
.fnb-verify:disabled { opacity: .7; cursor: not-allowed; }
.fnb-verify.is-loading .fnb-spinner { display: inline-block; }
.fnb-verify.is-loading .fnb-btn-text { display: none; }

.fnb-seo-box {
    background: var(--fnlm-light, #f4f6f9);
    border: 1.5px solid var(--fnlm-border, #dde3ed);
    border-radius: 10px;
    padding: 14px 16px;
}
.fnb-seo-text {
    margin: 0;
    font-size: .88rem;
    line-height: 1.5;
    color: #1a2235 !important;
    opacity: 1 !important;
    font-style: italic;
}

/* ---- FEED (stile social) ---- */
.fnb-feed-wrap {
    max-width: 640px;
    margin: 30px auto 60px;
}
.fnb-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.fnb-feed-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--fnlm-blue, #003580);
    display: flex;
    align-items: center;
    gap: 10px;
}
.fnb-feed-header h2 i { color: var(--fnlm-gold, #c8a040); }

.fnb-feed { display: flex; flex-direction: column; gap: 22px; }

.fnb-post-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--fnlm-shadow, 0 8px 32px rgba(0,53,128,.1));
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.fnb-post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 38px rgba(0,53,128,.18);
}
.fnb-post-media {
    display: block;
    width: 100%;
    aspect-ratio: 900 / 560;
    background: var(--fnlm-light, #f4f6f9);
    overflow: hidden;
}
.fnb-post-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.fnb-post-card:hover .fnb-post-media img { transform: scale(1.04); }

.fnb-post-body { padding: 18px 20px 20px; }
.fnb-post-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.fnb-post-meta-text { display: flex; flex-direction: column; line-height: 1.3; }
.fnb-post-author { font-weight: 700; font-size: .9rem; color: var(--fnlm-text, #1a2235); }
.fnb-post-time { font-size: .78rem; color: var(--fnlm-gray, #6b7280); }

.fnb-post-title { margin: 0 0 8px; font-size: 1.22rem; font-weight: 800; line-height: 1.3; }
.fnb-post-card .fnb-post-title a { color: var(--fnlm-blue, #003580) !important; text-decoration: none; }
.fnb-post-card .fnb-post-title a:hover { color: var(--fnlm-red, #cc0000) !important; }

.fnb-post-excerpt { margin: 0 0 14px; color: var(--fnlm-text, #1a2235) !important; font-size: .94rem; line-height: 1.6; opacity: .88; }
.fnb-post-excerpt--placeholder { opacity: .55; font-style: italic; }

.fnb-post-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--fnlm-red, #cc0000) !important;
    text-decoration: none;
}
.fnb-post-readmore:hover { gap: 10px; }
.fnb-post-readmore i { transition: transform .2s ease; }

.fnb-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--fnlm-gray, #6b7280);
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--fnlm-shadow, 0 8px 32px rgba(0,53,128,.1));
}
.fnb-empty i { font-size: 2rem; margin-bottom: 12px; display: block; color: var(--fnlm-blue, #003580); }

.fnb-feed-loader, .fnb-feed-end {
    text-align: center;
    padding: 24px 0;
    color: var(--fnlm-gray, #6b7280);
    font-size: .88rem;
    font-weight: 600;
}
.fnb-feed-sentinel { height: 1px; }

/* ---- PAGINA SINGOLO ARTICOLO ---- */
.fnb-single { max-width: 720px; margin: 30px auto 60px; }
.fnb-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--fnlm-blue, #003580);
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
}
.fnb-back-link:hover { color: var(--fnlm-red, #cc0000); }
.fnb-single-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--fnlm-shadow, 0 8px 32px rgba(0,53,128,.14));
    overflow: hidden;
}
.fnb-single-media { width: 100%; aspect-ratio: 1200 / 630; background: var(--fnlm-light, #f4f6f9); overflow: hidden; }
.fnb-single-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fnb-single-body { padding: 28px 32px 36px; }
.fnb-single-title {
    margin: 0 0 16px;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--fnlm-blue, #003580) !important;
}
.fnb-single-text,
.fnb-single-text p,
.fnb-single-text span,
.fnb-single-text strong,
.fnb-single-text em,
.fnb-single-text li {
    color: var(--fnlm-text, #1a2235) !important;
}
.fnb-single-text { margin-top: 18px; font-size: 1.05rem; line-height: 1.85; background: #fff; }
.fnb-single-text p { margin: 0 0 1.1em; }

/* ---- CONDIVISIONE ARTICOLO ---- */
.fnb-share-bar {
    position: relative;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--fnlm-border, #dde3ed);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}
.fnb-share-btn--facebook { border: none; cursor: pointer; font-family: inherit; }
.fnb-share-toast {
    display: none;
    position: absolute;
    bottom: -30px;
    right: 0;
    background: var(--fnlm-blue, #003580);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0,0,0,.16);
    white-space: nowrap;
}
.fnb-share-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: .92rem;
    color: var(--fnlm-blue, #003580);
}
.fnb-share-label i { font-size: 1rem; }
.fnb-share-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.fnb-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    white-space: nowrap;
}
.fnb-share-btn i { font-size: 1.05rem; }
.fnb-share-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.18); filter: brightness(1.05); }
.fnb-share-btn:active { transform: translateY(0); }
.fnb-share-btn--whatsapp { background: linear-gradient(135deg, #25D366, #1ebc59); }
.fnb-share-btn--telegram { background: linear-gradient(135deg, #34AADF, #1e88c7); }
.fnb-share-btn--facebook { background: linear-gradient(135deg, #1877F2, #0f5fc9); }

/* ---- COMMENTI ---- */
.fnb-comments {
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px solid var(--fnlm-border, #dde3ed);
}
.fnb-comments-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--fnlm-blue, #003580) !important;
}
.fnb-comments-title i { font-size: 1.05rem; }
.fnb-comments-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 22px; }
.fnb-comments-empty { color: var(--fnlm-gray, #6b7280); font-size: .92rem; margin: 0; }
.fnb-comment { display: flex; gap: 12px; }
.fnb-comment-avatar { flex-shrink: 0; }
.fnb-comment-body {
    flex: 1;
    background: var(--fnlm-light, #f4f6f9);
    border-radius: 12px;
    padding: 12px 16px;
}
.fnb-comment-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}
.fnb-comment-author { font-weight: 700; font-size: .92rem; color: var(--fnlm-text, #1a2235) !important; }
.fnb-comment-time { font-size: .76rem; color: var(--fnlm-gray, #6b7280) !important; white-space: nowrap; }
.fnb-comment-text { margin: 0; font-size: .94rem; line-height: 1.55; color: var(--fnlm-text, #1a2235) !important; white-space: pre-wrap; word-break: break-word; }
.fnb-comment--new { animation: fnbCommentIn .35s ease; }
.fnb-comment-actions { display: flex; gap: 14px; margin-top: 6px; }
.fnb-comment-edit-btn, .fnb-comment-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    color: var(--fnlm-gray, #6b7280);
}
.fnb-comment-edit-btn:hover { color: var(--fnlm-blue, #003580); }
.fnb-comment-delete-btn:hover { color: #c0392b; }
.fnb-comment-edit-form { margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.fnb-comment-edit-form textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 64px;
    border: 1px solid var(--fnlm-border, #dde3ed);
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: .9rem;
}
.fnb-comment-edit-actions { display: flex; gap: 10px; align-items: center; }
.fnb-btn--sm { padding: 7px 16px; font-size: .82rem; }
.fnb-comment-cancel-edit {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    color: var(--fnlm-gray, #6b7280);
}
.fnb-comment-cancel-edit:hover { color: var(--fnlm-text, #1a2235); }
@keyframes fnbCommentIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fnb-comment-form { display: flex; flex-direction: column; gap: 12px; }
.fnb-comment-form textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 80px;
    border: 1px solid var(--fnlm-border, #dde3ed);
    border-radius: 10px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: .94rem;
}
.fnb-comment-form textarea:focus { outline: none; border-color: var(--fnlm-blue, #003580); box-shadow: 0 0 0 3px rgba(0,53,128,.12); }
.fnb-comment-form button { align-self: flex-end; }

.fnb-comment-cta {
    text-align: center;
    background: var(--fnlm-light, #f4f6f9);
    border-radius: 14px;
    padding: 26px 22px;
}
.fnb-comment-cta i { font-size: 1.6rem; color: var(--fnlm-blue, #003580); margin-bottom: 8px; display: block; }
.fnb-comment-cta p { margin: 0 0 16px; font-weight: 600; color: var(--fnlm-text, #1a2235); }
.fnb-comment-cta-actions { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; max-width: 100%; }
.fnb-comment-cta-actions .fnb-btn { max-width: 100%; box-sizing: border-box; white-space: normal; text-align: center; justify-content: center; }
.fnb-comment-cta-login { font-size: .88rem; font-weight: 600; color: var(--fnlm-blue, #003580); text-decoration: underline; }

@media (max-width: 560px) {
    .fnb-card, .fnb-feed-wrap, .fnb-single { margin-left: 14px; margin-right: 14px; }
    .fnb-write-header { padding: 22px 20px 16px; }
    .fnb-form { padding: 18px 20px 24px; }
    .fnb-single-body { padding: 22px 20px 28px; }
    .fnb-share-bar { flex-direction: column; align-items: flex-start; }
    .fnb-share-btn { flex: 1; justify-content: center; }
    .fnb-share-buttons { width: 100%; }
    .fnb-comment-cta-actions { flex-direction: column; gap: 10px; width: 100%; }
    .fnb-comment-cta-actions .fnb-btn { width: 100%; }
    .fnb-share-toast { position: static; display: block; margin-top: -2px; text-align: center; width: 100%; box-sizing: border-box; }
    .fnb-feed-header {
        flex-direction: column;
        align-items: flex-end;
        gap: 12px;
    }
    .fnb-feed-header h2 {
        width: 100%;
        justify-content: flex-end;
        gap: 6px;
        font-size: 1.25rem;
        white-space: nowrap;
    }
}
