/* ==========================================================================
   Firmamento Technologies — Visual Fixes & Missing Styles
   Add to header.php AFTER breadcrumbs.css:
   <link rel="stylesheet" href="<?php echo assetUrl('css/fixes.css'); ?>">
   ========================================================================== */

/* ─── 1. HERO VIDEO FIX ─── */
/* The hero uses class "herocontainer" but CSS only defines "container" */
.herocontainer {
    width: min(var(--container-width), calc(100% - 3rem));
    margin-inline: auto;
    position: relative;
    z-index: 2;
}

/* Hero CTA buttons row */
.hero-cta {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-xl);
    flex-wrap: wrap;
}

/* Ensure hero video plays behind content */
.hero-video {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blu-scuro);
}

.hero-video__media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(3, 19, 53, 0.45) 0%,
        rgba(3, 19, 53, 0.65) 50%,
        rgba(3, 19, 53, 0.85) 100%
    );
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 850px;
    margin: 0 auto;
    text-align: center;
    color: var(--bianco-carta);
    padding: 0 1.5rem;
}

.hero-content * {
    color: var(--bianco-carta);
}

.hero-content .eyebrow {
    color: var(--oro);
    font-size: var(--font-size-sm);
    letter-spacing: 0.2em;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: var(--space-lg);
    line-height: 1.08;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    color: var(--bianco-carta);
}

.hero-content .lead {
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-lg);
    max-width: 650px;
    margin: 0 auto;
}

/* Hero buttons override for dark background */
.hero-cta .btn--primary {
    background: var(--oro);
    color: var(--blu-scuro);
    border-color: var(--oro);
}

.hero-cta .btn--secondary {
    background: transparent;
    color: var(--bianco-carta);
    border-color: rgba(255, 255, 255, 0.5);
}

.hero-cta .btn--secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--bianco-carta);
    color: var(--bianco-carta) !important;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    width: 26px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 13px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
}

.scroll-indicator span {
    width: 4px;
    height: 8px;
    background: var(--oro);
    border-radius: 2px;
    animation: scrollDot 2s infinite;
}

@keyframes scrollDot {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(16px); opacity: 0.2; }
}


/* ─── 2. SECTION BACKGROUNDS ─── */
.bg-panel {
    background: var(--surface-1);
}

.section-dark,
.section-dark * {
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.85);
}

.section-dark {
    background: var(--blu-scuro);
    color: var(--bianco-carta);
}


/* ─── 3. AI URGENCY SECTION (dark bg fix) ─── */
#ai-urgency {
    background: var(--blu-scuro);
}

#ai-urgency h2,
#ai-urgency p {
    color: var(--bianco-carta);
}

.ai-stat-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.ai-stat-value {
    color: var(--oro) !important;
}

.ai-stat-label {
    color: rgba(255, 255, 255, 0.7) !important;
}


/* ─── 4. SKILLS GRID FIX ─── */
.skills-grid .skill-card {
    background: var(--bianco-carta);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-xl) var(--space-lg);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.skills-grid .skill-card:hover {
    border-color: var(--oro);
    box-shadow: var(--shadow-md);
}

.skill-title {
    color: var(--blu-scuro) !important;
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--oro);
}


/* ─── 5. PROOF STRIP / PRESS BADGES ─── */
.proof-strip {
    background: var(--surface-1);
    padding: var(--space-xxl) 0;
}

.press-badges {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-xxl);
}

.press-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-sm) var(--space-lg);
    background: var(--bianco-carta);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.25s ease;
    text-decoration: none;
}

.press-badge:hover {
    border-color: var(--oro);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    color: var(--blu-scuro);
}


/* ─── 6. FEATURED PROJECT SECTION ─── */
.featured-project {
    background: var(--surface-1);
    padding: var(--space-xxl) 0;
}

.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xxl);
    align-items: start;
    margin-top: var(--space-xl);
}

.featured-media {
    width: 100%;
}

.rounded-video {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    background: #000;
}

