/**
 * Кастомные стили для сайта ФФГС
 * Подключается к теме через functions.php
 */

/* ===================================
   Стили для блока спонсоров в подвале
   =================================== */

/* Показываем спонсоров только на главной странице */
body:not(.home) .sp-footer-sponsors {
    display: none !important;
}

.sp-footer-sponsors {
    padding: 40px 0;
    background: #f4f4f4;
    border-top: 1px solid #397be9;
}

/* Заголовок блока спонсоров */
.sp-footer-sponsors h3,
.sp-footer-sponsors .sp-table-caption {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: #7f8081;
    margin-bottom: 0px;
    text-transform: uppercase;
    letter-spacing: 1px;
    order: -1;
}

/* Контейнер спонсоров */
.sp-footer-sponsors .sp-sponsors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    border: none !important;
    /* Отключаем границу */
    border-top: none !important;
    /* Отключаем верхнюю границу */
}

/* Отдельный спонсор */
.sp-footer-sponsors .sp-sponsors .sp-sponsor {
    display: inline-block;
    transition: all 0.3s ease;
}

/* Изображения спонсоров */
.sp-footer-sponsors .sp-sponsors img,
.sp-footer-sponsors img {
    max-width: 128px !important;
    max-height: 128px !important;
    width: auto !important;
    height: auto !important;
    opacity: 0.2;
    /* Прозрачность 80% = видны на 20% */
    transition: all 0.4s ease-in-out;
    filter: grayscale(100%);
    object-fit: contain;
}

/* При наведении - полная видимость */
.sp-footer-sponsors .sp-sponsors img:hover,
.sp-footer-sponsors img:hover {
    opacity: 1;
    /* Полная видимость */
    filter: grayscale(0%);
    transform: scale(1.1);
}

/* Ссылки на спонсоров */
.sp-footer-sponsors .sp-sponsors a {
    display: inline-block;
    text-decoration: none;
    border: none;
}

/* Адаптив для мобильных устройств */
@media screen and (max-width: 768px) {
    .sp-footer-sponsors .sp-sponsors {
        gap: 15px;
    }

    .sp-footer-sponsors .sp-sponsors img,
    .sp-footer-sponsors img {
        max-width: 96px !important;
        max-height: 96px !important;
    }

    .sp-footer-sponsors h3,
    .sp-footer-sponsors .sp-table-caption {
        font-size: 20px;
        margin-bottom: 20px;
    }
}

@media screen and (max-width: 480px) {

    .sp-footer-sponsors .sp-sponsors img,
    .sp-footer-sponsors img {
        max-width: 80px !important;
        max-height: 80px !important;
    }
}

/* Дополнительные эффекты */
.sp-footer-sponsors .sp-sponsors .sp-sponsor {
    position: relative;
}

/* Подсказка при наведении (опционально) */
.sp-footer-sponsors .sp-sponsors a[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Стили для заголовка спонсоров - сброс стилей h3 и применение точных стилей */
h3.sp-sponsors-title,
.sp-sponsors-title {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    font-size: 24px !important;
    font-weight: normal !important;
    color: #7f8081 !important;
    margin: 0 !important;
    margin-bottom: 0px !important;
    padding: 0 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    order: -1 !important;
    border: none !important;
    line-height: normal !important;
}

/* ===================================
   Стили для заголовков матчей
   =================================== */

/* Размер шрифта для названий матчей */
.sp-event-title {
    font-size: 14px !important;
}


/* ===================================
   Исправление наложения длинных названий команд на календарь
   =================================== */

/* Ограничиваем ширину логотипов команд на странице события */
.sp-template-event-logos-block .team-logo {
    max-width: 40% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Переносим текст в названиях команд */
.sp-template-event-logos-block .sp-team-name {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.3 !important;
}

/* Переносим текст в инлайн логотипах событий */
.sp-template-event-logos-inline {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Переносим текст в названиях команд внутри инлайн логотипов */
.sp-template-event-logos-inline .sp-team-name {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    display: inline-block !important;
    max-width: 45% !important;
    vertical-align: middle !important;
}

/* ===================================
   Кнопка "Наверх"
   =================================== */

/* Скрываем кнопку на мобильных устройствах */
#scroll-to-top {
    display: none;
}

/* Показываем кнопку только на планшетах и ПК */
@media screen and (min-width: 768px) {
    #scroll-to-top {
        display: block;
        position: fixed;
        bottom: 30px;
        right: 30px;
        width: 50px;
        height: 50px;
        background-color: #1650b1;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease-in-out;
        z-index: 9999;
        box-shadow: 0 4px 12px rgba(22, 80, 177, 0.4);
    }

    #scroll-to-top:hover {
        background-color: #0d3a7a;
        transform: translateY(-3px);
        box-shadow: 0 6px 16px rgba(22, 80, 177, 0.6);
    }

    #scroll-to-top.show {
        opacity: 1;
        visibility: visible;
    }

    /* Стрелка вверх */
    #scroll-to-top::before {
        content: "▲";
        color: #ffffff;
        font-size: 20px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        line-height: 1;
    }

    /* Анимация при клике */
    #scroll-to-top:active {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(22, 80, 177, 0.3);
    }
}

