/* =====================================================
   MASTER CAKE LAB — Design System v2
   Rivoluzione layout con skill frontend-design
   Palette audace, tipografia scultorea, signature ribbon
   ===================================================== */

/* ---- Google Fonts (Cormorant Garamond + Montserrat + Inter) ---- */
/* Importati via header.php */

/* ==============================
   1. CUSTOM PROPERTIES (Tokens)
   ============================== */
:root {
    /* ★ Brand Colors — Nuova palette audace */
    --mcl-burgundy:      #6B2D3F;
    --mcl-burgundy-dark: #4A1E2B;
    --mcl-burgundy-soft: #8B4A5C;
    --mcl-gold:          #D4A853;
    --mcl-gold-light:    #E8C482;
    --mcl-gold-dark:     #B8893A;
    --mcl-cream:         #FCF8F4;
    --mcl-ivory:         #F5EFE8;
    --mcl-charcoal:      #2C181A;
    --mcl-charcoal-soft: #4A3033;
    --mcl-warm-gray:     #8B7D7A;
    --mcl-white:         #FFFFFF;

    /* ★ Legacy alias — compatibilità */
    --color-gold:         var(--mcl-gold);
    --color-gold-light:   var(--mcl-gold-light);
    --color-gold-dark:    var(--mcl-gold-dark);
    --color-dust-rose:    var(--mcl-burgundy-soft);
    --color-rose-light:   var(--mcl-ivory);
    --color-rose-dark:    var(--mcl-burgundy);
    --color-charcoal:     var(--mcl-charcoal);
    --color-charcoal-soft:var(--mcl-charcoal-soft);
    --color-cream:        var(--mcl-cream);
    --color-cream-dark:   var(--mcl-ivory);

    /* Surface */
    --surface-bg:         var(--mcl-cream);
    --surface-card:       var(--mcl-white);
    --surface-glass:      rgba(255, 255, 255, 0.85);
    --surface-glass-hover:rgba(255, 255, 255, 0.95);
    --surface-border:     rgba(107, 45, 63, 0.12);
    --surface-border-hover: rgba(212, 168, 83, 0.35);

    /* Text */
    --text-primary:   var(--mcl-charcoal);
    --text-secondary: var(--mcl-charcoal-soft);
    --text-muted:     var(--mcl-warm-gray);
    --text-gold:      var(--mcl-gold);

    /* ★ Typography — Nuovo font display Cormorant Garamond */
    --font-display:  'Cormorant Garamond', Georgia, serif;
    --font-heading:  var(--font-display);
    --font-body:     'Montserrat', system-ui, -apple-system, sans-serif;
    --font-utility:  'Inter', system-ui, sans-serif;

    --font-size-xs:   0.75rem;
    --font-size-sm:   0.875rem;
    --font-size-base: 1rem;
    --font-size-md:   1.125rem;
    --font-size-lg:   1.25rem;
    --font-size-xl:   1.5rem;
    --font-size-2xl:  2rem;
    --font-size-3xl:  2.75rem;
    --font-size-4xl:  3.75rem;
    --font-size-5xl:  5rem;
    --font-size-6xl:  6.5rem;

    /* Spacing */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* Border Radius */
    --radius-sm:   0.375rem;
    --radius-md:   0.75rem;
    --radius-lg:   1.25rem;
    --radius-xl:   2rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(44,24,26,.05), 0 1px 2px rgba(44,24,26,.1);
    --shadow-md:  0 4px 16px rgba(44,24,26,.08), 0 2px 6px rgba(44,24,26,.05);
    --shadow-lg:  0 10px 40px rgba(44,24,26,.12), 0 4px 12px rgba(44,24,26,.08);
    --shadow-gold:0 0 30px rgba(212,168,83,.15), 0 0 60px rgba(212,168,83,.08);
    --shadow-burgundy:0 0 30px rgba(107,45,63,.12);

    /* ★ Gold Ribbon — Signature Element */
    --ribbon-height: 4px;
    --ribbon-gradient: linear-gradient(135deg, var(--mcl-gold-dark), var(--mcl-gold), var(--mcl-gold-light), var(--mcl-gold));

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index */
    --z-base:    1;
    --z-dropdown:100;
    --z-sticky:  200;
    --z-overlay: 500;
    --z-modal:   600;
    --z-toast:   700;
    --z-loader:  999;

    /* Layout */
    --container-max: 1280px;
    --container-pad: clamp(1rem, 5vw, 3rem);
    --header-height: 80px;
    --grid-gap:      1.5rem;
}