.featured-content .description {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-xl);
}

.quick-facts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.fact-card {
    background: var(--bianco-carta);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-md);
    text-align: center;
    transition: all 0.25s ease;
}

.fact-card:hover {
    border-color: var(--oro);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.fact-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--blu-scuro);
    margin-bottom: var(--space-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
}

.fact-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

@media (max-width: 768px) {
    .featured-grid { grid-template-columns: 1fr; }
    .quick-facts-grid { grid-template-columns: 1fr; }
}


/* ─── 7. FEATURED PRESS SECTION ─── */
.featured-press-section {
    background: var(--surface-1);
    padding: var(--space-xxl) 0;
}

.featured-press-container {
    max-width: 900px;
    margin: 0 auto;
}

.featured-press-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.featured-press-card {
    background: var(--bianco-carta);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
    transition: box-shadow 0.25s ease;
}

.featured-press-card:hover {
    box-shadow: var(--shadow-md);
}

.featured-press-image {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--surface-2);
}

.featured-press-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-press-content {
    padding: var(--space-xl);
}

.featured-press-meta {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    margin-bottom: var(--space-md);
    font-size: var(--font-size-sm);
}

.featured-press-meta .outlet {
    font-weight: 700;
    color: var(--blu-scuro);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.featured-press-meta .date {
    color: var(--text-muted);
}

.featured-press-title {
    font-size: var(--font-size-2xl);
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    line-height: 1.3;
}

.featured-press-desc {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}


/* ─── 8. COSTELLAZIONE CTA ─── */
.costellazione-cta {
    background: var(--blu-scuro) !important;
    color: var(--bianco-carta) !important;
    text-align: center;
    padding: var(--space-xxl) 0;
}

.costellazione-cta h2 {
    color: var(--bianco-carta) !important;
}

.costellazione-cta .lead,
.costellazione-cta p {
    color: rgba(255, 255, 255, 0.85) !important;
}

.costellazione-cta .eyebrow {
    color: var(--oro) !important;
}

.infographic-rounded {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: var(--space-xxl);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.infographic-rounded img {
    width: 100%;
    height: auto;
    display: block;
}


/* ─── 9. LAYOUT GRIDS ─── */
/* Used by about.php, project detail, etc. */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xxl);
}

.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xxl);
    align-items: start;
}

.text-block h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-md);
    color: var(--blu-scuro);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--oro);
}

.text-block p {
    color: var(--text-secondary);
    line-height: 1.75;
}

@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-2-1 { grid-template-columns: 1fr; }
}


/* ─── 10. CTA SECTION (end of pages) ─── */
.cta-banner {
    background: var(--blu-scuro);
    padding: var(--space-xxl) 0;
    text-align: center;
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.cta-content h2 {
    color: var(--bianco-carta);
    margin-bottom: var(--space-md);
}

.cta-content p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: var(--space-xl);
    font-size: var(--font-size-lg);
}


/* ─── 11. LANG SWITCHER ─── */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.lang-btn {
    background: none;
    border: 1px solid var(--line);
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    font-size: var(--font-size-xs);
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    font-family: var(--font-primary);
}

.lang-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.lang-btn.active {
    background: var(--blu-scuro);
    color: var(--bianco-carta);
    border-color: var(--blu-scuro);
}


/* ─── 12. VIDEO CONTAINER RESPONSIVE ─── */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: var(--radius-lg);
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}


/* ─── 13. PROJECT HERO (project.php) ─── */
.project-hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blu-scuro);
    overflow: hidden;
    padding: calc(var(--header-height) + 2rem) 0 3rem;
    text-align: center;
    color: var(--bianco-carta);
}

.project-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.project-hero__bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-hero .container {
    position: relative;
    z-index: 2;
}

.project-hero h1 {
    color: var(--bianco-carta);
    font-size: clamp(2rem, 5vw, 3.5rem);
}

.project-hero .lead {
    color: rgba(255, 255, 255, 0.85);
}

