/**
 * 014b — Homepage CSS Design System
 *
 * Stili per le 8 sezioni homepage NienteAnsia.
 * Prefisso BEM: .nia-hp-* (no conflitto con nia-psi-*, nia-hub-*, nia-prov-*)
 * Breakpoint responsive: 768px (da wireframe)
 * Design tokens da wireframe-homepage.html
 */

/* === ASTRA OVERRIDE: full-width homepage layout === */
.home #content .ast-container {
    display: block;
    max-width: 100%;
    padding: 0;
    margin: 0;
}

/* === HERO === */
.nia-hp-hero {
    background: linear-gradient(165deg, var(--nia-teal) 0%, var(--nia-teal-dark) 100%);
    padding: 56px 24px 52px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.nia-hp-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
    border-radius: 50%;
}
.nia-hp-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    border-radius: 50%;
}
.nia-hp-hero-inner {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Hero badge */
.nia-hp-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.03em;
    margin-bottom: 20px;
}
.nia-hp-hero-badge .dot {
    width: 6px;
    height: 6px;
    background: #6ee0b8;
    border-radius: 50%;
}

/* Hero typography */
.nia-hp-hero h1 {
    font-family: 'Source Serif 4', serif;
    font-size: 2.3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: 12px;
}
.nia-hp-hero p {
    font-size: 1rem;
    color: #fff;
    line-height: 1.6;
    margin-bottom: 32px;
}

/* Hero search pill */
.nia-hp-hero-search {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}
.nia-hp-hero-search input {
    width: 100%;
    padding: 16px 48px 16px 20px;
    border: 2px solid #fff;
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--nia-text-primary);
    background: #fff;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}
.nia-hp-hero-search input::placeholder {
    color: var(--nia-text-muted);
}
.nia-hp-hero-search input:focus {
    border-color: var(--nia-accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(58,124,106,0.12);
}
.nia-hp-hero-search .nia-hp-search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--nia-text-muted);
    pointer-events: none;
}

/* Hero quick links */
.nia-hp-hero-links {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.nia-hp-hero-links a {
    padding: 6px 14px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.30);
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #fff;
    transition: all 0.15s;
    text-decoration: none;
}
.nia-hp-hero-links a:hover {
    background: var(--nia-cta);
    color: var(--nia-cta-text);
}

/* Hero autocomplete dropdown */
.nia-hp-hero-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 6px;
    background: #fff;
    border-radius: var(--nia-radius);
    box-shadow: var(--nia-shadow-lg);
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.nia-hp-hero-autocomplete.active {
    display: block;
}
.nia-hp-hero-autocomplete a {
    display: block;
    padding: 12px 20px;
    font-size: 0.88rem;
    color: var(--nia-text-primary);
    border-bottom: 1px solid var(--nia-border-light);
    transition: background 0.1s;
    text-decoration: none;
}
.nia-hp-hero-autocomplete a:last-child {
    border-bottom: none;
}
.nia-hp-hero-autocomplete a:hover,
.nia-hp-hero-autocomplete a.nia-hp-ac-active {
    background: var(--nia-accent-xlight);
}
.nia-hp-hero-autocomplete .nia-hp-ac-type {
    font-size: 0.68rem;
    color: var(--nia-text-muted);
    margin-left: 6px;
}

/* === SECTIONS CONTAINER === */
.nia-hp-sections {
    max-width: var(--nia-max-w);
    margin: 0 auto;
    padding: 0 24px;
}

/* === SECTION HEADER === */
.nia-hp-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
}
.nia-hp-section-header h2 {
    font-family: 'Source Serif 4', serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--nia-text-primary);
    margin: 0;
}
.nia-hp-section-header .nia-hp-see-all {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--nia-accent);
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}
.nia-hp-section-header .nia-hp-see-all:hover {
    text-decoration: underline;
}

/* === SECTION — TEST === */
.nia-hp-section-tests {
    padding: 48px 0 44px;
    border-bottom: 1px solid var(--nia-border);
}
.nia-hp-tests-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.nia-hp-test-card {
    background: var(--nia-card-bg);
    border: 1px solid var(--nia-border);
    border-radius: var(--nia-radius);
    padding: 24px 18px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: block;
    text-decoration: none;
    color: inherit;
}
.nia-hp-test-card:hover {
    border-color: var(--nia-accent);
    box-shadow: var(--nia-shadow-md);
    transform: translateY(-3px);
}
/* 030b: Header teal card test */
.nia-hp-test-header {
    background: var(--nia-accent);
    margin: -24px -18px 0;
    padding: 14px 18px;
    border-radius: var(--nia-radius) var(--nia-radius) 0 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.nia-hp-test-card .nia-hp-test-header .nia-hp-test-name {
    color: #fff;
    margin-bottom: 0;
}
.nia-hp-test-body {
    padding-top: 16px;
}
.nia-hp-test-card .nia-hp-test-name {
    font-family: 'Source Serif 4', serif;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 6px;
    color: var(--nia-text-primary);
}
.nia-hp-test-card .nia-hp-test-desc {
    font-size: 0.72rem;
    color: var(--nia-text-muted);
    line-height: 1.4;
    margin-bottom: 14px;
}
.nia-hp-test-card .nia-hp-test-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--nia-cta-text);
    background: var(--nia-cta);
    padding: 6px 14px;
    border-radius: var(--nia-radius-sm);
    text-decoration: none;
    transition: background-color var(--nia-transition);
    align-self: flex-start;
}
.nia-hp-test-card:hover .nia-hp-test-cta {
    background: var(--nia-cta-hover);
    text-decoration: none;
}

