/* ==============================================================
   1️⃣ Переменные
   ============================================================== */
:root{
    --primary:#4D897C;
    --secondary:#3498db;
    --bg-light:#f8f9fa;
    --white:#ffffff;
    --border:#dee2e6;
    --card-bg:#D2CDE7;          /* фон карточек */
    --text-dark:#333333;        /* тёмный текст */
    --bg-dark:#0b0d0f;          /* фон страницы */
    --text-light:#e6e6e6;       /* светлый текст (для заголовков секций) */
    --card-bg-dark:#1e2124;     /* не используется, оставлено для совместимости */
    --nav-bg:rgba(0,0,0,.25);
}

/* ==============================================================
   2️⃣ Сброс и глобальные стили
   ============================================================== */
*, *::before, *::after{margin:0;padding:0;box-sizing:border-box;}
html{scroll-behavior:smooth;overflow-x:hidden;}
body{
    font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
    color:var(--text-light);
    line-height:1.7;
    background:var(--bg-dark);
    padding-top:calc(135px+4px);
    overflow-x:hidden;
}
a{color:var(--secondary);text-decoration:none;transition:color .2s;}
.container{max-width:1200px;margin:auto;padding:0 24px;}

/* ==============================================================
   3️⃣ Шапка
   ============================================================== */
header{
    position:fixed;top:0;left:0;right:0;z-index:9999;
    background:var(--bg-dark);
    border-bottom:1px solid var(--border);
    box-shadow:0 2px 8px rgba(0,0,0,.06);
    padding-top:clamp(12px,3vw,16px);
    transition:transform .3s ease-out,opacity .3s ease-out;
}
header .container{
    display:flex;align-items:center;justify-content:space-between;
    flex-wrap:wrap;gap:15px;height:auto;
}
.logo img{max-width:120px;width:auto;height:45px;object-fit:contain;}
nav{
    display:flex;flex-wrap:wrap;gap:8px;
    overflow-x:auto;-webkit-overflow-scrolling:touch;
}
nav a{
    background:var(--nav-bg);
    color:var(--text-light);
    font-weight:500;font-size:15px;
    white-space:nowrap;margin:0 6px;padding:4px 8px;border-radius:4px;
    transition:all .2s;
}
nav a:hover{
    background:rgba(0,0,0,.35);
    transform:translateY(-1px);
    box-shadow:0 2px 4px rgba(44,62,80,.1);
}
.highlight-link{
    background:#eef7ff!important;border:1px solid #b6d5eb;
    color:var(--primary)!important;font-weight:bold;
    box-shadow:0 2px 4px rgba(44,62,80,.05);
}
.highlight-link:hover{transform:translateY(-1px);border-color:var(--secondary);}
.header-hidden{transform:translateY(-100%);opacity:0;pointer-events:none;}

/* ==============================================================
   4️⃣ HERO
   ============================================================== */
