/* ============================================================
   base.css — Zazenware MVP1
   Reset, element defaults, typography, accessibility defaults.
   No class names here — targets HTML elements only.
   Depends on: tokens.css
   ============================================================ */

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

/* -------------------------------------------------------
   DOCUMENT
------------------------------------------------------- */
html {
  font-size: 100%;           /* 16px base; rem units scale from here */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--zw-font-body);
  font-size: var(--zw-text-base);
  line-height: var(--zw-leading-normal);
  background-color: var(--zw-bg);
  color: var(--zw-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--zw-transition-base), color var(--zw-transition-base);
}

/* Main content grows to fill available space */
main {
  flex: 1 0 auto;
}

/* -------------------------------------------------------
   HEADINGS
   h1 / h2: blackletter display, always lowercase.
   h3–h6:   typewriter body font.
------------------------------------------------------- */
h1,
h2 {
  font-family: var(--zw-font-display);
  text-transform: lowercase;
  font-weight: 400;          /* UnifrakturMaguntia has its own visual weight */
  line-height: var(--zw-leading-tight);
}

h1 { font-size: var(--zw-text-4xl); }
h2 { font-size: var(--zw-text-3xl); }

h3 {
  font-family: var(--zw-font-body);
  font-size: var(--zw-text-xl);
  font-weight: 700;
  line-height: var(--zw-leading-tight);
}

h4 {
  font-family: var(--zw-font-body);
  font-size: var(--zw-text-lg);
  font-weight: 700;
  line-height: var(--zw-leading-tight);
}

h5,
h6 {
  font-family: var(--zw-font-body);
  font-size: var(--zw-text-base);
  font-weight: 700;
  line-height: var(--zw-leading-tight);
}

/* Mobile heading scale */
@media (max-width: 47.999em) {
  h1 { font-size: var(--zw-text-3xl); }
  h2 { font-size: var(--zw-text-2xl); }
  h3 { font-size: var(--zw-text-lg);  }
}

/* -------------------------------------------------------
   PARAGRAPHS & INLINE TEXT
------------------------------------------------------- */
p {
  margin-bottom: var(--zw-space-4);
  max-width: 70ch;
}

p:last-child {
  margin-bottom: 0;
}

strong { font-weight: 700; }
em     { font-style: italic; }

small {
  font-size: var(--zw-text-sm);
  color: var(--zw-text-muted);
}

/* -------------------------------------------------------
   LISTS
------------------------------------------------------- */
ul,
ol {
  padding-left: var(--zw-space-6);
  margin-bottom: var(--zw-space-4);
}

li {
  margin-bottom: var(--zw-space-1);
  line-height: var(--zw-leading-normal);
}

/* -------------------------------------------------------
   LINKS
------------------------------------------------------- */
a {
  color: var(--zw-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--zw-transition-fast);
}

a:hover {
  color: var(--zw-link-hover);
}

a:focus-visible {
  outline: 3px solid var(--zw-focus-ring);
  outline-offset: 3px;
  border-radius: var(--zw-radius-sm);
}

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

img {
  font-style: italic;        /* Style alt text visually when image fails */
}

/* -------------------------------------------------------
   FORM ELEMENT DEFAULTS
   Full component styles are in components.css.
------------------------------------------------------- */
button,
input,
textarea,
select,
optgroup {
  font-family: var(--zw-font-body);
  font-size: var(--zw-text-base);
  line-height: var(--zw-leading-normal);
}

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

/* -------------------------------------------------------
   HORIZONTAL RULE
------------------------------------------------------- */
hr {
  border: none;
  border-top: var(--zw-border-width) solid var(--zw-border);
  margin: var(--zw-space-8) 0;
}

/* -------------------------------------------------------
   BLOCKQUOTE
------------------------------------------------------- */
blockquote {
  border-left: var(--zw-border-width-heavy) solid var(--zw-accent);
  padding-left: var(--zw-space-6);
  margin: var(--zw-space-6) 0;
  color: var(--zw-text-muted);
  font-style: italic;
}

/* -------------------------------------------------------
   CODE
------------------------------------------------------- */
code,
kbd,
samp,
pre {
  font-family: var(--zw-font-body);
  font-size: 0.9em;
}

pre {
  background-color: var(--zw-surface);
  border: var(--zw-border-width) solid var(--zw-border);
  padding: var(--zw-space-4);
  overflow-x: auto;
}

/* -------------------------------------------------------
   TABLES
------------------------------------------------------- */
table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  text-align: left;
  padding: var(--zw-space-3) var(--zw-space-4);
  border-bottom: var(--zw-border-width) solid var(--zw-border);
}

th {
  font-weight: 700;
  background-color: var(--zw-surface);
  font-size: var(--zw-text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* -------------------------------------------------------
   SELECTION
------------------------------------------------------- */
::selection {
  background-color: var(--zw-block);
  color: var(--zw-block-text);
}

/* -------------------------------------------------------
   GLOBAL FOCUS VISIBLE
   Individual components may refine this further.
------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--zw-focus-ring);
  outline-offset: 3px;
}

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

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