/* css/componenti.css - GENERATO da style.css (script componenti.js): non modificare a mano.
   Header, menu e footer comuni per le pagine che hanno un loro foglio di stile (es. stiloso.css).
   Le regole sono limitate a .site-header e .site-footer: il resto della pagina non cambia. */

/* ==================== VARIABILI CSS ==================== */
:root {
  /* Colori base - Light (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --accent-primary: #7c3aed;
  --accent-secondary: #dc2626;
  --border-color: #dee2e6;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --card-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.95);
  --footer-bg: #212529;
  --footer-text: #ffffff;
  --highlight-bg: rgba(124, 58, 237, 0.1);
  --success-color: #059669;
  --warning-color: #d97706;
  
  /* Spacing system */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 20px;
  --space-lg: 30px;
  --space-xl: 40px;
  --space-xxl: 60px;
  
  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px var(--shadow-color);
  --shadow-md: 0 4px 6px var(--shadow-color);
  --shadow-lg: 0 10px 20px var(--shadow-color);
  --shadow-xl: 0 10px 30px var(--shadow-color);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* Tema Dark */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-primary: #a78bfa;
  --accent-secondary: #f87171;
  --border-color: #334155;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --card-bg: #1e293b;
  --header-bg: rgba(15, 23, 42, 0.95);
  --footer-bg: #020617;
  --footer-text: #e2e8f0;
  --highlight-bg: rgba(167, 139, 250, 0.15);
  --success-color: #34d399;
  --warning-color: #fbbf24;
}

/* Tema High Contrast */
[data-theme="high-contrast"] {
  --bg-primary: #000000;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2d2d2d;
  --text-primary: #ffffff;
  --text-secondary: #ffff00;
  --text-muted: #00ffff;
  --accent-primary: #ffff00;
  --accent-secondary: #00ffff;
  --border-color: #ffffff;
  --shadow-color: transparent;
  --card-bg: #000000;
  --header-bg: #000000;
  --footer-bg: #000000;
  --footer-text: #ffffff;
  --highlight-bg: #ffff00;
  --success-color: #00ff00;
  --warning-color: #ff0000;
  --font-size-multiplier: 1.2;
  --line-height-multiplier: 1.8;
}


/* ambito: header e footer, con le basi che style.css dà a tutta la pagina */
:is(.site-header, .site-footer) { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; line-height: 1.6; color: var(--text-primary); -webkit-font-smoothing: antialiased; text-align: left; }
:is(.site-header, .site-footer) *, :is(.site-header, .site-footer) *::before, :is(.site-header, .site-footer) *::after { box-sizing: border-box; margin: 0; padding: 0; }
:is(.site-header, .site-footer) img { max-width: 100%; height: auto; display: block; }
:is(.site-header, .site-footer) a { color: var(--accent-primary); text-decoration: none; }
:is(.site-header, .site-footer) ul { list-style: none; }
:is(.site-header, .site-footer) .container { width: min(92%, 1200px); margin: 0 auto; padding: 0 20px; display: block; overflow: visible; min-width: 0; flex-direction: row; flex-wrap: nowrap; align-content: normal; }
.site-header { position: sticky; top: 0; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--accent-primary);
  color: white;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: 600;
  transition: top var(--transition-normal);
}

.skip-link:focus {
  top: 20px;
}

:is(.site-header, .site-footer) .theme-switcher {
  display: flex;
  gap: 8px;
  background: var(--bg-secondary);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

:is(.site-header, .site-footer) .theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
  background: transparent;
  color: var(--text-primary);
  line-height: 1;
}

:is(.site-header, .site-footer) .theme-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

:is(.site-header, .site-footer) .theme-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--highlight-bg);
}

:is(.site-header, .site-footer) .theme-btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 1001;
  pointer-events: none;
}

@media (max-width: 768px) {
  :is(.site-header, .site-footer) .theme-btn[title]:hover::after {
    display: none;
  }
  
  :is(.site-header, .site-footer) .theme-switcher {
    padding: 6px 10px;
  }
  
  :is(.site-header, .site-footer) .theme-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}

[data-theme="high-contrast"] .theme-btn {
  border-width: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 0;
}

:is(.site-header, .site-footer) .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

:is(.site-header, .site-footer) .logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

:is(.site-header, .site-footer) .logo:hover {
  color: var(--accent-secondary);
}

:is(.site-header, .site-footer) .logo img {
  height: 60px;
  width: auto;
  display: block;
  transition: filter var(--transition-normal);
}

[data-theme="dark"] .logo img,
[data-theme="high-contrast"] .logo img {
  filter: brightness(0) invert(1);
}

