/* =============================================================
   LOJAL BILPLEIE — BASE LAYER
   Подключается после tokens.css, до components.css.
   Структура:
     1. Document base / типографика
     2. Container (responsive max-widths по Bootstrap 5)
     3. Row / Col 12-col grid system
     4. Utility classes: display, flex, alignment, spacing, text
     5. Form controls — базовые input/textarea/select
   ============================================================= */


/* ===========================================================
   1. DOCUMENT BASE / TYPOGRAPHY
   =========================================================== */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;           /* sticky-header offset для якорей */
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;                   /* Mulish 300 — как референс */
  line-height: 1.65;
  color: var(--color-fg);
  background-color: var(--color-bg);
  text-rendering: optimizelegibility;
  animation: fadeIn 1s ease;          /* плавный fade-in при загрузке */
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.page_wrapper {
  overflow: hidden;
  position: relative;
}

iframe { border: none; }

img, embed, object, video {
  height: auto;
  max-width: 100%;
}

img {
  border: none;
  vertical-align: middle;
  user-select: none;
}

a {
  outline: 0;
  display: inline-block;
  text-decoration: none;
  color: inherit;
  transition: var(--transition-bs);
}
a:active, a:focus, a:hover, a:visited { outline: 0; text-decoration: none; }

button {
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: var(--transition-bs);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  color: var(--color-fg);
  margin: 0 0 0.5em;
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
}

/* Базовые размеры из референса (десктоп) */
h1 { font-size: 66px; line-height: 73px; }
h2 { font-size: 40px; line-height: 55px; }
h3 { font-size: 28px; line-height: 38px; }
h4 { font-size: 22px; line-height: 32px; }
h5 { font-size: 18px; line-height: 28px; }
h6 { font-size: 16px; line-height: 24px; }

@media (max-width: 991.98px) {
  h1 { font-size: 48px; line-height: 56px; }
  h2 { font-size: 32px; line-height: 42px; }
}

@media (max-width: 575.98px) {
  h1 { font-size: 36px; line-height: 44px; }
  h2 { font-size: 28px; line-height: 36px; }
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 30px 0;
}

::selection {
  background: var(--color-brand);
  color: var(--color-fg-inverse);
}


/* ===========================================================
   2. CONTAINER — Bootstrap 5 responsive widths
   =========================================================== */

.container,
.container-fluid {
  width: 100%;
  padding-right: var(--container-px);
  padding-left: var(--container-px);
  margin-right: auto;
  margin-left: auto;
}

@media (min-width: 576px)  { .container { max-width: var(--container-sm); } }
@media (min-width: 768px)  { .container { max-width: var(--container-md); } }
@media (min-width: 992px)  { .container { max-width: var(--container-lg); } }
@media (min-width: 1200px) { .container { max-width: var(--container-xl); } }
@media (min-width: 1400px) { .container { max-width: var(--container-xxl); } }


/* ===========================================================
   3. ROW / COL — 12-col grid (Bootstrap 5 совместимый)
   Reference использует col-lg-6, col-md-12 и т.д. — повторяем.
   =========================================================== */

.row {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0;
  margin-right: calc(var(--row-gx) * -0.5);
  margin-left: calc(var(--row-gx) * -0.5);
}

.row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--row-gx) * 0.5);
  padding-left: calc(var(--row-gx) * 0.5);
  margin-top: 0;
}

