/* 3. BASE.CSS - Normalizacja, Reset i Zmienne strukturalne. */

:root {
  /* Definicja modułu bazowego (szerokość kolumny mobile) */
  --module-base: 22.5rem;
}

/* --- NOWA NORMALIZACJA --- */

html {
	box-sizing: border-box;
    /* Zapobiega systemowym gestom nawigacji na poziomie HTML */
    overscroll-behavior: none; 
}

*, *:before, *:after {
	box-sizing: inherit;
}

body {
	margin: 0;
	width: 100vw;
	width: 100dvw;
	overflow: hidden; /* Pamiętaj, aby mieć wewnątrz kontener z overflow-y: auto */

	/* Style globalne aplikacji (fonty i kolory) */
	font-family: 'Dosis', sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-weight: 400; 
	line-height: 1.6;
	background-color: var(--bg-body);
	color: var(--text-main);

    /* Wyłączenie zaznaczania tekstu w całej aplikacji */
    -webkit-user-select: none; /* Safari/Chrome */
    user-select: none;         /* Standard */

    /* NOWOŚĆ: BLOKADA GESTÓW SYSTEMOWYCH */
    /* 1. Zapobiega "odbijaniu" strony i gestom nawigacji wstecz/dalej */
    overscroll-behavior: none;
    /* 2. Pozwala przeglądarce obsługiwać TYLKO przewijanie pionowe (pan-y).
          Wszelkie gesty poziome (pan-x) są ignorowane przez przeglądarkę,
          dzięki czemu Twój JS może je obsłużyć bez wywoływania "wstecz". */
    touch-action: pan-y;
}

/* Wyjątek dla pól formularzy - tam zaznaczanie musi działać */
input, textarea, select, [contenteditable] {
    -webkit-user-select: text;
    user-select: text;
    cursor: text;
    /* W polach tekstowych chcemy domyślne zachowanie dotyku */
    touch-action: manipulation; 
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

button,
input {
	overflow: hidden;
}

button,
select {
	text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
	-webkit-appearance: button;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
	border-style: none;
	padding: 0;
}

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

h1, h2, h3, h4, h5, h6, p {
	margin: 0;
	font-size: 1em;
	font-weight: 400;
}

strong, b {
	font-weight: 600;
}

button {
	font-weight: 600;
}

a {
	text-decoration: none;
  color: inherit;
}

img, video, iframe {
  display: block;
  max-width: 100%;
  height: auto;
}

:active {
  -webkit-tap-highlight-color: transparent;
}

button, input {
    background-color: transparent;
    border: none;
}

:hover, :active {
    border: none;
    outline: none;
}

:focus-visible {
    outline: 0.125em solid currentColor;
    outline-offset: 0.125em;
}

[data-column] {
	display: flex;
	flex-direction: column;
	position: relative;
}

[data-row] {
	display: flex;
	flex-direction: row;
	position: relative;
  align-items: center;
}

/* --- EKRAN BLOKADY (Orientation Lock) --- 
 * Jest to warstwa nakładana na całą stronę, 
 * aktywowana przez odpowiednie Media Queries w 4.desktop.css
 */
body::after {
  content: "Obróć urządzenie";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  background-color: black;
  color: white;
  z-index: 9999;
  
  display: flex; /* Flexbox do wycentrowania komunikatu */
  justify-content: center;
  align-items: center;
  
  font-size: 2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.25rem;
  
  /* Domyślnie ukryte */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Klasa pomocnicza, gdybyśmy chcieli wymusić blokadę z JS, 
   ale główna logika opiera się na CSS Media Queries */
body.orientation-locked::after {
  opacity: 1;
  pointer-events: all;
}