/*
 * base.css — the shop's element defaults, the page rhythm and the layout roles. Every value is a
 * token of tokens.css (A3); the classes of the theme's own markup carry the sz-shop- prefix.
 * Loaded after tokens.css and p13n.css, before the component and page stylesheets.
 *
 * Neither the GeneratePress stylesheets nor the general WooCommerce stylesheet is loaded
 * (docs/decisions.md: 2026-11-22 — A child theme váza), so this file is the whole base: the box
 * model, the text and headings, links, the focus ring, the screen-reader text and the content
 * column. It follows the website's base layer (src/styles/global.css): h1–h3 in the heading
 * font, h4–h6 in the body font, all text in ink, one focus ring for every interactive element.
 */

/*
 * The layout and rhythm roles, named once (the website's K18 / K19 names, so the Personalizer
 * pairing reads the same variables):
 *   --space-part      between the parts of a section
 *   --pad-card        inside a card
 *   --container-padding-inline
 *                     the content column's side padding, fluid 16 → 32 px
 *                     (components.layout.container_padding_inline)
 *   --header-clearance
 *                     where a sticky element stops under the header; the shop's header does not
 *                     float over the page, so a plain step is enough (the Personalizer's
 *                     integration guide, docs/integration-web.md: var(--space-4))
 *   --underline-offset
 *                     a text link's underline, a fifth of its own size under the text
 *   --layer-skip      the skip link's stacking layer (Brain components.layout.layers.skip_link)
 */
:root {
  --space-part: var(--space-7);
  --pad-card: var(--space-5);
  --container-padding-inline: clamp(var(--space-4), 4vw, var(--space-6));
  --header-clearance: var(--space-4);
  --underline-offset: 0.2em;
  --layer-skip: 100;
}

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

/* 1 rem = 16 px: the reader's own font size, never a theme's (docs/spec.md, 2. Architektúra). */
html {
  font-size: 100%;
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-size: var(--text-body);
  font-weight: var(--text-body-weight);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* A dark band flips the semantic variables (tokens.css); the band paints itself with them. */
[data-tone="inverse"] {
  background-color: var(--color-background);
  color: var(--color-text);
}

/*
 * Form controls take the text's font instead of the browser's own, and never grow wider than
 * their column (a `cols`/`size` attribute would push a 375 px page sideways).
 */
button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--space-4);
  color: var(--color-text);
  text-wrap: balance;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
}

h1 {
  font-size: var(--text-h1);
  font-weight: var(--text-h1-weight);
  line-height: var(--leading-h1);
}

h2 {
  font-size: var(--text-h2);
  font-weight: var(--text-h2-weight);
  line-height: var(--leading-h2);
}

h3 {
  font-size: var(--text-h3);
  font-weight: var(--text-h3-weight);
  line-height: var(--leading-h3);
}

h4,
h5,
h6 {
  font-family: var(--font-body);
  font-weight: var(--text-h4-weight);
  line-height: var(--leading-h4);
}

h4 {
  font-size: var(--text-h4);
}

h5,
h6 {
  font-size: var(--text-body);
}

p,
ul,
ol,
dl,
table,
figure,
blockquote {
  margin: 0 0 var(--space-4);
}

p {
  text-wrap: pretty;
}

small {
  font-size: var(--text-small);
  line-height: var(--leading-small);
}

a {
  color: var(--color-text);
  text-underline-offset: var(--underline-offset);
}

/*
 * One visible focus ring on every interactive element (color.role.focus, 3 px ring, 2 px offset);
 * on a [data-tone="inverse"] band --color-focus is the inverse focus colour.
 */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-sm);
}

img,
video {
  max-width: 100%;
  height: auto;
}

/* An inline icon without a viewBox has no ratio: its height attribute stays. */
svg {
  max-width: 100%;
}

/*
 * The screen-reader text of WordPress and WooCommerce (labels, the skip link): hidden until it
 * takes the focus.
 */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  top: var(--space-2);
  left: var(--space-2);
  z-index: var(--layer-skip);
  width: auto;
  height: auto;
  padding: var(--space-3) var(--space-4);
  margin: 0;
  clip-path: none;
  font-size: var(--text-small);
  font-weight: var(--text-label-weight);
  color: var(--color-text);
  text-decoration: none;
  background-color: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* The content column: the header, the page (#page) and the footer stand on the same line. */
.sz-shop-container {
  width: 100%;
  max-width: var(--size-container);
  margin-inline: auto;
  padding-inline: var(--container-padding-inline);
}

/* The page between the header and the footer: the rhythm of the sections. */
.site-content {
  padding-block: var(--space-6) var(--space-part);
}

/* The header and footer placeholders (phase 13 gives them their content). */
.sz-shop-header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.sz-shop-header__inner,
.sz-shop-footer__inner {
  display: flex;
  align-items: center;
  min-height: var(--size-button);
  padding-block: var(--space-3);
}

.sz-shop-header__name {
  font-family: var(--font-heading);
  font-size: var(--text-h4);
  font-weight: var(--text-h4-weight);
  line-height: var(--leading-h4);
  text-decoration: none;
}

.sz-shop-footer {
  border-top: 1px solid var(--color-border);
}

.sz-shop-footer__name {
  margin: 0;
  font-size: var(--text-small);
  color: var(--color-text-muted);
}

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