/* ==========================================================================
   Base - Reset, Typography, CSS Custom Properties
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
    /* Colors - Main */
    --color-bg:          #f2f0ec;
    --color-bg-alt:      #E2DBD4;
    --color-gold:        #e7d296;
    --color-primary:     #453731;
    --color-dark:        #453731;
    --color-black:       #000000;
    --color-white:       #ffffff;
    --color-gray:        #D3D4D6;
    --color-gray-dark:   #6b7280;
    --color-border:      #e5e5e5;

    /* Formation Colors */
    --color-psp:         #b63434;
    --color-osp:         #8CAABE;
    --color-policja:     #0a1a2f;
    --color-pzl:         #2f3a2f;
    --color-mdp:         #b63434;
    --color-inne:        #453731;

    /* Typography */
    --font-body:    'Montserrat', system-ui, -apple-system, sans-serif;
    --font-heading: 'Montserrat', system-ui, -apple-system, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;

    /* Modular Scale 1.25 (base 16px) */
    --text-xs:   clamp(0.64rem, 0.6rem + 0.2vw, 0.75rem);
    --text-sm:   clamp(0.8rem, 0.75rem + 0.25vw, 0.875rem);
    --text-base: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
    --text-lg:   clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
    --text-xl:   clamp(1.15rem, 1.05rem + 0.5vw, 1.25rem);
    --text-2xl:  clamp(1.3rem, 1.1rem + 1vw, 1.563rem);
    --text-3xl:  clamp(1.5rem, 1.2rem + 1.5vw, 1.953rem);
    --text-4xl:  clamp(1.8rem, 1.3rem + 2.5vw, 2.441rem);
    --text-5xl:  clamp(2.1rem, 1.4rem + 3.5vw, 3.052rem);

    /* Spacing */
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  24px;
    --space-6:  32px;
    --space-8:  48px;
    --space-10: 64px;
    --space-12: 80px;

    /* Layout */
    --max-width: 1280px;
    --header-height: 94px;
    --top-bar-height: 40px;

    /* Border Radius */
    --radius-sm:    4px;
    --radius-md:    8px;
    --radius-lg:    12px;
    --radius-badge: 20px;
    --radius-full:  9999px;

    /* Shadows */
    --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg:  0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl:  0 20px 48px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 550ms ease;
}

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

/* Ensure [hidden] always wins over display:flex/grid overrides in component CSS */
[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden; /* prevents fixed panels (mini-cart, inquiry, mobile-nav) from creating horizontal scroll on mobile */
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-dark);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden; /* iOS Safari requires overflow-x:hidden on body too, not just html */
}

/* Reserve space for fixed mobile bottom nav so last section is not hidden under it */
@media (max-width: 1023px) {
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
}

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

a {
    color: inherit;
    text-decoration: none;
}

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

ul, ol {
    list-style: none;
}

input,
select,
textarea {
    font: inherit;
    color: inherit;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-black);
}

h4, h5, h6 {
    font-weight: 600;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

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

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

.skip-link:focus {
    position: fixed;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 10000;
    padding: var(--space-3) var(--space-5);
    background: var(--color-dark);
    color: var(--color-white);
    font-weight: 600;
    clip: auto;
    width: auto;
    height: auto;
}

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

/* ---------- Utility ---------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--space-4);
}

/* Lucide icon sizing */
.icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.icon--sm {
    width: 18px;
    height: 18px;
}

.icon--xs {
    width: 14px;
    height: 14px;
}

.icon--md {
    width: 28px;
    height: 28px;
}

.icon--lg {
    width: 32px;
    height: 32px;
}
