/**
 * MIREKBYGG - CSS Reset & Base Styles
 * Modern CSS reset with Scandinavian precision
 */

/* === BOX SIZING === */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* === RESET MARGINS & PADDING === */
* {
    margin: 0;
    padding: 0;
}

/* === HTML & BODY === */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    line-height: var(--leading-normal);
    font-family: var(--font-body);
    font-weight: var(--font-regular);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Prevent scroll when menu is open */
body.menu-open,
body.loading {
    overflow: hidden;
}

/* === TYPOGRAPHY RESET === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-medium);
    line-height: var(--leading-tight);
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

/* === MEDIA === */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* === FORM ELEMENTS === */
input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
}

/* === LINKS === */
a {
    color: inherit;
    text-decoration: none;
}

/* === LISTS === */
ul, ol {
    list-style: none;
}

/* === TABLES === */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* === QUOTES === */
blockquote, q {
    quotes: none;
}

blockquote::before, blockquote::after,
q::before, q::after {
    content: '';
    content: none;
}

/* === MISC === */
[hidden] {
    display: none !important;
}

/* Remove default appearance */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    display: none;
}

/* === FOCUS STYLES === */
:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* === SELECTION === */
::selection {
    background-color: var(--color-gold);
    color: var(--color-black);
}

::-moz-selection {
    background-color: var(--color-gold);
    color: var(--color-black);
}

/* === SCROLLBAR STYLING === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-charcoal);
}

::-webkit-scrollbar-thumb {
    background: var(--color-graphite);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold-muted);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-graphite) var(--color-charcoal);
}

/* === 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;
    }
}

/* === PRINT STYLES === */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    img {
        max-width: 100% !important;
    }
    
    @page {
        margin: 2cm;
    }
    
    h2, h3 {
        page-break-after: avoid;
    }
    
    p {
        orphans: 3;
        widows: 3;
    }
}