/* ==============================
   2. RESET & BASE
   ============================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    background-color: var(--surface-bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background texture — più morbida e calda */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(ellipse 70% 40% at 50% -15%, rgba(212,168,83,0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 30% at 100% 90%, rgba(107,45,63,0.08) 0%, transparent 50%),
        radial-gradient(ellipse 40% 30% at 0% 70%, rgba(212,168,83,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

main { position: relative; z-index: 1; }

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

a {
    color: var(--mcl-gold-dark);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--mcl-gold); }

ul, ol { list-style: none; }

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-body);
}

input, select, textarea {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--mcl-gold);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ==============================
   3. TYPOGRAPHY
   ============================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    color: var(--text-primary);
}

h1 { font-size: clamp(var(--font-size-4xl), 7vw, var(--font-size-6xl)); }
h2 { font-size: clamp(var(--font-size-3xl), 5vw, var(--font-size-5xl)); }
h3 { font-size: clamp(var(--font-size-2xl), 3.5vw, var(--font-size-3xl)); }
h4 { font-size: var(--font-size-2xl); }
h5 { font-size: var(--font-size-xl); }
h6 { font-size: var(--font-size-lg); }

.text-gold     { color: var(--mcl-gold) !important; }
.text-burgundy { color: var(--mcl-burgundy) !important; }
.text-muted    { color: var(--text-muted) !important; }
.text-center   { text-align: center; }
.text-left     { text-align: left; }
.text-right    { text-align: right; }
.font-display  { font-family: var(--font-display); }
.font-body     { font-family: var(--font-body); }
.font-utility  { font-family: var(--font-utility); }
.font-light    { font-weight: 300; }
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.gradient-text {
    background: linear-gradient(135deg, var(--mcl-gold-light), var(--mcl-gold), var(--mcl-burgundy-soft));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Corsivo enfatico — tipico Cormorant */
.em-gold {
    font-style: italic;
    color: var(--mcl-gold);
}

/* ==============================
   4. LAYOUT UTILITIES
   ============================== */
.container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.container--narrow {
    max-width: 860px;
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.section {
    padding-block: clamp(var(--space-16), 10vw, var(--space-32));
}

.section--sm { padding-block: clamp(var(--space-8), 5vw, var(--space-16)); }
.section--pt0 { padding-top: 0; }

/* Grid */
.grid           { display: grid; gap: var(--grid-gap); }
.grid-2         { grid-template-columns: repeat(2, 1fr); }
.grid-3         { grid-template-columns: repeat(3, 1fr); }
.grid-4         { grid-template-columns: repeat(4, 1fr); }
.grid-auto-fill { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Flex */
.flex           { display: flex; }
.flex-center    { display: flex; align-items: center; justify-content: center; }
.flex-between   { display: flex; align-items: center; justify-content: space-between; }
.flex-col       { display: flex; flex-direction: column; }
.flex-wrap      { flex-wrap: wrap; }
.gap-2          { gap: var(--space-2); }
.gap-4          { gap: var(--space-4); }
.gap-6          { gap: var(--space-6); }
.gap-8          { gap: var(--space-8); }

/* Spacing */
.mt-4  { margin-top: var(--space-4); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

/* ==============================
   5. ★ GOLD RIBBON — Signature Element
   Il nastro dorato è il fil rouge visivo di MCL.
   ============================== */
.gold-ribbon {
    display: block;
    height: var(--ribbon-height);
    background: var(--ribbon-gradient);
    border: none;
    border-radius: var(--radius-full);
    width: 80px;
    margin: var(--space-4) 0;
}

.gold-ribbon--center {
    margin-inline: auto;
}

.gold-ribbon--wide {
    width: 140px;
}

.gold-ribbon--full {
    width: 100%;
}

/* Ribbon badge — per card, tag */
.ribbon-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--mcl-burgundy), var(--mcl-burgundy-soft));
    color: var(--mcl-white);
    font-family: var(--font-utility);
    font-size: var(--font-size-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    position: relative;
}

.ribbon-badge::after {
    content: '';
    position: absolute;
    inset: 1px;
    border: 1px solid var(--mcl-gold);
    border-radius: calc(var(--radius-sm) - 1px);
    opacity: 0.5;
    pointer-events: none;
}

/* Ribbon divider — separatore decorativo */
.ribbon-divider {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-block: var(--space-6);
}

.ribbon-divider::before,
.ribbon-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--mcl-gold), transparent);
}

