/* --- Глобальные настройки и шрифты --- */
body {
    font-family: 'Montserrat', sans-serif;
    color: #343a40;
    background-color: #f8f9fa;
}

/* --- Цветовая палитра --- */
:root {
    --primary-deep: #1e3a8a;
    --primary-light: #3b82f6;
    --accent-gold: #f59e0b;
    --bg-dark: #212529;
}

.color-primary-deep {
    color: var(--primary-deep) !important;
}
.color-accent-gold {
    color: var(--accent-gold) !important;
}

.cosmic-gradient {
    background: linear-gradient(90deg, var(--primary-deep) 0%, #2563eb 100%);
}

/* --- Шапка и логотип --- */
.logo-1-1 {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0;
    border: none;
}

.sltitle {
    font-size: 1.5rem !important;
    line-height: 1.3;
    font-weight: 700;
    color: var(--primary-deep);
}

.sltitle .short {
    font-size: 0.8rem !important;
    font-weight: 400;
    color: #6c757d;
}

.purple-icon {
    font-size: 1.5rem !important;
    color: var(--primary-deep) !important;
}

.single-widget p.small,
.single-widget a.small {
    font-size: 0.9rem !important;
}

/* --- Адаптивность: Контакты в шапке --- */
@media (min-width: 768px) {
    .row.g-3.justify-content-lg-end {
        gap: 0 !important;
        display: flex;
        justify-content: space-between !important;
        width: 100%;
    }
    .col-lg-4.single-widget {
        max-width: 33.333%;
        flex: 0 0 33.333%;
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 767px) {
    .col-lg-8.col-md-12 {
        display: none;
    }

    header .row.align-items-center {
        flex-direction: column;
        text-align: center;
    }

    header .col-lg-4.col-md-12.text-lg-start.text-center {
        margin-bottom: 10px;
    }

    header .row.g-3.justify-content-lg-end {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        justify-items: center;
        margin-top: 10px;
    }

    header .single-widget {
        width: 100%;
        margin: 0;
        text-align: center;
    }

    header .row.g-3.justify-content-lg-end .single-widget:nth-child(3) {
        grid-column: 1 / -1;
        justify-self: center;
    }

    @media (max-width: 480px) {
        header .row.g-3.justify-content-lg-end {
            grid-template-columns: 1fr;
        }
        header .row.g-3.justify-content-lg-end .single-widget:nth-child(3) {
            grid-column: auto;
            justify-self: center;
        }
    }
}

/* --- Навигационное меню --- */
@media (min-width: 992px) {
    .navbar-nav {
        width: auto;
        display: flex;
        justify-content: center;
        gap: 28px;
        align-items: center;
    }
    .nav-link {
        color: #fff !important;
        padding: 0.75rem 0.6rem;
        transition: color 0.3s ease, background-color 0.3s ease;
        z-index: 2;
        font-weight: 600;
    }
    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 5px;
        left: 10%;
        width: 80%;
        height: 3px;
        background-color: var(--accent-gold);
        transform: scaleX(0);
        transform-origin: bottom center;
        transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1);
        z-index: 1;
    }
}

.nav-item {
    position: relative;
}
.nav-link:hover,
.nav-link.active {
    color: #ffffff !important;
    background-color: transparent;
    border-radius: 0;
}
.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

@media (max-width: 991.98px) {
    .navbar-nav {
        justify-content: flex-start;
        flex-direction: column;
        gap: 8px;
    }
    .nav-link::after {
        display: none;
    }
    .nav-link {
        padding: 10px 0;
    }
    .nav-link:hover,
    .nav-link.active {
        color: var(--accent-gold) !important;
        background-color: rgba(255, 255, 255, 0.03);
        border-radius: 4px;
    }
}

/* --- Offcanvas (мобильное меню слева) --- */
.offcanvas-start {
    width: 260px;
    transition: transform 0.3s ease-in-out;
}

.offcanvas-start:not(.show) {
    transform: translateX(-100%);
}

.offcanvas-start.show {
    transform: translateX(0);
}

.offcanvas-body ul {
    padding-left: 0;
}
.offcanvas-body .nav-link {
    color: #fff !important;
    font-size: 1rem;
    padding: 8px 0;
}
.offcanvas-body .nav-link:hover {
    color: var(--accent-gold) !important;
}

/* --- Слайдер (Swiper) --- */
.swiper-slide {
    min-height: 450px;
    background-size: cover !important;
    background-position: center center !important;
}

.swiper-slide .overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

.swiper-slide h1 {
    font-size: 2.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
}

.swiper-slide p {
    font-size: 1rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
}

