@charset "UTF-8";

/*
 * atfun-global.css
 * Глобальные стили atfun.at — грузятся на КАЖДОЙ странице сайта.
 *
 * Содержит:
 *  1. CSS-переменные (цвета, шрифты)
 *  2. Load More — универсальная кнопка (все типы контента)
 *  3. Общие анимации (@keyframes)
 *  4. Bottom Sheet / Шторка (модальное окно)
 *  5. Главная страница — секции, слайдер карточек (card-home)
 *  6. Общие карточки главной — бейджи, изображение, контент, адрес
 *  7. Адаптивность главной страницы
 */


/* ==========================================================================
   1. CSS-ПЕРЕМЕННЫЕ
   ========================================================================== */
:root {
    --atfun-orange:        #f68016;
    --atfun-orange-dark:   #c75f02;
    --atfun-orange-hover:  #e57200;
    --atfun-green:         #02b893;
    --atfun-text-dark:     #1a1a1a;
    --atfun-text-gray:     #4a5568;
    --atfun-text-muted:    #666;
    --atfun-border:        #e0e0e0;
    --atfun-shadow-sm:     0 2px 8px rgba(0, 0, 0, 0.15);
    --atfun-shadow-md:     0 4px 20px rgba(0, 0, 0, 0.08);
    --atfun-shadow-lg:     0 8px 30px rgba(0, 0, 0, 0.12);
    --atfun-radius-card:   16px;
    --atfun-radius-badge:  20px;
    --atfun-font-main:     'Montserrat', sans-serif;
    --atfun-font-body:     'Poppins', sans-serif;
}


/* ==========================================================================
   2. LOAD MORE — УНИВЕРСАЛЬНАЯ КНОПКА
   Используется для: clubs, events, workshops, freizeit,
                     feriencamp, kindergeburtstage
   ========================================================================== */

/* Контейнер кнопки — общий для всех типов */
.loadmore-container,
.loadmore-container-clubs,
.loadmore-container-freizeit,
.loadmore-container-feriencamp,
.loadmore-container-kindergeburtstage {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 40px;
    margin-bottom: 20px;
    clear: both;
    text-align: center;
    position: relative;
    z-index: 50;
}

/* Сама кнопка — общий стиль для всех типов */
.loadmore-btn,
.loadmore-btn-clubs,
.loadmore-btn-freizeit,
.loadmore-btn-feriencamp,
.loadmore-btn-kindergeburtstage {
    display: inline-block;
    padding: 12px 40px !important;
    background: #fff !important;
    border: 2px solid #f68016 !important;
    border-radius: 50px !important;
    color: #f68016 !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    outline: none !important;
    box-shadow: none !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
}

.loadmore-btn:hover,
.loadmore-btn-clubs:hover,
.loadmore-btn-freizeit:hover,
.loadmore-btn-feriencamp:hover,
.loadmore-btn-kindergeburtstage:hover {
    background: #f68016 !important;
    color: #fff !important;
    border-color: #f68016 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(246, 128, 22, 0.3) !important;
}

.loadmore-btn:active,
.loadmore-btn-clubs:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(246, 128, 22, 0.2) !important;
}

/* Состояния disabled и loading — только для основной кнопки */
.loadmore-btn:disabled,
.loadmore-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
    background: #ccc !important;
    border-color: #999 !important;
    color: #666 !important;
    transform: none;
    box-shadow: none !important;
}

.loadmore-btn.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: atfun-spin 0.8s linear infinite;
    vertical-align: middle;
}

/* Скрытие карточек */
.event-card.loadmore-hidden,
.workshop-card.loadmore-hidden,
.workshop-card.filtered-out {
    display: none !important;
}


/* ==========================================================================
   3. ОБЩИЕ АНИМАЦИИ
   ========================================================================== */

@keyframes atfun-spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes atfun-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==========================================================================
   4. BOTTOM SHEET / ШТОРКА
   Модальное окно для мобильных устройств.
   Используется в: events, workshops, clubs.
   ========================================================================== */

/* Оверлей */
.atfun-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.atfun-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Сама шторка */
.atfun-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 85vh;
    background: #fff;
    z-index: 9999999;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.2);
}
.atfun-bottom-sheet.active {
    transform: translateY(0);
}

/* Шапка шторки */
.atfun-bs-header {
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-bottom: 1px solid #eee;
    background: #fff;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
}

/* Ручка для свайпа */
.atfun-bs-drag-handle {
    width: 40px;
    height: 5px;
    background: #ddd;
    border-radius: 3px;
}

/* Кнопка закрытия */
.atfun-bs-close {
    position: absolute;
    right: 15px;
    top: 7px;
    background: #f0f0f0;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}
.atfun-bs-close:hover {
    background: #e0e0e0;
}

/* Контентная область */
.atfun-bs-content {
    flex: 1;
    position: relative;
    background: #fff;
    overflow: hidden;
}

/* iframe внутри шторки */
#atfun-bs-iframe {
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#atfun-bs-iframe.loaded {
    opacity: 1;
}

