/* ══════════════════════════════════════════════════════════════════
   FM Digital Strategy Consulting — Custom CSS
   Child theme di Astra
   ══════════════════════════════════════════════════════════════════ */

/* ─── 1. CSS CUSTOM PROPERTIES (BRAND TOKENS) ─────────────────── */
:root {
    --fm-red:           #E8175D;
    --fm-orange:        #F05A28;
    --fm-yellow:        #F5A623;
    --fm-dark:          #14141C;
    --fm-dark-2:        #1A1A2E;
    --fm-dark-3:        #2C1810;
    --fm-mid:           #1E1E1E;
    --fm-white:         #FFFFFF;
    --fm-text-light:    rgba(255,255,255,0.85);
    --fm-text-muted:    rgba(255,255,255,0.55);
    --fm-border-subtle: rgba(255,255,255,0.08);

    --fm-gradient:      linear-gradient(135deg, #E8175D 0%, #F05A28 50%, #F5A623 100%);
    --fm-gradient-dark: linear-gradient(135deg, rgba(232,23,93,.15) 0%, rgba(240,90,40,.10) 100%);

    --fm-font-head:     'Montserrat', sans-serif;
    --fm-font-body:     'Inter', sans-serif;

    --fm-radius:        8px;
    --fm-radius-lg:     16px;
    --fm-radius-xl:     24px;
    --fm-shadow:        0 4px 24px rgba(0,0,0,.25);
    --fm-shadow-lg:     0 12px 48px rgba(0,0,0,.4);

    --fm-container:     1120px;
    --fm-header-h:      80px;
}

/* ─── 2. RESET / BASE ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--fm-font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--fm-dark);
    background: #fff;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--fm-font-head);
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0;
}

a {
    color: var(--fm-red);
    text-decoration: none;
    transition: color .2s ease;
}
a:hover { color: var(--fm-orange); }

img { max-width: 100%; height: auto; display: block; }

/* Container globale */
.fm-container {
    max-width: var(--fm-container);
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* ─── 3. ASTRA OVERRIDES GLOBALI ──────────────────────────────── */

/* Rimuove il padding laterale che Astra aggiunge al body */
.ast-container,
.ast-wide-container {
    max-width: var(--fm-container) !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
}

/* Azzera margini top che Astra mette sotto l'header fisso */
.ast-above-header-wrap { display: none; }

/* Colore primary Astra → brand */
:root {
    --ast-global-color-0: #E8175D;
    --ast-global-color-1: #F05A28;
    --ast-global-color-2: #F5A623;
    --ast-global-color-3: #14141C;
    --ast-global-color-4: #FFFFFF;
    --ast-global-color-5: #1A1A2E;
    --ast-global-color-6: #EEEEEE;
}

/* ─── 4. HEADER STICKY ─────────────────────────────────────────── */

/* Se Astra header è usato, lo sovrascriviamo */
#masthead,
.site-header,
#fm-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--fm-header-h);
    display: flex;
    align-items: center;
    transition: background .35s ease, backdrop-filter .35s ease, box-shadow .35s ease;
}

/* Stato trasparente (default — sopra la hero) */
#masthead.fm-transparent,
.site-header.fm-transparent,
#fm-header.fm-transparent {
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
}

/* Stato scrolled (dopo 60px) */
#masthead.fm-scrolled,
.site-header.fm-scrolled,
#fm-header.fm-scrolled {
    background: rgba(20, 20, 28, 0.92);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: 0 2px 20px rgba(0,0,0,.5);
}

/* Logo */
.site-branding,
.ast-site-identity {
    font-family: var(--fm-font-head);
    font-weight: 800;
    font-size: 20px;
}

