/*
===========================================
АДАПТИВНАЯ ВЕРСТКА ДЛЯ PSIHOLOGI-SPB.RU
===========================================
*/

/* ============================================
   БАЗОВЫЕ СТИЛИ И СБРОС
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-size: 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: #4F473A;
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    border: 0;
}

a {
    outline: none;
    text-decoration: none;
    transition: all 0.3s ease;
}

.clear {
    clear: both;
}

.wrapper {
    position: relative;
    float: left;
    width: 100%;
    margin: 0;
    text-align: left;
}

/* ============================================
   ЦВЕТОВЫЕ КЛАССЫ
   ============================================ */
.col1 {
    color: #FFFFFF;
    background-color: #294E79;
}

.col2 {
    color: #666666;
    background-color: #F5F5F5;
}

.col2 a {
    color: #294E79;
    background-color: #F5F5F5;
}

.col3,
.col4 {
    color: #666666;
    background-color: #FFFFFF;
}

.col5 {
    color: #FFFFFF;
    background-color: #1C3451;
}

.col6 {
    color: #FFFFFF;
    background-color: #597Ea9;
    text-align: center;
    width: 100%;
}

/* ============================================
   КОНТЕЙНЕРЫ
   ============================================ */
#head,
#gallery,
#breadcrumb,
#container,
#footer {
    position: relative;
    margin: 0 auto;
    display: block;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
}

/* ============================================
   ШАПКА САЙТА
   ============================================ */
#head {
    min-height: 110px;
    padding: 20px;
    position: relative;
}

#head h1,
#head p,
#head ul,
#head a {
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: normal;
}

#head h1 {
    margin-bottom: 10px;
}

#head h1 a {
    font-size: 32px;
    font-weight: normal;
    color: #FFFFFF;
    background-color: #294E79;
    font-family: Georgia, "Times New Roman", Times, serif;
}

#head > p {
    color: #F5F5F5;
    background-color: #294E79;
    font-size: 16px;
    font-family: Georgia, "Times New Roman", Times, serif;
    margin-bottom: 15px;
}

/* Телефон и адрес */
#toptel,
#topad {
    display: inline-block;
    margin: 10px 0;
}

#toptel h4 {
    margin: 0;
    font-size: 20px;
    color: #FFFFFF;
}

#topad h6 {
    margin: 0;
    font-size: 14px;
    color: #F5F5F5;
}

/* ============================================
   НАВИГАЦИЯ
   ============================================ */
#topnav {
    margin-top: 6px;
}

#topnav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

#topnav li {
    margin: 0;
}

#topnav a {
    display: block;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s ease;
}

#topnav a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

#topnav li.current a {
    background: #FFFFFF;
    color: #294E79;
    font-weight: bold;
}

/* Мобильное меню */
.mobile-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #FFFFFF;
    padding: 10px 15px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
    margin-top: 30px;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   НОВОСТНАЯ ЛЕНТА
   ============================================ */
.news-roll {
    margin: 0 0 20px 0;
    padding: 15px;
    background: #597Ea9;
    border-radius: 5px;
}

.news-roll strong {
    display: block;
    text-align: center;
}

.news-roll a {
    text-decoration: underline;
    color: #fff !important;
    background-color: transparent !important;
}

/* ============================================
   ОСНОВНОЙ КОНТЕЙНЕР
   ============================================ */
#container {
    padding: 40px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

#container h1,
#container h2,
#container h3,
#container h4,
#container h5,
#container h6 {
    margin: 0 0 15px 0;
    padding: 0 0 15px 0;
    line-height: normal;
    font-weight: normal;
    font-size: 20px;
    font-family: Georgia, "Times New Roman", Times, serif;
    border-bottom: 1px dashed #666666;
}

#container h1 {
    font-size: 28px;
    color: #294E79;
}

#container h2 {
    font-size: 22px;
    border-bottom: none;
    padding: 0;
    margin-top: 20px;
}

#container h3 {
    font-size: 18px;
}

#container a {
    color: #294E79;
    background-color: #FFFFFF;
    text-decoration: underline;
}

#container a:hover {
    color: #1982A5;
}

/* ============================================
   ОСНОВНОЙ КОНТЕНТ
   ============================================ */
