/* ==========================================================================
   GP-OVERRIDES.CSS — Override degli stili GeneratePress Customizer
   
   GeneratePress inietta un <style> inline nel <head> con regole che
   sovrascrivono i nostri stili. Questo file usa specificita maggiore
   (body a, body h1, ecc.) per vincere sugli inline styles di GP.
   
   Caricato DOPO tutti gli altri CSS nel functions.php.
   ========================================================================== */


/* -- Fix link sottolineati --
   GP inline: a { text-decoration: underline; }
   Noi vinciamo con specificita body a (0,0,1,1 vs 0,0,0,1) */

body a {
    text-decoration: none;
}

body a:hover {
    text-decoration: none;
}

/* -- Fix sfondo body --
   GP inline: body { background-color: var(--base-2); }
   che risolve in #f7f8f9 */

body {
    background-color: var(--gf-white);
}

/* -- Fix font famiglia --
   GP inline: body { font-family: -apple-system, system-ui, ... }
   Noi forziamo Inter */

body,
body button,
body input,
body select,
body textarea {
    font-family: var(--gf-font-primary);
    font-size: var(--gf-text-base);
    color: var(--gf-dark);
}

/* -- Fix headings --
   GP imposta font-weight: 400 e dimensioni proprie sugli h1-h6.
   Rimettiamo 700 e le nostre dimensioni. */

body h1,
body h2,
body h3,
body h4,
body h5,
body h6 {
    font-family: var(--gf-font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--gf-black);
}

body h1 { font-size: var(--gf-text-3xl); }
body h2 { font-size: var(--gf-text-2xl); }
body h3 { font-size: var(--gf-text-xl);  }
body h4 { font-size: var(--gf-text-lg);  }

@media (min-width: 768px) {
    body h1 { font-size: var(--gf-text-4xl); }
    body h2 { font-size: var(--gf-text-3xl); }
    body h3 { font-size: var(--gf-text-2xl); }
}

@media (min-width: 1024px) {
    body h1 { font-size: var(--gf-text-5xl); }
    body h2 { font-size: var(--gf-text-4xl); }
}

/* -- Fix header sticky --
   GP o un suo default porta position: relative.
   Forziamo sticky con specificita. */

body .site-header,
.site-header {
    position: sticky;
    position: -webkit-sticky;
    top: 0;
    z-index: var(--gf-z-header);
}

/* -- Fix margini GP sui paragrafi e heading -- */

body p {
    margin-bottom: var(--gf-space-4);
    color: var(--gf-gray-700);
}

body p:last-child {
    margin-bottom: 0;
}

body h1, body h2, body h3,
body h4, body h5, body h6 {
    margin-bottom: var(--gf-space-3);
}

/* -- Fix colore link GP --
   GP inline: a { color: var(--accent); }
   Noi riportiamo al nostro arancione */

body a {
    color: var(--gf-orange);
}

body a:hover {
    color: var(--gf-orange-hover);
}

/* Eccezioni: link nelle sezioni scure ereditano il colore del parent */

body .hero a,
body .banner-exp a,
body .cta-banner a {
    color: inherit;
}

body .hero .gf-btn--primary {
    color: var(--gf-white);
}

/* Link arrow — assicura colore arancione ovunque */

body .gf-link-arrow {
    color: var(--gf-orange);
    text-decoration: none;
}

body .gf-link-arrow:hover {
    color: var(--gf-orange-hover);
    text-decoration: none;
}

/* -- Fix footer link colori -- */

body .site-footer a {
    color: var(--gf-gray-300);
    text-decoration: none;
}

body .site-footer a:hover {
    color: var(--gf-orange);
}

/* -- Fix pulsanti -- */

body .gf-btn,
body .gf-btn--primary,
body .gf-btn--primary:hover,
body .gf-btn--outline-white,
body .gf-btn--outline-white:hover {
    text-decoration: none;
}

body .gf-btn--primary,
body .gf-btn--primary:hover {
    color: var(--gf-white);
}

/* -- Fix card links -- */

body .settore-card .gf-link-arrow,
body .servizio-nav__card,
body .servizio-nav__card:hover {
    text-decoration: none;
}

/* -- Disattiva variabili CSS di GP --
   GP inietta --base-2, --contrast, --accent come custom properties.
   Le sovrascriviamo nel :root per evitare che interferiscano. */

:root {
    --base-2: var(--gf-white);
    --contrast: var(--gf-dark);
    --accent: var(--gf-orange);
}



/* ==========================================================================
   FOCUS STYLES — Accessibilità tastiera
   ========================================================================== */

/* Skip link: invisibile ma appare con :focus */

.skip-link:focus {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 999;
    padding: 12px 24px;
    background: var(--gf-orange);
    color: var(--gf-white);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--gf-border-radius);
    box-shadow: var(--gf-shadow-lg);
    clip: auto;
    clip-path: none;
    width: auto;
    height: auto;
    text-decoration: none;
}

/* Focus visibile su tutti gli elementi interattivi */

body a:focus-visible,
body button:focus-visible,
body input:focus-visible,
body textarea:focus-visible,
body select:focus-visible,
body .gf-btn:focus-visible,
body .gf-link-arrow:focus-visible {
    outline: 2px solid var(--gf-orange);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Rimuovi outline per utenti mouse (solo :focus senza :focus-visible) */

body a:focus:not(:focus-visible),
body button:focus:not(:focus-visible),
body .gf-btn:focus:not(:focus-visible) {
    outline: none;
}


/* ==========================================================================
   ADMIN BAR — Fix sticky header quando la admin bar di WP è presente
   ========================================================================== */

.admin-bar .site-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}
