body {
  font-family: Arial, sans-serif;
  font-size: 16px !important;
}

/* ========================================
   RESPONSIVE TYPOGRAPHY - PLAIN PARAGRAPHS
   Target: <p> tags without classes
   ======================================== */

/* Base: Mobile-first (320px - 767px) */
p:not([class]) {
  font-size: 1.0625rem;        /* 17px base - legibility boost */
  line-height: 1.65;           /* Optimal readability ratio */
  letter-spacing: 0.01em;      /* Subtle tracking improvement */
  margin-bottom: 1.25rem;      /* Vertical rhythm */
}

/* Tablet: Medium screens (768px - 1199px) */
@media screen and (min-width: 768px) {
  p:not([class]) {
    font-size: clamp(1.0625rem, 1.5vw, 1.25rem);  /* 17px → 20px fluid */
    line-height: 1.68;
  }
}

/* Desktop: Large screens (1200px - 1919px) */
@media screen and (min-width: 1200px) {
  p:not([class]) {
    font-size: clamp(1.125rem, 1.2vw, 1.375rem);  /* 18px → 22px fluid */
    line-height: 1.7;
    letter-spacing: 0.015em;
  }
}

/* High-Res: Extra large displays (1920px+) */
@media screen and (min-width: 1920px) {
  p:not([class]) {
    font-size: clamp(1.25rem, 1.15vw, 1.625rem);  /* 20px → 26px fluid */
    line-height: 1.72;
    letter-spacing: 0.018em;
    max-width: 75ch;             /* Optimal line length */
    margin-bottom: 1.5rem;
  }
}

/* Ultra-Wide: 4K/5K displays (2560px+) */
@media screen and (min-width: 2560px) {
  p:not([class]) {
    font-size: clamp(1.375rem, 1.1vw, 1.875rem);  /* 22px → 30px fluid */
    line-height: 1.75;
    letter-spacing: 0.02em;
    max-width: 80ch;
  }
}

/* Fix per H1 (.home-title) - Word-breaking approach */
.home-title {
  margin-left: 0 !important;
  margin-right: 0 !important;
  letter-spacing: -2px !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  hyphens: auto !important;
  -webkit-hyphens: auto !important;
  -ms-hyphens: auto !important;
}

/* Fix per H2 troncato */
h2 {
  margin-left: 0 !important;
  letter-spacing: -1px !important;
}

/* Assicurati che i container non nascondano il testo */
.container {
  overflow: visible !important;
}

.w-container {
  overflow: visible !important;
}

/* H2 E P NELLA CONTACT GRID OCCUPANO TUTTA LA LARGHEZZA */
.contact-grid-wrapper > h2,
.contact-grid-wrapper > p {
  grid-column: 1 / -1 !important; /* Occupa tutte le colonne */
}

/* INGRANDISCI TESTO BOLD NEI BOX STATS - APPLICA A TUTTE LE CELLE */
.stat-wrapper strong {
  font-size: 1.1em !important;
  line-height: 1.4 !important;
}

.summary {
  max-width: 75% !important;
}

:is(#communication, #branding, #content, #digital, #events, #customer, #people, #csr, #development, #story) .summary {
  max-width: 90% !important;
}

h3 {
  font-size: 3.5vw !important;
  font-weight: 600 !important;
}

.stats-grid {
  grid-template-columns: 1fr 1fr 1fr 1fr !important;
  max-width: 100% !important;
}

/* MEDIA QUERY PER TABLET/DESKTOP (≥762px) - 2x2 SEMPRE CON MAX-WIDTH 1200px */
@media screen and (min-width: 762px) {
  .home-title {
    letter-spacing: -1.5px !important;
    font-size: 14vw !important;
    line-height: 1.1 !important;
  }

  h2 {
    margin-left: 0 !important;
    letter-spacing: -1px !important;
  }

  .summary {
    max-width: 90% !important;
  }

  h3 {
    font-size: 4.5vw !important;
  }

  .stat-wrapper strong {
    font-size: 1.12em !important;
  }

  :is(#communication, #branding, #content, #digital, #events, #customer, #people, #csr, #development) .summary {
    max-width: 100% !important;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr !important; /* DUE COLONNE - 2x2 SEMPRE */
    grid-column-gap: 80px !important; /* Spaziatura aumentata tra colonne */
    grid-row-gap: 60px !important; /* Spaziatura aumentata tra righe */
    max-width: 1200px !important; /* Larghezza massima 1200px */
    margin-left: 0 !important; /* Allineamento a SINISTRA */
    margin-right: 0 !important;
  }
}