.site-title a,
.ast-site-title a {
    background: var(--fm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Voci di menu header */
#site-navigation a,
.main-navigation a,
.ast-main-header-wrap a.menu-link {
    color: rgba(255,255,255,.85) !important;
    font-family: var(--fm-font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .3px;
    transition: color .2s ease;
}

#site-navigation a:hover,
.main-navigation a:hover,
.ast-main-header-wrap a.menu-link:hover {
    color: var(--fm-yellow) !important;
}

/* CTA nel menu */
.menu-item-cta > a,
.menu-item.cta > a {
    background: var(--fm-gradient) !important;
    color: #fff !important;
    padding: 8px 20px !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
}

/* Offset contenuto per l'header fisso */
.site-content,
#page,
.hfeed {
    padding-top: var(--fm-header-h);
}

/* Elementor: nessun offset se la pagina usa Elementor full width */
.elementor-page .site-content,
.elementor-page #page,
body.elementor-page .hfeed {
    padding-top: 0;
}

/* ─── 5. HERO SECTION ─────────────────────────────────────────── */

.fm-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;

    /* Sfondo di default (sostituire con foto reale di Fabio tramite Elementor) */
    background:
        linear-gradient(135deg,
            rgba(20,20,28,.92) 0%,
            rgba(26,26,46,.85) 45%,
            rgba(44,24,16,.80) 75%,
            rgba(20,20,28,.90) 100%),
        linear-gradient(to bottom right, #1A1A2E 0%, #2C1810 50%, #1A1A1A 100%);
    background-size: cover;
    background-position: center 20%;
}

/* Quando c'è una foto di sfondo: aggiungere classe .has-photo */
.fm-hero.has-photo {
    background:
        linear-gradient(135deg,
            rgba(20,20,28,.90) 0%,
            rgba(26,26,46,.82) 45%,
            rgba(44,24,16,.75) 75%,
            rgba(20,20,28,.88) 100%),
        var(--hero-bg-image, none);
}

.fm-hero__content {
    position: relative;
    z-index: 2;
    max-width: 640px;
}

.fm-hero__badge {
    display: inline-block;
    background: var(--fm-gradient-dark);
    border: 1px solid rgba(232,23,93,.25);
    color: var(--fm-yellow);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 24px;
}

.fm-hero h1 {
    font-family: var(--fm-font-head);
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 24px;
}

.fm-hero h1 .gradient-text,
.gradient-text {
    background: var(--fm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fm-hero__subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--fm-text-light);
    line-height: 1.7;
    margin-bottom: 40px;
    max-width: 520px;
}

/* Pill statistiche */
.fm-stats-pill {
    display: inline-flex;
    gap: 32px;
    background: rgba(255,255,255,.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--fm-border-subtle);
    border-radius: 50px;
    padding: 16px 32px;
    margin-top: 48px;
}

.fm-stats-pill__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.fm-stats-pill__num {
    font-family: var(--fm-font-head);
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--fm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fm-stats-pill__label {
    font-size: 11px;
    color: var(--fm-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ─── 6. BOTTONI ───────────────────────────────────────────────── */

/* Bottone primario (gradiente brand) */
.fm-btn,
.wp-block-button__link,
.elementor-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-family: var(--fm-font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
    border: none;
    text-decoration: none;
}

.fm-btn-primary,
.wp-block-button.is-style-fill .wp-block-button__link {
    background: var(--fm-gradient);
    color: #fff;
    box-shadow: 0 4px 20px rgba(232,23,93,.35);
}

.fm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(232,23,93,.5);
    color: #fff;
}

.fm-btn-secondary {
    background: transparent;
    color: rgba(255,255,255,.85);
    border: 1px solid rgba(255,255,255,.25);
}

.fm-btn-secondary:hover {
    border-color: rgba(255,255,255,.6);
    color: #fff;
    background: rgba(255,255,255,.05);
}

/* ─── 7. TRUST BAR ─────────────────────────────────────────────── */

.fm-trust-bar {
    background: #0F0F17;
    border-top: 1px solid var(--fm-border-subtle);
    border-bottom: 1px solid var(--fm-border-subtle);
    padding: 24px 0;
}

.fm-trust-bar__items {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.fm-trust-bar__item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.6);
    font-size: 13px;
    font-weight: 500;
}

.fm-trust-bar__item .icon {
    font-size: 18px;
    opacity: .8;
}

/* ─── 8. SEZIONE SERVIZI ──────────────────────────────────────── */

.fm-section {
    padding: 96px 0;
}

.fm-section--dark {
    background: var(--fm-dark);
    color: #fff;
}

.fm-section--darker {
    background: #0F0F17;
    color: #fff;
}

.fm-section-header {
    text-align: center;
    margin-bottom: 64px;
}

.fm-section-header__tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--fm-orange);
    margin-bottom: 16px;
}

.fm-section-header h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 16px;
}

.fm-section-header p {
    font-size: 1.1rem;
    color: inherit;
    opacity: .7;
    max-width: 580px;
    margin: 0 auto;
}

/* Service cards grid */
.fm-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.fm-card {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--fm-border-subtle);
    border-radius: var(--fm-radius-lg);
    padding: 36px 32px;
    transition: all .3s ease;
}

.fm-card:hover {
    background: rgba(255,255,255,.07);
    border-color: rgba(232,23,93,.25);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,.3);
}

.fm-card__icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--fm-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 20px;
}

.fm-card h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 12px;
}

.fm-card p {
    font-size: 14px;
    color: rgba(255,255,255,.6);
    line-height: 1.7;
    margin: 0;
}

/* Tag pill nelle card */
.fm-card__tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--fm-yellow);
    background: rgba(245,166,35,.1);
    border: 1px solid rgba(245,166,35,.2);
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 16px;
}

/* ─── 9. SEZIONE AI ACT ─────────────────────────────────────────── */

.fm-ai-act {
    background: linear-gradient(135deg, #0F0F17 0%, #1A1A2E 50%, #14141C 100%);
    border-top: 1px solid rgba(232,23,93,.2);
    border-bottom: 1px solid rgba(232,23,93,.2);
    padding: 96px 0;
}

.fm-ai-act__visual {
    position: relative;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(232,23,93,.2);
    border-radius: var(--fm-radius-xl);
    padding: 48px 40px;
    text-align: center;
}

.fm-ai-act__visual::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(232,23,93,.3), transparent 60%);
    z-index: -1;
}