.swiper-button-next, .swiper-button-prev {
    background-color: transparent !important;
    border: none !important;
    width: auto;
    height: auto;
    padding: 0 10px;
    opacity: 0.9;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.swiper-button-next::after, .swiper-button-prev::after {
    font-size: 2rem;
    color: #ffffff;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

.swiper-button-next:hover, .swiper-button-prev:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* --- Секция "Kodėl muzika?" --- */
.cosmic-section-bg {
    background: var(--primary-deep);
    border-radius: 10px;
}
.cosmic-section-bg p.lead {
    font-size: 1.25rem;
    color: #f8f9fa;
}
.cosmic-section-bg .text-white-50 {
    color: rgba(255, 255, 255, 0.75) !important;
}
.cosmic-section-bg .text-white {
    color: #ffffff !important;
}

/* --- Секция "Veiklos" (Карточки) --- */
.section-title-purple {
    color: var(--primary-deep);
}

.activity-card img {
    height: 250px;
    object-fit: cover;
    border-bottom: 5px solid var(--accent-gold);
}

.cosmic-card {
    background-color: #ffffff;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.cosmic-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(30, 58, 138, 0.2) !important;
}

.cosmic-card .card-body {
    padding: 1.5rem;
    color: var(--primary-deep) !important;
}

.cosmic-card a {
    color: var(--primary-deep) !important;
    transition: color 0.3s ease;
}
.cosmic-card a:hover {
    color: var(--accent-gold) !important;
}

/* --- Таблица контактов --- */
.cosmic-table {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    font-family: 'Montserrat', sans-serif;
    color: #343a40;
    width: 100%;
}

.cosmic-table thead {
    background-color: #1e3a8a;
    color: #ffffff;
}

.cosmic-table th,
.cosmic-table td {
    padding: 1.25rem;
    vertical-align: middle;
    border-color: #f59e0b;
}

.cosmic-table th:nth-child(1),
.cosmic-table td:nth-child(1) {
    width: 30%;
}

.cosmic-table th:nth-child(2),
.cosmic-table td:nth-child(2) {
    width: 70%;
}

.cosmic-table th {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
}

.cosmic-table td {
    font-size: 1rem;
    font-weight: 400;
}

.cosmic-table tbody tr {
    border-bottom: 2px solid #f59e0b;
}

.cosmic-table tbody tr:last-child {
    border-bottom: none;
}

.cosmic-table .teacher-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem;
    align-items: flex-start;
    justify-content: center;
}

.cosmic-table .teacher-info div {
    display: block !important;
    line-height: 1.5;
}

.cosmic-table .teacher-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1e3a8a;
}

.cosmic-table a {
    color: #343a40;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cosmic-table a:hover {
    color: #f59e0b;
}

/* --- Таблица нуомы --- */
.rental-table {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    font-family: 'Montserrat', sans-serif;
    color: #343a40;
}

.rental-table thead {
    background-color: #1e3a8a;
    color: #ffffff;
}

.rental-table th,
.rental-table td {
    padding: 1.25rem;
    vertical-align: middle;
    border-color: #f59e0b;
}

.rental-table th:nth-child(1),
.rental-table td:nth-child(1) {
    width: 30%;
}

.rental-table th:nth-child(2),
.rental-table td:nth-child(2) {
    width: 70%;
}

.rental-table th {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
}

.rental-table td {
    font-size: 1rem;
    font-weight: 400;
}

.rental-table tbody tr:hover {
    background-color: rgba(245, 158, 11, 0.1);
}

.rental-table .rental-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem;
    align-items: flex-start;
    justify-content: center;
}

.rental-table .rental-info div {
    display: block !important;
    line-height: 1.5;
}

/* --- Таблица команды (для english.html) --- */
.team-table {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    font-family: 'Montserrat', sans-serif;
    color: #343a40;
}

.team-table thead {
    background-color: #1e3a8a;
    color: #ffffff;
}

.team-table th,
.team-table td {
    padding: 1.25rem;
    vertical-align: middle;
    border-color: #f59e0b;
}

.team-table th:nth-child(1),
.team-table td:nth-child(1) {
    width: 30%;
}

.team-table th:nth-child(2),
.team-table td:nth-child(2) {
    width: 70%;
}

.team-table th {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
}

.team-table td {
    font-size: 1rem;
    font-weight: 400;
}

.team-table tbody tr:hover {
    background-color: rgba(245, 158, 11, 0.1);
}

.team-table .team-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem;
    align-items: flex-start;
    justify-content: center;
}

.team-table .teacher-info div {
    display: block !important;
    line-height: 1.5;
}

.team-table .teacher-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1e3a8a;
}

.team-table a {
    color: #343a40;
    text-decoration: none;
    transition: color 0.3s ease;
}

.team-table a:hover {
    color: #f59e0b;
}

/* --- Карта Google Maps --- */
.map-container {
    max-width: 100%;
    margin: 0 auto;
}