/* Badge "Popolare" */
.nia-hp-test-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    padding: 3px 8px;
    background: var(--nia-warm-light);
    border-radius: 100px;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--nia-warm);
}

/* === SECTION — DIRECTORY === */
.nia-hp-section-directory {
    padding: 44px 0;
    border-bottom: 1px solid var(--nia-border);
}
.nia-hp-directory-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Directory left: search + quick links */
.nia-hp-dir-search-panel {
    background: var(--nia-card-bg);
    border: 1px solid var(--nia-border);
    border-radius: var(--nia-radius);
    padding: 28px 24px;
}
.nia-hp-dir-search-panel h3 {
    font-family: 'Source Serif 4', serif;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--nia-text-primary);
}
.nia-hp-dir-search-panel .nia-hp-dir-sub {
    font-size: 0.8rem;
    color: var(--nia-text-secondary);
    margin-bottom: 18px;
}

/* Directory search input */
.nia-hp-dir-search {
    position: relative;
    margin-bottom: 18px;
}
.nia-hp-dir-search input {
    width: 100%;
    padding: 13px 16px 13px 42px;
    border: 1.5px solid var(--nia-accent-light);
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--nia-text-primary);
    background: var(--nia-accent-xlight);
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}
.nia-hp-dir-search input::placeholder {
    color: var(--nia-text-muted);
}
.nia-hp-dir-search input:focus {
    border-color: var(--nia-accent);
    box-shadow: 0 0 0 3px rgba(58,124,106,0.08);
    background: #fff;
}
.nia-hp-dir-search .nia-hp-dir-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--nia-text-muted);
    pointer-events: none;
}

/* Directory autocomplete dropdown */
.nia-hp-dir-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border-radius: var(--nia-radius);
    box-shadow: var(--nia-shadow-lg);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.nia-hp-dir-autocomplete.active {
    display: block;
}
.nia-hp-dir-autocomplete a {
    display: block;
    padding: 10px 16px;
    font-size: 0.82rem;
    color: var(--nia-text-primary);
    border-bottom: 1px solid var(--nia-border-light);
    transition: background 0.1s;
    text-decoration: none;
}
.nia-hp-dir-autocomplete a:last-child {
    border-bottom: none;
}
.nia-hp-dir-autocomplete a:hover,
.nia-hp-dir-autocomplete a.nia-hp-ac-active {
    background: var(--nia-accent-xlight);
}

/* Directory quick links */
.nia-hp-dir-quick-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--nia-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.nia-hp-dir-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.nia-hp-dir-quick-link {
    padding: 8px 10px;
    background: var(--nia-accent-xlight);
    border: 1px solid var(--nia-accent-light);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--nia-text-secondary);
    text-align: center;
    transition: all 0.15s;
    text-decoration: none;
    display: block;
}
.nia-hp-dir-quick-link:hover {
    border-color: var(--nia-accent);
    color: var(--nia-accent);
    background: var(--nia-accent-light);
}

/* Directory right: featured/placeholder */
.nia-hp-dir-featured-panel {
    background: var(--nia-card-bg);
    border: 1px solid var(--nia-border);
    border-radius: var(--nia-radius);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
}
.nia-hp-dir-featured-panel h3 {
    font-family: 'Source Serif 4', serif;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--nia-text-primary);
}
.nia-hp-dir-featured-panel .nia-hp-dir-sub {
    font-size: 0.8rem;
    color: var(--nia-text-secondary);
    margin-bottom: 20px;
}

/* Placeholder dashed (nessun verificato) */
.nia-hp-dir-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: var(--nia-accent-xlight);
    border: 1.5px dashed var(--nia-accent);
    border-radius: var(--nia-radius-sm);
    text-align: center;
    opacity: 0.85;
}
.nia-hp-dir-placeholder .nia-hp-ph-icon {
    width: 36px;
    height: 36px;
    color: var(--nia-accent);
    opacity: 0.5;
    margin-bottom: 12px;
}
.nia-hp-dir-placeholder p {
    font-size: 0.8rem;
    color: var(--nia-text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}
.nia-hp-dir-placeholder a {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--nia-accent);
    text-decoration: none;
}
.nia-hp-dir-placeholder a:hover {
    text-decoration: underline;
}

