/*
 * Дополнения к styles.css из макета (сам styles.css не правим, чтобы новые версии дизайна
 * можно было копировать целиком). Здесь — то, что появилось вместе с бэкендом:
 * фото из админки, статусы отправки форм, рейтинг в отзыве, оформление юр. страниц.
 */

/* --- Фото педагогов и галереи, загруженные через админку */
.trainer-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb.has-image { padding: 0; }
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Формы */
.hp-field {
    position: absolute !important;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-status {
    font-size: 0.85rem;
    text-align: center;
    margin-top: 10px;
    font-weight: 600;
}
.form-status.is-success { color: #059669; }
.form-status.is-error { color: var(--primary); }

/* Галочка согласия на обработку ПДн — перед кнопкой каждой формы */
.form-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.4;
    text-align: left;
    margin: 4px 0 12px;
    cursor: pointer;
}
.form-consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}
.form-consent a { color: var(--primary); text-decoration: underline; }
.form-consent.is-invalid { color: var(--primary); }
.form-consent.is-invalid input[type="checkbox"] { outline: 2px solid var(--primary); outline-offset: 2px; }

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 600px) {
    .form-grid-2 { grid-template-columns: 1fr; }
}

.form-calc-note {
    font-size: 0.82rem;
    color: var(--text);
    background: var(--accent-yellow-soft);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    line-height: 1.45;
}

button[disabled] { opacity: 0.7; cursor: wait; }

/* --- Оценка в форме отзыва (звёзды справа налево, чтобы работал селектор ~) */
.rating-input {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
    font-size: 1.6rem;
    line-height: 1;
}
.rating-input input { position: absolute; opacity: 0; pointer-events: none; }
.rating-input label { color: #d9dee7; cursor: pointer; transition: color 0.15s ease; }
.rating-input input:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label { color: var(--accent-yellow); }
.rating-input input:focus-visible + label { outline: 2px solid var(--primary); border-radius: 4px; }

/* --- Расписание */
.slots-empty {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    padding: 12px 0;
}

/* --- Юридические страницы */
.legal-page { padding: 40px 20px 80px; max-width: 900px; }
.legal-article { line-height: 1.8; color: var(--text); font-size: 0.95rem; }
.legal-article h2 { font-size: 1.4rem; color: var(--dark); margin-bottom: 12px; }
.legal-article p { margin-bottom: 20px; }
.legal-article p.tight { margin-bottom: 10px; }
.legal-article p.tight-sm { margin-bottom: 6px; }
.legal-article ul { margin-left: 20px; margin-bottom: 20px; }
.legal-article a { color: var(--primary); }
.legal-article .legal-link-strong { font-weight: 700; }

/* --- Посадочные страницы (/zanyatiya/...) */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 14px;
}
.breadcrumbs a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.breadcrumbs a:hover { color: var(--primary); }

.landing-facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.landing-text p { margin-bottom: 12px; line-height: 1.7; }
.landing-text h3 { margin: 18px 0 8px; }
.landing-text ul:not(.detail-list), .landing-text ol { margin: 0 0 12px 20px; }

.detail-content > h2 { margin: 36px 0 16px; }
.landing-subheading { font-size: 1.05rem; font-weight: 800; color: var(--dark); margin: 18px 0 10px; }
.landing-prices { margin-bottom: 8px; }
.landing-note { font-size: 0.88rem; color: var(--muted); margin-top: 10px; }

.landing-schedule {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.landing-trainers { padding: 0; }

.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: var(--shadow);
}
.faq-item summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--dark);
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--primary); font-size: 1.2rem; line-height: 1; }
.faq-item[open] summary::after { content: '–'; }
.faq-item p { margin-top: 10px; color: var(--text); line-height: 1.6; }

.landing-links { display: flex; flex-wrap: wrap; gap: 8px; }
.landing-links .tag:hover { background: var(--primary); color: #fff; }

/* --- Отзывы с Яндекс Карт */
.review-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 6px;
}
.review-source a { color: var(--muted); text-decoration: underline; }

.yandex-reviews {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 14px;
    padding: 10px 0 40px;
}
.yandex-reviews-frame {
    width: 100%;
    max-width: 760px;
    height: 800px;
    overflow: hidden;
    position: relative;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    background: #fff;
}
.yandex-reviews-frame iframe { width: 100%; height: 100%; border: 0; }

