@charset "UTF-8";

/**
 * UCOI/UCOIM Website - Main Foundation Styles
 * 
 * @file        main.css
 * @version     1.6.0
 * @description Foundation CSS con reset, variabili globali, tipografia,
 *              layout container, Bootstrap Grid integration e utility classes
 * 
 * @author      Altoprofilo Studio
 * @created     2024-05-01
 * @modified    2025-11-01
 * 
 * @dependencies
 *   None (file base fondamentale)
 * 
 * @standards
 *   - UCOI/UCOIM Standards v3.1
 *   - Comments Standards v1.0
 *   - Bootstrap 5 Grid System compatible
 * 
 * @changelog
 *   - v1.6.0 (2025-11-01): Correzione naming, UTF-8, eliminazione duplicazioni,
 *                          commenti conformi standard, header completo
 *   - v1.5.0 (2025-10-01): Aggiunta footer utilities e heading styles
 * 
 * ============================================================================
 * INDICE
 * ============================================================================
 * 1. Variabili Globali
 * 2. Reset CSS
 * 3. Tipografia
 * 4. Layout Container
 * 5. Bootstrap Grid System
 * 6. Utility Classes
 * 7. Section Enhancements
 * 8. Back to Top Button
 * 9. Footer Utilities
 * 10. Responsive Overrides
 * 11. Legacy Compatibility
 * ============================================================================
 */

/* ============================================================================
   1. VARIABILI GLOBALI
   ============================================================================
   Design tokens condivisi da tutti i file CSS del progetto
   ========================================================================= */

:root {
  /* Colori brand */
  --primary-color: #036;
  --primary-hover: #001a49;
  --secondary-color: #005bac;
  --secondary-hover: #004080;
  --accent-color: #f57c00;
  --accent-hover: #d35400;
  
  /* Stati interattivi */
  --focus: #036;
  --focus-ring: 0 0 0 3px rgba(0, 51, 102, 0.25);
  --active-border: 3px solid var(--primary-color);
  
  /* Background */
  --bg-light: #f5f9fc;
  
  /* Tipografia */
  --font-body: "Inter", sans-serif;
  --font-heading: "DM Serif Display", serif;
  --text-color: #222;
  --text-muted: #555;
  
  /* Layout */
  --max-width: 1200px;
  --section-inline-padding: 1rem;
  
  /* Transizioni standardizzate */
  --transition-fast: all 0.2s ease;
  --transition-normal: all 0.3s ease;
  --transition-slow: all 0.4s ease;
  
  /* Elevazioni hover */
  --hover-lift-small: translateY(-2px);
  --hover-lift-medium: translateY(-4px);
  --hover-lift-large: translateY(-6px);
  
  /* Sistema ombre progressivo */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  
  /* Spaziature responsive */
  --section-padding-block: clamp(2rem, 5vw, 4rem);
  --section-padding-inline: clamp(1.5rem, 4vw, 2rem);
  --card-padding: clamp(1rem, 2vw, 2rem);
  --element-gap: clamp(0.5rem, 1.5vw, 1.5rem);
  
  /* Bootstrap Grid integration */
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0;
}

/* ============================================================================
   2. RESET CSS
   ============================================================================
   Normalizzazione cross-browser
   ========================================================================= */

/**
 * Box sizing universale
 */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/**
 * HTML base
 * Smooth scroll e normalizzazione font-size
 */
html {
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/**
 * Body base
 * Tipografia e rendering ottimizzato
 */
body {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-color);
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  background-color: white;
  font-family: var(--font-body);
  text-rendering: optimizeLegibility;
}

/**
 * Liste
 * Reset stile default
 */
ul,
ol {
  list-style: none;
  padding-left: 0;
}

/**
 * Media
 * Responsive di default
 */
img,
video {
  display: block;
  height: auto;
  max-width: 100%;
}

/**
 * Form elements
 * Ereditano font e colori
 */
button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

/**
 * Anchor target scroll offset
 * Compensa header fisso
 */
:target {
  scroll-margin-top: 90px;
}

/* ============================================================================
   3. TIPOGRAFIA
   ============================================================================
   Sistema tipografico responsive con scale fluide
   ========================================================================= */

/**
 * Headings base
 * Font serif per tutti i titoli
 */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 400;
  color: var(--primary-color);
  font-family: var(--font-heading);
  margin-bottom: 1rem;
}

