﻿/*
|--------------------------------------------------------------------------
| ZAWARO THEME SYSTEM — SHARED BASE LAYER
|--------------------------------------------------------------------------
|
| Task: P4-ZTS-0003
|
| Dependency:
|   - zawaro-tokens.css
|
| Scope:
|   - global reset
|   - document defaults
|   - typography
|   - links
|   - images and media
|   - forms font inheritance
|   - focus visibility
|   - selection
|   - accessibility helpers
|   - reduced-motion support
|
| This file intentionally contains no page-specific, frontend-specific,
| backend-specific, login, card, table, navigation, or profile styling.
|
*/

/* -------------------------------------------------------------------------
   Box model and document baseline
   ------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--z-page-bg);
    color-scheme: inherit;
    font-family: var(--z-font-sans);
    line-height: var(--z-line-height-normal);
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--z-page-bg);
    color: var(--z-text);
    font-family: var(--z-font-sans);
    font-size: var(--z-font-size-md);
    font-weight: var(--z-font-weight-regular);
    line-height: var(--z-line-height-normal);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition:
        background-color var(--z-transition-normal),
        color var(--z-transition-normal);
}

/* -------------------------------------------------------------------------
   Typography
   ------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-block-start: 0;
    margin-block-end: var(--z-space-4);
    color: var(--z-text-strong);
    font-family: var(--z-font-sans);
    font-weight: var(--z-font-weight-bold);
    line-height: var(--z-line-height-tight);
}

h1 {
    font-size: var(--z-font-size-4xl);
}

h2 {
    font-size: var(--z-font-size-3xl);
}

h3 {
    font-size: var(--z-font-size-2xl);
}

h4 {
    font-size: var(--z-font-size-xl);
}

h5 {
    font-size: var(--z-font-size-lg);
}

h6 {
    font-size: var(--z-font-size-md);
}

p {
    margin-block-start: 0;
    margin-block-end: var(--z-space-4);
}

small {
    font-size: var(--z-font-size-sm);
}

strong,
b {
    font-weight: var(--z-font-weight-bold);
}

em,
i {
    font-style: italic;
}

code,
kbd,
samp,
pre {
    font-family: var(--z-font-mono);
}

code {
    font-size: 0.95em;
}

pre {
    margin: 0;
    overflow: auto;
    white-space: pre-wrap;
}

blockquote {
    margin: 0 0 var(--z-space-4);
    padding-inline-start: var(--z-space-4);
    border-inline-start: var(--z-border-width-strong) solid var(--z-border-strong);
    color: var(--z-text-muted);
}

hr {
    height: 0;
    margin: var(--z-space-6) 0;
    border: 0;
    border-top: var(--z-border-width) solid var(--z-divider);
}

/* -------------------------------------------------------------------------
   Links
   ------------------------------------------------------------------------- */

a {
    color: var(--z-primary);
    text-decoration: none;
    text-underline-offset: 0.16em;
    transition:
        color var(--z-transition-fast),
        text-decoration-color var(--z-transition-fast);
}

a:hover {
    color: var(--z-primary-hover);
    text-decoration: underline;
}

a:active {
    color: var(--z-primary-active);
}

/* -------------------------------------------------------------------------
   Lists
   ------------------------------------------------------------------------- */

ul,
ol {
    margin-block-start: 0;
    margin-block-end: var(--z-space-4);
    padding-inline-start: var(--z-space-6);
}

li + li {
    margin-block-start: var(--z-space-1);
}

/* -------------------------------------------------------------------------
   Media
   ------------------------------------------------------------------------- */

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
    display: block;
    max-width: 100%;
}

img,
video {
    height: auto;
}

svg {
    fill: currentColor;
}

figure {
    margin: 0;
}

figcaption {
    margin-block-start: var(--z-space-2);
    color: var(--z-text-muted);
    font-size: var(--z-font-size-sm);
}

/* -------------------------------------------------------------------------
   Forms and controls baseline
   ------------------------------------------------------------------------- */

button,
input,
optgroup,
select,
textarea {
    margin: 0;
    color: inherit;
    font: inherit;
    line-height: inherit;
}

button,
select {
    text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
    appearance: button;
    -webkit-appearance: button;
}

button,
[role="button"] {
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

textarea {
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--z-input-placeholder);
    opacity: 1;
}

fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

legend {
    padding: 0;
    color: inherit;
}

label {
    display: inline-block;
}

/* -------------------------------------------------------------------------
   Tables baseline
   ------------------------------------------------------------------------- */

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

caption {
    margin-block-end: var(--z-space-2);
    color: var(--z-text-muted);
    text-align: start;
}

/* -------------------------------------------------------------------------
   Focus and interaction
   ------------------------------------------------------------------------- */

:focus {
    outline: none;
}

:focus-visible {
    outline: none;
    box-shadow: var(--z-focus-ring);
}

[tabindex="-1"]:focus {
    outline: none;
    box-shadow: none;
}

/* -------------------------------------------------------------------------
   Selection and browser details
   ------------------------------------------------------------------------- */

::selection {
    background: var(--z-primary-soft);
    color: var(--z-text-strong);
}

::-moz-selection {
    background: var(--z-primary-soft);
    color: var(--z-text-strong);
}

::-webkit-scrollbar {
    width: 0.75rem;
    height: 0.75rem;
}

::-webkit-scrollbar-track {
    background: var(--z-surface-muted);
}

::-webkit-scrollbar-thumb {
    border: 0.2rem solid var(--z-surface-muted);
    border-radius: var(--z-radius-pill);
    background: var(--z-border-strong);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--z-text-soft);
}

/* -------------------------------------------------------------------------
   Hidden and utility semantics
   ------------------------------------------------------------------------- */

[hidden] {
    display: none !important;
}

template {
    display: none;
}

summary {
    cursor: pointer;
}

address {
    font-style: normal;
}

/* -------------------------------------------------------------------------
   Accessibility helpers
   ------------------------------------------------------------------------- */

.z-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.z-sr-only-focusable:focus,
.z-sr-only-focusable:active {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

.z-skip-link {
    position: fixed;
    inset-block-start: var(--z-space-3);
    inset-inline-start: var(--z-space-3);
    z-index: var(--z-zindex-toast);
    padding: var(--z-space-3) var(--z-space-4);
    border-radius: var(--z-radius-md);
    background: var(--z-primary);
    color: var(--z-primary-contrast);
    font-weight: var(--z-font-weight-semibold);
    transform: translateY(-200%);
    transition: transform var(--z-transition-fast);
}

.z-skip-link:focus {
    color: var(--z-primary-contrast);
    text-decoration: none;
    transform: translateY(0);
}

/* -------------------------------------------------------------------------
   Motion and print
   ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    *,
    *::before,
    *::after {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        background: #FFFFFF !important;
        color: #000000 !important;
    }

    a,
    a:visited {
        color: #000000 !important;
        text-decoration: underline;
    }
}