/* Базовые .col-* — для всех брейкпойнтов */
.col-1  { flex: 0 0 auto; width: 8.33333333%; }
.col-2  { flex: 0 0 auto; width: 16.66666667%; }
.col-3  { flex: 0 0 auto; width: 25%; }
.col-4  { flex: 0 0 auto; width: 33.33333333%; }
.col-5  { flex: 0 0 auto; width: 41.66666667%; }
.col-6  { flex: 0 0 auto; width: 50%; }
.col-7  { flex: 0 0 auto; width: 58.33333333%; }
.col-8  { flex: 0 0 auto; width: 66.66666667%; }
.col-9  { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.33333333%; }
.col-11 { flex: 0 0 auto; width: 91.66666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

.col-auto { flex: 0 0 auto; width: auto; }

/* Responsive variants — генерируем через @media */
@media (min-width: 576px) {
  .col-sm-1  { flex: 0 0 auto; width: 8.33333333%; }
  .col-sm-2  { flex: 0 0 auto; width: 16.66666667%; }
  .col-sm-3  { flex: 0 0 auto; width: 25%; }
  .col-sm-4  { flex: 0 0 auto; width: 33.33333333%; }
  .col-sm-5  { flex: 0 0 auto; width: 41.66666667%; }
  .col-sm-6  { flex: 0 0 auto; width: 50%; }
  .col-sm-7  { flex: 0 0 auto; width: 58.33333333%; }
  .col-sm-8  { flex: 0 0 auto; width: 66.66666667%; }
  .col-sm-9  { flex: 0 0 auto; width: 75%; }
  .col-sm-10 { flex: 0 0 auto; width: 83.33333333%; }
  .col-sm-11 { flex: 0 0 auto; width: 91.66666667%; }
  .col-sm-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 768px) {
  .col-md-1  { flex: 0 0 auto; width: 8.33333333%; }
  .col-md-2  { flex: 0 0 auto; width: 16.66666667%; }
  .col-md-3  { flex: 0 0 auto; width: 25%; }
  .col-md-4  { flex: 0 0 auto; width: 33.33333333%; }
  .col-md-5  { flex: 0 0 auto; width: 41.66666667%; }
  .col-md-6  { flex: 0 0 auto; width: 50%; }
  .col-md-7  { flex: 0 0 auto; width: 58.33333333%; }
  .col-md-8  { flex: 0 0 auto; width: 66.66666667%; }
  .col-md-9  { flex: 0 0 auto; width: 75%; }
  .col-md-10 { flex: 0 0 auto; width: 83.33333333%; }
  .col-md-11 { flex: 0 0 auto; width: 91.66666667%; }
  .col-md-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 992px) {
  .col-lg-1  { flex: 0 0 auto; width: 8.33333333%; }
  .col-lg-2  { flex: 0 0 auto; width: 16.66666667%; }
  .col-lg-3  { flex: 0 0 auto; width: 25%; }
  .col-lg-4  { flex: 0 0 auto; width: 33.33333333%; }
  .col-lg-5  { flex: 0 0 auto; width: 41.66666667%; }
  .col-lg-6  { flex: 0 0 auto; width: 50%; }
  .col-lg-7  { flex: 0 0 auto; width: 58.33333333%; }
  .col-lg-8  { flex: 0 0 auto; width: 66.66666667%; }
  .col-lg-9  { flex: 0 0 auto; width: 75%; }
  .col-lg-10 { flex: 0 0 auto; width: 83.33333333%; }
  .col-lg-11 { flex: 0 0 auto; width: 91.66666667%; }
  .col-lg-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 1200px) {
  .col-xl-1  { flex: 0 0 auto; width: 8.33333333%; }
  .col-xl-2  { flex: 0 0 auto; width: 16.66666667%; }
  .col-xl-3  { flex: 0 0 auto; width: 25%; }
  .col-xl-4  { flex: 0 0 auto; width: 33.33333333%; }
  .col-xl-5  { flex: 0 0 auto; width: 41.66666667%; }
  .col-xl-6  { flex: 0 0 auto; width: 50%; }
  .col-xl-7  { flex: 0 0 auto; width: 58.33333333%; }
  .col-xl-8  { flex: 0 0 auto; width: 66.66666667%; }
  .col-xl-9  { flex: 0 0 auto; width: 75%; }
  .col-xl-10 { flex: 0 0 auto; width: 83.33333333%; }
  .col-xl-11 { flex: 0 0 auto; width: 91.66666667%; }
  .col-xl-12 { flex: 0 0 auto; width: 100%; }
}


/* ===========================================================
   4. UTILITIES — самый используемый Bootstrap-подобный набор
   =========================================================== */

/* Display */
.d-none    { display: none !important; }
.d-block   { display: block !important; }
.d-inline  { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex    { display: flex !important; }
.d-grid    { display: grid !important; }
.d-inline-flex { display: inline-flex !important; }

@media (min-width: 576px)  { .d-sm-none{display:none!important;} .d-sm-block{display:block!important;} .d-sm-flex{display:flex!important;} }
@media (min-width: 768px)  { .d-md-none{display:none!important;} .d-md-block{display:block!important;} .d-md-flex{display:flex!important;} }
@media (min-width: 992px)  { .d-lg-none{display:none!important;} .d-lg-block{display:block!important;} .d-lg-flex{display:flex!important;} }
@media (min-width: 1200px) { .d-xl-none{display:none!important;} .d-xl-block{display:block!important;} .d-xl-flex{display:flex!important;} }

/* Flex */
.flex-wrap   { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-column { flex-direction: column !important; }
.flex-row    { flex-direction: row !important; }
.flex-grow-1 { flex-grow: 1 !important; }

/* Justify */
.justify-content-start    { justify-content: flex-start !important; }
.justify-content-center   { justify-content: center !important; }
.justify-content-end      { justify-content: flex-end !important; }
.justify-content-between  { justify-content: space-between !important; }
.justify-content-around   { justify-content: space-around !important; }
.justify-content-evenly   { justify-content: space-evenly !important; }

@media (min-width: 992px) {
  .justify-content-lg-start   { justify-content: flex-start !important; }
  .justify-content-lg-center  { justify-content: center !important; }
  .justify-content-lg-end     { justify-content: flex-end !important; }
  .justify-content-lg-between { justify-content: space-between !important; }
}

/* Align */
.align-items-start    { align-items: flex-start !important; }
.align-items-center   { align-items: center !important; }
.align-items-end      { align-items: flex-end !important; }
.align-items-stretch  { align-items: stretch !important; }
.align-items-baseline { align-items: baseline !important; }

/* Text alignment */
.text-start   { text-align: left !important; }
.text-center  { text-align: center !important; }
.text-end     { text-align: right !important; }
.text-uppercase { text-transform: uppercase !important; letter-spacing: var(--tracking-wide); }
.text-lowercase { text-transform: lowercase !important; }

@media (min-width: 992px) {
  .text-lg-start  { text-align: left !important; }
  .text-lg-center { text-align: center !important; }
  .text-lg-end    { text-align: right !important; }
}

/* Spacing — margins/paddings 0..5 в Bootstrap-стиле (mb-0..5, pt-0..5) */
.m-0  { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.ms-0 { margin-left: 0 !important; }
.me-0 { margin-right: 0 !important; }

.mb-1 { margin-bottom: 0.25rem !important; }   /* 4px */
.mb-2 { margin-bottom: 0.5rem !important; }    /* 8px */
.mb-3 { margin-bottom: 1rem !important; }      /* 16px */
.mb-4 { margin-bottom: 1.5rem !important; }    /* 24px */
.mb-5 { margin-bottom: 3rem !important; }      /* 48px */

.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.p-0  { padding: 0 !important; }
.pt-0 { padding-top: 0 !important; }
.pb-0 { padding-bottom: 0 !important; }
.ps-0 { padding-left: 0 !important; }
.pe-0 { padding-right: 0 !important; }

@media (min-width: 992px) {
  .mb-lg-0 { margin-bottom: 0 !important; }
  .pe-lg-5 { padding-right: 3rem !important; }
  .ps-lg-5 { padding-left: 3rem !important; }
}

/* Section spacing — порт из референса */
.section_space_md { padding-top: var(--section-py-md); padding-bottom: var(--section-py-md); }
.section_space_lg { padding-top: var(--section-py-md); padding-bottom: var(--section-py-md); }
.section_space_lg.pb-0 { padding-bottom: 0; }

@media (max-width: 991.98px) {
  .section_space_md, .section_space_lg { padding-top: 80px; padding-bottom: 80px; }
}
@media (max-width: 575.98px) {
  .section_space_md, .section_space_lg { padding-top: 60px; padding-bottom: 60px; }
}

/* Backgrounds (из референса) */
.bg_gray_dark { background-color: var(--color-bg-raised); }
.bg_dark      { background-color: var(--color-bg); }


/* ===========================================================
   5. FORM CONTROLS — базовые input/textarea/select
   =========================================================== */

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-fg);
  background-color: var(--color-bg-inset);
  background-clip: padding-box;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--r-xs);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.form-control::placeholder,
.form-select::placeholder {
  color: var(--color-fg-subtle);
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(var(--color-brand-rgb), 0.18);
}

textarea.form-control { min-height: 120px; resize: vertical; }

.form-group { margin-bottom: 20px; }

.form-group label,
.form-label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  color: var(--color-fg);
}

/* Visually-hidden helper для honeypot и а11y */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
