/* Стили для главной страницы */
body {
    background: linear-gradient(135deg, #f8fff8 0%, #f3f7fa 100%);
}

.section-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.7s cubic-bezier(.4,0,.2,1);
}

.section-fade.visible {
    opacity: 1;
    transform: none;
}

.card, .gallery-item {
    box-shadow: 0 2px 16px rgba(44,62,80,0.07);
    border-radius: 1.5rem;
}

.gallery-item {
    border: 2px solid #e0f5e0;
    margin-bottom: 0.5rem;
}

.gallery-caption {
    text-align: center;
    font-size: 1em;
    color: #256029;
    margin-top: 0.3em;
}

.advantage-item, .skill-item {
    background: rgba(255,255,255,0.95);
    transition: box-shadow .3s, transform .3s;
}

.advantage-item:hover, .skill-item:hover {
    box-shadow: 0 8px 32px rgba(44,62,80,0.13);
    transform: translateY(-6px) scale(1.03);
}

/* Стили для изображений и блоков */
.logoped-img {
    width: 180px !important;
    height: 180px !important;
    max-width: 180px !important;
    max-height: 180px !important;
    object-fit: cover;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    flex-shrink: 0;
    display: block;
}

.slogan-block {
    display: flex;
    align-items: center;
    gap: 0.7em;
    margin-top: 1.2em;
    font-size: 1.25em;
    font-weight: 600;
    color: #43a047 !important;
    background: rgba(232,255,232,0.7) !important;
    border-radius: 18px;
    padding: 0.7em 1.2em;
    box-shadow: 0 2px 12px rgba(74,112,74,0.08);
}

.slogan-icon {
    font-size: 1.5em;
}

.gallery-img {
    width: 100%;
    max-width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    background: #f3f7fa;
}

@media (min-width: 1400px) {
    .container-xl {
        max-width: 1320px;
    }
}

@media (min-width: 1200px) {
    .container-xl {
        max-width: 1100px;
    }
}

@media (max-width: 768px) {
    .logoped-img {
        width: 150px !important;
        height: 150px !important;
        max-width: 150px !important;
        max-height: 150px !important;
    }
}

@media (max-width: 576px) {
    .logoped-img {
        width: 120px !important;
        height: 120px !important;
        max-width: 120px !important;
        max-height: 120px !important;
    }
}

.card .logoped-img {
    width: 180px !important;
    height: 180px !important;
    max-width: 180px !important;
    max-height: 180px !important;
    object-fit: cover;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    flex-shrink: 0;
    display: block;
}

@media (max-width: 768px) {
    .card .logoped-img {
        width: 150px !important;
        height: 150px !important;
        max-width: 150px !important;
        max-height: 150px !important;
    }
}

@media (max-width: 576px) {
    .card .logoped-img {
        width: 120px !important;
        height: 120px !important;
        max-width: 120px !important;
        max-height: 120px !important;
    }
}

.card.d-flex .logoped-img {
    width: 180px !important;
    height: 180px !important;
    min-width: 180px !important;
    min-height: 180px !important;
    max-width: 180px !important;
    max-height: 180px !important;
    object-fit: cover;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    flex: 0 0 180px !important;
    display: block;
}
@media (max-width: 768px) {
    .card.d-flex .logoped-img {
        width: 150px !important;
        height: 150px !important;
        min-width: 150px !important;
        min-height: 150px !important;
        max-width: 150px !important;
        max-height: 150px !important;
        flex: 0 0 150px !important;
    }
}
@media (max-width: 576px) {
    .card.d-flex .logoped-img {
        width: 120px !important;
        height: 120px !important;
        min-width: 120px !important;
        min-height: 120px !important;
        max-width: 120px !important;
        max-height: 120px !important;
        flex: 0 0 120px !important;
    }
}

