/* ===================================================================
   1. ОБЩИЕ СТИЛИ И СБРОС НАСТРОЕК
   =================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

/* ===================================================================
   2. СТИЛИ МАКЕТА И КОНТЕЙНЕРОВ
   =================================================================== */

.container {
    display: flex;
    max-width: 1200px;
    margin: 15px auto;
    gap: 15px;
    flex-wrap: wrap;
    padding: 0 10px;
}

.sidebar {
    width: 250px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.content {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.teachers-section {
    max-width: 1200px;
    width: calc(100% - 20px);
    margin: 20px auto;
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.btn-wrapper {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

.team-section {
    width: 100%;
    max-width: 960px;       /* ограничиваем ширину, чтобы не было слишком широко */
    margin: 24px auto;       /* центрирование по горизонтали */
    padding: 0 12px;         /* небольшие боковые отступы на мобильных */
}

.team-section h2.section-title-center {
    margin-bottom: 16px;    /* фиксируем отступ под заголовком */
}


/* ===================================================================
   3. СТИЛИ ДЛЯ ЭЛЕМЕНТОВ НАВИГАЦИИ И ВКЛАДОК
   =================================================================== */

.tabs .tab {
    padding: 12px 15px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 15px;
    border-radius: 4px;
}

.tabs .tab:hover {
    background: #e9f0ff;
}

.tabs .tab.active {
    background: #007bff;
    color: white;
    border-left: 3px solid #0056b3;
}

/* ===================================================================
   4. СТИЛИ ДЛЯ КНОПОК И ССЫЛОК
   =================================================================== */

.callback-link {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 16px;
    border: 2px solid #007bff;
    border-radius: 6px;
    display: inline-block;
    transition: all 0.3s ease;
}

.callback-link:hover {
    background-color: #007bff;
    color: white;
}

.callback-button {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    transition: background 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.callback-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.callback-btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ff6b00;
    color: white;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.icon-phone {
    font-size: 18px;
}

.open-form-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.btn-icon {
    font-size: 18px;
}

.open-form-btn:hover {
    background: #0056b3;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.open-form-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* 5. СТИЛИ ДЛЯ КАРТОЧЕК ПРЕПОДАВАТЕЛЕЙ (ИСПРАВЛЕННАЯ ВЕРСИЯ) */
.teachers-section {
    max-width: 1200px;
    width: 100%;
    margin: 20px auto;
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.teachers-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.teacher-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.teacher-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.teacher-photo {
    width: 140px;
    height: 140px;
    margin-bottom: 16px;
    overflow: hidden; /* Ключевое свойство: обрезает всё, что вылезает */
    border-radius: 8px; /* Квадратная рамка со скруглением */
    flex: 0 0 auto;
    position: relative;
    border: 4px solid #f0f0f0;
    background-color: #eee; /* Цвет фона, если фото не загрузится */
}

.teacher-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Картинка заполняет рамку, не искажаясь */
    display: block;
}

.teacher-info {
    flex: 1;
    width: 100%;
}

.teacher-name {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.1rem;
    line-height: 1.3;
}

.teacher-position {
    margin: 0 0 12px 0;
    color: #555;
    font-weight: 400;
    font-style: normal;
    font-size: 0.95rem;
}

.teacher-description {
    line-height: 1.5;
    color: #444;
    font-size: 0.95rem;
    margin: 0;
}
.teachers-title {
    background-color: #1e90ff;
    color: white;
    border-radius: 1rem;
    padding: 1.2rem 1.8rem;
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 700;
    text-align: center;
    margin: 1rem 0;
    width: fit-content;
    max-width: 90vw;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    margin-left: auto;
    margin-right: auto;
}

.content .teachers-section h2.teachers-title {
    font-size: 32px;
    background-color: #007bff;
    width: 100%;
    padding: 10px 0;
    text-align: center;
    margin: 0 0 20px 0;
    border-radius: 8px;
}

/* ===================================================================
   6. СТИЛИ ДЛЯ ГАЛЕРЕИ ИЗОБРАЖЕНИЙ
   =================================================================== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 20px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.gallery-item-inner {
    position: relative;
    width: 100%;
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 15px 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-caption {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

/* ===================================================================
   7. СТИЛИ ДЛЯ МОДАЛЬНЫХ ОКОН
   =================================================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: auto;
}

.form-iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 4px;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    font-weight: bold;
}

.close-btn:hover {
    color: #333;
}

/* ===================================================================
   8. СТИЛИ ДЛЯ ИЗОБРАЖЕНИЙ И КОНТЕЙНЕРОВ С ИЗОБРАЖЕНИЯМИ
   =================================================================== */

.header-image-wrapper {
    width: 100%;
    overflow: hidden;
    margin-bottom: 15px;
}

.header-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.element-block {
    padding: 1rem;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.image-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.detail-picture {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.detail-picture:hover {
    transform: scale(1.02);
}

.no-image-message {
    padding: 2rem;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
}

/* ===================================================================
   9. СТИЛИ ДЛЯ ТЕКСТОВЫХ ЭЛЕМЕНТОВ
   =================================================================== */

h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

p {
    margin-bottom: 12px;
    font-size: 14px;
}

/* ===================================================================
   10. СТИЛИ ДЛЯ СПИСКОВ
   =================================================================== */

.file-list {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 15px 0;
}

.file-list li {
    margin-bottom: 8px;
}

.file-list a {
    color: inherit;
    text-decoration: underline;
}

/* ===================================================================
   11. СТИЛИ ДЛЯ БЛОКОВ КОНТЕНТА
   =================================================================== */

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 15px;
}

/* ===================================================================
   12. СПОЙЛЕРЫ (СОСТАВ ШТАБА, ФОТОАРХИВ, МЕТОДИЧЕСКАЯ КОПИЛКА)
   =================================================================== */

.section-title-center {
    text-align: center;
    margin: 24px 0 16px;
    font-size: 1.5rem;
    cursor: pointer;
    user-select: none;
}

.spoiler-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.spoiler-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0 !important;
}

.spoiler-content:not(.collapsed) {
    max-height: 1000px;
    opacity: 1;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* Альбомы внутри фотоархива */
.album-block {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 20px;
}

.album-title {
    text-align: center;
    margin: 0;
    padding: 12px 15px;
    font-size: 1.2rem;
    cursor: pointer;
    user-select: none;
    background: #f0f4f8;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.album-title:hover {
    background: #e3ecf3;
}

.album-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
}

.album-content.collapsed {
    max-height: 0;
    opacity

/* ===================================================================
   14. ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ БИТРИКСА И ВСТАВОК
   =================================================================== */

/* Чтобы .detail-picture корректно работал в компонентах Битрикса */
.detail-picture {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* Если .detail-picture лежит внутри блока с фиксированной шириной — не вылезает */
.element-block .detail-picture,
.content-section .detail-picture {
    max-width: 100%;
}

/* Для CIBlockElement и стандартных контейнеров Битрикса — сброс лишних отступов */
.iblock-element,
.ci-block-element {
    width: 100%;
}

/* Контейнер детальной картинки в карточке элемента */
.detail-image-wrapper {
    width: 100%;
    text-align: center;
}

/* ===================================================================
   15. СТИЛИ ДЛЯ ФОРМ И ПОЛЕЙ (если понадобится форма заявки)
   =================================================================== */

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

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

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #444;
}

/* Кнопка отправки формы */
.submit-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.submit-btn:hover {
    background: #0056b3;
}

/* ===================================================================
   16. ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ (UTILITY)
   =================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.p-15 { padding: 15px; }

/* Класс для принудительного центрирования картинки (если в шаблоне что-то ломает margin: 0 auto) */
.img-center {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ===================================================================
   17. МЕДИА‑ЗАПРОСЫ (АДАПТИВНОСТЬ — ПРОДОЛЖЕНИЕ)
   =================================================================== */

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        margin: 10px auto;
        gap: 10px;
    }

    .sidebar {
        width: 100%;
        padding: 12px;
    }

    .header-image-wrapper {
        margin-bottom: 10px;
    }

    .tabs .tab {
        font-size: 14px;
        padding: 10px 12px;
    }

    .content {
        padding: 20px;
    }

    .teachers-section {
        padding: 20px;
        width: calc(100% - 10px);
    }

    p {
        font-size: 13px;
    }

    /* Делаем фото круглым на мобильных */
    .teacher-photo {
        border-radius: 50% !important;
    }

    /* Картинки в деталях */
    .detail-picture,
    .content-section .detail-picture,
    .element-block .detail-picture {
        max-width: 95% !important;
        width: 100% !important;
        margin: 10px auto !important;
    }

    .tabs .detail-picture {
        max-width: 90%;
    }

    .element-block {
        padding: 0.5rem;
    }

    .detail-picture {
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .no-image-message {
        padding: 1.5rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .container, .sidebar, .content, .teachers-section {
        padding: 10px;
    }

    .teacher-card {
        padding: 1rem 0.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .open-form-btn,
    .callback-button,
    .submit-btn {
        width: 100%;
        text-align: center;
    }

    .btn-wrapper {
        position: static;
        margin-top: 15px;
        text-align: center;
    }
}
