/*
Theme Name: Glaciron
Theme URI: https://example.com/glaciron
Author: Glaciron
Author URI: https://example.com
Description: Тёмная тема для лендингов в стиле спорт/беттинг. Цвета настраиваются в Кастомайзере, страницы собираются в Gutenberg из блок-паттернов (hero-section и др.). Эталон дизайна — статический лендинг Melbet.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: glaciron
Tags: dark, custom-colors, block-patterns, full-width-template, footer-widgets
*/

/* ===================================================================
   CSS-переменные — значения по умолчанию (эталон).
   Кастомайзер переопределяет их инлайн-стилем в <head>.
   =================================================================== */
:root {
  --primary: #f7b506;        /* праймари / кнопки / заголовок hero */
  --text: #f4f4f4;           /* основной цвет текста */
  --btn-text: #1a1a1a;       /* цвет текста на кнопках */
  --bg: #272626;             /* цвет фона страницы */
  --icon-color: #f7b506;     /* цвет маркеров нумерованного списка */
  --table-border: #f7b506;   /* цвет бордера таблицы */

  --bg-header: #1f1e1e;      /* фон шапки и футера (фикс., производный от --bg) */
  --text-muted: color-mix(in srgb, var(--text) 72%, var(--bg));
  --primary-hover: color-mix(in srgb, var(--primary) 82%, #fff);
  --container: 1200px;
}

/* ===== Reset & base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: var(--btn-text);
  padding: 10px 18px;
  font-weight: 700;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ===== Header ===== */
.site-header {
  background: var(--bg-header);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
}
.site-logo img,
.site-logo svg {
  height: 30px;
  width: auto;
}
.site-logo .site-logo__text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
  text-transform: uppercase;
}

/* ===== Navigation ===== */
.nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav__link,
.nav .menu-item > a {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  transition: color 0.2s ease;
}

.nav__link:hover,
.nav .menu-item > a:hover {
  color: var(--primary);
}

/* пункт с подменю */
.nav .menu-item,
.nav__item {
  display: flex;
  align-items: center;
  position: relative;
}

.nav .menu-item-has-children > a,
.nav__link--parent {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}
.nav__link--parent:hover {
  color: var(--primary);
}

.nav__caret,
.nav .menu-item-has-children > a::after {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.2s ease;
}
.nav .menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  margin-left: 7px;
}

.nav__sub,
.nav .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  padding: 6px 0;
  margin: 0;
  list-style: none;
  background: var(--bg-header);
  border: 1px solid #333;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 60;
}

.nav__item--has-sub:hover .nav__sub,
.nav__item--has-sub:focus-within .nav__sub,
.nav .menu-item-has-children:hover > .sub-menu,
.nav .menu-item-has-children:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav__item--has-sub:hover .nav__caret,
.nav .menu-item-has-children:hover > a::after {
  transform: rotate(180deg);
}

.nav__sublink,
.nav .sub-menu .menu-item > a {
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav__sublink:hover,
.nav .sub-menu .menu-item > a:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
}

/* ===== Burger ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 3px;
  width: 26px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle--active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle--active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle--active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ===== Site main / content width ===== */
.site-main {
  display: block;
}

.entry-content {
  padding-bottom: 90px;
}

.entry-content > * {
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}
.entry-content > .alignwide {
  max-width: 1320px;
}
.entry-content > .alignfull {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* вертикальные отступы блоков контента */
.entry-content > * + * {
  margin-top: 28px;
}
.entry-content > .alignfull + * {
  margin-top: 60px;
}
.entry-content > * + .alignfull {
  margin-top: 0;
}
/* первый блок, если это не полноширинный hero — даём отступ от шапки */
.entry-content > *:first-child:not(.alignfull) {
  margin-top: 48px;
}

/* карточки записей (лента/архив) */
.post-card + .post-card {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 28px;
}
.post-card__title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
}
.post-card__title a:hover {
  color: var(--primary);
}
.post-card__excerpt {
  color: var(--text-muted);
  margin-bottom: 16px;
}
.wp-block-post-title,
.post-card .btn {
  margin-top: 4px;
}

/* ===== Hero (cover-блок с классом hero-section) ===== */
.hero-section.wp-block-cover {
  min-height: 540px;
  align-items: center;
  padding: 70px 0;
  margin-top: 0;
}
.hero-section .wp-block-cover__inner-container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}
.hero-section .wp-block-columns {
  align-items: center;
  gap: 40px;
  margin: 0;
}
.hero-section h1,
.hero-section h2 {
  font-size: 46px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 24px;
}
.hero-section p {
  font-size: 16px;
  color: var(--text);
  margin: 0 0 32px;
}
.hero-section .wp-block-image {
  margin: 0;
  display: flex;
  justify-content: center;
}
.hero-section .wp-block-image img {
  width: 300px;
  max-width: 100%;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
}

/* ===== Buttons ===== */
.wp-block-button__link,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 15px 32px;
  background: var(--primary);
  color: var(--btn-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 40px;
  border: none;
  transition: background 0.2s ease, transform 0.1s ease;
}
.wp-block-button__link:hover,
.btn:hover {
  background: var(--primary-hover);
  color: var(--btn-text);
}
.wp-block-button__link:active,
.btn:active {
  transform: translateY(1px);
}
.wp-block-buttons {
  gap: 20px;
}
/*
 * Доп. классы кнопок: reg-btn / app-btn.
 * Класс стоит и на обёртке .wp-block-button, и на самом теге <a>
 * (фильтр glaciron_button_link_class). Селекторы-хуки для кастомных стилей:
 *   a.reg-btn  /  a.app-btn  /  .wp-block-button__link.reg-btn  и т.п.
 */