.greeting-block {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 2px 16px rgba(44,62,80,0.07);
    padding: 2rem 2.5rem;
}
.greeting-photo-wrapper {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    min-height: 220px;
}
.greeting-photo {
    width: 220px;
    height: 220px;
    min-width: 220px;
    min-height: 220px;
    max-width: 220px;
    max-height: 220px;
    object-fit: cover;
    border-radius: 1.2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.13);
    display: block;
}
@media (max-width: 992px) {
    .greeting-block {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 1.2rem 0.7rem;
    }
    .greeting-photo-wrapper {
        min-width: 160px;
        min-height: 160px;
    }
    .greeting-photo {
        width: 160px;
        height: 160px;
        min-width: 160px;
        min-height: 160px;
        max-width: 160px;
        max-height: 160px;
    }
}
@media (max-width: 576px) {
    .greeting-block {
        padding: 0.7rem 0.2rem;
        gap: 1rem;
    }
    .greeting-photo-wrapper {
        min-width: 120px;
        min-height: 120px;
    }
    .greeting-photo {
        width: 120px;
        height: 120px;
        min-width: 120px;
        min-height: 120px;
        max-width: 120px;
        max-height: 120px;
    }
}

.office-gallery {
    background: #fff;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 2px 16px rgba(44,62,80,0.07);
}

.office-gallery-title {
    color: #2e7d32 !important;
    text-align: center;
    font-weight: 700;
    margin-bottom: 2rem;
    margin-top: 0;
    letter-spacing: 0.01em;
}

.office-gallery-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.office-gallery-item {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.office-gallery-item:hover .office-img {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(44,62,80,0.13);
    z-index: 2;
}

.office-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s, box-shadow 0.3s;
}

.office-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 0.8rem;
    text-align: center;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .office-gallery-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .office-gallery-item {
        margin-bottom: 1rem;
    }
    .office-img {
        height: 220px;
    }
}

@media (max-width: 600px) {
    .office-gallery-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .office-gallery-item {
        margin-bottom: 0.5rem;
    }
    .office-img {
        height: 200px;
    }
}

.welcome-text {
    text-align: justify;
    color: #222 !important;
}

/* Modal styles */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    align-items: flex-start;
    justify-content: center;
    transition: opacity 0.3s;
    padding: 0;
    --header-height: 110px;
}

body.modal-open {
    overflow: hidden;
}

.modal-overlay.active {
    display: flex;
}

.modal-overlay::before {
    content: '';
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    transition: opacity 0.3s;
    pointer-events: none;
}

.modal-content {
    max-width: 92vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 1.2rem;
    box-shadow: 0 8px 32px rgba(44,62,80,0.25);
    background: #fff;
    padding: 0.5rem;
    margin: auto;
    display: block;
    /* opacity: 0; */
    transform: scale(0.97);
    transition: opacity 0.35s cubic-bezier(.4,0,.2,1), transform 0.35s cubic-bezier(.4,0,.2,1);
    z-index: 2;
    position: relative;
}

