/* ==========================================================================
   VINEYARD WINERY TEMPLATE - PREMIUM CSS
   Design System: Elegant wine country aesthetic with burgundy/gold/cream
   ========================================================================== */

/* ==========================================================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ========================================================================== */

:root {
    /* Colors - Light Mode */
    --color-burgundy-50: #fdf8f8;
    --color-burgundy-100: #f9e8e8;
    --color-burgundy-200: #f3d1d1;
    --color-burgundy-300: #e8a5a5;
    --color-burgundy-400: #dc7878;
    --color-burgundy-500: #8b2635;
    --color-burgundy-600: #721e2b;
    --color-burgundy-700: #5a1822;
    --color-burgundy-800: #421219;
    --color-burgundy-900: #2a0b0f;

    --color-gold-50: #fefbf3;
    --color-gold-100: #fdf6e3;
    --color-gold-200: #faedc7;
    --color-gold-300: #f5dd9e;
    --color-gold-400: #efc775;
    --color-gold-500: #c9a054;
    --color-gold-600: #a58344;
    --color-gold-700: #816635;
    --color-gold-800: #5d4926;
    --color-gold-900: #3a2c17;

    --color-cream-50: #fefefe;
    --color-cream-100: #fdfcfa;
    --color-cream-200: #faf8f4;
    --color-cream-300: #f5f2eb;
    --color-cream-400: #ebe6db;
    --color-cream-500: #e0d9ca;
    --color-cream-600: #c9bfad;
    --color-cream-700: #9e9484;
    --color-cream-800: #6d665b;
    --color-cream-900: #3d3832;

    /* Semantic Colors - Light */
    --bg-primary: #ffffff;
    --bg-secondary: var(--color-cream-50);
    --bg-tertiary: var(--color-cream-100);
    --text-primary: #1a1614;
    --text-secondary: #564e47;
    --text-tertiary: #857c73;
    --border-primary: var(--color-cream-300);
    --border-secondary: var(--color-cream-200);
    --accent-primary: var(--color-burgundy-500);
    --accent-secondary: var(--color-gold-500);
    --accent-tertiary: var(--color-burgundy-600);

    /* Typography Scale (Responsive with clamp) */
    --text-hero: clamp(3rem, 8vw, 6rem);
    --text-display: clamp(2.5rem, 5vw, 4rem);
    --text-h1: clamp(2rem, 4vw, 3rem);
    --text-h2: clamp(1.5rem, 3vw, 2.25rem);
    --text-h3: clamp(1.25rem, 2vw, 1.5rem);
    --text-h4: 1.125rem;
    --text-body: 1rem;
    --text-small: 0.875rem;
    --text-xs: 0.75rem;

    /* Font Families */
    --font-serif: 'Playfair Display', 'Georgia', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing Scale (8px base unit) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --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.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 60px rgba(139, 38, 53, 0.3);
    --shadow-glow-gold: 0 0 40px rgba(201, 160, 84, 0.4);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slowest: 800ms cubic-bezier(0.16, 1, 0.3, 1);

    /* Z-index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal: 400;
    --z-popover: 500;
    --z-tooltip: 600;
}

/* Dark Mode */
[data-theme="dark"],
.dark {
    --bg-primary: #0f0d0c;
    --bg-secondary: #1a1614;
    --bg-tertiary: #252220;
    --text-primary: #faf8f4;
    --text-secondary: #c9bfad;
    --text-tertiary: #9e9484;
    --border-primary: #2f2a27;
    --border-secondary: #252220;
    --accent-primary: #dc7878;
    --accent-secondary: #efc775;
    --accent-tertiary: #e8a5a5;
    --shadow-glow: 0 0 60px rgba(220, 120, 120, 0.2);
    --shadow-glow-gold: 0 0 40px rgba(239, 199, 117, 0.3);
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

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

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

body {
    font-family: var(--font-sans);
    font-size: var(--text-body);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); }

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-tertiary);
}

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

/* Selection */
::selection {
    background-color: var(--accent-primary);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-tertiary);
}

