/*
Theme Name: Elementa eMokki
Theme URI: https://emokki.fi
Description: A Nordic Noir editorial theme for MökkiGuru with Material Design 3 (BeerCSS) and automated virtual pages.
Author: AtmosCode
Version: 2.2.0
Text Domain: elementa-emokki
*/

:root {
    /* Material Design 3 Theme (Nordic Noir Palette) */
    
    /* Primary Colors - Deep Forest Green */
    --primary: #1A2F23;          /* Deep Forest (Buttons, Active states) */
    --on-primary: #ffffff;       /* Text on Primary */
    --primary-container: #253D30; /* Lighter Forest */
    --on-primary-container: #D4E7DD;
    
    /* Secondary Colors - Burnt Orange */
    --secondary: #C88D43;        /* Burnt Orange (CTAs) */
    --on-secondary: #ffffff;     /* Text on Secondary */
    --secondary-container: #E5B47D;
    --on-secondary-container: #2B1F0D;
    
    /* Background & Surface - Nordic Paper */
    --background: #F9F9F7;       /* Paper White (Page BG) */
    --on-background: #222222;    /* Charcoal Text */
    --surface: #ffffff;          /* Card Backgrounds */
    --on-surface: #222222;       /* Text on Surface */
    --surface-variant: #F5F5F3;  /* Subtle variation */
    --on-surface-variant: #5A5A54;
    
    /* Material Design Elevation & Overlay */
    --overlay-opacity: 0.08;
    
    /* Typography Scale (Material Design 3) */
    --font-title: 'Playfair Display', serif;  /* Display, Headline */
    --font-body: 'Inter', sans-serif;         /* Body, Label */
    --font-mono: 'Courier Prime', monospace;  /* Code blocks */
    
    /* Shape (Material 3 Rounded Corners) */
    --radius: 16px;           /* Default card radius */
    --radius-small: 8px;      /* Chips, buttons */
    --radius-large: 24px;     /* Hero sections */
    --radius-extra: 28px;     /* FAB buttons */
    
    /* Spacing System (8px base unit) */
    --spacing-unit: 8px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;
    
    /* Layout Widths */
    --container-width: 1200px;
    --text-width: 700px;
    
    /* Seasonal Variables (Default: Winter) */
    --hero-overlay: linear-gradient(to bottom, rgba(26, 47, 35, 0.3), rgba(26, 47, 35, 0.8));
    --accent-color: #C88D43;
}

/* Seasonal Overrides (Material You Dynamic Color) */
body.season-summer {
    --hero-overlay: linear-gradient(to bottom, rgba(0, 100, 150, 0.2), rgba(0, 50, 80, 0.6));
    --primary: #004d40;        /* Lake Green */
    --primary-container: #00695C;
    --accent-color: #4FC3F7;   /* Sky Blue */
}

body.season-ruska {
    --hero-overlay: linear-gradient(to bottom, rgba(150, 50, 0, 0.2), rgba(80, 30, 0, 0.6));
    --primary: #4e342e;        /* Earthy Brown */
    --primary-container: #6D4C41;
    --accent-color: #FF6F00;   /* Autumn Orange */
}

/* === CRITICAL CSS === */

/* Base Body Styles */
body {
    background-color: var(--background);
    color: var(--on-background);
    font-family: var(--font-body);
    line-height: 1.6;
    margin: 0;
    opacity: 0;
    animation: fadeIn 0.5s ease-in forwards;
}

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

/* Typography Hierarchy (Material Design 3) */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    margin-top: 0;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* Body Text */
p {
    margin-bottom: var(--spacing-md);
}

.large-text {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    line-height: 1.7;
}

.small-text {
    font-size: 0.875rem;
}

.mono {
    font-family: var(--font-mono);
}

/* === BEERCSS OVERRIDES FOR NORDIC NOIR === */

/* Primary Button (Material You) */
.button.primary, 
button.primary,
.primary {
    background-color: var(--primary) !important;
    color: var(--on-primary) !important;
}

/* Secondary Button (Burnt Orange CTA) */
.button.secondary,
button.secondary,
.secondary {
    background-color: var(--secondary) !important;
    color: var(--on-secondary) !important;
}