.map-container iframe {
    width: 100%;
    height: 450px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* --- Стили для страницы pedagogai.html и dalykas.php --- */
main.py-5 .teacher-img {
    width: 150px !important; /* Increased specificity and !important to ensure size applies */
    height: 150px !important;
    object-fit: cover;
    border-radius: 10px !important; /* Matches template's square image with rounded corners */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important; /* Ensure shadow applies */
    margin: 0 auto; /* Center image in its container */
}

main.py-5 .read-more {
    color: var(--primary-deep) !important;
    text-decoration: underline;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

main.py-5 .read-more:hover {
    color: var(--accent-gold) !important;
}

main.py-5 .teacher-img-circle {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
}

main.py-5 .teacher-row {
    display: flex !important;
    align-items: flex-start;
    gap: 2rem;
    justify-content: center;
    margin: 0 auto 3rem auto !important; /* Ensure margin between teacher rows */
    max-width: 900px;
    padding: 1rem 0; /* Added padding for better spacing */
}

main.py-5 .teacher-text {
    flex-grow: 1;
    max-width: calc(100% - 270px);
}

main.py-5 .teacher-text p.mb-2 {
    font-size: 1rem !important; /* Ensure consistent text size */
    line-height: 1.6 !important; /* Match template's text appearance */
    margin-bottom: 0.5rem !important; /* Ensure proper spacing below description */
}

@media (max-width: 767.98px) {
    main.py-5 .teacher-row {
        gap: 1rem;
        padding: 0.5rem 0;
    }
    main.py-5 .teacher-img {
        width: 100px !important;
        height: 100px !important;
    }
    main.py-5 .teacher-img-circle {
        width: 150px;
        height: 150px;
    }
    main.py-5 .teacher-text {
        max-width: calc(100% - 170px);
    }
    main.py-5 .teacher-text:has(+ .teacher-img-circle) {
        max-width: calc(100% - 170px);
    }
}

@media (max-width: 576px) {
    main.py-5 .teacher-row {
        gap: 0.8rem;
        padding: 0.5rem 0;
    }
    main.py-5 .teacher-img {
        width: 80px !important;
        height: 80px !important;
    }
    main.py-5 .teacher-img-circle {
        width: 120px;
        height: 120px;
    }
    main.py-5 .teacher-text {
        max-width: calc(100% - 140px);
    }
    main.py-5 .teacher-text:has(+ .teacher-img-circle) {
        max-width: calc(100% - 140px);
    }
}

/* --- АДАПТИВНОСТЬ: МОБИЛЬНЫЕ УСТРОЙСТВА (до 992px) --- */
@media (max-width: 991.98px) {
    .swiper-slide h1 {
        font-size: 1.5rem !important;
    }
    .swiper-slide .lead {
        font-size: 0.9rem !important;
    }
    .swiper-slide {
        min-height: 350px !important;
    }
    .sltitle {
        font-size: 1.6rem;
    }
    .sltitle .short {
        font-size: 0.8rem;
    }

    .cosmic-table th,
    .cosmic-table td,
    .rental-table th,
    .rental-table td,
    .team-table th,
    .team-table td {
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    .cosmic-table th:nth-child(1),
    .cosmic-table td:nth-child(1),
    .rental-table th:nth-child(1),
    .rental-table td:nth-child(1),
    .team-table th:nth-child(1),
    .team-table td:nth-child(1) {
        width: auto;
    }

    .cosmic-table th:nth-child(2),
    .cosmic-table td:nth-child(2),
    .rental-table th:nth-child(2),
    .rental-table td:nth-child(2),
    .team-table th:nth-child(2),
    .team-table td:nth-child(2) {
        width: auto;
    }

    .cosmic-table .teacher-name,
    .rental-table .rental-info div,
    .team-table .teacher-name,
    .team-table .team-info div {
        font-size: 1rem;
    }

    .cosmic-table .teacher-info,
    .rental-table .rental-info,
    .team-table .team-info {
        gap: 0.4rem;
    }

    .map-container iframe {
        height: 300px;
    }
}

/* --- Очень узкие экраны (до 576px) --- */
@media (max-width: 576px) {
    .cosmic-table th,
    .cosmic-table td,
    .rental-table th,
    .rental-table td,
    .team-table th,
    .team-table td {
        font-size: 0.85rem;
        padding: 0.5rem;
    }

    .cosmic-table .teacher-name,
    .rental-table .rental-info div,
    .team-table .teacher-name,
    .team-table .team-info div {
        font-size: 0.95rem;
    }

    .cosmic-table .teacher-info,
    .rental-table .rental-info,
    .team-table .team-info {
        gap: 0.3rem;
    }
}

/* --- Новый стиль контактных карточек для страницы kontaktai.html --- */
.contact-section {
    margin-bottom: 60px;
}

.contact-card {
    background: #ffffff;
    border-radius: 15px;
    padding: 35px 25px;
    box-shadow: 0 5px 20px rgba(30, 58, 138, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.15);
}

.contact-card .icon-circle {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-deep), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px auto;
    color: #fff;
    font-size: 1.8rem;
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.25);
}

.contact-card h5 {
    color: var(--primary-deep);
    font-weight: 700;
}

.contact-card p {
    color: #343a40;
    font-size: 1rem;
}

.contact-card a {
    color: #343a40;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-card a:hover {
    color: var(--accent-gold);
}

@media (max-width: 768px) {
    .contact-card {
        padding: 25px 20px;
    }
    .contact-card .icon-circle {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

.teacher-img-400 {
    width: 400px;
    height: 400px;
    border-radius: 10px;
    object-fit: cover;
    margin-right: 20px;
}