/* ==========================================================================
   SCROLL REVEAL ANIMATIONS
   ========================================================================== */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slowest),
                transform var(--transition-slowest);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all var(--transition-slowest);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all var(--transition-slowest);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all var(--transition-slowest);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

.reveal-blur {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
    transition: all var(--transition-slowest);
}

.reveal-blur.active {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ==========================================================================
   HOVER ANIMATIONS
   ========================================================================== */

.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.hover-zoom {
    overflow: hidden;
}

.hover-zoom img {
    transition: transform var(--transition-slow);
}

.hover-zoom:hover img {
    transform: scale(1.05);
}

.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--transition-slow);
}

.hover-shine:hover::before {
    left: 100%;
}

/* ==========================================================================
   CONTINUOUS ANIMATIONS
   ========================================================================== */

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes gentle-sway {
    0%, 100% { transform: rotate(-1deg); }
    50% { transform: rotate(1deg); }
}

.animate-sway {
    animation: gentle-sway 8s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(201, 160, 84, 0.2), transparent);
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

/* ==========================================================================
   SIGNATURE COMPONENTS
   ========================================================================== */

/* Wine Bottle Card */
.wine-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.wine-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.wine-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-primary);
}

.wine-card:hover::before {
    opacity: 1;
}

.wine-bottle-image {
    aspect-ratio: 3/4;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
    margin-bottom: var(--space-4);
}

.vintage-badge {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: var(--accent-primary);
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-family: var(--font-serif);
    font-size: var(--text-small);
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.tasting-notes {
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent-secondary);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-top: var(--space-4);
}

.tasting-notes h4 {
    font-size: var(--text-small);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
    margin-bottom: var(--space-2);
}

.tasting-notes p {
    font-size: var(--text-small);
    font-style: italic;
    margin-bottom: 0;
}

/* Terroir Section */
.terroir-card {
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    aspect-ratio: 16/9;
}

.terroir-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    align-items: flex-end;
    padding: var(--space-8);
}

.terroir-content {
    color: white;
}

.terroir-content h3 {
    color: white;
    margin-bottom: var(--space-2);
}

.terroir-content p {
    color: rgba(255,255,255,0.9);
}

/* Vineyard Stats */
.stat-card {
    text-align: center;
    padding: var(--space-6);
}

.stat-number {
    font-family: var(--font-serif);
    font-size: var(--text-display);
    color: var(--accent-primary);
    font-weight: 700;
    line-height: 1;
    margin-bottom: var(--space-2);
}

.stat-label {
    color: var(--text-secondary);
    font-size: var(--text-small);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Wine Timeline */
.timeline-item {
    position: relative;
    padding-left: var(--space-8);
    padding-bottom: var(--space-8);
    border-left: 2px solid var(--border-primary);
}

.timeline-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -9px;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 3px solid var(--bg-primary);
}

.timeline-year {
    font-family: var(--font-serif);
    font-size: var(--text-h3);
    color: var(--accent-primary);
    margin-bottom: var(--space-2);
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

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

.section-padding {
    padding: var(--space-20) 0;
}

@media (min-width: 768px) {
    .section-padding {
        padding: var(--space-32) 0;
    }
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-pattern {
    background-image:
        radial-gradient(circle at 20% 50%, rgba(139, 38, 53, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(201, 160, 84, 0.05) 0%, transparent 50%);
}

.dark .bg-pattern {
    background-image:
        radial-gradient(circle at 20% 50%, rgba(220, 120, 120, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(239, 199, 117, 0.1) 0%, transparent 50%);
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

.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;
}

.sr-only:focus,
.sr-only:active {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@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;
    }

    .reveal, .reveal-left, .reveal-right, .reveal-scale, .reveal-blur {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

section {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

.animate-float,
.animate-sway,
.hover-lift {
    transform: translateZ(0);
    will-change: transform;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    body {
        background: white;
        color: black;
    }

    nav, footer, .theme-toggle {
        display: none;
    }

    a {
        text-decoration: underline;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
    }
}