/* Extended FAB (Pill Button) */
.button.extended,
button.extended {
    border-radius: var(--radius-extra);
    padding: 14px 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

/* Chips (Material 3 Filter Chips) */
.chip {
    border-radius: var(--radius-small);
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Cards (Material 3 Elevated) */
.card {
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card.elevated,
.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card.no-padding {
    padding: 0;
}

.card.round {
    border-radius: var(--radius);
}

.card.top-round img {
    border-radius: var(--radius) var(--radius) 0 0;
}

/* Surface Variants */
.surface-container {
    background-color: var(--surface-variant);
    color: var(--on-surface-variant);
}

.surface-variant {
    background-color: var(--surface-variant);
}

/* Primary Container */
.primary-container {
    background-color: var(--primary-container);
    color: var(--on-primary-container);
}

.secondary-container {
    background-color: var(--secondary-container);
    color: var(--on-secondary-container);
}

/* Text Colors */
.primary-text {
    color: var(--primary) !important;
}

.secondary-text {
    color: var(--secondary) !important;
}

.white-text {
    color: #ffffff !important;
}

/* === HERO & VIDEO BACKGROUNDS === */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero.large {
    min-height: 100vh;
}

.hero.medium {
    min-height: 60vh;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.hero-overlay {
    background: var(--hero-overlay);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero.large {
    min-height: 100vh;
}

.hero.medium {
    min-height: 60vh;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.hero-overlay {
    background: var(--hero-overlay);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Black Overlay Utilities */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.black-opacity-30 {
    background-color: rgba(0, 0, 0, 0.3);
}

.black-opacity-50 {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Gradient Overlays */
.gradient-bottom {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

/* === LAYOUT & GRID === */

.max-width {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

.text-width {
    max-width: var(--text-width);
    margin-left: auto;
    margin-right: auto;
}

.container {
    width: 100%;
    padding: var(--spacing-md);
}

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

/* Padding Utilities */
.padding {
    padding: var(--spacing-md);
}

.padding-large {
    padding: var(--spacing-lg);
}

.padding-vertical {
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-md);
}

/* Margin Utilities */
.margin-bottom {
    margin-bottom: var(--spacing-md);
}

.margin-top {
    margin-top: var(--spacing-md);
}

.margin-vertical {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.large-margin {
    margin: var(--spacing-xl);
}

.no-margin {
    margin: 0 !important;
}

/* === SCROLL CONTAINERS === */

.scroll,
.scroll-horizontal {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--spacing-sm);
}

.scroll::-webkit-scrollbar,
.scroll-horizontal::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

/* === BADGES & INDICATORS === */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.badge.circle {
    border-radius: 50%;
    width: 64px;
    height: 64px;
}

.badge.large {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
}

/* === EDITORIAL COMPONENTS === */

.drop-cap::first-letter {
    font-family: var(--font-title);
    font-size: 3.5rem;
    float: left;
    line-height: 0.8;
    margin-right: 0.5rem;
    margin-top: 0.1rem;
    color: var(--primary);
    font-weight: 700;
}

.quote-box,
blockquote.left-border {
    background-color: var(--surface-variant);
    color: var(--on-surface);
    padding: var(--spacing-lg);
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-style: italic;
    margin: var(--spacing-lg) 0;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-small);
}

.primary-border {
    border-color: var(--primary) !important;
}

/* === IMAGES === */

img.responsive {
    width: 100%;
    height: auto;
    display: block;
}

.image-fill {
    position: relative;
    overflow: hidden;
}

.image-fill img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === TABLES (Utility Pages) === */

table.border {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-lg) 0;
}

table.stripe tbody tr:nth-child(even) {
    background-color: var(--surface-variant);
}

table.border td,
table.border th {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--surface-variant);
}

table.border th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    color: var(--on-surface-variant);
}

img.tiny {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* === ANIMATIONS === */

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

.animate-bounce {
    animation: bounce 2s infinite;
}

.hover-up {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-up:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* === POSITIONING === */

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.top {
    top: 0;
}

.bottom {
    bottom: 0;
}

.left {
    left: 0;
}

.right {
    right: 0;
}

.center {
    left: 50%;
    transform: translateX(-50%);
}

.middle {
    top: 50%;
    transform: translateY(-50%);
}

.center-align {
    text-align: center;
}

.right-align {
    text-align: right;
}

/* === ELEVATION (Material Design 3) === */

.elevation-1 {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.elevation-2 {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.elevation-3 {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.18);
}

.elevated {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* === TRANSPARENCY & OPACITY === */

.transparent {
    background-color: transparent !important;
}

.opacity-50 {
    opacity: 0.5;
}

/* === MOBILE RESPONSIVENESS === */

@media (max-width: 768px) {
    .hero {
        min-height: 70vh;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .padding {
        padding: var(--spacing-sm);
    }
    
    .max-width {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
    }
}

/* === STICKY NAVIGATION === */

header.fixed.top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header.fixed.top.scrolled {
    background-color: var(--surface);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

header.fixed.top.scrolled .white-text {
    color: var(--on-surface) !important;
}

/* === STICKY BOTTOM BAR (Mobile CTAs) === */

.fixed.bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

/* === PARALLAX EFFECT === */

.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

@media (max-width: 768px) {
    .parallax {
        background-attachment: scroll; /* Better mobile performance */
    }
}