/*
Theme Name: CSAIN TEMPLATE
Theme URI: https://csain.digitalmarketingai.it
Author: Italian Graphic
Author URI: https://italiangraphic.com
Description: Tema professionale WordPress per CSAIN - Centri Sportivi Aziendali e Industriali. Ottimizzato per Elementor, ACF Pro, compatibile AGID, veloce e sicuro.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: csain-template
Domain Path: /languages
Tags: accessibility-ready, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, threaded-comments, translation-ready

CSAIN TEMPLATE - Copyright (C) 2025 Italian Graphic
Questo tema è distribuito sotto licenza GNU GPL v2 o successiva.
*/

/* =========================================
   RESET & BASE
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    /* Colori CSAIN */
    --csain-blue: #24244d;
    --csain-green: #008c39;
    --csain-yellow: #f19001;
    --csain-red: #cc1427;
    --csain-white: #ffffff;
    --csain-black: #000000;
    --csain-gray: #f5f5f5;
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --font-heading: var(--font-primary);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Container */
    --container-max: 1200px;
    --container-padding: var(--spacing-md);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--csain-black);
    background: var(--csain-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   SKIP LINK (AGID)
   ========================================= */
.skip-link {
    position: absolute;
    top: -999px;
    left: -999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100000;
    width: auto;
    height: auto;
    padding: var(--spacing-sm);
    background: var(--csain-blue);
    color: var(--csain-white);
    text-decoration: none;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--spacing-sm);
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--csain-blue);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 var(--spacing-sm);
}

a {
    color: var(--csain-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover,
a:focus {
    color: var(--csain-green);
    outline: 2px solid var(--csain-green);
    outline-offset: 2px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   LAYOUT
   ========================================= */
.site-content {
    min-height: 50vh;
}

.site-main {
    margin: var(--spacing-lg) 0;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* =========================================
   HEADER
   ========================================= */
.site-header {
    background: var(--csain-white);
    border-bottom: 2px solid var(--csain-blue);
    position: relative;
    z-index: 9999;
}

.site-branding {
    padding: var(--spacing-md) 0;
}

.site-branding a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--csain-blue);
}

.site-description {
    margin: var(--spacing-xs) 0 0;
    font-size: 0.875rem;
    color: #666;
}

/* =========================================
   NAVIGATION
   ========================================= */
.site-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.site-navigation a {
    display: block;
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--csain-blue);
    font-weight: 500;
}

.site-navigation a:hover,
.site-navigation a:focus {
    background: var(--csain-gray);
}

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
    background: var(--csain-blue);
    color: var(--csain-white);
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-xl);
    text-align: center;
}

.site-footer a {
    color: var(--csain-white);
}

/* =========================================
   ACCESSIBILITY (AGID)
   ========================================= */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: var(--csain-white);
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: var(--csain-blue);
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* =========================================
   UTILITIES
   ========================================= */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-sm { margin-top: var(--spacing-sm); }
.mb-sm { margin-bottom: var(--spacing-sm); }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .site-navigation ul {
        flex-direction: column;
    }
}

/* =========================================
   PRINT STYLES (AGID)
   ========================================= */
@media print {
    .site-header,
    .site-navigation,
    .site-footer,
    .skip-link {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a {
        text-decoration: underline;
    }
}

/* =========================================
   ELEMENTOR COMPATIBILITY
   ========================================= */
.elementor-section.elementor-top-section {
    position: relative;
    z-index: 1;
}

/* Fix z-index header vs Elementor */
.site-header,
.elementor-location-header {
    position: relative;
    z-index: 9999;
}