/* MEDIA QUERY PER MOBILE (<767px) - 1 COLONNA */
@media screen and (max-width: 767px) {
  /* Fix allineamento hero titles in mobile */
  .hero-heading-bottom {
    justify-content: flex-start !important;
  }
  
  .home-title {
    margin-left: 0 !important;
    letter-spacing: -1.5px !important;
    font-size: 20vw !important;
    line-height: 1.1 !important;
    text-align: left !important;
  }
  
  h2 {
    margin-left: 0 !important;
    letter-spacing: -0.5px !important;
    font-size: 12vw !important;
  }
  
  .summary {
    max-width: 100% !important;
  }
  
  h3 {
    font-size: 8vw !important;
  }
  
  .stat-wrapper strong {
    font-size: 1.15em !important;
  }
  
  :is(#communication, #branding, #content, #digital, #events, #customer, #people, #csr, #development) .summary {
    max-width: 100% !important;
  }
  
  .stats-grid {
    grid-template-columns: 1fr !important; /* UNA COLONNA */
  }
}

/* MEDIA QUERY PER EXTRA SMALL DEVICES (<375px) */
@media screen and (max-width: 374px) {
  .home-title {
    font-size: 18vw !important;
    letter-spacing: -1.8px !important;
  }
}

/* ================================================
   NAVBAR LOGO SIZE - parity with custom.css
   ================================================ */

.logo {
  max-height: 50px !important;   /* Desktop default */
  height: auto !important;
  width: auto !important;         /* preserva il ratio */
  object-fit: contain !important;
  display: block !important;
  transition: max-height 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
}

/* Large Desktop (≥1920px) */
@media screen and (min-width: 1920px) {
  .logo {
    max-height: 60px !important;
  }
}

/* Tablet (768px - 991px) */
@media screen and (min-width: 768px) and (max-width: 991px) {
  .logo {
    max-height: 45px !important;
  }
}

/* Mobile (≤767px) */
@media screen and (max-width: 767px) {
  .logo {
    max-height: 40px !important;
  }
}

/* Extra Small Mobile (≤374px) */
@media screen and (max-width: 374px) {
  .logo {
    max-height: 35px !important;
  }
}

/* ============================================
   27FACTORY - SOCIAL LINKS STYLES
   ============================================ */

.social-section {
    padding: 60px 0;
    background-color: #fff;
}

.social-heading {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    letter-spacing: -0.5px;
    color: var(--colors--black, #1e1e1e);
    line-height: 1.3;
}

.social-icons-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background-color: #f6f6f6;
    border-radius: 8px;
    border: 2px solid transparent;
    text-decoration: none;
    color: var(--colors--black, #1e1e1e);
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.5;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform, background-color;
}

.social-link:hover {
    background-color: #0077b5;
    color: #ffffff;
    border-color: #0077b5;
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
}

.social-link:active {
    transform: translateY(0) translateZ(0);
    box-shadow: 0 2px 6px rgba(0, 119, 181, 0.2);
}

.social-link:focus {
    outline: 3px solid #0077b5;
    outline-offset: 2px;
}

.social-link:focus-visible {
    outline: 3px solid #0077b5;
    outline-offset: 2px;
}

.social-link:focus:not(:focus-visible) {
    outline: none;
}

.linkedin-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.linkedin-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    transition: all 0.3s ease;
}

.social-link:hover .linkedin-icon svg {
    animation: iconPulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes iconPulse {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.15); 
    }
}

/* TABLET RESPONSIVE */
@media screen and (min-width: 768px) and (max-width: 991px) {
    .social-section {
        padding: 40px 0;
    }
    
    .social-heading {
        font-size: 1.35rem;
    }
    
    .social-link {
        padding: 10px 18px;
        font-size: 0.95rem;
    }
    
    .linkedin-icon {
        width: 22px;
        height: 22px;
    }
}