/* 030c: Card professionisti in evidenza — teal */
.nia-hp-dir-featured-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--nia-accent);
    border-radius: var(--nia-radius-sm);
    margin-bottom: 8px;
    color: #fff;
}
.nia-hp-fc-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.3);
}
.nia-hp-fc-photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
}
.nia-hp-fc-photo--placeholder svg {
    width: 28px;
    height: 28px;
}
.nia-hp-fc-info {
    flex: 1;
    min-width: 0;
}
.nia-hp-fc-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nia-hp-fc-comuni {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.nia-hp-fc-pill {
    display: inline-block;
    padding: 2px 8px;
    background: var(--nia-cta);
    color: var(--nia-cta-text);
    border-radius: 100px;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: opacity 0.15s;
}
.nia-hp-fc-pill:hover {
    opacity: 0.8;
}

/* === SECTION — EDITORIAL (disturbi, articoli, glossario) === */
.nia-hp-section-editorial {
    padding: 44px 0;
    border-bottom: 1px solid var(--nia-border);
}

.nia-hp-editorial-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Article card */
.nia-hp-article-card {
    background: var(--nia-card-bg);
    border: 1px solid var(--nia-border);
    border-radius: var(--nia-radius);
    overflow: hidden;
    transition: all 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
}
.nia-hp-article-card:hover {
    box-shadow: var(--nia-shadow-md);
    transform: translateY(-2px);
}

/* Article thumb */
.nia-hp-article-thumb {
    height: 140px;
    background: linear-gradient(135deg, #d8cfc5 0%, #c8bdb0 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.nia-hp-article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.nia-hp-article-thumb .nia-hp-thumb-placeholder {
    width: 40px;
    height: 40px;
    opacity: 0.25;
    color: #fff;
}
.nia-hp-article-cat {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.92);
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--nia-accent);
    backdrop-filter: blur(4px);
}

/* Article body */
.nia-hp-article-body {
    padding: 18px;
}
.nia-hp-article-body h3 {
    font-family: 'Source Serif 4', serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
    color: var(--nia-text-primary);
}
.nia-hp-article-body p {
    font-size: 0.76rem;
    color: var(--nia-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* === SECTION — PSICOTERAPIE === */
.nia-hp-section-psicoterapie {
    padding: 44px 0;
    border-bottom: 1px solid var(--nia-border);
}
.nia-hp-therapy-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.nia-hp-therapy-card {
    background: var(--nia-card-bg);
    border: 1px solid var(--nia-border);
    border-radius: var(--nia-radius);
    padding: 20px 16px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}
.nia-hp-therapy-card:hover {
    border-color: var(--nia-accent);
    box-shadow: var(--nia-shadow-md);
    transform: translateY(-2px);
}
.nia-hp-therapy-card h4 {
    font-family: 'Source Serif 4', serif;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    color: var(--nia-text-primary);
}
.nia-hp-therapy-card .nia-hp-therapy-count {
    font-size: 0.68rem;
    color: var(--nia-text-muted);
}
/* 030d: Header teal card psicoterapie */
.nia-hp-therapy-header {
    background: var(--nia-accent);
    margin: -20px -16px 0;
    padding: 12px 16px;
    border-radius: var(--nia-radius) var(--nia-radius) 0 0;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nia-hp-therapy-header h4 {
    color: #fff;
    margin-bottom: 0;
}
.nia-hp-therapy-body {
    padding-top: 12px;
}

/* === SECTION — CTA BANNER PROFESSIONISTI === */
.nia-hp-section-cta-pro {
    padding: 48px 0 56px;
}
.nia-hp-cta-banner {
    background: linear-gradient(135deg, var(--nia-teal), var(--nia-teal-dark));
    border-radius: var(--nia-radius-lg);
    padding: 40px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    position: relative;
    overflow: hidden;
}
.nia-hp-cta-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
}
.nia-hp-cta-banner-text {
    position: relative;
    z-index: 1;
}
.nia-hp-cta-banner-text h2 {
    font-family: 'Source Serif 4', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}
.nia-hp-cta-banner-text p {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
    max-width: 440px;
    margin: 0;
}
.nia-hp-cta-banner-btn {
    position: relative;
    z-index: 1;
    padding: 14px 32px;
    background: var(--nia-cta);
    color: var(--nia-cta-text);
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    text-decoration: none;
    display: inline-block;
}
.nia-hp-cta-banner-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    background: var(--nia-cta-hover);
    color: var(--nia-cta-text);
}

/* === RESPONSIVE 768px === */
@media (max-width: 768px) {
    .nia-hp-hero h1 {
        font-size: 1.7rem;
    }
    .nia-hp-tests-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .nia-hp-directory-layout {
        grid-template-columns: 1fr;
    }
    .nia-hp-dir-quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .nia-hp-editorial-grid-3 {
        grid-template-columns: 1fr;
    }
    .nia-hp-therapy-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .nia-hp-cta-banner {
        flex-direction: column;
        text-align: center;
        padding: 32px 24px;
    }
    .nia-hp-cta-banner-text p {
        max-width: 100%;
    }
}