/**
 * Scale tipografica responsive
 * Usa clamp() per fluidità tra breakpoint
 */
h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

h4 {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
}

h5 {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
}

h6 {
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/**
 * Paragrafi
 * Spaziatura verticale consistente
 */
p {
  color: var(--text-color);
  margin-bottom: 1.2rem;
}

/**
 * Utility classes per stili heading
 * Mantiene semantica HTML ma cambia aspetto visivo
 */
.h4,
h2.h4,
h3.h4 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 1rem;
  color: inherit;
}

/**
 * Variante body font
 * Per casi speciali dove serve font sans-serif
 */
.h4-body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 1rem;
  color: inherit;
}

/**
 * Stili heading combinati
 * Permette h1 con aspetto h2, h3, h4
 */
h1.h2 {
  font-family: var(--font-heading);
  font-size: 2.25rem;
}

h1.h3 {
  font-family: var(--font-heading);
  font-size: 1.875rem;
}

h1.h4 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
}

h2.h3 {
  font-family: var(--font-heading);
  font-size: 1.875rem;
}

h2.h4 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
}

h3.h4 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
}

/* ============================================================================
   4. LAYOUT CONTAINER
   ============================================================================
   Sistema container compatibile con Bootstrap Grid
   ========================================================================= */

/**
 * Container base
 * Larghezze responsive per diversi breakpoint
 */
.container {
  width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-right: auto;
  margin-left: auto;
}

/**
 * Breakpoint containers
 */
@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
}

@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: var(--max-width);
  }
}

@media (min-width: 1400px) {
  .container {
    max-width: var(--max-width);
  }
}

/**
 * Container fluid
 * Full width con padding laterale
 */
.container-fluid {
  width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-right: auto;
  margin-left: auto;
}

/**
 * Section spacing
 * Padding verticale per sezioni
 */
.section {
  padding: var(--section-padding-block) 0;
}

.section .container,
.section .container-fluid {
  padding-top: 0;
  padding-bottom: 0;
}

/* ============================================================================
   5. BOOTSTRAP GRID SYSTEM
   ============================================================================
   Sistema di colonne responsive compatibile Bootstrap
   ========================================================================= */

/**
 * Row container
 * Sistema flexbox con gutter negativi
 */
.row {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 1rem;
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--bs-gutter-y));
  margin-right: calc(-0.5 * var(--bs-gutter-x));
  margin-left: calc(-0.5 * var(--bs-gutter-x));
}

.row > * {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-top: var(--bs-gutter-y);
}

/**
 * Gutter utilities
 * Controllo spacing tra colonne
 */
.g-0 {
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
}

.g-1 {
  --bs-gutter-x: 0.25rem;
  --bs-gutter-y: 0.25rem;
}

.g-2 {
  --bs-gutter-x: 0.5rem;
  --bs-gutter-y: 0.5rem;
}

.g-3 {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
}

.g-4 {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 1.5rem;
}

.g-5 {
  --bs-gutter-x: 3rem;
  --bs-gutter-y: 3rem;
}

/**
 * Base columns
 * Sistema 12 colonne
 */
.col {
  flex: 1 0 0%;
}

.col-auto {
  flex: 0 0 auto;
  width: auto;
}