#content {
    flex: 1 1 65%;
    min-width: 300px;
}

#content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

#content ul,
#content ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

#content li {
    margin-bottom: 10px;
}

/* ============================================
   БОКОВАЯ КОЛОНКА
   ============================================ */
#column {
    flex: 1 1 30%;
    min-width: 250px;
}

#column .holder,
#column #featured {
    display: block;
    width: 100%;
    margin-bottom: 20px;
}

#column #featured {
    background: #F9F9F9;
    padding: 20px;
    border-radius: 5px;
}

#column #featured h3 {
    margin: 0 0 15px 0;
    padding: 0 0 14px 0;
    font-size: 20px;
    font-weight: normal;
    font-family: Georgia, "Times New Roman", Times, serif;
    color: #666666;
    border-bottom: 1px dashed #666666;
}

#column #featured p {
    line-height: 1.6em;
    margin-bottom: 15px;
}

#column #featured a {
    color: #294E79;
}

#column #featured p.more {
    display: block;
    width: 100%;
    margin-top: 15px;
    font-weight: bold;
    text-align: right;
}

/* ============================================
   СЕТКА ПСИХОЛОГОВ
   ============================================ */
.group-photo {
    width: 100%;
}

#photo {
    display: inline-block;
    width: 160px;
    margin: 10px;
    text-align: center;
    vertical-align: top;
}

#photo a {
    display: block;
    text-decoration: none;
    color: #294E79;
}

#photo img {
    width: 160px;
    height: 200px;
    object-fit: cover;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

#photo a:hover img {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#photo-2 {
    display: inline-block;
    width: 332px;
    margin: 10px;
    text-align: center;
    vertical-align: top;
}

/* ============================================
   ТАБЫ
   ============================================ */
.tabs {
    width: 100%;
    padding: 0;
    margin: 20px 0;
}

.tabs > input {
    display: none;
    position: absolute;
}

.tabs > label {
    display: inline-block;
    margin: 5px 5px 0 0;
    padding: 12px 18px;
    font-weight: 600;
    text-align: center;
    color: #666;
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tabs > label:hover {
    color: #333;
    background: #e8e8e8;
}

.tabs > input:checked + label {
    color: #fff;
    background: #294E79;
    border-color: #294E79;
}

.tabs > section {
    display: none;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 5px 5px 5px;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#tab1:checked ~ #content-tab1,
#tab2:checked ~ #content-tab2,
#tab3:checked ~ #content-tab3,
#tab4:checked ~ #content-tab4,
#tab5:checked ~ #content-tab5 {
    display: block;
}

/* ============================================
   ТАРИФЫ
   ============================================ */
#tarif {
    display: inline-block;
    width: 160px;
    height: auto;
    min-height: 30px;
    padding: 10px;
    text-align: center;
    font-size: 16px;
    margin: 6px;
    color: #ffffff;
    background: #597Ea9;
    border-radius: 5px;
}

/* ============================================
   КНОПКИ
   ============================================ */
.button {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    color: #f7f7f7 !important;
    background: linear-gradient(to bottom, #3BA4C7 0%, #1982A5 100%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* ============================================
   ФУТЕР
   ============================================ */
#footer {
    padding: 30px 20px;
}

#footer a {
    color: #98B7DC;
    background-color: #1C3451;
    text-decoration: underline;
}

#footer a:hover {
    color: #FFFFFF;
}

#copyright {
    display: block;
    width: 100%;
    margin: 25px 0 0 0;
    padding: 20px 0 0 0;
    text-align: center;
    font-size: 12px;
    border-top: 1px dashed #666666;
}

#copyright ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

#copyright li {
    display: inline-block;
}

/* ============================================
   АДАПТИВНОСТЬ ДЛЯ ПЛАНШЕТОВ
   ============================================ */
@media screen and (max-width: 1024px) {
    #head,
    #container,
    #footer {
        max-width: 100%;
        padding: 0 20px;
    }

    #head h1 a {
        font-size: 28px;
    }

    #container {
        padding: 30px 20px;
        gap: 20px;
    }

    #content {
        flex: 1 1 100%;
    }

    #column {
        flex: 1 1 100%;
    }
}

