/* Базові стилі проекту
 * 
 * Цей файл містить базові стилі, які застосовуються після normalize.css
 * 
 * ПРАВИЛА:
 * - НЕ дублювати правила з normalize.css
 * - НЕ використовувати !important для перевизначення normalize
 * - Використовувати специфічність замість !important
 * - Використовувати CSS custom properties для кольорів/відступів
 * - Використовувати BEM методологію для компонентів
 */

/* ============================================================================ */

/* CSS CUSTOM PROPERTIES (ЗМІННІ)                                              */

/* ============================================================================ */

:root {
  /* Кольори */
  --color-primary: #007bff;
  --color-secondary: #6c757d;
  --color-success: #28a745;
  --color-danger: #dc3545;
  --color-warning: #ffc107;
  --color-info: #17a2b8;
  --color-text: #212529;
  --color-text-muted: #6c757d;
  --color-bg: #ffffff;
  --color-bg-light: #f8f9fa;
  --color-bg-dark: #070707;
  --color-text-light: #ffffff;

  /* Safe area для iOS (notch/Dynamic Island) */
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);

  /* Відступи */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;

  /* Шрифти */
  --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-display: 'Montserrat', sans-serif;
  --font-family-display-bold: 'Oswald', sans-serif;
  --font-family-hero: 'Rubik Scribble', sans-serif;
  --font-family-mono: "Courier New", monospace;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2.5rem;
  --font-size-4xl: 3.5rem;
  --font-size-6xl: 6rem;

  /* Інше */
  --border-radius: 0.25rem;
  --transition-speed: 0.2s;

  /* Z-index layers (систематизація для уникнення конфліктів) */
  --z-index-base: 1;
  --z-index-dropdown: 100;
  --z-index-sticky: 200;
  --z-index-fixed: 300;
  --z-index-modal-backdrop: 400;
  --z-index-modal: 500;
  --z-index-popover: 600;
  --z-index-tooltip: 700;

  /* Header використовує fixed layer */
  --z-index-header: var(--z-index-fixed);

  /* Transition timings (додавлення для більш швидких анімацій) */
  --transition-fast: 0.15s;
  --transition-base: 0.3s;
  --transition-slow: 0.7s;

  /* Header розміри */
  --header-capsule-mobile-open-width: 90vw; /* Ширина меню на мобільному при відкритті (100vw - 10%) */
  --header-capsule-desktop-open-width: 30vw; /* Ширина меню на десктопі при відкритті */
}

/* ============================================================================ */

/* ШРИФТИ (@font-face)                                                         */

/* ============================================================================ */

@font-face {
  font-family: 'Electronica Display Stencil';
  src: url('../fonts/Electronica Display Stencil.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ============================================================================ */

/* БАЗОВІ СТИЛІ                                                                */

/* ============================================================================ */

main {
  position: relative;
  z-index: 1;
}

body {
  overscroll-behavior: none;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  color: var(--color-text-light);
  background-color: var(--color-bg-dark);
  line-height: 1.5;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../img/Logoabout.png');
  background-size: auto 70vh;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
}

/* Mobile: логотип 95% ширини */
@media (width <= 767px) {
  body::before {
    background-size: 95% auto;
  }
}

/* iOS Safari */
@supports (-webkit-touch-callout: none) {
  body::before {
    height: 100vh; /* Fallback */
    height: 100dvh;
    height: -webkit-fill-available;
  }
}


/* ============================================================================ */

/* УТИЛІТАРНІ КЛАСИ                                                            */

/* ============================================================================ */

/* Відступи */
.mt-sm {
  margin-top: var(--spacing-sm);
}

.mt-md {
  margin-top: var(--spacing-md);
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

.mb-sm {
  margin-bottom: var(--spacing-sm);
}

.mb-md {
  margin-bottom: var(--spacing-md);
}

.mb-lg {
  margin-bottom: var(--spacing-lg);
}

/* Текст */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--color-text-muted);
}

/* HTMX індикатори завантаження */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-request.htmx-indicator {
  display: inline-block;
}

/* ============================================================================ */

/* ДОДАЙТЕ СВОЇ СТИЛІ НИЖЧЕ                                                    */

/* ============================================================================ */