.hub-badge-lg {
    display: inline-block;
    background: var(--oro);
    color: var(--blu-scuro);
    padding: 0.35rem 1rem;
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-md);
}

.project-metrics {
    display: flex;
    gap: var(--space-xl);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-xl);
}

.metric {
    text-align: center;
}

.metric-value {
    display: block;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--oro);
}

.metric-label {
    display: block;
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: var(--space-xs);
}


/* ─── 14. PROJECT TABS NAV ─── */
.project-tabs-nav {
    background: var(--bianco-carta);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: var(--header-height);
    z-index: 90;
}

.project-tabs-nav ul {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
    overflow-x: auto;
}

.project-tabs-nav a {
    display: block;
    padding: var(--space-md) var(--space-lg);
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.project-tabs-nav a:hover {
    color: var(--text-primary);
}

.project-tabs-nav a.active {
    color: var(--blu-scuro);
    border-bottom-color: var(--oro);
}

/* Tab panes for project detail */
.project-content .tab-pane {
    display: none;
}

.project-content .tab-pane.active {
    display: block;
}


/* ─── 15. SIDEBAR (project/service detail) ─── */
.sidebar-widget {
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-lg);
    position: sticky;
    top: calc(var(--header-height) + 4rem);
}

.sidebar-widget h3 {
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.status-box {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-box.active {
    background: rgba(76, 175, 80, 0.12);
    color: #2e7d32;
}

.status-box.development {
    background: rgba(255, 152, 0, 0.12);
    color: #e65100;
}

.status-box.completed {
    background: rgba(33, 150, 243, 0.12);
    color: #1565c0;
}


/* ─── 16. FIRMAMENTO SECTION (homepage bottom) ─── */
.firmamento-section {
    background: var(--bianco-carta);
    padding: var(--space-xxl) 0;
}


/* ─── 17. GENERAL POLISH ─── */

/* Better button styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    font-size: var(--font-size-base);
    font-weight: 600;
    text-align: center;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    font-family: var(--font-primary);
    line-height: 1.4;
}

.btn--primary {
    background: var(--oro);
    color: var(--blu-scuro);
    border-color: var(--oro);
}

.btn--primary:hover {
    background: var(--blu-scuro);
    color: var(--bianco-carta) !important;
    border-color: var(--blu-scuro);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn--secondary {
    background: transparent;
    color: var(--blu-scuro);
    border-color: var(--blu-scuro);
}

.btn--secondary:hover {
    background: var(--blu-scuro);
    color: var(--bianco-carta) !important;
}

.btn--lg {
    padding: 1rem 2.25rem;
    font-size: var(--font-size-lg);
}

/* Smooth section transitions */
section + section {
    border-top: none;
}

/* Better image handling */
img {
    max-width: 100%;
    height: auto;
}

/* Content blocks */
.content-block h2 {
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.content-block p {
    color: var(--text-secondary);
    line-height: 1.75;
}

/* Relative z-index helper */
.relative { position: relative; }
.z-10 { z-index: 10; }

/* Partners listing (partners.php) */
.partners-listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.partner-listing-card {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
    padding: var(--space-lg);
    background: var(--bianco-carta);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.partner-listing-card:hover {
    border-color: var(--oro);
    box-shadow: var(--shadow-sm);
}

.partner-logo {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.partner-info h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-xs);
}

.partner-info p {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}


/* ─── 18. MOBILE RESPONSIVE ─── */
@media (max-width: 768px) {
    .hero-video {
        min-height: 90vh;
    }
    
    .hero-content h1 {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 300px;
    }

    .ai-urgency-stats {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .press-badges {
        flex-direction: column;
        align-items: center;
    }

    .featured-press-card {
        grid-template-columns: 1fr;
    }

    .project-metrics {
        gap: var(--space-md);
    }

    .partners-listing-grid {
        grid-template-columns: 1fr;
    }

    .partner-listing-card {
        flex-direction: column;
        text-align: center;
    }
}