/* MOBILE RESPONSIVE */
@media screen and (max-width: 767px) {
    .social-section {
        padding: 30px 0;
    }
    
    .social-heading {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }
    
    .social-icons-wrapper {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .social-link {
        width: 100%;
        justify-content: flex-start;
        padding: 14px 20px;
    }
    
    .linkedin-icon {
        width: 20px;
        height: 20px;
    }
}

/* DARK MODE SUPPORT */
@media (prefers-color-scheme: dark) {
    .social-section {
        background-color: #1a1a1a;
    }
    
    .social-heading {
        color: #ffffff;
    }
    
    .social-link {
        background-color: #2a2a2a;
        color: #ffffff;
    }
    
    .social-link:hover {
        background-color: #0077b5;
    }
}

/* REDUCED MOTION SUPPORT */
@media (prefers-reduced-motion: reduce) {
    .social-link,
    .linkedin-icon svg {
        transition: none;
        animation: none;
    }
    
    .social-link:hover {
        transform: none;
    }
}

/* Applica scroll offset a tutti gli elementi con ID */
[id] {
    scroll-margin-top: 100px;
}

/* Abilita smooth scrolling nativo del browser */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

/* FIX ANCHOR SCROLL: Riserva spazio per immagini animate */
/* Risolve problema scroll che si ferma troppo in alto quando l'immagine non è ancora apparsa */
.animated-grid-image {
    aspect-ratio: 3 / 2; /* Riserva spazio in proporzione 3:2 */
    object-fit: cover; /* Mantiene il crop corretto */
    width: 100%; /* Occupa tutta la larghezza disponibile */
    height: auto !important; /* Sovrascrive height: 100% originale */
}

/* RESPONSIVE: Tablet (navbar più piccola) */
@media screen and (max-width: 991px) {
    [id] { 
        scroll-margin-top: 80px; 
    }
    html { 
        scroll-padding-top: 80px; 
    }
}

/* RESPONSIVE: Mobile (navbar ancora più piccola) */
@media screen and (max-width: 767px) {
    [id] { 
        scroll-margin-top: 70px; 
    }
    html { 
        scroll-padding-top: 70px; 
    }
}

/* ACCESSIBILITY: Rispetta le preferenze utente */
@media (prefers-reduced-motion: reduce) {
    html { 
        scroll-behavior: auto; 
    }
}

.lang-switcher {
  display: flex !important;
  align-items: center !important;
}

.lang-switcher .nav-link.lingua {
  display: flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em !important;
  color: var(--colors--grey, #6f6f6f) !important;
  text-decoration: none !important;
  transition: color 0.2s ease !important;
}

.lang-switcher .nav-link.lingua:hover {
  color: var(--colors--black, #1e1e1e) !important;
}

.lang-switcher .nav-link.lingua svg {
  flex-shrink: 0 !important;
}

/* =============================================
   SCROLL PROGRESS INDICATOR
   Riga sottile agganciata al bottom del navbar.
   Larghezza guidata da --scroll-progress (0→1)
   aggiornata via progress-indicator.js
   ============================================= */

:root {
  --scroll-progress: 0;
}

.navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: calc(var(--scroll-progress) * 100%);
  background-color: #BF0A0B;
  transform-origin: left center;
  transition: width 0.05s linear;
  pointer-events: none;
  z-index: 11;
}

/* Rispetta prefers-reduced-motion:
   mantiene la barra ma rimuove la transition */
@media (prefers-reduced-motion: reduce) {
  .navbar::after {
    transition: none;
  }
}

.client-tags-label {
  font-family: var(--fonts--body, Switzer, Arial, sans-serif) !important;
  font-size: 0.65rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--colors--black, #1e1e1e) !important;
  width: 100% !important;
  display: block !important;
  margin-top: 0.4rem !important;
}

.client-tags {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.5rem !important;
  padding-top: 0.75rem !important;
  margin-top: auto !important;
}

.client-card .client-tags .client-tag {
  font-family: var(--fonts--body, Switzer, Arial, sans-serif) !important;
  font-size: 0.65rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: var(--colors--grey, #6f6f6f) !important;
  border: 1px solid var(--colors--grey, #6f6f6f) !important;
  padding: 0.25rem 0.6rem !important;
  border-radius: 2px !important;
  white-space: nowrap !important;
  display: inline-block !important;
  line-height: 1.4 !important;
}

.client-card {
  padding-bottom: 2rem !important;
  border-bottom: 1px solid var(--colors--light-grey, #eff4f7) !important;
}

.client-card:last-child {
  border-bottom: none !important;
}

.home-title {
  hyphens: none !important;
  -webkit-hyphens: none !important;
  -ms-hyphens: none !important;
}

#CookiebotWidget :focus-visible,
#CookiebotWidget:not(.CookiebotWidget-open) .CookiebotWidget-logo {
  outline: none !important;
  outline-offset: 0 !important;
}