.col-1 { flex: 0 0 auto; width: 8.33333333%; }
.col-2 { flex: 0 0 auto; width: 16.66666667%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.33333333%; }
.col-5 { flex: 0 0 auto; width: 41.66666667%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.33333333%; }
.col-8 { flex: 0 0 auto; width: 66.66666667%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.33333333%; }
.col-11 { flex: 0 0 auto; width: 91.66666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

/**
 * Small devices (≥576px)
 */
@media (min-width: 576px) {
  .col-sm { flex: 1 0 0%; }
  .col-sm-auto { flex: 0 0 auto; width: auto; }
  .col-sm-1 { flex: 0 0 auto; width: 8.33333333%; }
  .col-sm-2 { flex: 0 0 auto; width: 16.66666667%; }
  .col-sm-3 { flex: 0 0 auto; width: 25%; }
  .col-sm-4 { flex: 0 0 auto; width: 33.33333333%; }
  .col-sm-5 { flex: 0 0 auto; width: 41.66666667%; }
  .col-sm-6 { flex: 0 0 auto; width: 50%; }
  .col-sm-7 { flex: 0 0 auto; width: 58.33333333%; }
  .col-sm-8 { flex: 0 0 auto; width: 66.66666667%; }
  .col-sm-9 { flex: 0 0 auto; width: 75%; }
  .col-sm-10 { flex: 0 0 auto; width: 83.33333333%; }
  .col-sm-11 { flex: 0 0 auto; width: 91.66666667%; }
  .col-sm-12 { flex: 0 0 auto; width: 100%; }
}

/**
 * Medium devices (≥768px)
 */
@media (min-width: 768px) {
  .col-md { flex: 1 0 0%; }
  .col-md-auto { flex: 0 0 auto; width: auto; }
  .col-md-1 { flex: 0 0 auto; width: 8.33333333%; }
  .col-md-2 { flex: 0 0 auto; width: 16.66666667%; }
  .col-md-3 { flex: 0 0 auto; width: 25%; }
  .col-md-4 { flex: 0 0 auto; width: 33.33333333%; }
  .col-md-5 { flex: 0 0 auto; width: 41.66666667%; }
  .col-md-6 { flex: 0 0 auto; width: 50%; }
  .col-md-7 { flex: 0 0 auto; width: 58.33333333%; }
  .col-md-8 { flex: 0 0 auto; width: 66.66666667%; }
  .col-md-9 { flex: 0 0 auto; width: 75%; }
  .col-md-10 { flex: 0 0 auto; width: 83.33333333%; }
  .col-md-11 { flex: 0 0 auto; width: 91.66666667%; }
  .col-md-12 { flex: 0 0 auto; width: 100%; }
}

/**
 * Large devices (≥992px)
 */
@media (min-width: 992px) {
  .col-lg { flex: 1 0 0%; }
  .col-lg-auto { flex: 0 0 auto; width: auto; }
  .col-lg-1 { flex: 0 0 auto; width: 8.33333333%; }
  .col-lg-2 { flex: 0 0 auto; width: 16.66666667%; }
  .col-lg-3 { flex: 0 0 auto; width: 25%; }
  .col-lg-4 { flex: 0 0 auto; width: 33.33333333%; }
  .col-lg-5 { flex: 0 0 auto; width: 41.66666667%; }
  .col-lg-6 { flex: 0 0 auto; width: 50%; }
  .col-lg-7 { flex: 0 0 auto; width: 58.33333333%; }
  .col-lg-8 { flex: 0 0 auto; width: 66.66666667%; }
  .col-lg-9 { flex: 0 0 auto; width: 75%; }
  .col-lg-10 { flex: 0 0 auto; width: 83.33333333%; }
  .col-lg-11 { flex: 0 0 auto; width: 91.66666667%; }
  .col-lg-12 { flex: 0 0 auto; width: 100%; }
}

/**
 * Extra large devices (≥1200px)
 */
@media (min-width: 1200px) {
  .col-xl { flex: 1 0 0%; }
  .col-xl-auto { flex: 0 0 auto; width: auto; }
  .col-xl-1 { flex: 0 0 auto; width: 8.33333333%; }
  .col-xl-2 { flex: 0 0 auto; width: 16.66666667%; }
  .col-xl-3 { flex: 0 0 auto; width: 25%; }
  .col-xl-4 { flex: 0 0 auto; width: 33.33333333%; }
  .col-xl-5 { flex: 0 0 auto; width: 41.66666667%; }
  .col-xl-6 { flex: 0 0 auto; width: 50%; }
  .col-xl-7 { flex: 0 0 auto; width: 58.33333333%; }
  .col-xl-8 { flex: 0 0 auto; width: 66.66666667%; }
  .col-xl-9 { flex: 0 0 auto; width: 75%; }
  .col-xl-10 { flex: 0 0 auto; width: 83.33333333%; }
  .col-xl-11 { flex: 0 0 auto; width: 91.66666667%; }
  .col-xl-12 { flex: 0 0 auto; width: 100%; }
}

/* ============================================================================
   6. UTILITY CLASSES
   ============================================================================
   Classi helper per layout, allineamento e spacing
   ========================================================================= */

/**
 * Text alignment
 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

@media (min-width: 576px) {
  .text-sm-center { text-align: center; }
  .text-sm-left { text-align: left; }
  .text-sm-right { text-align: right; }
}

@media (min-width: 768px) {
  .text-md-center { text-align: center; }
  .text-md-left { text-align: left; }
  .text-md-right { text-align: right; }
}

@media (min-width: 992px) {
  .text-lg-center { text-align: center; }
  .text-lg-left { text-align: left; }
  .text-lg-right { text-align: right; }
}

/**
 * Display & Flexbox
 */
.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

.justify-content-start { justify-content: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }

.align-items-start { align-items: flex-start; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }

/**
 * Background
 */
.bg-light {
  background-color: var(--bg-light);
}

/**
 * Miscellaneous
 */
.note {
  margin-top: 1rem;
  font-size: 0.8rem;
}

.divider {
  margin: 3rem auto;
  max-width: 800px;
  border-top: 1px solid #ddd;
}

/* ============================================================================
   7. SECTION ENHANCEMENTS
   ============================================================================
   Stili migliorati per contenuti section
   ========================================================================= */

/**
 * Sottotitoli centrati nelle sezioni
 * Max-width per leggibilità ottimale
 */
.section h2 + p.text-center,
.section .row h2 + p.text-center {
  margin: 0 auto 3rem;
  max-width: 800px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ============================================================================
   8. BACK TO TOP BUTTON
   ============================================================================
   Pulsante floating per ritorno a inizio pagina
   ========================================================================= */

/**
 * Bottone fisso in basso a destra
 * Animazione hover con lift
 */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid white;
  background: var(--primary-color);
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 999;
  transition: background 0.3s ease, transform 0.3s ease;
}

.back-to-top:hover {
  background: var(--accent-color);
  transform: translateY(-3px);
}

.back-to-top:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

/* ============================================================================
   9. FOOTER UTILITIES
   ============================================================================
   Helper classes per footer layout
   ========================================================================= */

/**
 * Footer bottom layout
 * Flex layout con responsive wrapping
 */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.4;
}

