/* ============================
   KHURAL.MN _system/base.css
   Reset + typography + layout primitives shared by ALL themes.
   Colors come from each theme's palette.css (loaded BEFORE this file).
   ============================ */

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--ff-sans);
    font-size: var(--fs-base);
    color: var(--c-text);
    background: var(--c-bg);
    line-height: var(--lh-base);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--motion-fast); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--s-5);
}

h1, h2, h3, h4 {
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--c-text);
    letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

/* Section rhythm */
.section { padding: var(--s-7) 0; }
.section + .section { padding-top: 0; }

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

/* A11y — focus visible */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--c-brand);
    outline-offset: 2px;
}

/* A11y — skip-to-content */
.skip-link {
    position: absolute;
    top: -40px;
    left: var(--s-4);
    z-index: 999;
    background: var(--c-brand);
    color: #fff;
    padding: var(--s-2) var(--s-4);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    text-decoration: none;
    transition: top var(--motion-fast);
}
.skip-link:focus { top: var(--s-2); }

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