/* Лоадер */
.atfun-bs-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #666;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}
.atfun-bs-loader.visible {
    display: flex;
}

.atfun-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #f68016;
    border-radius: 50%;
    animation: atfun-spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes atfun-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   5. ГЛАВНАЯ СТРАНИЦА — СЕКЦИИ И ЗАГОЛОВКИ
   ========================================================================== */

.home-section {
    margin: 40px 0;
    padding: 0 20px;
    font-family: 'Montserrat', 'Poppins', sans-serif;
    position: relative;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-title-container {
    flex: 1;
    min-width: 200px;
}

.section-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Ссылка в заголовке секции */
.section-title-link {
    text-decoration: none !important;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}
.section-title-link:hover {
    color: #333;
}

/* Цвет при наведении для конкретных секций */
.home-workshops-section .section-link:hover,
.home-events-section .section-title-link:hover {
    color: #e67e22 !important;
}
.home-workshops-section .section-title-link:hover .location-highlight,
.home-workshops-section .section-title-link:hover .section-arrow,
.home-events-section .section-title-link:hover .location-highlight,
.home-events-section .section-title-link:hover .section-arrow {
    color: #333 !important;
}

/* Стрелка в заголовке */
.section-arrow {
    transition: transform 0.3s ease;
    font-weight: 700;
    margin-left: 5px;
}
.section-title-link:hover .section-arrow {
    transform: translateX(5px);
}

/* Кнопки прокрутки слайдера */
.scroll-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scroll-button {
    display: none; /* показываем только на десктопе */
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 10;
    padding: 0;
}
.scroll-button:hover {
    background: #ffffffff !important;
            transform: scale(1.2);
            border: 1px solid #000000ff;
}
.scroll-button:active {
    transform: scale(0.95);
}
.scroll-button:disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}
.scroll-button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

@media (min-width: 992px) {
    .scroll-button {
        display: flex;
    }
}

/* Контейнер карточек */
.cards-container {
    position: relative;
}




/* ==========================================================================
   6. ГОРИЗОНТАЛЬНЫЙ СЛАЙДЕР КАРТОЧЕК
   ========================================================================== */

.cards-slider {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 20px;
    padding: 10px 0;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    touch-action: pan-y;
}
.cards-slider::-webkit-scrollbar {
    display: none;
}




/* ==========================================================================
   7. КАРТОЧКИ ГЛАВНОЙ СТРАНИЦЫ (.card-home)
   ========================================================================== */

.card-home {
    flex: 0 0 calc(25% - 15px);
    min-width: 280px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: auto !important;
    min-height: 300px !important;
    scroll-snap-align: start;
    position: relative;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    will-change: transform;
}

.card-home:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Изображение карточки */
.card-image-home {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f7fa;
    margin: 0;
    padding: 0;
}

.card-image-home img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
    transition: transform 0.5s ease;
    display: block;
}

.card-home:hover .card-image-home img {
    transform: scale(1.05);
}

/* --- Бейджи на изображении --- */
.age-badge-home,
.workshop-price-badge-home,
.event-price-badge-home {
    position: absolute !important;
    background: rgba(255, 255, 255, 0.95) !important;
    padding: 4px 10px !important;
    border-radius: 20px;
    font-size: 11px !important;
    font-weight: 600;
    color: #333 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid #838584;
    z-index: 20;
    white-space: nowrap !important;
}

/* Цена — вверху слева */
.workshop-price-badge-home,
.event-price-badge-home {
    top: 12px !important;
    left: 12px !important;
}

/* Возраст — внизу слева */
.age-badge-home {
    bottom: 10px !important;
    left: 12px !important;
}

