/* ==============================================
   BASE.CSS - Fondamenta del Design System
   Botanica Veneta - Tuttifiori
   ============================================== */

/* ==============================================
   1. CSS VARIABLES
   ============================================== */

:root {
    /* Colori Primari */
    --verde-botanico: #2D4A3B;
    --oro-caldo: #D4A574;
    
    /* Palette Estesa */
    --crema: #FFFEF9;
    --sabbia-chiara: #F7F3ED;
    --verde-salvia: #8B9680;
    --cannella: #B8896B;
    --perla: #E5E0D8;
    --text-dark: #1A1A1A;
    --text-quiet: #615F5A;
    
    /* Spacing System (8px base) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;
    --space-3xl: 104px;
    
    /* Typography */
    --font-heading: 'Newsreader', serif;
    --font-body: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Font Sizes - Sistema Fluido */
    --text-xs: 13px;
    --text-sm: 15px;
    --text-base: 17px;
    --text-lg: 20px;
    --text-xl: 24px;
    --text-2xl: 32px;
    --text-3xl: 40px;
    --text-4xl: 52px;
    
    /* Line Heights */
    --line-tight: 1.2;
    --line-normal: 1.6;
    --line-relaxed: 1.75;
    
    /* Border Radius */
    --radius-small: 4px;
    --radius-medium: 8px;
    --radius-large: 16px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(45, 74, 59, 0.05);
    --shadow-md: 0 10px 20px rgba(45, 74, 59, 0.08);
    --shadow-lg: 0 20px 40px rgba(45, 74, 59, 0.12);
    --shadow-hover: 0 10px 20px rgba(45, 74, 59, 0.15);
    
    /* Container */
    --container-max: 1180px;
    --container-padding: var(--space-lg);
}

/* ==============================================
   2. RESET MODERNO
   ============================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: var(--text-base);
    line-height: var(--line-normal);
    color: var(--text-dark);
    background-color: var(--crema);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Previeni margini indesiderati */
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
    margin: 0;
}

/* Reset liste */
ul, ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Reset link */
a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* Immagini responsive di default */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

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

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

/* Tabelle */
table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

/* Focus visibile per accessibilità */
:focus-visible {
    outline: 2px solid var(--oro-caldo);
    outline-offset: 2px;
}

/* ==============================================
   3. TYPOGRAPHY BASE
   ============================================== */

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: var(--line-tight);
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(var(--text-3xl), 5vw, var(--text-4xl));
    font-weight: 300;
    margin-bottom: var(--space-lg);
}

h2 {
    font-size: clamp(28px, 4vw, var(--text-2xl));
    color: var(--verde-botanico);
    margin-bottom: var(--space-lg);
}

h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-md);
}

h4 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-md);
}

h5 {
    font-size: 18px;
    margin-bottom: var(--space-sm);
}

h6 {
    font-size: 16px;
    margin-bottom: var(--space-sm);
}

/* Paragraphs */
p {
    line-height: var(--line-relaxed);
    color: var(--text-quiet);
    margin-bottom: var(--space-md);
}

p:last-child {
    margin-bottom: 0;
}

/* Text variations */
.text-lead {
    font-size: var(--text-lg);
    line-height: 1.7;
    color: var(--text-quiet);
}

.text-small {
    font-size: var(--text-sm);
    color: var(--text-quiet);
}

.text-xs {
    font-size: var(--text-xs);
    color: var(--text-quiet);
}

/* Emphasis */
strong, b {
    font-weight: 500;
}

em, i {
    font-style: italic;
}

/* Links nel testo */
p a, li a {
    color: var(--verde-botanico);
    text-decoration: underline;
    text-decoration-color: var(--oro-caldo);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

p a:hover, li a:hover {
    color: var(--oro-caldo);
}

/* Liste con stile */
article ul,
article ol,
.content ul,
.content ol {
    padding-left: var(--space-lg);
    margin-bottom: var(--space-lg);
}

article li,
.content li {
    margin-bottom: var(--space-sm);
    color: var(--text-quiet);
}

article ul li::before,
.content ul li::before {
    content: "•";
    color: var(--oro-caldo);
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* Blockquote */
blockquote {
    border-left: 3px solid var(--oro-caldo);
    padding-left: var(--space-lg);
    margin: var(--space-xl) 0;
    font-style: italic;
    color: var(--text-quiet);
}

blockquote cite {
    display: block;
    margin-top: var(--space-sm);
    font-size: var(--text-sm);
    font-style: normal;
}

/* ==============================================
   4. UTILITY CLASSES
   ============================================== */

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

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

/* Display utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

/* Flexbox utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

/* Spacing utilities */
.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* Colori utility */
.text-primary { color: var(--verde-botanico); }
.text-accent { color: var(--oro-caldo); }
.text-muted { color: var(--text-quiet); }
.text-white { color: white; }

.bg-primary { background-color: var(--verde-botanico); }
.bg-accent { background-color: var(--oro-caldo); }
.bg-cream { background-color: var(--crema); }
.bg-sand { background-color: var(--sabbia-chiara); }

/* ==============================================
   5. ANIMAZIONI BASE
   ============================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation classes */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease-out forwards;
}

/* Delay utilities per animazioni sequenziali */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ==============================================
   6. ACCESSIBILITY
   ============================================== */

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--verde-botanico);
    color: white;
    padding: var(--space-sm) var(--space-md);
    z-index: 100;
    text-decoration: none;
}

.skip-to-content:focus {
    top: 0;
}

/* Reduced motion per chi lo preferisce */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}