/*
Theme Name: Rebootkz
Theme URI: https://school.edy.kz
Author: School EDY Kazakhstan
Author URI: https://school.edy.kz
Description: Кастомизированная тема для образовательных учреждений Казахстана на базе Reboot
Template: reboot
Version: 1.0
Text Domain: rebootkz
*/

/* --- Стили для бегущей строки виджета --- */
#header-widget-area {
    background-color: #ddf2ff;
    padding: 5px 0;
    overflow: hidden;
}

#header-widget-area marquee {
    font-size: 14px;
    color: #333;
}

/* --- Общие стили для заголовков, названия и описания сайта --- */
.site-branding__body h1,
.site-title,
.site-description {
  text-align: center;
  white-space: normal;        /* Разрешаем перенос текста */
  overflow-wrap: break-word;  /* Перенос слов при переполнении */
  word-wrap: break-word;      /* Для совместимости со старыми браузерами */
  padding: 0;
}

/* --- Стили для мобильных устройств (до 768px) --- */
@media only screen and (max-width: 768px) {
  .site-branding__body h1,
  .site-title,
  .site-description {
    font-size: 0.8em !important;  /* Уменьшаем шрифт на мобильных устройствах */
  }
}
  
  /* При мобильной верстке устанавливаем отступы для контейнеров */
  .block-after-site,
  .related-posts,
  .section-block,
  .section-html,
  .site-content,
  .site-footer-inner,
  .site-header-inner {
    padding-left: 8px;
    padding-right: 0px;
  }
  
  /* Для навигации на мобильных другие отступы */
  .main-navigation-inner {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  body {
    margin: 0;
    padding: 0;
    font-size: 12px;
  }
  
  .container {
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
  }

/* --- Desktop (от 768px) --- */
@media (min-width: 768px) {
  /* Контейнер шапки – сбрасываем отступы */
  .site-header-inner {
    position: relative;
    padding: 0;
  }
  
  /* Центрируем блок брендинга с помощью flex */
  .site-branding {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 0;
  }
  
  /* Логотип отделяем от текста – задаём отступ справа */
  .site-logotype {
    margin-right: 5px;
  }
  
  /* Сбрасываем внутренние отступы внутри блока брендинга */
  .site-branding__body {
    padding: 0;
  }
}

/* --- Ограничение максимальной ширины контейнеров --- */
.site-header.fixed,
.container,
.fixed.block-after-site,
.fixed.main-navigation-inner,
.fixed.related-posts,
.fixed.section-block,
.fixed.section-html,
.fixed.site-content,
.fixed.site-footer-inner,
.fixed.site-header-inner,
.footer-navigation.fixed,
.main-navigation.fixed,
.site-footer.fixed {
  max-width: 1320px;
  margin: 0 auto; /* Важно для центрирования */
}

/* Дополнительное центрирование для навигации */
.main-navigation {
    width: 100%;
    background-color: inherit;
}

/* Дополнительное центрирование для навигации - только для header */
#site-navigation .main-navigation-inner .menu {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center; /* Центрируем пункты меню */
}

/* --- Загрузка шрифтов --- */
@font-face {
  font-family: 'PT Sans';
  src: url('../fonts/ptsans.woff2') format('woff2');
}

/* --- Полная ширина контента (только для тела) --- */
/* Когда контент без класса fixed - растягиваем на всю ширину */
.site-content:not(.fixed) {
    max-width: 100% !important;
    width: 100% !important;
}

.site-content:not(.fixed) .site-content-inner {
    max-width: 100% !important;
    padding: 0;
}

/* Секции могут быть полной ширины */
.site-content:not(.fixed) .section-block,
.site-content:not(.fixed) .section-html {
    max-width: 100% !important;
}

