/*
Theme Name: MG Solution Theme
Theme URI: https://madelabroma.it
Author: Made Lab
Author URI: https://madelabroma.it
Description: Tema custom ad altissime prestazioni sviluppato da Made Lab per MG Solution.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
Text Domain: offset-theme
*/

/* ==========================================================================
   UTOPIA.FYI FLUID RESPONSIVE TYPE SCALE
   Min Viewport: 360px  |  Max Viewport: 1280px
   Mobile-Optimized to prevent H1 overflow while preserving desktop impact
   ========================================================================== */
:root {
  --step--2: clamp(0.6944rem, 0.6944rem + 0vw, 0.6944rem);
  --step--1: clamp(0.8125rem, 0.78rem + 0.12vw, 0.8889rem);
  --step-0:  clamp(0.9375rem, 0.89rem + 0.22vw, 1.125rem);
  --step-1:  clamp(1.0625rem, 0.98rem + 0.4vw, 1.45rem);
  --step-2:  clamp(1.2rem, 1.05rem + 0.7vw, 1.85rem);
  --step-3:  clamp(1.35rem, 1.12rem + 1.1vw, 2.45rem);
  --step-4:  clamp(1.5rem, 1.18rem + 1.6vw, 3.25rem);
  --step-5:  clamp(1.68rem, 0.78rem + 4.2vw, 4.45rem);
  --step-6:  clamp(2.05rem, 0.88rem + 5.5vw, 5.65rem);

  /* CMYK Digital Engine Tokens */
  --cmyk-c: #00F0FF;
  --cmyk-m: #FF0055;
  --cmyk-y: #FFE600;
  --cmyk-k: #0A0B0E;
  --cmyk-paper: #F4F4F6;
  --cmyk-surface: #12141A;
  --cmyk-surface-light: #1A1E26;
  --cmyk-border: #232733;
}

/* Global Box Sizing & Mobile Horizontal Overflow Containment */
html {
  overflow-x: clip !important;
  max-width: 100vw !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

*, *:before, *:after {
  box-sizing: inherit;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--cmyk-k);
  color: var(--cmyk-paper);
  overflow-x: clip !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative !important;
}

/* ==========================================================================
   CSS DI CONTENIMENTO PER L'EDITOR GUTENBERG
   ========================================================================== */
.editor-styles-wrapper {
  background-color: #0A0B0E !important;
  color: #F4F4F6 !important;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Nascondi il titolo H1 nativo della pagina in Gutenberg */
.edit-post-visual-editor__post-title-wrapper,
.editor-post-title,
.editor-post-title__block,
.wp-block-post-title {
  display: none !important;
}

/* Forza i blocchi a prendere la larghezza intera nell'editor */
.editor-styles-wrapper .is-root-container {
  padding: 0 !important;
  max-width: 100% !important;
}
.editor-styles-wrapper .wp-block {
  max-width: 100% !important;
}
.editor-styles-wrapper .wp-block[data-align="full"] {
  width: 100% !important;
  max-width: 100% !important;
}

/* ==========================================================================
   TIPOGRAFIA E UTILITY
   ========================================================================== */
.font-syne { font-family: 'Syne', sans-serif; }
.font-mono-code { font-family: 'Space Mono', monospace; }

/* Fluid Typography utility classes */
.type-step-6 { 
  font-size: var(--step-6); 
  line-height: 1.02; 
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
  word-break: normal;
}
.type-step-5 { 
  font-size: var(--step-5); 
  line-height: 1.08; 
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
  word-break: normal;
}
.type-step-4 { 
  font-size: var(--step-4); 
  line-height: 1.15; 
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  word-break: normal;
}
.type-step-3 { font-size: var(--step-3); line-height: 1.2; overflow-wrap: break-word; }
.type-step-2 { font-size: var(--step-2); line-height: 1.25; }
.type-step-1 { font-size: var(--step-1); line-height: 1.45; }
.type-step-0 { font-size: var(--step-0); line-height: 1.6; }
.type-step--1 { font-size: var(--step--1); line-height: 1.5; }
.type-step--2 { font-size: var(--step--2); line-height: 1.4; }

/* Responsive Heading & Mobile Typography Overrides */
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  word-break: normal;
}

@media (max-width: 640px) {
  :root {
    --step-6: clamp(1.75rem, 6.8vw, 2.35rem);
    --step-5: clamp(1.48rem, 5.6vw, 1.95rem);
    --step-4: clamp(1.28rem, 4.6vw, 1.65rem);
  }

  .type-step-6 {
    font-size: var(--step-6) !important;
    line-height: 1.12 !important;
    letter-spacing: -0.015em !important;
    text-wrap: balance !important;
  }

  .type-step-5 {
    font-size: var(--step-5) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.015em !important;
    text-wrap: balance !important;
  }

  .type-step-4 {
    font-size: var(--step-4) !important;
    line-height: 1.2 !important;
    letter-spacing: -0.01em !important;
    text-wrap: balance !important;
  }

  h1.type-step-5,
  h1.type-step-6 {
    font-size: var(--step-5) !important;
    hyphens: auto !important;
  }
}

/* ==========================================================================
   REGISTRATION MARK (Crocini di registro) & SICUREZZA POSIZIONAMENTO
   ========================================================================== */
.registration-mark {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  pointer-events: none;
}
.registration-mark::before,
.registration-mark::after {
  content: '';
  position: absolute;
  background-color: currentColor;
}
.registration-mark::before {
  width: 100%;
  height: 1px;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}
.registration-mark::after {
  height: 100%;
  width: 1px;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}
.registration-circle {
  width: 12px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 50%;
  position: relative;
  z-index: 1;
}

/* Background Grid Pattern */
.bg-grid-dots {
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Glow Tokens */
.glow-cyan { text-shadow: 0 0 20px rgba(0, 240, 255, 0.45); }
.glow-magenta { text-shadow: 0 0 20px rgba(255, 0, 85, 0.45); }
.glow-yellow { text-shadow: 0 0 20px rgba(255, 230, 0, 0.45); }

/* Custom corner crop marks for cards */
.crop-box {
  position: relative;
}
.crop-box::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 8px; height: 8px;
  border-top: 2px solid var(--cmyk-c);
  border-left: 2px solid var(--cmyk-c);
  pointer-events: none;
}
.crop-box::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 8px; height: 8px;
  border-bottom: 2px solid var(--cmyk-m);
  border-right: 2px solid var(--cmyk-m);
  pointer-events: none;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0A0B0E; }
::-webkit-scrollbar-thumb { background: #232733; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #00F0FF; }


/* ==========================================================================
   STICKY HEADER DURING SCROLL (DESKTOP & MOBILE)
   ========================================================================== */
#site-header-wrapper {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
  width: 100% !important;
}