/* Категория — вверху справа */
.category-badge-home {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    z-index: 2;
    max-width: calc(100% - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Контент карточки --- */
.card-content-home {
    padding: 16px 15px 15px 15px !important;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: 100%;
    box-sizing: border-box;
    gap: 0;
    justify-content: flex-start;   /* Главное изменение здесь */
}

/* Дата — намертво приклеена к верху */
.card-dates-home {
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    color: #666 !important;
    line-height: 1.4;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    flex-shrink: 0;
    align-self: flex-start;
    width: 100%;
}

/* Заголовок */
.card-title-home {
    margin: 0 0 14px 0 !important;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 1;           /* лучше 2 строки, чем 1 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-shrink: 0;
}

.card-title-home a {
    color: #1a1a1a;
    text-decoration: none !important;
}

.card-title-home a:hover {
    color: #c75f02;
    text-decoration: none !important;
}

/* ========================================================== */
/* ОБНОВЛЕННЫЙ БЛОК АДРЕСА НА ГЛАВНОЙ (в стиле синей карточки) */
/* ========================================================== */

/* Ссылка-контейнер (теперь кликабелен весь блок) */
.card-address-home-link {
    display: block;
    margin: 12px 0 0 0;
    text-decoration: none !important; /* Усиливаем защиту от подчеркиваний темы */
    border-bottom: none !important; /* На случай, если тема делает подчеркивание бордером */
    box-shadow: none !important;
    transition: opacity 0.2s;
}

.card-address-home-link:hover,
.card-address-home-link:focus {
    opacity: 0.8;
    text-decoration: none !important;
}

/* Флекс-контейнер: иконка слева, текст справа */
.card-address-home-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px; /* Аналог mr-3 */
}

/* Круглый фон для иконки (аналог bg-slate-50 w-8 h-8 rounded-full) */
.card-address-icon-bg {
    width: 32px;
    height: 32px;
    background-color: #f8fafc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Сама иконка (оранжевая, как вы просили) */
.card-address-icon-home {
    width: 16px; /* Аналог w-4 h-4 */
    height: 16px;
    color: #f97316; /* Оранжевый Tailwind orange-500 */
}

/* Контейнер для текста */
.card-address-text-container {
    display: flex;
    flex-direction: column;
    padding-top: 1px; /* Слегка подправил центровку под больший шрифт */
    line-height: 1.3;
}

/* Индекс и город (первая строка) - СДЕЛАЛИ БОЛЬШЕ */
.card-plz-city-home {
    font-size: 13px; /* Было 11px */
    font-weight: 700;
    color: #475569; /* text-slate-600 */
}

/* Улица (вторая строка, более светлая) - СДЕЛАЛИ БОЛЬШЕ */
.card-address-text-home {
    font-size: 12px; /* Было 11px */
    font-weight: 500;
    color: #334660; /* text-slate-400 */
    margin-top: 2px;
}
/* ==========================================================================
   8. АДАПТИВНОСТЬ ГЛАВНОЙ СТРАНИЦЫ
   ========================================================================== */

/* Планшет горизонтальный: 3 карточки */
@media (max-width: 1200px) {
    .card-home {
        flex: 0 0 calc(33.333% - 14px);
        min-width: 260px;
        min-height: 350px;
    }
    .card-image-home {
        height: 130px !important;
    }
}

/* Планшет вертикальный: 2 карточки */
@media (max-width: 992px) {
    .card-home {
        flex: 0 0 calc(50% - 10px);
        min-width: 240px;
        min-height: 340px;
    }
    .section-title {
        font-size: 24px;
    }
    .cards-slider {
        touch-action: pan-x pan-y;
    }
    .scroll-buttons {
        display: none;
    }
}

/* ====================== МОБИЛЬНЫЕ ====================== */

/* Основной мобильный (768px и меньше) */
@media (max-width: 768px) {
    .home-section {
        padding: 0 20px !important;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .card-home {
        flex: 0 0 80%;
        min-width: 80%;
        margin-right: 5px !important;
        min-height: 320px;
    }

    .card-content-home {
        padding: 12px !important;
    }

    .card-image-home {
        height: 130px;
    }

    .cards-slider {
        gap: 15px;
    }

    /* Бейджи */
    .age-badge-home {
        bottom: 6px !important;
        left: 6px !important;
        font-size: 10px !important;
        padding: 2px 6px !important;
    }
    .workshop-price-badge-home,
    .event-price-badge-home {
        top: 6px !important;
        left: 6px !important;
        font-size: 10px !important;
        padding: 2px 6px !important;
    }
    .category-badge-home {
        top: 8px;
        right: 8px;
        font-size: 10px;
        padding: 2px 6px !important;
    }

     /* Дата — уменьшаем отступ снизу */
    .card-dates-home {
        font-size: 12px !important;
        margin: 0 0 6px 0 !important;     /* ← главное изменение */
        line-height: 1.3;
    }

    /* Текст */
    .card-title-home {
        font-size: 14px;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        line-height: 1.25;
        margin: 0 0 6px 0 !important;   /* уменьшили */
    }

   

    /* Адрес — убираем авто-отступ, делаем фиксированный */
    .card-address-home {
        font-size: 13px;
        margin-top: 4px !important;       /* маленький фиксированный отступ */
        margin-bottom: 0 !important;
    }
}

/* Маленький мобильный (до 480px) */
@media (max-width: 480px) {
    .home-section {
        padding: 0 10px;
    }
    .section-title {
        font-size: 18px;
    }
    .card-home {
        min-height: 200px !important;     /* чуть увеличили, чтобы выглядело лучше */
    }
    .card-content-home {
        padding: 11px !important;
    }
    .card-title-home {
        font-size: 15.5px;
        line-height: 1.25;
        margin-bottom: 7px !important;
    }
    .card-dates-home {
        font-size: 12px !important;
        margin: 0 0 5px 0 !important;
    }
    .card-address-home {
        font-size: 13px !important;
        margin-top: 3px !important;
    }
}

/* Очень маленький экран (до 360px) */
@media (max-width: 360px) {
    .card-home {
        flex: 0 0 85%;
        min-width: 85%;
        min-height: 280px;
    }
    .card-image-home {
        height: 135px;
    }
    .card-title-home {
        font-size: 15px;
    }
    .card-dates-home {
        font-size: 11.5px !important;
        margin-bottom: 5px !important;
    }
    .card-address-home {
        margin-top: 2px !important;
    }
}