/* === Hub /psicologi/ — estratto da astra-custom.php (015b) === */
/* Originale: inline <style> nel handler hub, 011 Layout Revision */

.nia-hub {
    max-width: var(--nia-max-w);
    margin: 0 auto;
    padding: 48px 24px 80px;
}

/* --- Hero centrato --- */
.nia-hub__hero {
    text-align: center;
    margin-bottom: 32px;
}

.nia-hub__title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--nia-text-primary);
    margin: 0 0 8px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.nia-hub__subtitle {
    font-size: .95rem;
    color: var(--nia-text-secondary);
    margin: 0 0 28px;
}

/* --- Search bar centrata (pill) --- */
.nia-hub__search-bar {
    max-width: 560px;
    margin: 0 auto;
    position: relative;
}

.nia-hub__search-wrap {
    position: relative;
}

.nia-hub__input {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 48px 16px 20px;
    font-size: .95rem;
    font-family: inherit;
    border: 2px solid var(--nia-border);
    border-radius: 100px;
    background: var(--nia-card-bg);
    color: var(--nia-text-primary);
    transition: border-color .2s, box-shadow .2s;
}

.nia-hub__input:focus {
    outline: none;
    border-color: var(--nia-accent);
    box-shadow: 0 0 0 4px rgba(58, 124, 106, .1);
}

.nia-hub__input::placeholder {
    color: var(--nia-text-muted);
}

.nia-hub__search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    color: var(--nia-text-muted);
}

/* Dropdown autocomplete */
.nia-hub__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--nia-card-bg);
    border: 1px solid var(--nia-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
    max-height: 360px;
    overflow-y: auto;
    z-index: 100;
}

.nia-hub__dropdown[data-visible="true"] {
    display: block;
}

.nia-hub__result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--nia-text-primary);
    transition: background .15s;
}

.nia-hub__result:hover,
.nia-hub__result[data-active="true"] {
    background: var(--nia-accent-light);
}

.nia-hub__result-label {
    font-size: .95rem;
}

.nia-hub__result-badge {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 2px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    margin-left: 12px;
}

.nia-hub__result-badge--prov {
    background: var(--nia-accent-light);
    color: var(--nia-accent);
}

.nia-hub__result-badge--com {
    background: #f0ebe3;
    color: #8a7560;
}

.nia-hub__no-results {
    padding: 16px;
    text-align: center;
    color: var(--nia-text-muted);
    font-size: .9rem;
}

/* --- Toggle "Sfoglia per regione" --- */
.nia-hub__browse-toggle {
    text-align: center;
    margin-top: 16px;
    margin-bottom: 8px;
}

.nia-hub__browse-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: transparent;
    border: 1.5px solid var(--nia-border);
    border-radius: 100px;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    color: var(--nia-text-secondary);
    cursor: pointer;
    transition: all .2s;
}

.nia-hub__browse-btn:hover,
.nia-hub__browse-btn.open {
    border-color: var(--nia-accent);
    color: var(--nia-accent);
    background: var(--nia-accent-light);
}

.nia-hub__chevron {
    width: 16px;
    height: 16px;
    transition: transform .3s ease;
}

.nia-hub__browse-btn.open .nia-hub__chevron {
    transform: rotate(180deg);
}

/* --- Griglia regionale collassabile --- */
.nia-hub__region-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease, opacity .3s ease;
    opacity: 0;
}

.nia-hub__region-panel.open {
    max-height: 2000px;
    opacity: 1;
}

.nia-hub__region-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 8px 0 4px;
}

.nia-hub__region-item {
    display: flex;
    flex-direction: column;
}

.nia-hub__region-card {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 14px;
    background: var(--nia-card-bg);
    border: 1px solid var(--nia-border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s ease;
    color: var(--nia-text-primary);
    font-family: inherit;
    font-size: inherit;
}

.nia-hub__region-card:hover,
.nia-hub__region-card.open {
    border-color: var(--nia-accent);
    background: rgba(58, 124, 106, 0.12);
    color: var(--nia-accent);
}

.nia-hub__region-name {
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.3;
}

.nia-hub__region-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

.nia-hub__region-count {
    font-size: .68rem;
    color: var(--nia-text-muted);
    white-space: nowrap;
}

.nia-hub__region-chevron {
    width: 12px;
    height: 12px;
    transition: transform .3s ease;
    color: var(--nia-text-muted);
    flex-shrink: 0;
}

.nia-hub__region-card.open .nia-hub__region-chevron {
    transform: rotate(180deg);
    color: var(--nia-accent);
}

/* --- Province sub-accordion --- */
.nia-hub__province-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}

.nia-hub__province-panel.open {
    max-height: 500px;
}

.nia-hub__province-list {
    padding: 4px 0 2px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nia-hub__province-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 14px;
    font-size: .74rem;
    color: var(--nia-text-primary);
    text-decoration: none;
    border-radius: 4px;
    transition: background .15s;
}

.nia-hub__province-link:hover {
    background: rgba(58, 124, 106, 0.10);
    color: var(--nia-accent);
}

.nia-hub__province-count {
    font-size: .67rem;
    color: var(--nia-text-muted);
}