/* --- Исправление макета: скрытое мобильное меню (position: fixed + translateX(100%)) расширяло
       страницу вправо, и на телефонах появлялась горизонтальная прокрутка. clip, а не hidden —
       чтобы не ломать position: sticky у боковых колонок. */
html, body { overflow-x: clip; }

/* --- Исправление макета: .direction-detail-layout { padding: 40px 0 70px } обнулял боковые отступы
       .container, и на экранах уже 1200px текст страниц направлений прилипал к краю. */
.container.direction-detail-layout { padding-left: 20px; padding-right: 20px; }

/* --- Главная: «Гармоничное развитие в каждом возрасте» — возраст × направление (src/Development/DevelopmentMatrix.php) */
.development-section { padding: 60px 0; }
.dev-matrix {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: var(--shadow);
}
.dev-row { display: grid; grid-template-columns: 150px repeat(3, minmax(0, 1fr)); }
.dev-row + .dev-row { border-top: 1px solid var(--border); }
.dev-age, .dev-area, .dev-cell { padding: 18px 20px; }
.dev-age { font-weight: 800; color: var(--dark); font-size: 1.05rem; background: #fafbfc; }
.dev-cell { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; }
.dev-cell + .dev-cell, .dev-area + .dev-area { border-left: 1px solid var(--border); }
.dev-head .dev-age { display: flex; align-items: flex-end; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.dev-area { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.dev-area-icon {
    grid-row: span 2;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
}
.dev-area strong { color: var(--dark); font-size: 1rem; }
.dev-area-hint { color: var(--muted); font-size: 0.8rem; line-height: 1.3; }
.dev-area .dev-area-icon { background: var(--a-soft); }
.dev-head .dev-area { border-top: 4px solid var(--a); }
.dev-chip {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    background: var(--a-soft);
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.15s, border-color 0.15s, color 0.15s;
}
.dev-chip:hover { transform: translateY(-1px); color: var(--a-ink); border-color: var(--a); }
.dev-empty { color: var(--muted); }
.dev-cell-label { display: none; }
.dev-cta { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px 20px; margin-top: 28px; text-align: center; }
.dev-cta p { color: var(--muted); margin: 0; }
.detail-subcard { scroll-margin-top: 110px; }

/* На телефоне — карточка на каждый возраст, направления друг под другом */
@media (max-width: 860px) {
    .dev-matrix { border: 0; box-shadow: none; background: none; overflow: visible; display: grid; gap: 16px; }
    .dev-head { display: none; }
    .dev-row { grid-template-columns: minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card-bg); box-shadow: var(--shadow); overflow: hidden; }
    .dev-row + .dev-row { border-top: 1px solid var(--border); }
    .dev-age { padding: 14px 18px; }
    .dev-cell { padding: 12px 18px 16px; }
    .dev-cell + .dev-cell { border-left: 0; border-top: 1px dashed var(--border); }
    .dev-cell-label { display: block; flex-basis: 100%; font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
}

/* «О центре»: ссылки под текстом карточек философии */
.bento-card .bento-link { margin-top: 12px; font-size: 0.9rem; }
.bento-card .bento-link a { color: var(--primary); font-weight: 700; text-decoration: none; }
.bento-card .bento-link a:hover { text-decoration: underline; }

/* --- Цвета направлений развития (переменные --area-* — в styles.css).
       Класс area-* задаёт --a / --a-soft / --a-ink / --a-on, остальное берёт их. */
.area-intellect { --a: var(--area-intellect); --a-soft: var(--area-intellect-soft); --a-ink: var(--area-intellect-ink); --a-on: var(--area-intellect-on); }
.area-aesthetic { --a: var(--area-aesthetic); --a-soft: var(--area-aesthetic-soft); --a-ink: var(--area-aesthetic-ink); --a-on: var(--area-aesthetic-on); }
.area-physical { --a: var(--area-physical); --a-soft: var(--area-physical-soft); --a-ink: var(--area-physical-ink); --a-on: var(--area-physical-on); }

/* Карточки «Подбор идеальной секции» */
.area-party { --a: var(--area-party); --a-soft: var(--area-party-soft); --a-ink: var(--area-party); --a-on: #ffffff; }

/* Карточки каталогов (главная, «Все направления», «Занятия»): цвет по направлению, а не по порядку */
.cards-grid .direction-card[class*="area-"]:not(.area-mix) { border-top: 5px solid var(--a); }
.cards-grid .direction-card[class*="area-"]:not(.area-mix) .card-header-badge { background: var(--a-soft); color: var(--a-ink); }
.cards-grid .direction-card[class*="area-"]:not(.area-mix) .tag { background: var(--a-soft); }
/* Студия с несколькими направлениями — полоска из их цветов и значки направлений */
.cards-grid .direction-card.area-mix {
    border-top: 5px solid transparent;
    background: linear-gradient(var(--card-bg), var(--card-bg)) padding-box, var(--stripe) border-box;
    position: relative;
}
.cards-grid .direction-card.area-mix::after {
    content: attr(data-areas);
    position: absolute;
    top: 26px;
    right: 24px;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

/* Кнопки фильтра по категории */
/* Кнопки фильтров. Бирюзовый и малиновый теперь означают направления, поэтому «Все» и возраст — нейтральные тёмные,
   а кнопки категорий — в цвете своего направления (на главной area-*, в расписании category-*). */
.pill.active, .pill:hover { background: var(--dark); border-color: var(--dark); color: #ffffff; }
.pill.pill-area.category-intellect { --a: var(--area-intellect); --a-soft: var(--area-intellect-soft); --a-ink: var(--area-intellect-ink); --a-on: var(--area-intellect-on); }
.pill.pill-area.category-aesthetic { --a: var(--area-aesthetic); --a-soft: var(--area-aesthetic-soft); --a-ink: var(--area-aesthetic-ink); --a-on: var(--area-aesthetic-on); }
.pill.pill-area.category-physical { --a: var(--area-physical); --a-soft: var(--area-physical-soft); --a-ink: var(--area-physical-ink); --a-on: var(--area-physical-on); }
.pill.pill-area.category-party { --a: var(--area-party); --a-soft: var(--area-party-soft); --a-ink: var(--area-party); --a-on: #ffffff; }
.pill.pill-area { background: var(--a-soft); border-color: var(--a); color: var(--a-ink); }
.pill.pill-area.active, .pill.pill-area:hover { background: var(--a); border-color: var(--a); color: var(--a-on); }
.results-badge { background: var(--dark); white-space: nowrap; }

/* Программы на страницах студий */
.detail-subcard[class*="area-"] { background: var(--a-soft); border-color: transparent; border-left: 5px solid var(--a); }
.detail-subcard[class*="area-"] h3 { color: var(--a-ink); }

/* «О центре»: иконки трёх направлений */
.bento-grid .bento-card[class*="area-"] .bento-icon { background: var(--a-soft); }
.bento-card[class*="area-"] { border-top: 5px solid var(--a); }

/* Педагоги: полоска и специализация — в цвете направления */
.trainers-grid .trainer-card[class*="area-"] { border-top: 5px solid var(--a); }
.trainer-card[class*="area-"] .trainer-spec { color: var(--a-ink); }
.trainer-card[class*="area-"] .trainer-badge { background: var(--a); color: var(--a-on); }

/* Мобильное меню: подменю раскрываются нажатием на пункт */
.dropdown-all { display: none; }

@media (max-width: 992px) {
    .burger-btn { position: relative; z-index: 1002; }
    .nav-menu { overflow-y: auto; justify-content: flex-start; gap: 24px; }
    .nav-menu .mobile-drawer-footer { margin-top: auto; }
    .has-dropdown .chevron { display: inline-block; transition: transform 0.2s ease; }
    .has-dropdown.open .chevron { transform: rotate(180deg); }
    .has-dropdown.open .dropdown-panel {
        display: block;
        position: static;
        min-width: 0;
        margin-top: 8px;
        padding: 4px 0 4px 12px;
        border: none;
        border-left: 3px solid var(--border);
        border-radius: 0;
        box-shadow: none;
    }
    .has-dropdown.open .dropdown-panel-mega { display: flex; }
    .dropdown-panel a, .dropdown-col a { padding: 8px 10px; font-size: 1rem; }
    .dropdown-all { display: block; }
}

/* Навигация по неделям во всех видах расписания. */
.schedule-week-nav, .schedule-week-picker { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.schedule-week-nav { margin-bottom: 24px; }
.schedule-week-picker input { font: inherit; border: 1px solid var(--border-color, #e5e7eb); border-radius: 12px; padding: 8px; background: #fff; color: inherit; }
.schedule-week-range { white-space: nowrap; }
@media (max-width: 600px) { .schedule-week-range { order: -1; width: 100%; text-align: center; } }
