/*
 * Masuria Esport - base layer (base.css)
 * Reset, document defaults, container, accessibility helpers. Requires tokens.css + fonts.css (loaded before this file).
 * Anything marked "ADDED: not in design" is a robustness / accessibility extra that does not change the desktop look.
 */

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--msr-bg);
  color-scheme: dark; /* ADDED: not in design - dark scrollbars / form controls, no white flash */
  scroll-behavior: smooth; /* ADDED: not in design - disabled again under prefers-reduced-motion below */
  /* ADDED: not in design - anchor jumps land below the fixed header (and the WP admin bar when it is shown) */
  scroll-padding-top: calc(var(--msr-header-h) + var(--msr-adminbar-h));
}

/* ADDED: not in design - keep anchor offset correct while the WP admin bar is visible */
:root:has(body.admin-bar) {
  --msr-adminbar-h: 32px;
}

@media (max-width: 782px) {
  :root:has(body.admin-bar) {
    --msr-adminbar-h: 46px;
  }
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/*
 * Media: never overflow the container. `height: auto` is deliberately NOT set globally -
 * the design's icons are rendered at an exact width x height (their SVGs use preserveAspectRatio="none").
 */
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   Document
   ========================================================================== */

body {
  background-color: var(--msr-bg);
  color: var(--msr-white);
  font-family: var(--msr-font-body);
  font-size: var(--msr-fs-16);
  font-weight: var(--msr-fw-regular);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip; /* ADDED: not in design - off-canvas decoration (hero watermark, offer badge overhang) must never create a horizontal scrollbar */
}

/* Headings: Barlow Condensed bold italic is the design's heading face. Sizes come from the components. */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--msr-font-heading);
  font-weight: var(--msr-fw-bold);
  font-style: italic;
  line-height: 1.1;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   Form controls / buttons
   ========================================================================== */

button,
input,
select,
textarea {
  margin: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

button {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

button:disabled,
[aria-disabled='true'] {
  cursor: not-allowed;
}

/* ==========================================================================
   Lists - anything carrying an msr-* class is a UI list, not prose
   ========================================================================== */

:where(ul, ol)[class*='msr-'] {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ==========================================================================
   Layout helper: 1248px content column with fluid side gutter (96px at 1440px)
   ========================================================================== */

.msr-container {
  width: 100%;
  max-width: calc(var(--msr-container) + 2 * var(--msr-gutter));
  margin-inline: auto;
  padding-inline: var(--msr-gutter);
}

/* ==========================================================================
   Accessibility (ADDED: not in design)
   ========================================================================== */

/* WordPress standard visually-hidden helper */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  top: 5px;
  left: 5px;
  z-index: var(--msr-z-skip-link);
  width: auto;
  height: auto;
  padding: var(--msr-space-16) var(--msr-space-24);
  clip: auto !important;
  clip-path: none;
  background-color: var(--msr-gold);
  color: var(--msr-on-gold);
  font-size: var(--msr-fs-14);
  line-height: normal;
  text-decoration: none;
}

/* Skip link: off-screen until focused (works with or without .screen-reader-text) */
.skip-link {
  position: absolute;
  top: 0;
  left: var(--msr-space-16);
  z-index: var(--msr-z-skip-link);
  padding: var(--msr-space-12) var(--msr-space-24);
  background-color: var(--msr-gold);
  color: var(--msr-on-gold);
  font-family: var(--msr-font-body);
  font-size: var(--msr-fs-12);
  font-weight: var(--msr-fw-bold);
  line-height: var(--msr-lh-16);
  letter-spacing: var(--msr-ls-wider);
  text-transform: uppercase;
  transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto !important;
  clip-path: none;
  transform: translateY(var(--msr-adminbar-h, 0px));
}

/* Gold focus ring for keyboard users; mouse clicks do not show it */
:focus-visible {
  outline: 2px solid var(--msr-gold);
  outline-offset: 3px;
}

/* Non-interactive skip-link target (e.g. <main tabindex="-1">) gets focus programmatically - no ring around the whole page */
[tabindex='-1']:focus-visible {
  outline: 0;
}

::selection {
  background-color: var(--msr-gold);
  color: var(--msr-on-gold);
}

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

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

/* ==========================================================================
   Generic content (ADDED: not in design) - posts / pages rendered by the default templates
   ========================================================================== */

:where(.entry-content, .msr-prose) {
  color: var(--msr-white-70);
  line-height: var(--msr-lh-relaxed);
}

:where(.entry-content, .msr-prose) > * + * {
  margin-top: 1.25em;
}

:where(.entry-content, .msr-prose) :is(h1, h2, h3, h4, h5, h6) {
  margin-top: 1.75em;
  color: var(--msr-white);
  letter-spacing: var(--msr-ls-wide);
  text-transform: uppercase;
}

:where(.entry-content, .msr-prose) h1 {
  font-size: var(--msr-fs-48);
}

:where(.entry-content, .msr-prose) h2 {
  font-size: var(--msr-fs-36);
}

:where(.entry-content, .msr-prose) h3 {
  font-size: var(--msr-fs-24);
}

:where(.entry-content, .msr-prose) :is(h4, h5, h6) {
  font-size: var(--msr-fs-20);
}

:where(.entry-content, .msr-prose) a {
  color: var(--msr-gold);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

:where(.entry-content, .msr-prose) :is(ul, ol) {
  padding-left: 1.5em;
}
