/**
 * D-One UI Components - Hero Second Level
 * Pattern standardizzato per hero delle pagine di secondo livello
 * Basato sul design Services/KB con gradiente e spacing unificati
 */

/* ========================================
   HERO SECOND LEVEL - FOUNDATION
   Pattern Services: hero compatto con gradient, icon bianco, typography standardizzata
   ======================================== */

.hero-second-level {
    background: linear-gradient(135deg, #9458cf 0%, #4652c2 50%, #6747b4 100%);
    padding: 0.05rem 0 0.625rem;
    margin-top: 70px; /* header offset */
    margin-bottom: 2rem; /* spacing standard sotto hero */
    border-radius: 20px;
    position: relative;
    color: white;
    text-align: center;
}

/* Container per contenuto hero - pattern Services */
.hero-content-container {
    padding: 10px 2rem; /* pattern standard Services */
    max-width: var(--container-max-width);
    margin: 0 auto;
}

/* ========================================
   HERO TYPOGRAPHY - SERVICES PATTERN
   ======================================== */

/* Title - h3 size pattern Services */
.hero-second-level-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
    line-height: var(--line-height-tight);
    color: white;
}

/* Subtitle - Services pattern con nowrap desktop */
.hero-second-level-subtitle {
    font-size: 0.95rem;
    margin-bottom: var(--space-4);
    opacity: 0.95;
    line-height: var(--line-height-base);
    color: white;
}

/* Desktop: subtitle single line con ellipsis se necessario */
@media (min-width: 992px) {
    .hero-second-level-subtitle {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        max-width: 100%;
    }
}

/* Mobile: permettere wrap normale */
@media (max-width: 576px) {
    .hero-second-level-title {
        font-size: 1.5rem;
    }
    
    .hero-second-level-subtitle {
        font-size: 0.85rem;
        white-space: normal;
        max-width: 90%;
        margin: 0 auto var(--space-4);
    }
}

/* ========================================
   HERO ICON - WHITE ON GRADIENT
   ======================================== */

.hero-second-level-icon {
    color: white !important;
    margin-bottom: var(--space-3);
    font-size: 3rem;
}

.hero-second-level-icon i,
.hero-second-level-icon .fas,
.hero-second-level-icon .far {
    color: white !important;
}

/* ========================================
   HERO ACTIONS - BUTTONS CONTAINER
   ======================================== */

.hero-second-level-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-4);
}

@media (max-width: 576px) {
    .hero-second-level-actions {
        flex-direction: column;
        gap: var(--space-2);
        align-items: center;
    }
}

/* ========================================
   CONTENT SECTION RESET
   Per rimuovere gap tra header fisso e hero
   ======================================== */

.content-section-reset {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ========================================
   HERO VARIANTS - DIFFERENT GRADIENTS
   ======================================== */

/* Default Services gradient (already in .hero-second-level) */

/* KB variant gradient */
.hero-second-level.hero-kb {
    background: var(--gradient-primary);
}

/* Tools variant gradient */
.hero-second-level.hero-tools {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Admin variant gradient */
.hero-second-level.hero-admin {
    background: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
}

/* Test variant gradient */
.hero-second-level.hero-test {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
}

/* ========================================
   HERO STATS/INFO SECTION
   Pattern per elementi info sotto hero title
   ======================================== */

.hero-info-section {
    display: flex;
    gap: var(--space-6);
    justify-content: center;
    align-items: center;
    margin-top: var(--space-4);
    flex-wrap: wrap;
}

.hero-info-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: white;
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

.hero-info-item i {
    color: white;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .hero-info-section {
        gap: var(--space-4);
    }
    
    .hero-info-item {
        font-size: var(--font-size-xs);
    }
}

/* ========================================
   HERO BREADCRUMB INTEGRATION
   Per breadcrumb su hero se necessario
   ======================================== */

.hero-breadcrumb {
    margin-bottom: var(--space-3);
    opacity: 0.8;
}

.hero-breadcrumb a {
    color: white;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.hero-breadcrumb a:hover {
    opacity: 1;
}

.hero-breadcrumb .breadcrumb-separator {
    margin: 0 var(--space-2);
    opacity: 0.6;
}

/* ========================================
   DARK THEME ADJUSTMENTS
   Hero mantiene stesso aspetto in entrambi i temi (sempre gradient colorato)
   Nessuna modifica necessaria - hero è sempre colorato
   ======================================== */

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

.hero-second-level:focus-within {
    /* Ensure sufficient contrast for focused elements */
    outline: none;
}

.hero-second-level *:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero-second-level {
        border: 2px solid white;
    }
    
    .hero-second-level-title,
    .hero-second-level-subtitle {
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .hero-second-level,
    .hero-second-level * {
        transition: none !important;
        animation: none !important;
    }
}

/* ========================================
   UTILITY CLASSES FOR HERO CUSTOMIZATION
   ======================================== */

.hero-text-left { text-align: left; }
.hero-text-center { text-align: center; }
.hero-text-right { text-align: right; }

.hero-compact {
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.hero-extended {
    padding: 3rem 0;
    margin-bottom: 3rem;
}

/* Remove margin-bottom for hero seguiti immediatamente da content */
.hero-no-margin {
    margin-bottom: 0;
}

/* Pattern per hero con background image overlay */
.hero-with-image {
    background-blend-mode: overlay;
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-with-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-with-image .hero-content-container {
    position: relative;
    z-index: 2;
}