.footer-bottom-left {
  flex: 1;
}

.footer-bottom-right {
  margin-left: auto;
}

.footer-bottom p {
  margin: 0.25rem 0;
}

.footer-bottom small {
  color: #ccc;
}

.footer-bottom .credits {
  font-size: 0.80rem;
  color: #bbb !important;
}

/**
 * Footer headings
 * Stili specifici per titoli nel footer
 */
.global-footer .footer-column .h4 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff !important;
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
}

.global-footer .footer-column .h4.serif-elegant {
  font-weight: 400;
  font-size: 1.25rem;
}

/* ============================================================================
   10. RESPONSIVE OVERRIDES
   ============================================================================
   Aggiustamenti specifici per breakpoint mobile
   ========================================================================= */

/**
 * Mobile very small (max 480px)
 */
@media (max-width: 480px) {
  :root {
    --section-padding-inline: 1rem;
  }

  .back-to-top {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    bottom: 1rem;
    right: 1rem;
  }
}

/**
 * Mobile (max 575.98px)
 */
@media (max-width: 575.98px) {
  .container,
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .row {
    --bs-gutter-x: 1rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }

  .section h2 + p.text-center {
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
  }
}

/**
 * Tablet small (576px - 767.98px)
 */
@media (min-width: 576px) and (max-width: 767.98px) {
  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/**
 * Tablet (768px - 991.98px)
 */
@media (min-width: 768px) and (max-width: 991.98px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .h4,
  h2.h4,
  h3.h4 {
    font-size: 1rem;
  }

  .global-footer .footer-column .h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
}

/**
 * Dark mode support
 */
@media (prefers-color-scheme: dark) {
  .global-footer .footer-column .h4 {
    color: #f9fafb;
  }
}

/**
 * High contrast mode
 */
@media (prefers-contrast: high) {
  .global-footer .footer-column .h4 {
    font-weight: 700;
  }
}

/**
 * Print styles
 */
@media print {
  .h4,
  h2.h4,
  h3.h4 {
    font-family: var(--font-heading), Georgia, serif;
  }
}

/* ============================================================================
   11. LEGACY COMPATIBILITY
   ============================================================================
   Supporto per codice esistente
   ========================================================================= */

/**
 * Classe column legacy
 * Compatibilità con vecchio codice
 */
.column {
  max-width: 100%;
}

@media (max-width: 768px) {
  .column {
    max-width: 100%;
  }
}

/* ============================================================================
   END OF FILE
   ========================================================================= */