/* ========================================
   ERMIAS — Design Tokens (CSS Custom Properties)
   Единый источник цветов, типографики, spacing
   ======================================== */

/* ========================================
   0. FOCUS RESET — Hamburger Button (global)
   ======================================== */
.header__hamburger-btn:focus,
.header__hamburger-btn:focus-visible,
.header__hamburger-btn:active {
    outline: none !important;
    box-shadow: none !important;
}

/* ========================================
   1. DARK THEME (default) — Base Tokens
   ======================================== */
:root {
    /* --- Background Colors --- */
    --ed-bg-primary:      #0a0f0d;
    --ed-bg-secondary:    #111916;
    --ed-bg-tertiary:     #0d1210;
    --ed-bg-card:         #111916;
    --ed-bg-input:        #1a2520;

    /* --- Accent Colors --- */
    --ed-accent:          #00e676;
    --ed-accent-hover:    #00c853;
    --ed-accent-subtle:   rgba(0, 230, 118, 0.08);

    /* --- Text Colors --- */
    --ed-text-primary:    #ffffff;
    --ed-text-secondary:  #8a9ba0;
    --ed-text-body:       #c5d0d1;

    /* --- Border Colors --- */
    --ed-border:          #1e2a25;
    --ed-border-light:    #2a3a33;

    /* --- Link Colors --- */
    --ed-link:            #00e676;
    --ed-link-hover:      #ffffff;

    /* --- Typography --- */
    --ed-font-family:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ed-font-size-hero:  clamp(2rem, 5.5vw, 3.75rem);
    --ed-font-size-h2:    clamp(1.5rem, 3vw, 2.25rem);
    --ed-font-size-body:  1rem;
    --ed-font-size-small: 0.875rem;

    /* --- Layout --- */
    --ed-max-width:       1200px;
    --ed-section-padding:  80px 24px;
    --ed-card-gap:        24px;
    --ed-container-padding: 0 24px;

    /* --- Touch Targets (WCAG 2.1) --- */
    --ed-touch-target:    44px;

    /* --- Logo Tokens --- */
    --logo-font-family:       'Inter', sans-serif;
    --logo-font-size-desktop: 2rem;
    --logo-font-size-tablet:  1.5rem;
    --logo-font-weight:       700;
    --logo-letter-spacing:    0.05em;
    --logo-text-transform:    uppercase;
    --logo-line-height:       1;
    --logo-gradient-start:    #00c853;
    --logo-gradient-end:      #00e676;
}

/* ========================================
   2. LIGHT THEME Override
   ======================================== */
[data-theme="light"] {
    --ed-bg-primary:      #f5f7fa;
    --ed-bg-secondary:    #ffffff;
    --ed-bg-tertiary:     #eef1f5;
    --ed-bg-card:         #ffffff;
    --ed-bg-input:        #f0f2f5;

    --ed-accent:          #00c853;
    --ed-accent-hover:    #00a844;
    --ed-accent-subtle:   rgba(0, 200, 83, 0.06);

    --ed-text-primary:    #1a1a2e;
    --ed-text-secondary:  #5f6b75;
    --ed-text-body:       #4a5568;

    --ed-border:          #e2e8f0;
    --ed-border-light:    #cbd5e0;

    --ed-link:            #00a844;
    --ed-link-hover:      #1a1a2e;
}

/* ========================================
   3. BODY / LAYOUT OVERRIDES — Hub Page
   Тёмный фон на главной странице
   ======================================== */
body {
    background-color: var(--ed-bg-primary) !important;
}

.main-content-1,
#main-content-background-1 {
    background: var(--ed-bg-primary) !important;
}

.body-content {
    background: var(--ed-bg-primary) !important;
}

/* Скрываем светлые декоративные элементы фона лендинга */
.homepage-background,
.homepage-background-element-1,
.homepage-background-element-2 {
    display: none !important;
}

/* ========================================
   4. BODY / LAYOUT OVERRIDES — Sub Pages
   Тёмный фон на внутренних страницах
   ======================================== */
body.sub-page {
    background-color: var(--ed-bg-primary) !important;
    color: var(--ed-text-body) !important;
}

body.sub-page .main-content-1,
body.sub-page #main-content-background-1 {
    background: var(--ed-bg-primary) !important;
}

body.sub-page .body-content {
    background: var(--ed-bg-primary) !important;
}

body.sub-page .homepage-background,
body.sub-page .homepage-background-element-1,
body.sub-page .homepage-background-element-2 {
    display: none !important;
}

/* Prevent any element from overflowing viewport */
html, body {
    overflow-x: hidden !important;
    max-width: 100%;
}

.sp-page,
.sp-section,
.sp-section__container,
.sp-container,
.sp-page-header__container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Отступ основного контента, чтобы sticky-хедер не перекрывал */
body.sub-page .main-content-1 {
    padding-top: 0 !important;
}

body.sub-page .sp-page {
    margin-top: 0;
}