/* ============================================
   АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ
   ============================================ */
@media screen and (max-width: 768px) {
    body {
        font-size: 15px;
    }

    #head {
        padding: 15px;
    }

    #head h1 a {
        font-size: 24px;
    }

    #head > p {
        font-size: 14px;
    }

    #toptel h4 {
        font-size: 18px;
    }

    /* Мобильное меню */
    .mobile-menu-toggle {
        display: block;
        float: right;
    }

    #topnav {
        display: none;
        margin-top: 15px;
    }

    #topnav.active {
        display: block;
    }

    #topnav ul {
        flex-direction: column;
        gap: 8px;
        background-color: #fff;
    }

    #topnav a {
        padding: 12px 15px;
        text-align: center;
    }

    /* Контейнер */
    #container {
        padding: 20px 15px;
        gap: 20px;
        flex-direction: column;
    }

    #container h1 {
        font-size: 24px;
    }

    #container h2 {
        font-size: 20px;
    }

    #content {
        flex: 1 1 100%;
        order: 1;
    }

    #column {
        flex: 1 1 100%;
        order: 2;
    }

    /* Новостная лента */
    .news-roll {
        padding: 12px;
        font-size: 14px;
    }

    /* Сетка психологов */
    #photo {
        width: calc(50% - 20px);
        margin: 10px;
    }

    #photo img {
        width: 100%;
        height: auto;
        min-height: 180px;
    }

    /* Табы */
    .tabs > label {
        font-size: 13px;
        padding: 10px 12px;
        margin: 3px;
    }

    .tabs > section {
        padding: 15px;
    }

    /* Тарифы */
    #tarif {
        width: calc(50% - 20px);
        margin: 10px;
    }

    /* Футер */
    #footer {
        padding: 20px 15px;
    }

    #copyright {
        text-align: center;
        font-size: 11px;
    }

    #copyright ul {
        flex-direction: column;
        gap: 10px;
    }
}

/* ============================================
   АДАПТИВНОСТЬ ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ
   ============================================ */
@media screen and (max-width: 480px) {
    body {
        font-size: 14px;
    }

    #head h1 a {
        font-size: 20px;
    }

    #head > p {
        font-size: 13px;
    }

    #toptel h4 {
        font-size: 16px;
    }

    #topad h6 {
        font-size: 12px;
    }

    #container {
        padding: 15px 10px;
    }

    #container h1 {
        font-size: 22px;
    }

    #container h2 {
        font-size: 18px;
    }

    /* Психологи на всю ширину */
    #photo {
        width: 100%;
        margin: 10px 0;
    }

    #photo img {
        width: 100%;
        max-width: 200px;
        height: auto;
    }

    /* Табы */
    .tabs > label {
        font-size: 12px;
        padding: 8px 10px;
        margin: 2px;
    }

    /* Кнопки */
    .button {
        padding: 10px 20px;
        font-size: 16px;
        display: block;
        width: 100%;
        max-width: 300px;
        margin: 10px auto;
    }
}

/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ УТИЛИТЫ
   ============================================ */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

/* Улучшение читаемости на мобильных */
@media screen and (max-width: 768px) {
    p, li {
        line-height: 1.7;
    }

    a {
        padding: 2px 0;
        display: inline-block;
    }
}

/* Скрыть LiveInternet на мобильных */
@media screen and (max-width: 480px) {
    #copyright li img {
        max-width: 60px;
        height: auto;
    }
}

/* ========================================
   ИСПРАВЛЕНИЕ МОБИЛЬНОГО МЕНЮ
   ======================================== */

@media screen and (max-width: 768px) {
    /* Скрываем меню по умолчанию на мобильных */
    #topnav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background: #294E79;
        z-index: 1000;
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }
    
    /* Показываем меню когда оно активно */
    #topnav.active {
        display: block !important;
    }
    
    /* Меню список */
    #topnav ul {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin: 0;
        padding: 10px 0;
    }
    
    /* Пункты меню */
    #topnav li {
        width: 100%;
        margin: 0;
    }
    
    #topnav a {
        display: block;
        width: 100%;
        padding: 15px 20px;
        text-align: left;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    /* Контейнер шапки должен быть relative */
    #head {
        position: relative;
    }
}