.hero{background:var(--bg-dark);padding-top:calc(40px+4px);padding-bottom:clamp(60px,8vh,80px);}
.hero-content{
    display:flex;flex-direction:column;align-items:center;text-align:center;
    gap:clamp(20px,4vw,36px);
}
@media (min-width:769px){
    .hero-top-group{display:flex;flex-direction:row;align-items:center;justify-content:center;
        gap:clamp(24px,5vw,48px);width:100%;}
    .logo-hero img{max-width:340px;width:auto;height:auto;object-fit:contain;display:block;}
    .hero-lines-wrapper{
        display:flex;flex-direction:column;
        gap:clamp(8px,2vw,16px);
        align-items:center; /* центрируем строки */
    }
    .hero-color-line{
        font-size:clamp(1.5rem,5.5vw,2rem);
        line-height:1.4;letter-spacing:.8px;font-weight:700;
    }
    .hero-color-line.orange{color:#EF7F1A;}
    .hero-color-line.green{color:#4D897C;}
    .hero-description{
        margin-top:clamp(12px,3vw,24px);
        max-width:700px;line-height:1.6;
        overflow-wrap:break-word;color:var(--text-light);
        font-size:clamp(1rem,3.8vw,1.15rem);
    }
}
@media (max-width:768px){
    .hero-top-group{
        display:flex;
        flex-direction:column;
        align-items:center;
        gap:clamp(12px,3vw,20px);
        width:100%;
    }
    .logo-hero img{
        max-width:300px;
        margin-bottom:8px;
    }
    .hero-lines-wrapper{
        display:flex;
        flex-direction:column;
        gap:clamp(6px,2vw,14px);
        align-items:center;
        width:100%;
    }
    .hero-color-line{
        font-size: clamp(1.5rem, 5.5vw, 2rem); /* Убедитесь, что размер сохраняется */
        line-height: 1.4;
        letter-spacing: 0.8px;
        font-weight: 700;
        text-align: center; /* Центрируем текст */
    }
    .hero-color-line.orange {
        color: #EF7F1A;
    }

    .hero-color-line.green {
        color: #4D897C;
    }

    .hero-description {
        max-width:none;
        text-align:center;
        font-size: clamp(.95rem,3.2vw,1rem);
        color: var(--text-light);
    }
}
@media (max-width:480px){
    .logo-hero img{max-width:260px;}
    .hero-top-group{gap:clamp(10px,3vw,18px);}
}
/* Центрируем текст в цветных строках */
.hero-color-line{text-align:center;}

/* ==============================================================
   5️⃣ Заголовки секций
   ============================================================== */
section{padding:clamp(50px,8vh,80px) 0;}
h2{
    font-size:clamp(1.6rem,4vw,2rem);
    margin-bottom:clamp(30px,5vh,40px);
    text-align:center;
    color:var(--text-light);
    overflow-wrap:break-word;
}

/* ==============================================================
   6️⃣ О нас
   ============================================================== */
.about-grid{
    display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
    gap:clamp(24px,5vw,36px);max-width:95%;margin:auto;
}
.about-card{
    background:var(--card-bg);
    color:var(--text-dark);
    border-radius:12px;padding:30px;
    box-shadow:0 4px 12px rgba(0,0,0,.05);
    overflow-x:hidden;
}
.about-card h3{
    font-size:clamp(1.1rem,3vw,1.3rem);
    color:var(--primary);
    margin-bottom:16px;
    text-align:center;
    overflow-wrap:break-word;
}

/* Блок «Мы» */
.me-block{
    display:flex;align-items:center;
    gap:clamp(1rem,3vw,2rem);
    max-width:600px;margin-left:auto;margin-right:auto;
    flex-direction:row;background:var(--card-bg);
    color:var(--text-dark);padding:20px 30px;border-radius:12px;
    box-shadow:0 4px 12px rgba(0,0,0,.05);
}
.me-block .spec-photo{flex-shrink:0;}
.me-block .spec-photo img{
    max-width:100%;height:auto;display:block;
    border-radius:50%;
    width:clamp(80px,12vw,120px);height:clamp(80px,12vw,120px);
    object-fit:cover;
}
.me-block .me-text h3,.me-block .me-text p{margin:0;text-align:left;}
.me-block .me-text h3{
    color:var(--primary);
    font-size:clamp(1.1rem,3vw,1.3rem);
}

/* ==============================================================
   7️⃣ Услуги
   ============================================================== */
.services-grid{
    display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
    gap:clamp(24px,5vw,36px);max-width:95%;margin:auto;
}
@media (min-width:768px){.services-grid{grid-template-columns:repeat(2,1fr);}}
@media (min-width:1100px){.services-grid{grid-template-columns:repeat(4,1fr);}}

.service-card{
    background:var(--card-bg);
    color:var(--text-dark);
    border-radius:12px;padding:30px;
    text-align:center;
    box-shadow:0 4px 12px rgba(0,0,0,.05);
    overflow-x:hidden;transition:transform .2s;
    display:flex;flex-direction:column;align-items:center;
    min-height:260px;
}
.service-card:hover{transform:translateY(-4px);}
.service-icon{
    display:block;margin-bottom:16px;
    font-size:clamp(2rem,6vw,2.8rem);
    color:var(--text-dark);
}
.service-card h3{
    font-size:clamp(1.05rem,3vw,1.2rem);
    color:var(--primary);
    margin-bottom:12px;
    text-align:center;overflow-wrap:break-word;
}
.service-card img.service-icon{max-width:100%;height:auto;object-fit:contain;}
.service-card .service-icon span{font-size:96px;line-height:1;}
.service-card h3,.service-card p{
    margin-top:0;margin-bottom:12px;text-align:center;
}
.service-card img{max-width:100%;height:auto;}

/* ==============================================================
   8️⃣ Специалисты
   ============================================================== */
.spec-card{
    background:var(--card-bg);
    color:var(--text-dark);
    border-radius:12px;
    padding:clamp(28px,5vw,40px);
    box-shadow:0 4px 12px rgba(0,0,0,.05);

    width:100%;max-width:none;margin:0 auto;
    overflow-x:hidden;
}
.spec-header{
    display:flex;align-items:center;
    gap:clamp(24px,5vw,30px);margin-bottom:clamp(20px,4vh,28px);
    flex-wrap:wrap;
}
.spec-photo img{
    width:clamp(100px,16vw,160px);height:clamp(100px,16vw,160px);
    border-radius:50%;object-fit:cover;box-shadow:0 4px 16px rgba(0,0,0,.12);
}
.spec-info h3{
    font-size:clamp(1.2rem,3.5vw,1.4rem);
    color:var(--primary);
    margin-bottom:clamp(8px,2vw,6px);
    text-align:center;overflow-wrap:break-word;
}
.spec-title{color:var(--text-dark);}
.spec-card .bio p,.spec-card .dir-list li,.spec-card .edu-list li{
    color:var(--text-dark);
}
.spec-card h4{color:var(--primary);}
.collapsible-toggle{
    background:var(--primary);color:#fff;border:none;
    padding:10px 20px;border-radius:8px;cursor:pointer;
    font-size:.95rem;margin-top:20px;transition:background .2s;
}
.collapsible-toggle:hover{background:#3d6f64;}

/* NEW – добавить отступ между блоками специалистов */
#specialists .container > div:not(:last-child){
    margin-bottom:clamp(24px,5vw,36px);
}

/* ==============================================================
   9️⃣ Партнёры
   ============================================================== */
.partners-section{
    background:var(--bg-dark);
    padding:20px 0;
    margin-top:40px;
}
.partners-section .container{
    display:flex;align-items:center;justify-content:center;
    flex-wrap:wrap;gap:20px;
}
.partners-section img{
    height:clamp(35px,7vw,50px);
    max-width:clamp(120px,24vw,200px);
    opacity:.85;margin:0 auto 16px;display:block;
}
.partners-section p{
    color:var(--text-light);
    font-size:.95rem;
    text-align:center;width:100%;
}

/* ==============================================================
   А. Контакты (новая структура)
   ============================================================== */
.contacts-grid{
    display:flex;flex-direction:column;align-items:center;
    gap:30px;width:100%;max-width:900px;margin:0 auto;
}
.contacts-row{
    display:flex;flex-wrap:wrap;justify-content:center;
    gap:20px;width:100%;
}
.top-row{justify-content:space-around;}
.bottom-row{justify-content:center;}

.contact-item{
    flex:0 1 auto;
    min-width:150px;text-align:center;
}
.contact-item h3{
    font-size:clamp(1rem,2.8vw,1.1rem);
    color:var(--text-light);
    margin-bottom:clamp(10px,2vw,12px);
}
.contact-item a{
    display:inline-block;padding:9px 22px;
    border-radius:8px;background:var(--card-bg);
    font-weight:600;transition:all .2s;
    color:var(--text-dark);margin-bottom:8px;white-space:nowrap;
}
.contact-item a:hover{background:#c2bcd9;}
.contact-item p{
    font-weight:600;color:var(--primary);
    margin-top:8px;
}

@media (max-width:768px){
    .contacts-row{flex-direction:column;align-items:center;gap:20px;}
    .top-row,.bottom-row{justify-content:center;}
    .contact-item{width:100%;max-width:300px;}
    .contact-item a{white-space:normal;}
}

/* ==============================================================
   Б. Footer
   ============================================================== */
footer{
    position:relative;
    background:url('web_images/bottom.png') left bottom no-repeat, var(--bg-dark);
    background-size:auto,cover;
    color:rgba(255,255,255,.7);
    text-align:right;
    padding:clamp(24px,6vh,30px) 0;
    font-size:clamp(.8rem,2vw,.85rem);
    overflow-x:hidden;
    min-height:200px;
}

/* ==============================================================
   В. Мобильные стили
   ============================================================== */
@media (max-width:768px){
    section{padding:48px 0;}
    header .container{flex-direction:column-reverse;align-items:flex-start;}
    nav a{font-size:12px;padding:6px 4px;}
    .hero h1{font-size:1.5rem;margin-bottom:12px;line-height:1.35;}
    .hero p{font-size:.95rem;margin:0 auto 24px;
        max-width:none;text-align:center;}
    #contacts .contacts-grid{
        display:flex;flex-direction:column;align-items:center;
    }
}
@media (max-width:480px){
    header .container{flex-direction:column;align-items:center;}
    nav{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;
        justify-content:center;width:100%;}
    nav a{font-size:11px;padding:5px 3px;text-align:center;
        background:rgba(255,255,255,.7);}
    .hero h1{font-size:1.3rem;margin-bottom:12px;line-height:1.35;}
    section{padding:36px 0;}
}

/* ==============================================================
   Г. Длинные строки текста – переносим слова
   ============================================================== */
.hero h1,.hero p,.bio p,.dir-list li,.edu-list li,.contact-item a{
    word-wrap:break-word;overflow-wrap:break-word;hyphens:auto;
}