.ribbon-divider .gold-ribbon {
    margin: 0;
    width: 40px;
    flex-shrink: 0;
}

/* ==============================
   6. GLASSMORPHISM
   ============================== */
.glass {
    background: var(--surface-glass);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
}

.glass:hover {
    background: var(--surface-glass-hover);
    border-color: var(--surface-border-hover);
}

/* ==============================
   7. BUTTONS
   ============================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.875rem 2rem;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid transparent;
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.08);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn:hover::after { opacity: 1; }
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* Primary — Borgogna / Gold */
.btn-primary {
    background: linear-gradient(135deg, var(--mcl-burgundy), var(--mcl-burgundy-dark));
    color: var(--mcl-white) !important;
    border-color: var(--mcl-burgundy);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--mcl-burgundy-soft), var(--mcl-burgundy));
    box-shadow: var(--shadow-burgundy);
}

/* Secondary — Gold Outline */
.btn-secondary {
    background: transparent;
    color: var(--mcl-burgundy) !important;
    border-color: var(--mcl-gold);
}
.btn-secondary:hover {
    background: var(--mcl-gold);
    color: var(--mcl-white) !important;
    border-color: var(--mcl-gold);
}

/* Ghost — Clean */
.btn-ghost {
    background: transparent;
    color: var(--text-primary) !important;
    border-color: var(--surface-border-hover);
}
.btn-ghost:hover {
    background: var(--mcl-burgundy);
    border-color: var(--mcl-burgundy);
    color: var(--mcl-white) !important;
}

/* Sizes */
.btn-sm { padding: 0.5rem 1.25rem; font-size: var(--font-size-xs); }
.btn-lg { padding: 1.125rem 2.75rem; font-size: var(--font-size-sm); }
.btn-block { width: 100%; text-align: center; }

/* Loading */
.btn.loading {
    pointer-events: none;
    opacity: .7;
}
.btn.loading::after {
    content: '';
    width: 1em; height: 1em;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    margin-left: var(--space-2);
}

/* ==============================
   8. SECTION HEADERS
   ============================== */
.section-header {
    text-align: center;
    margin-bottom: clamp(var(--space-10), 6vw, var(--space-16));
}

.section-label {
    display: inline-block;
    font-family: var(--font-utility);
    font-size: var(--font-size-xs);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--mcl-burgundy-soft);
    margin-bottom: var(--space-4);
}

.section-title {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-md);
    max-width: 620px;
    margin-inline: auto;
    font-weight: 300;
    line-height: 1.8;
}

/* ==============================
   9. RESPONSIVE
   ============================== */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root {
        --container-pad: 1.25rem;
        --grid-gap: 1rem;
    }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .btn { padding: 0.75rem 1.5rem; }
    .btn-lg { padding: 0.875rem 2rem; }
}

/* ==============================
   10. SCROLLBAR
   ============================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--surface-bg); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--mcl-gold-dark), var(--mcl-gold));
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--mcl-gold); }

/* ==============================
   11. SELECTION
   ============================== */
::selection {
    background: rgba(212, 168, 83, 0.25);
    color: var(--mcl-charcoal);
}
