/*
 * EduGames - Interactive Learning Games
 * (c) 2025-2026 Prof. N. All rights reserved.
 *
 * File:    styles/core/base.css
 * Updated: 2026-10-03 18:56
 * Purpose: The base of every page: a small reset, the text styles, the keyboard focus ring and the helpers
 *          [hidden] and .sr-only.
 */

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

/* Remove the browser's margins and borders from the elements the pages use */
html, body, div, span, h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, address, cite, code, img, small, strike, strong, sub, sup,
dl, dt, dd, ol, ul, li, fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, figure, figcaption, footer, header,
menu, nav, section, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  vertical-align: baseline;
}

article, aside, figcaption, figure, footer, header, nav, section, main {
  display: block;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--text-primary);
  text-rendering: optimizeSpeed;
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  color: inherit;
}

input, button, textarea, select {
  font: inherit;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

::selection {
  background-color: rgba(0, 123, 255, 0.25);
}

/* The hidden attribute must win over component display rules */
[hidden] {
  display: none !important;
}

/* Visually hidden but available to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----- Text ----- */

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--space-4);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-sm);
}

h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }
h4 { font-size: var(--font-size-base); }
h5, h6 { font-size: var(--font-size-sm); }

p {
  margin-top: 0;
  margin-bottom: var(--space-4);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

ul, ol {
  margin-top: 0;
  margin-bottom: var(--space-4);
  padding-left: var(--space-5);
  list-style: none;
}

li {
  margin-bottom: var(--space-2);
}

strong, b { font-weight: var(--font-weight-bold); }
em, i { font-style: italic; }
small { font-size: var(--font-size-xs); }

@media (max-width: 768px) {
  h1 { font-size: calc(var(--font-size-2xl) * 0.9); }
  h2 { font-size: calc(var(--font-size-xl) * 0.9); }
}

/* ----- Touch and keyboard ----- */

/* No double-tap zoom on tappable elements */
button, select, a, .card {
  touch-action: manipulation;
}

/* Visible keyboard focus */
button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