.fm-ai-act__status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(232,23,93,.1);
    border: 1px solid rgba(232,23,93,.3);
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--fm-red);
    text-transform: uppercase;
    margin-bottom: 24px;
}

.fm-ai-act__status-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fm-red);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .3; }
}

/* ─── 10. SEZIONE CHI SONO ────────────────────────────────────── */

.fm-about {
    padding: 96px 0;
    background: #fff;
}

.fm-about__content { max-width: 540px; }

.fm-about__title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 24px;
    color: var(--fm-dark);
}

.fm-about__text {
    font-size: 1.05rem;
    color: #444;
    line-height: 1.8;
    margin-bottom: 32px;
}

/* Credential pills */
.fm-credentials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 36px;
}

.fm-credential {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #F8F8F8;
    border: 1px solid #E5E5E5;
    border-radius: 50px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

/* ─── 11. CTA FINALE ────────────────────────────────────────────── */

.fm-cta {
    padding: 120px 0;
    background: var(--fm-gradient);
    text-align: center;
}

.fm-cta h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: #fff;
    margin-bottom: 16px;
}

.fm-cta p {
    font-size: 1.1rem;
    color: rgba(255,255,255,.85);
    margin-bottom: 40px;
}

.fm-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: var(--fm-red);
    font-weight: 700;
    font-size: 16px;
    padding: 16px 40px;
    border-radius: 50px;
    transition: all .25s ease;
    box-shadow: 0 4px 24px rgba(0,0,0,.2);
}

.fm-cta__btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 36px rgba(0,0,0,.3);
    color: var(--fm-orange);
}

/* ─── 12. FOOTER ────────────────────────────────────────────────── */

.site-footer,
#colophon,
.fm-footer {
    background: var(--fm-dark) !important;
    color: rgba(255,255,255,.6) !important;
    padding: 80px 0 0 !important;
    font-size: 14px;
}

.fm-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--fm-border-subtle);
}

.fm-footer__brand-name {
    font-family: var(--fm-font-head);
    font-size: 1.3rem;
    font-weight: 800;
    background: var(--fm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.fm-footer__tagline {
    font-style: italic;
    color: rgba(255,255,255,.5);
    font-size: 13px;
    margin-bottom: 20px;
}

.fm-footer__social {
    display: flex;
    gap: 12px;
}

.fm-footer__social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--fm-border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.6);
    font-size: 16px;
    transition: all .2s ease;
}

.fm-footer__social a:hover {
    border-color: var(--fm-red);
    color: var(--fm-red);
    background: rgba(232,23,93,.1);
}

.fm-footer__col-title {
    font-family: var(--fm-font-head);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,.4);
    margin-bottom: 20px;
}

.fm-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fm-footer__links a {
    color: rgba(255,255,255,.6);
    font-size: 14px;
    transition: color .2s ease;
}

.fm-footer__links a:hover { color: var(--fm-yellow); }

.fm-footer__copyright {
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: rgba(255,255,255,.3);
}

/* ─── 13. ELEMENTOR INTEGRATION ─────────────────────────────── */

/* Applica i font brand ai widget Elementor */
.elementor-widget-heading .elementor-heading-title {
    font-family: var(--fm-font-head) !important;
}

.elementor-widget-text-editor p,
.elementor-widget-text-editor {
    font-family: var(--fm-font-body) !important;
}

/* Pulsanti Elementor */
.elementor-button.elementor-button-gradient,
.elementor-widget-button .elementor-button[style*="background-color"] {
    background: var(--fm-gradient) !important;
    border: none !important;
}

/* Rimuove outline Elementor in editor mode */
.elementor-editor-active .elementor-section:hover > .elementor-element-overlay {
    border: 2px dashed rgba(232,23,93,.6);
}

/* ─── 14. RESPONSIVE ─────────────────────────────────────────── */

@media (max-width: 1024px) {
    .fm-footer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --fm-header-h: 64px;
    }

    .fm-hero h1 {
        font-size: 2.2rem;
    }

    .fm-section {
        padding: 64px 0;
    }

    .fm-services-grid {
        grid-template-columns: 1fr;
    }

    .fm-stats-pill {
        gap: 20px;
        padding: 14px 24px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .fm-trust-bar__items {
        gap: 24px;
    }

    .fm-footer__grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .fm-cta {
        padding: 80px 0;
    }
}

@media (max-width: 480px) {
    .fm-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .fm-hero h1 {
        font-size: 1.9rem;
    }

    .fm-btn-group {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ─── 15. UTILITY CLASSES ────────────────────────────────────── */

.fm-gradient-text {
    background: var(--fm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fm-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.fm-text-white  { color: #fff; }
.fm-text-muted  { color: rgba(255,255,255,.6); }
.fm-text-center { text-align: center; }

.fm-mt-0 { margin-top: 0; }
.fm-mb-0 { margin-bottom: 0; }