/* Но содержимое секций ограничиваем для удобства чтения */
.site-content:not(.fixed) .section-block .container,
.site-content:not(.fixed) .section-html .container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Контент статей также ограничиваем */
.site-content:not(.fixed) .content-area {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Блок иконок под слайдером --- */
.school-icons-section {
    padding: 30px 0;
    background-color: transparent; /* Прозрачный фон */
    margin-top: -40px; /* Поднимаем блок еще ближе к слайдеру */
}

.icons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.icon-tile {
    text-decoration: none;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.icon-tile:hover {
    transform: translateY(-10px);
}

.icon-tile-inner {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    height: 100%;
    transition: box-shadow 0.3s ease;
}

.icon-tile:hover .icon-tile-inner {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.icon-wrapper {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
}

.icon-wrapper i {
    font-size: 40px;
    color: #ffffff;
}

.icon-title {
    font-size: 22px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 15px;
}

.icon-description {
    font-size: 15px;
    color: #718096;
    line-height: 1.6;
    margin: 0;
}

/* Цвета для разных плиток */
.icon-tile:nth-child(1) .icon-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.icon-tile:nth-child(2) .icon-wrapper {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.icon-tile:nth-child(3) .icon-wrapper {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.icon-tile:nth-child(4) .icon-wrapper {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* Адаптивность для планшетов */
@media (max-width: 991px) {
    .icons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .icon-tile-inner {
        padding: 30px 20px;
    }
}

/* Адаптивность для мобильных */
@media (max-width: 576px) {
    .school-icons-section {
        padding: 20px 0;
        margin-top: -10px;
    }
    
    .icons-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .icon-wrapper {
        width: 70px;
        height: 70px;
    }
    
    .icon-wrapper i {
        font-size: 32px;
    }
    
    .icon-title {
        font-size: 20px;
    }
    
    .icon-description {
        font-size: 14px;
    }
}

/* --- Убираем стрелки из меню --- */
/* Скрываем все стрелки в меню */
.main-navigation ul li.menu-item-has-children > a:after,
.main-navigation ul li.menu-item-has-children > span:after,
.main-navigation ul li .sub-menu li.menu-item-has-children > a:after,
.main-navigation ul li .sub-menu li.menu-item-has-children > span:after,
.footer-navigation ul li.menu-item-has-children > a:after,
.footer-navigation ul li.menu-item-has-children > span:after,
.top-menu ul li.menu-item-has-children > a:after,
.top-menu ul li.menu-item-has-children > span:after,
.widget-area .widget_nav_menu .menu-item-has-children:after {
    display: none !important;
}

/* Убираем лишние отступы справа, которые были для стрелок */
.widget-area .widget_nav_menu .menu-item-has-children {
    padding-right: 0 !important;
}

/* Убираем фоновую область для стрелок в боковом меню */
.widget-area .widget_nav_menu .menu-item-has-children:before {
    display: none !important;
}

/* --- Фикс для карты Leaflet --- */
.section-html {
    overflow: hidden;
}

.leaflet-container {
    max-width: 100%;
}

/* --- Уменьшаем отступы между секциями --- */
.site-content .section-block {
    margin-bottom: 30px;
}

.site-content .section-block:first-child {
    margin-top: 0; /* Убираем отрицательный отступ */
}

/* --- Полная ширина для блока иконок --- */
.school-icons-section > div:not(.container) {
    padding: 0 30px;
}

.school-icons-section > div:not(.container) .icons-grid {
    max-width: 1920px;
    margin: 0 auto;
}

/* --- Фикс ширины для секций постов --- */
/* Для полной ширины */
.site-content:not(.fixed) .section-posts {
    padding: 0 15px;
}

.site-content:not(.fixed) .section-posts .post-cards {
    max-width: 1320px;
    margin: 0 auto;
}

/* Для всех прямых потомков section-block при полной ширине */
.site-content:not(.fixed) .section-block > .post-cards,
.site-content:not(.fixed) .section-block > .section-block__header {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 15px;
}

/* Для фиксированной ширины - радикальное решение */
.site-content.fixed .section-block,
.site-content.fixed .section-posts {
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.site-content.fixed .post-cards {
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Ограничиваем все карточки */
.site-content.fixed .post-card {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.site-content.fixed .post-card__thumbnail {
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Специально для grid layout */
.site-content.fixed .post-cards--grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 0 15px;
    max-width: 100%;
    box-sizing: border-box;
}

/* Для content-area в фиксированной ширине */
.site-content.fixed .content-area {
    max-width: 100%;
    overflow: hidden;
}

/* Убираем только отрицательные margin */
.site-content.fixed .section-block,
.site-content.fixed .post-cards,
.site-content.fixed .post-card {
    margin-left: 0;
    margin-right: 0;
}

/* Исправляем margin для section-block и section-html на планшетах и десктопе */
@media (min-width: 768px) {
    .site-content.fixed .section-block,
    .site-content.fixed .section-html {
        margin-left: auto;
        margin-right: auto;
    }
}

/* --- Фикс фона секций для полной ширины --- */
.site-content:not(.fixed) .section-preset--bgc-1,
.site-content:not(.fixed) .preset-bgc-1 {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: calc(50vw - 50%);
    padding-right: calc(50vw - 50%);
}

/* Альтернативный метод для более старых браузеров */
.site-content:not(.fixed) .section-block.section-preset--bgc-1 {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* Контент внутри секции остается ограниченным */
.site-content:not(.fixed) .section-preset--bgc-1 .post-cards {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Отступы для виджетов при полной ширине --- */
.site-content:not(.fixed) .widget-area,
.site-content:not(.fixed) .sidebar,
.site-content:not(.fixed) aside {
    padding-left: 20px;
    padding-right: 20px;
}

/* Дополнительные отступы для самих виджетов */
.site-content:not(.fixed) .widget {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

/* Для контейнера с виджетами и контентом */
.site-content:not(.fixed) .content-with-sidebar {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Адаптивность для планшетов и мобильных */
@media (max-width: 991px) {
    .site-content:not(.fixed) .widget-area,
    .site-content:not(.fixed) .sidebar,
    .site-content:not(.fixed) aside {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* --- Исправление наезда слайдера на меню при фиксированной ширине --- */
/* Используем те же z-index что и родительская тема */
.site-header,
.site-header.fixed {
    position: relative;
    z-index: 9999 !important;
}

.main-navigation,
.main-navigation.fixed,
.site-navigation-fixed {
    position: relative;
    z-index: 9999 !important;
}

/* Слайдер должен быть под навигацией */
.slider-posts {
    position: relative;
    z-index: 1 !important;
}

/* Скрываем футер навигацию которая появляется неожиданно */
.footer-navigation {
    display: none !important;
}

/* Скрываем дублированное меню которое появляется после контента */
.site-content ~ .main-navigation,
.school-icons-section ~ .main-navigation,
#primary ~ .main-navigation,
body > .main-navigation:not(#site-navigation) {
    display: none !important;
}