/* --- Section divider --- */
.nia-hub__divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 40px 0 28px;
}

.nia-hub__divider::before,
.nia-hub__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--nia-border);
}

.nia-hub__divider h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--nia-text-primary);
    white-space: nowrap;
    margin: 0;
}

/* === Sezione verificati === */
.nia-hub__verificati {
    margin-top: 0;
}

/* Empty state */
.nia-hub__empty {
    text-align: center;
    padding: 48px 20px;
    background: #faf8f4;
    border: 1px dashed var(--nia-border);
    border-radius: 12px;
}

.nia-hub__empty-icon {
    width: 56px;
    height: 56px;
    color: #ccc;
    margin: 0 auto 16px;
}

.nia-hub__empty p {
    font-size: .95rem;
    color: #888;
    margin: 0 0 8px;
}

.nia-hub__empty a {
    color: var(--nia-accent);
    font-weight: 600;
    text-decoration: none;
}

.nia-hub__empty a:hover {
    text-decoration: underline;
}

/* Card grid */
.nia-hub__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.nia-hub__card {
    background: var(--nia-card-bg);
    border: 1px solid var(--nia-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}

.nia-hub__card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .04);
    transform: translateY(-2px);
}

.nia-hub__card-inner {
    padding: 22px;
}

.nia-hub__card-header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.nia-hub__avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    background: linear-gradient(135deg, #d4c5b5, #c2b09e);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.nia-hub__avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.nia-hub__avatar-ph {
    width: 26px;
    height: 26px;
    opacity: .4;
}

.nia-hub__badge-check {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 22px;
    height: 22px;
    background: var(--nia-accent);
    border-radius: 50%;
    border: 2.5px solid var(--nia-card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nia-hub__badge-check svg {
    width: 12px;
    height: 12px;
    color: var(--nia-card-bg);
}

.nia-hub__card-identity {
    flex: 1;
    min-width: 0;
}

.nia-hub__card-name {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--nia-text-primary);
}

/* 029g: Pill tipologia terapia */
.nia-hub__card-terapie {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
    justify-content: flex-end;
}
.nia-hub__terapia-pill {
    display: inline-block;
    padding: 3px 10px;
    font-size: .7rem;
    font-weight: 600;
    color: #fff;
    background: var(--nia-accent, #3a7c6a);
    border-radius: 12px;
    line-height: 1.4;
}

.nia-hub__card-hr {
    border: none;
    border-top: 1px solid var(--nia-border, #e5e7eb);
    margin: 15px 0;  /* 029g: era 8px 0 */
}

/* 028c — Pill ambiti di intervento (azzurrine) */
.nia-hub__card-specs {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.nia-hub__spec-pill {
    display: inline-block;
    padding: 3px 10px;
    font-size: .7rem;
    font-weight: 500;
    color: #2563a8;
    background: rgba(37, 99, 168, .08);
    border: 1px solid rgba(37, 99, 168, .18);
    border-radius: 12px;
    line-height: 1.4;
}

/* 028c — Pill comuni (colore CTA) */
.nia-hub__card-comuni {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}
.nia-hub__comune-pill {
    display: inline-block;
    padding: 4px 12px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--nia-cta-text, #1a1a1a);
    background: var(--nia-cta, #e8c547);
    border-radius: 14px;
    text-decoration: none;
    transition: background .15s, opacity .15s;
    line-height: 1.4;
}
.nia-hub__comune-pill:hover {
    background: var(--nia-cta-hover, #d4b43e);
    color: var(--nia-cta-text, #1a1a1a);
}

.nia-hub__card-cta {
    display: flex;
    gap: 8px;
}

.nia-hub__btn {
    flex: 1;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: .76rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all .15s;
    border: none;
    cursor: pointer;
}

.nia-hub__btn--primary {
    background: var(--nia-cta);
    color: var(--nia-cta-text);
}

.nia-hub__btn--primary:hover {
    background: var(--nia-cta-hover);
    color: var(--nia-cta-text);
}

.nia-hub__btn--secondary {
    background: transparent;
    color: var(--nia-accent);
    border: 1.5px solid var(--nia-accent);
}

.nia-hub__btn--secondary:hover {
    background: var(--nia-accent-light);
}

/* --- CTA professionisti --- */
.nia-hub__cta-pro {
    text-align: center;
    margin-top: 32px;
    padding: 28px;
    background: var(--nia-card-bg);
    border: 1.5px dashed var(--nia-border);
    border-radius: 12px;
}

.nia-hub__cta-pro p {
    font-size: .88rem;
    color: var(--nia-text-secondary);
    margin: 0 0 12px;
}

.nia-hub__cta-pro a {
    font-size: .88rem;
    font-weight: 600;
    color: var(--nia-accent);
    text-decoration: none;
}

.nia-hub__cta-pro a:hover {
    text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nia-hub {
        padding: 24px 16px 40px;
    }
    .nia-hub__title {
        font-size: 1.6rem;
    }
    .nia-hub__region-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .nia-hub__grid {
        grid-template-columns: 1fr;
    }
    .nia-hub__card-inner {
        padding: 18px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .nia-hub__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
