/* Explain: Base styles, typography, and global layout safeguards for consistent rendering. - */
* {
    box-sizing: border-box;
}

/* Custom pointer skriven u korist interaktivnog DOM kružića */
body.has-custom-cursor, body.has-custom-cursor * {
    cursor: none !important;
}

[x-cloak] { 
    display: none !important; 
}

html {
    background: var(--background-color);
    scroll-behavior: smooth;
    /* Dinamično skaliranje baza fonta u odnosu na širinu ekrana (skalira sve rem vrijednosti zadužene za veličine i razmake) */
    font-size: clamp(14px, 1vw + 10px, 18px);
    overflow-x: hidden;
    max-width: 100vw;
}

/* Accessiblity: Visible focus outline for keyboard users */
*:focus-visible {
    outline: 2px solid var(--text-color);
    outline-offset: 3px;
}

/* Accessibility: Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    overflow-x: hidden;
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-body);
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    max-width: 100vw;
    width: 100%;
}

/* Minimalna dopuštena veličina fonta 12px (Accessibility i čitljivost) */
.text-\\[9px\\],
.text-\\[10px\\],
.text-\\[11px\\] {
    font-size: 12px !important;
}

/* Globalna zaštita od probijanja (overflow) dugih riječi izvan okvira kontejnera */
h1, h2, h3, h4, h5, h6, p, a, span {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

main,
section,
article,
.card,
.btn,
button,
a {
    min-width: 0;
}

main,
section,
article {
    max-width: 100%;
    overflow-wrap: break-word;
}

img,
video,
canvas,
svg {
    max-width: 100%;
}

.btn {
    min-height: 3rem;
    height: auto;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.25;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:not(.btn) {
    white-space: normal;
    overflow-wrap: break-word;
}

@media (max-width: 767px) {
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }
}

/* Globalna harmonizacija tipografskih standarda za sve podstranice prema naslovnoj */
main h1:not([class*="text-[10px]"]):not([class*="text-xs"]) {
    font-size: clamp(2.25rem, 4vw, 4.5rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

main h2:not([class*="text-[10px]"]):not([class*="text-xs"]) {
    font-size: clamp(1.875rem, 3vw, 3rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

main h3:not([class*="text-[10px]"]):not([class*="text-xs"]) {
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    line-height: 1.2;
    text-wrap: balance;
}

main h4:not([class*="text-[10px]"]):not([class*="text-xs"]) {
    font-size: clamp(1.25rem, 1.5vw, 1.5rem);
    line-height: 1.3;
    text-wrap: balance;
}

main p:not([class*="text-[10px]"]):not([class*="text-[11px]"]):not([class*="text-xs"]) {
    line-height: 1.625 !important;
    font-weight: 300 !important;
    text-wrap: pretty !important;
}
