/* =============================================================================
   Homepage — Udemy-style layout
   corsi.coreform.it
   ============================================================================= */

/* ── Hero ── */
.hp-hero {
    background: #1c1d1f; /* fallback se l'inline style non carica */
    padding-top: calc(var(--cf-navbar-height) + 3rem);
    padding-bottom: 3.5rem;
    position: relative;
    overflow: hidden;
}

.hp-hero::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -5%;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(16,185,129,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.hp-hero-inner {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hp-hero-text {
    max-width: 640px;
    width: 100%;
}

.hp-hero-title {
    font-size: clamp(1.75rem, 4vw, 2.625rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.hp-hero-sub {
    font-size: 1rem;
    color: #d1d7dc;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Search bar */
.hp-search-wrap {
    display: flex;
    align-items: stretch;
    border: none;
    border-radius: 4px;
    overflow: hidden;
    max-width: 560px;
    height: 52px;
}

.hp-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 18px;
    font-size: 15px;
    color: #1c1d1f;
    background: #fff;
    min-width: 0;
}

.hp-search-input::placeholder { color: #6a6f73; }

.hp-search-btn {
    background: var(--cf-primary);
    border: none;
    color: #fff;
    padding: 0 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}

.hp-search-btn:hover { background: var(--cf-primary-dark); }

.hp-hero-img {
    display: none; /* immagine ora in background CSS */
}

/* ── Category pills ── */
.hp-cats {
    background: #fff;
    border-bottom: 1px solid #d1d7dc;
    padding: 0;
    position: sticky;
    top: var(--cf-navbar-height);
    z-index: 100;
}

.hp-cats-scroll {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.hp-cats-scroll::-webkit-scrollbar { display: none; }

.hp-cat-pill {
    flex-shrink: 0;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #1c1d1f;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: border-color 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hp-cat-pill:hover,
.hp-cat-pill.active {
    border-bottom-color: #1c1d1f;
    color: #1c1d1f;
}

.hp-cat-pill i {
    font-size: 13px;
    color: var(--cf-primary);
}

/* ── Generic section wrapper ── */
.hp-section {
    padding: 3rem 0;
}

.hp-section + .hp-section {
    padding-top: 0;
}

.hp-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 16px;
}

.hp-section-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1c1d1f;
    margin: 0;
    line-height: 1.3;
}

.hp-section-link {
    font-size: 14px;
    font-weight: 700;
    color: #5624d0;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.hp-section-link:hover { color: #401b9c; text-decoration: underline; }

/* ── Course cards horizontal scroll ── */
.hp-course-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: #d1d7dc transparent;
    /* Show partial next card as affordance */
    padding-right: 1px;
}

.hp-course-scroll::-webkit-scrollbar { height: 4px; }
.hp-course-scroll::-webkit-scrollbar-track { background: transparent; }
.hp-course-scroll::-webkit-scrollbar-thumb { background: #d1d7dc; border-radius: 4px; }

/* ── Course card ── */
.hp-course-card {
    flex-shrink: 0;
    width: 260px;
    border: 1px solid #d1d7dc;
    background: #fff;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s;
    cursor: pointer;
}

.hp-course-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.14);
    color: inherit;
    text-decoration: none;
}

.hp-course-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background: #f1f5f9;
}

.hp-course-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hp-course-card-cat {
    font-size: 11px;
    font-weight: 700;
    color: var(--cf-primary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.hp-course-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1c1d1f;
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hp-course-card-price {
    font-size: 15px;
    font-weight: 700;
    color: #1c1d1f;
    margin-top: auto;
}

.hp-course-card-price-old {
    font-size: 12px;
    color: #6a6f73;
    text-decoration: line-through;
    margin-left: 6px;
    font-weight: 400;
}

/* ── Promo banner (dark) ── */
.hp-promo-banner {
    background: #1c1d1f;
    padding: 3rem 0;
    margin: 0;
}

.hp-promo-banner-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.hp-promo-banner-text { flex: 1; min-width: 260px; }

.hp-promo-banner-eyebrow {
    font-size: 12px;
    font-weight: 700;
    color: var(--cf-primary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
}

.hp-promo-banner-title {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 12px;
}

.hp-promo-banner-desc {
    font-size: 15px;
    color: #d1d7dc;
    margin-bottom: 20px;
    line-height: 1.5;
}

.hp-promo-banner-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--cf-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.15s;
}

.hp-promo-banner-cta:hover { background: var(--cf-primary-dark); color: #fff; }

.hp-promo-banner-cta-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 24px;
    border: 2px solid #fff;
    border-radius: 4px;
    text-decoration: none;
    margin-left: 12px;
    transition: background 0.15s;
}

.hp-promo-banner-cta-outline:hover { background: rgba(255,255,255,0.1); color: #fff; }

.hp-promo-banner-img {
    flex-shrink: 0;
    max-width: 340px;
}

.hp-promo-banner-img img {
    max-width: 100%;
    border-radius: 8px;
    display: block;
}

/* ── Trust logos ── */
.hp-trust {
    padding: 2rem 0;
    border-top: 1px solid #d1d7dc;
    border-bottom: 1px solid #d1d7dc;
    background: #f7f9fa;
}

.hp-trust-label {
    font-size: 13px;
    color: #6a6f73;
    font-weight: 600;
    margin-right: 24px;
    white-space: nowrap;
    flex-shrink: 0;
}

.hp-trust-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

.hp-trust-logo {
    height: 36px;
    width: auto;
    opacity: 0.65;
    filter: grayscale(100%);
    transition: opacity 0.15s, filter 0.15s;
    display: block;
    object-fit: contain;
}

.hp-trust-logo:hover { opacity: 1; filter: grayscale(0%); }

.hp-trust-text {
    font-size: 16px;
    font-weight: 700;
    color: #6a6f73;
    white-space: nowrap;
    letter-spacing: -0.3px;
}

/* ── Popular topics ── */
.hp-topics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hp-topic-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #d1d7dc;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #1c1d1f;
    text-decoration: none;
    background: #fff;
    transition: background 0.1s, border-color 0.1s;
}

.hp-topic-tag:hover {
    background: #f7f9fa;
    border-color: #1c1d1f;
    color: #1c1d1f;
}

.hp-topic-tag span {
    font-size: 11px;
    color: #6a6f73;
    font-weight: 400;
}

/* ── Stats bar ── */
.hp-stats-bar {
    background: var(--cf-secondary);
    padding: 2rem 0;
}

.hp-stats-inner {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}

.hp-stat {
    flex: 1;
    min-width: 140px;
    text-align: center;
    padding: 1rem;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.hp-stat:last-child { border-right: none; }

.hp-stat-num {
    font-size: 2rem;
    font-weight: 700;
    color: var(--cf-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.hp-stat-label {
    font-size: 13px;
    color: #94a3b8;
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .hp-hero {
        padding-top: calc(var(--cf-navbar-height) + 2rem);
        padding-bottom: 2.5rem;
        /* Su mobile sfuma tutta la foto per leggibilità del testo */
        background: linear-gradient(to bottom, rgba(28,29,31,0.92) 0%, rgba(28,29,31,0.85) 100%), center center / cover no-repeat !important;
    }
    .hp-promo-banner-img { display: none; }
    .hp-course-card { width: 220px; }
}

@media (max-width: 767.98px) {
    .hp-section-title { font-size: 1.125rem; }
    .hp-promo-banner-title { font-size: 1.25rem; }
    .hp-promo-banner-cta-outline { display: none; }
    .hp-cat-pill { padding: 12px 14px; font-size: 13px; }
    .hp-stat-num { font-size: 1.5rem; }
}