.modal-overlay.active .modal-content {
    opacity: 1;
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
    z-index: 3;
    background: none;
    border: none;
    transition: color 0.2s;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.modal-close:hover {
    color: #2e7d32;
}

.modal-caption {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    z-index: 3;
}

/* Стили для изображений с возможностью увеличения */
.zoomable {
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.zoomable:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@media (max-width: 600px) {
    .modal-content {
        max-width: 98vw;
        max-height: 60vh;
        width: auto;
        height: auto;
        object-fit: contain;
        padding: 0.2rem;
        margin: auto;
    }
    .modal-close {
        top: 1rem;
        right: 1rem;
        font-size: 2rem;
    }
    .modal-caption {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
}

.about-photo-col {
    display: flex;
    align-items: flex-start;
    overflow: hidden;
    border-radius: 28px;
    max-width: 360px;
    width: 100%;
}

.about-photo-framed {
    border: none;
    border-radius: 28px;
    box-shadow: 0 6px 32px rgba(74,112,74,0.18);
    background: #fff;
    padding: 0;
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: box-shadow 0.3s;
}

.about-row-flex {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* Unified text styles for content blocks */
.content-block {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #2c3e50;
    text-align: justify;
    margin-bottom: 1.5rem;
}

.content-block p {
    margin-bottom: 1.2rem;
}

.content-block h2, 
.content-block h3, 
.content-block h4 {
    color: #2e7d32;
    font-weight: 600;
    margin-bottom: 1rem;
}

.content-block h2 {
    font-size: 1.8rem;
}

.content-block h3 {
    font-size: 1.5rem;
}

.content-block h4 {
    font-size: 1.3rem;
}

.content-block ul {
    padding-left: 1.2rem;
    margin-bottom: 1.2rem;
}

.content-block li {
    margin-bottom: 0.5rem;
}

.content-block .text-muted {
    color: #6c757d !important;
    font-size: 1rem;
}

/* Apply to all cards and content sections */
.card, 
.glass-card,
.about-text,
.welcome-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #2c3e50;
    text-align: justify;
}

/* Unified styles for skills/competence blocks */
.skills-block {
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 2px 16px rgba(44,62,80,0.07);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
}

.skill-item {
    background: transparent;
    box-shadow: none;
    border-radius: 1rem;
    padding: 0.5rem 0.5rem 0.5rem 0;
    text-align: left;
    transition: box-shadow .3s, transform .3s;
}

.skill-item .skill-item-icon {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.skill-item-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #2c3e50;
    text-align: left;
}

.skill-item-title {
    color: #2e7d32;
    font-weight: 600;
    font-size: 1.18rem;
    margin-bottom: 0.3rem;
    text-align: left;
}

@media (max-width: 768px) {
    .skills-block {
        padding: 1.2rem 0.5rem;
    }
    .skill-item {
        padding: 0.5rem 0;
    }
}

/* Fix: Use green for block section headings */
.advantage-block h2, .advantage-block h3, .faq-block h2, .faq-block h3, .faq-block .accordion-button, .faq-block .accordion-header, .faq-block .accordion-item.active .accordion-button, .faq-block .accordion-item .accordion-button[aria-expanded="true"] {
    color: #2e7d32 !important;
}

/* Remove blue color from highlighted/active FAQ */
.faq-block .accordion-item.active, .faq-block .accordion-item .accordion-button[aria-expanded="true"] {
    background-color: #e0f5e0 !important;
    color: #2e7d32 !important;
}

/* Override Bootstrap .text-primary to use site green */
.text-primary {
    color: #2e7d32 !important;
}

/* Center and unify all main block section headings on the main page */
.card-title,
.section-title,
.main-section-title,
.advantage-block h2,
.advantage-block h3,
.faq-block h2,
.faq-block h3 {
    color: #2e7d32 !important;
    text-align: center;
    font-weight: 700;
    margin-bottom: 2rem;
    margin-top: 0;
    letter-spacing: 0.01em;
}

/* FAQ block: make questions more prominent */
.faq-block .accordion-button {
    background: #e8fbe8;
    color: #256029 !important;
    font-weight: 700;
    font-size: 1.15rem;
    box-shadow: 0 2px 8px rgba(74,112,74,0.06);
    border-radius: 12px !important;
    margin-bottom: 0.5rem;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.faq-block .accordion-button:hover, .faq-block .accordion-button:focus {
    background: #e0f5e0;
    color: #2e7d32 !important;
    box-shadow: 0 4px 16px rgba(74,112,74,0.10);
}
.faq-block .accordion-button:not(.collapsed) {
    background: #e0f5e0;
    color: #2e7d32 !important;
    box-shadow: 0 4px 16px rgba(74,112,74,0.10);
}

/* Style for the answer text within the accordion body */
.faq-block .accordion-body {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #2c3e50;
    text-align: justify;
}

/* --- Fixes for main page dropdown and headings --- */
/* Удалено: .dropdown-content, .dropdown-menu, .dropdown-item, .dropdown-item:hover (теперь всё управляется через layout.css) */

/* Усиленный селектор для зелёного цвета надписи "Логопед на Пятёрке: работаем только на 5" */
.greeting-block .slogan-block,
.welcome-block .slogan-block {
    color: #43a047 !important;
}