/* ===================================
   Стили для цитат (blockquote)
   =================================== */

blockquote {
    margin-left: 40px !important;
    margin-right: 40px !important;
}

/* ===================================
   Стили для страницы 'About'
   =================================== */

.features-grid .feature-item {
    margin-bottom: 20px;
}

/* ===================================
   Отступы футера
   =================================== */

/* Уменьшаем нижний отступ для .site-info */
.site-info {
    padding-bottom: 20px !important;
    color: #FFFFFF !important;
}

@media screen and (min-width: 1025px) {
    .site-info {
        padding: 5px 0 20px !important;
    }
}

/* ===================================
   Кнопка CTA для страницы Спонсорам
   =================================== */

/* Основной стиль кнопки */
.entry-content a[href="/join/"] {
    transition: all 0.3s ease !important;
}

/* Эффект при наведении */
.entry-content a[href="/join/"]:hover {
    background-color: #008a82 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 166, 156, 0.3);
}

/* Эффект при клике */
.entry-content a[href="/join/"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 166, 156, 0.2);
}

/* ===================================
   Кнопка CTA - универсальный стиль
   =================================== */

/* Основной стиль кнопки */
.entry-content a.button {
    display: inline-block;
    transition: all 0.3s ease !important;
}

/* Эффект при наведении */
.entry-content a.button:hover {
    background-color: #0d3a7a !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 80, 177, 0.4);
}

/* Эффект при клике */
.entry-content a.button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(22, 80, 177, 0.3);
}

/* ===================================
   Градиентный фон сайта
   =================================== */

/* Градиентный фон для body */
body {
    background: linear-gradient(135deg,
            #0b2855 0%,
            /* Темная версия #1650b1 */
            #0d3a7a 25%,
            /* Средне-темная версия */
            #1650b1 50%,
            /* Базовый фирменный цвет */
            #0d3a7a 75%,
            /* Средне-темная версия */
            #0b2855 100%) !important;
    /* Темная версия #1650b1 */
    background-attachment: fixed !important;
    position: relative;
}

/* Дополнительный анимированный градиент (опционально) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(22, 80, 177, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(31, 93, 201, 0.1) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* ===================================
   Цвет заголовка на темном фоне
   =================================== */

/* Белый цвет для заголовка сайта на темном градиентном фоне */
.site-branding hgroup {
    color: #FFFFFF !important;
}

/* Белый цвет для названия сайта */
.site-title,
.site-title a,
.site-title a:hover {
    color: #FFFFFF !important;
}

/* Белый цвет для описания сайта */
.site-description {
    color: #FFFFFF !important;
    opacity: 0.9;
}

/* ===================================
   Структура описания и телефона в header
   =================================== */

/* Контейнер для строк описания и телефона */
.header-info-row {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

/* Колонка описания (65%) */
.site-desc-column {
    width: 65%;
    flex-shrink: 0;
}

/* Колонка телефона (35%) */
.site-contact-phone {
    width: 35%;
    display: flex;
    justify-content: center;
    /* Выравнивание по центру */
    align-items: center;
}

/* Восстановление стилей кнопки телефона */
.site-phone-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #ffffff !important;
    color: #2f46b1 !important;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.site-phone-button:hover {
    background: #2f46b1 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(22, 80, 177, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    /* Полупрозрачная граница */
    padding: 9px 19px;
    /* Уменьшаем padding на 1px чтобы не скакала ширина */
}

.site-phone-button:hover .site-phone-icon {
    color: #ffffff !important;
}

.site-phone-icon {
    display: inline-flex;
    align-items: center;
}

/* Адаптив для мобильных устройств */
@media screen and (max-width: 768px) {
    .header-info-row {
        flex-direction: column;
        gap: 15px;
    }

    .site-desc-column,
    .site-contact-phone {
        width: 100%;
        justify-content: center;
    }

    .site-description {
        text-align: center;
    }
}
/* ===================================
   Тень для контента
   =================================== */
.site-content {
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3) !important;
}

/* ===================================
   Глобальный цвет ссылок
   =================================== */
a {
    color: #1650b1;
}

a:hover,
a:focus,
a:active {
    color: #0d3a7a;
}

/* Принудительный цвет для ссылок в контенте */
.entry-content a:not(.button),
.site-content a:not(.button) {
    color: #1650b1;
}

.entry-content a:not(.button):hover,
.site-content a:not(.button):hover {
    color: #0d3a7a;
}
