/*
Theme Name: Scudo231® Theme
Theme URI: https://scudo231.it
Author: Scudo231
Author URI: https://scudo231.it
Description: Tema istituzionale custom per Scudo231® - Ecosistema AI per D.Lgs. 231/2001
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: Proprietary
License URI: https://scudo231.it/license
Text Domain: scudo231
Tags: institutional, compliance, dual-theme, custom
*/

/* ============================================
   IMPORTAZIONE STILI HOMEPAGE
   ============================================ */

/* Reset di base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variabili CSS - Light Theme (default) */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    --border-color: #dee2e6;
    --accent-primary: #2c5282;
    --accent-secondary: #b8860b;
    --accent-hover: #1e3a5f;
    --shadow: rgba(0, 0, 0, 0.1);
    --link-color: #2c5282;
    --link-hover: #1e3a5f;
}

/* Dark Theme (auto da sistema) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f1419;
        --bg-secondary: #1a1f2e;
        --bg-tertiary: #252b3b;
        --text-primary: #e8eaed;
        --text-secondary: #b8bcc8;
        --text-tertiary: #8b92a4;
        --border-color: #2d3748;
        --accent-primary: #4a90e2;
        --accent-secondary: #d4af37;
        --accent-hover: #357abd;
        --shadow: rgba(0, 0, 0, 0.3);
        --link-color: #4a90e2;
        --link-hover: #357abd;
    }
}

/* Override manuale - Light forzato */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    --border-color: #dee2e6;
    --accent-primary: #2c5282;
    --accent-secondary: #b8860b;
    --accent-hover: #1e3a5f;
    --shadow: rgba(0, 0, 0, 0.1);
    --link-color: #2c5282;
    --link-hover: #1e3a5f;
}

/* Override manuale - Dark forzato */
[data-theme="dark"] {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252b3b;
    --text-primary: #e8eaed;
    --text-secondary: #b8bcc8;
    --text-tertiary: #8b92a4;
    --border-color: #2d3748;
    --accent-primary: #4a90e2;
    --accent-secondary: #d4af37;
    --accent-hover: #357abd;
    --shadow: rgba(0, 0, 0, 0.3);
    --link-color: #4a90e2;
    --link-hover: #357abd;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover);
}

/* Importa il resto degli stili dall'HTML */
/* Gli stili completi sono in assets/css/main.css */
/* ============================================
   1. VARIABILI E COLORI (La tua base, ottimizzata)
   ============================================ */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa; /* Per le card chiare */
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --border-color: #dee2e6;
    --accent-primary: #2c5282;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    
    /* RESPONSIVITÀ FLUIDA (Aggiunta mia) */
    /* Il font scala automaticamente tra 16px e 18px */
    --font-body: clamp(1rem, 0.5vw + 0.9rem, 1.125rem); 
    /* Spaziatura che si adatta al mobile/desktop */
    --spacing-fluid: clamp(1rem, 3vw, 2rem);
}

/* Dark Theme (Automatico da sistema) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f1419;
        --bg-secondary: #1a1f2e; /* Per le card scure */
        --text-primary: #e8eaed;
        --text-secondary: #b8bcc8;
        --border-color: #2d3748;
        --accent-primary: #4a90e2;
        --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    }
}

/* Override Manuale - Light */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --border-color: #dee2e6;
    --accent-primary: #2c5282;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Override Manuale - Dark */
[data-theme="dark"] {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --text-primary: #e8eaed;
    --text-secondary: #b8bcc8;
    --border-color: #2d3748;
    --accent-primary: #4a90e2;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

/* ============================================
   2. STILI GENERALI & RESPONSIVE
   ============================================ */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: var(--font-body); /* Usa il font fluido */
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Immagini responsive (Mancava questo!) */
img, video, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   3. HEADER ISTITUZIONALE (Per il tuo HTML)
   ============================================ */
.institutional-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.header-top-content {
    display: flex;
    justify-content: flex-end; /* Spinge il toggle a destra */
    padding: 0 var(--spacing-fluid);
    max-width: 1200px;
    margin: 0 auto;
}

.header-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem var(--spacing-fluid);
    display: flex;
    flex-wrap: wrap; /* Fondamentale per il mobile */
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Menu Responsive Semplice */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}

.main-nav a:hover {
    color: var(--accent-primary);
}

/* ============================================
   4. STILE DEL TOGGLE (Mancava questo!)
   ============================================ */
#theme-toggle {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 50px; /* Pill shape */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

#theme-toggle:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

/* ============================================
   5. STILE DELLE CARDS
   ============================================ */
.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-fluid);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
    
    /* Layout fluido */
    width: 100%; 
}

/* Griglia per le card (se le metti in un container) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-fluid);
    padding: var(--spacing-fluid);
    max-width: 1200px;
    margin: 0 auto;
}