/* ===== Typography in content ===== */
.entry-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.entry-content h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.entry-content h4 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}
.entry-content p {
  font-size: 16px;
  color: var(--text-muted);
}
.entry-content a:not(.wp-block-button__link) {
  color: var(--primary);
}
.entry-content a:not(.wp-block-button__link):hover {
  text-decoration: underline;
}

/* ===== Numbered list — кружки с цифрой (цвет = --icon-color) ===== */
.entry-content ol:not(.is-style-plain) {
  list-style: none;
  counter-reset: glaciron-counter;
  padding-left: 20px; /* в один край с заголовками/абзацами (.entry-content > *) */
}
.entry-content ol:not(.is-style-plain) > li {
  counter-increment: glaciron-counter;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 16px;
  color: var(--text);
}
.entry-content ol:not(.is-style-plain) > li + li {
  margin-top: 16px;
}
.entry-content ol:not(.is-style-plain) > li::before {
  content: counter(glaciron-counter);
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 3px solid var(--icon-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--icon-color);
}

/* ===== Unordered list — чек-марки (check.svg, цвет = --icon-color) ===== */
.entry-content ul:not(.is-style-plain) {
  list-style: none;
  padding-left: 20px; /* в один край с заголовками/абзацами (.entry-content > *) */
}
.entry-content ul:not(.is-style-plain) > li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 16px;
  color: var(--text);
}
.entry-content ul:not(.is-style-plain) > li + li {
  margin-top: 12px;
}
.entry-content ul:not(.is-style-plain) > li::before {
  content: "";
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  background-color: var(--icon-color);
  -webkit-mask: url("assets/images/check.svg") center / contain no-repeat;
  mask: url("assets/images/check.svg") center / contain no-repeat;
}

/* стиль «Стандартные маркеры» — родные маркеры списка */
.entry-content ol.is-style-plain,
.entry-content ul.is-style-plain {
  /* 20px — гаттер контейнера (как у .entry-content > *), ~20px — отступ под маркеры */
  padding-left: 40px;
}
.entry-content ol.is-style-plain {
  list-style: decimal;
}
.entry-content ul.is-style-plain {
  list-style: disc;
}

/* ===== Table ===== */
.entry-content .wp-block-table,
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-left: auto;
  margin-right: auto;
}
.entry-content .wp-block-table table,
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
  border: 2px solid var(--table-border);
  color: var(--text);
}
.entry-content .wp-block-table th,
.entry-content .wp-block-table td,
.table th,
.table td {
  border: 2px solid var(--table-border);
  padding: 16px 14px;
  text-align: center;
  font-size: 15px;
  vertical-align: middle;
}
.entry-content .wp-block-table th,
.table th {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.entry-content .wp-block-table td,
.table td {
  font-weight: 600;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-header);
  padding: 22px 0;
}
.site-footer__copy {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Page title (внутренние страницы) ===== */
.page-header {
  padding: 48px 0 8px;
}
.page-header__title {
  font-size: 34px;
  font-weight: 800;
  color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .nav-toggle {
    display: flex;
    margin-left: auto; /* прижимаем бургер к правому краю контейнера */
  }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-header);
    border-top: 1px solid #333;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav--open {
    max-height: 520px;
    overflow-y: auto;
  }
  .nav__link,
  .nav__link--parent,
  .nav .menu-item > a {
    padding: 16px 20px;
    border-bottom: 1px solid #333;
  }
  .nav__item,
  .nav__item--has-sub,
  .nav .menu-item {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }
  .nav__link--parent,
  .nav .menu-item-has-children > a {
    justify-content: space-between;
  }
  .nav__sub,
  .nav .sub-menu {
    position: static;
    min-width: 0;
    padding: 0;
    border: none;
    background: rgba(0, 0, 0, 0.25);
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav__item--open .nav__sub,
  .nav .menu-item--open > .sub-menu {
    max-height: 280px;
  }
  .nav__item--open .nav__caret,
  .nav .menu-item--open > a::after {
    transform: rotate(180deg);
  }
  .nav__sublink,
  .nav .sub-menu .menu-item > a {
    padding: 14px 20px 14px 38px;
    border-bottom: 1px solid #333;
  }
}

@media (max-width: 900px) {
  .hero-section h1,
  .hero-section h2 {
    font-size: 38px;
  }
  .hero-section .wp-block-image img {
    width: 240px;
  }
}

@media (max-width: 781px) {
  /* колонки hero стекаются — телефон-мокап скрываем */
  .hero-section .wp-block-columns .wp-block-column:last-child,
  .hero-section .hero-phone {
    display: none;
  }
  .hero-section.wp-block-cover {
    min-height: 360px;
    padding: 48px 0;
  }
  .hero-section h1,
  .hero-section h2 {
    font-size: 30px;
  }
}

@media (max-width: 600px) {
  .hero-section h1,
  .hero-section h2 {
    font-size: 26px;
  }
  .wp-block-buttons {
    flex-direction: column;
  }
  .wp-block-button,
  .wp-block-button__link,
  .btn {
    width: 100%;
  }
  .entry-content {
    padding-bottom: 64px;
  }
  .entry-content > *:first-child:not(.alignfull) {
    margin-top: 36px;
  }
  .entry-content h2 {
    font-size: 20px;
  }
  .entry-content h3 {
    font-size: 19px;
  }
}