[data-theme="high-contrast"] .logo img {
  border: 2px solid white;
  border-radius: 4px;
  padding: 4px;
}

@media (max-width: 768px) {
  :is(.site-header, .site-footer) .logo img {
    height: 50px;
  }
}

:is(.site-header, .site-footer) .main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

:is(.site-header, .site-footer) .nav-list {
  display: flex;
  gap: 25px;
  align-items: center;
}

:is(.site-header, .site-footer) .nav-list a {
  color: var(--text-primary);
  font-weight: 500;
  position: relative;
  padding: 5px 0;
}

:is(.site-header, .site-footer) .nav-list a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width var(--transition-normal);
}

:is(.site-header, .site-footer) .nav-list a:hover::after,
:is(.site-header, .site-footer) .nav-list a.active::after {
  width: 100%;
}

:is(.site-header, .site-footer) .nav-list .btn-nav {
  background: var(--accent-primary);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
}

:is(.site-header, .site-footer) .nav-list .btn-nav:hover {
  background: var(--accent-secondary);
  color: white;
}

:is(.site-header, .site-footer) .nav-list .btn-nav::after {
  display: none;
}

:is(.site-header, .site-footer) .nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

:is(.site-header, .site-footer) .hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  position: relative;
  transition: all var(--transition-normal);
}

:is(.site-header, .site-footer) .hamburger::before,
:is(.site-header, .site-footer) .hamburger::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  left: 0;
  transition: all var(--transition-normal);
}

:is(.site-header, .site-footer) .hamburger::before {
  top: -8px;
}

:is(.site-header, .site-footer) .hamburger::after {
  top: 8px;
}

:is(.site-header, .site-footer) .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 2px solid transparent;
  text-align: center;
  text-decoration: none;
  gap: 8px;
}

:is(.site-header, .site-footer) .btn-primary {
  background: var(--accent-primary);
  color: white;
}

:is(.site-header, .site-footer) .btn-primary:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

:is(.site-header, .site-footer) .btn-outline {
  background: transparent;
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

:is(.site-header, .site-footer) .btn-outline:hover {
  background: var(--accent-primary);
  color: white;
}

:is(.site-header, .site-footer) .btn-secondary {
  background: var(--accent-secondary);
  color: white;
}

:is(.site-header, .site-footer) .btn-secondary:hover {
  background: #b91c1c;
  transform: translateY(-2px);
}

:is(.site-header, .site-footer) .btn-sm {
  padding: 10px 20px;
  font-size: 0.9rem;
  border-radius: 8px;
}

:is(.site-header, .site-footer) .btn-large {
  padding: 16px 32px;
  font-size: 1.125rem;
}

:is(.site-header, .site-footer) .btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 60px 0 30px;
  font-size: 0.875rem;
}

:is(.site-header, .site-footer) .footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  text-align: center;
}

@media (min-width: 768px) {
  :is(.site-header, .site-footer) .footer-inner {
    grid-template-columns: 1fr 2.4fr 1fr;
    text-align: left;
  }
}

:is(.site-header, .site-footer) .footer-brand p {
  opacity: 0.8;
  max-width: 30ch;
  margin-top: 10px;
}

:is(.site-header, .site-footer) .footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

@media (min-width: 768px) {
  :is(.site-header, .site-footer) .footer-nav ul {
    justify-content: flex-start;
  }
}

:is(.site-header, .site-footer) .footer-nav a {
  color: var(--footer-text);
  opacity: 0.8;
}

:is(.site-header, .site-footer) .footer-nav a:hover {
  opacity: 1;
  color: var(--accent-primary);
}

:is(.site-header, .site-footer) .footer-legal {
  opacity: 0.7;
  line-height: 1.6;
  margin-top: 20px;
}

:is(.site-header, .site-footer) .footer-legal a {
  color: inherit;
  text-decoration: underline;
}

@media (max-width: 768px) {
  :is(.site-header, .site-footer) .nav-toggle {
    display: block;
  }
  
  :is(.site-header, .site-footer) .nav-list {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    padding: 20px;
    gap: 15px;
    border-bottom: 2px solid var(--border-color);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-lg);
  }
  
  :is(.site-header, .site-footer) .nav-list.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  :is(.site-header, .site-footer) .nav-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
  }
  
  :is(.site-header, .site-footer) .nav-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg) translate(8px, 8px);
  }
  
  :is(.site-header, .site-footer) .nav-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg) translate(8px, -8px);
  }
}

/* qui il contenuto delle pagine non segue il tema: il selettore del tema è nascosto */
.site-header .header-inner .theme-switcher { display: none; }
