/**
 * Страница «Расписание» (/raspisanie, page-schedule.php).
 * Виды «Календарь» и «Список». Портировано из raspisanie-mockup.html.
 * Всё заскоуплено под .schedule — без утечек в /shop. Карточки списка
 * (.product-card / .products--grid) стилизуются в woocommerce.css, тут не трогаем.
 * Шрифт наследуется от темы (Montserrat не грузим).
 */

.schedule{
  --blue:#15579B; --magenta:var(--color-accent,#C23571); --blue2:#5891AF;
  --ink:#1d2433; --muted:#5b6577; --line:#e7eaf0; --bg:#f5f7fb; --green:#1f9d57;
  --radius:14px;
  /* цвета типов мероприятий */
  --t-seminar:#15579B; --t-video:#7a5bd0; --t-marafon:#e08a1e; --t-konsultarium:#1f9d57;
  --t-konsultatsiya:#C23571; --t-game:#11998e; --t-lektoriy:#5891AF; --t-kniga:#6b7280;
  --t-podpiska:#3a6186; --t-oplata:#9aa3b2; --t-default:#5b6577;
  --t-webinar:#5891AF; --t-kurs:#C23571; --t-marathon:#e08a1e; --t-game-complex:#11998e;
  color:var(--ink); line-height:1.5;
}
.schedule a{color:inherit;text-decoration:none}
.schedule h1,.schedule h2,.schedule h3{margin:0;line-height:1.15;font-weight:800;letter-spacing:-.01em}
.schedule p{margin:0}
.schedule__wrap{max-width:1140px;margin:0 auto;padding:0 24px}
/* воздух: сверху от баннера к контенту, снизу до футера */
.schedule > .schedule__wrap{padding-top:28px;padding-bottom:64px}
@media (max-width:680px){.schedule > .schedule__wrap{padding-top:20px;padding-bottom:40px}}

/* ---------- HERO ---------- */
.schedule__head{background:linear-gradient(125deg,#15579B,#2f4ea0 50%,#9a3b86 85%,#C23571);color:#fff;padding:30px 0 36px;margin-bottom:24px}
.schedule__head .schedule__wrap{padding-top:0}
.schedule__crumbs{font-size:14px;color:rgba(255,255,255,.72);margin-bottom:20px}
.schedule__crumbs span{color:rgba(255,255,255,.5)}
.schedule__head h1{font-size:clamp(30px,4vw,44px)}
.schedule__head p{margin-top:12px;color:rgba(255,255,255,.9);font-size:17px;max-width:60ch}

/* ---------- ФИЛЬТРЫ ---------- */
.sch-filters{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end;background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);padding:16px;margin-bottom:24px}
.sch-f{display:flex;flex-direction:column;gap:5px}
.sch-f label{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.sch-f select,.sch-f input{padding:10px 12px;border:1px solid var(--line);border-radius:9px;font-family:inherit;font-size:14px;background:#fff;min-width:150px;color:var(--ink)}
.sch-f--date input{min-width:140px}
.sch-apply{display:flex;gap:8px;align-items:flex-end}
.sch-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;font-weight:700;font-size:14px;padding:11px 18px;border-radius:9px;border:0;cursor:pointer;font-family:inherit}
.sch-btn--primary{background:var(--blue);color:#fff}
.sch-btn--primary:hover{background:#11487f}
.sch-btn--ghost{background:#fff;border:1px solid var(--line);color:var(--muted)}
.sch-btn--ghost:hover{border-color:var(--blue);color:var(--blue)}

/* ---------- ПАНЕЛЬ: счётчик + переключатель ---------- */
.sch-bar{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin:0 0 18px}
.sch-count{color:var(--muted);font-size:15px}
.sch-count b{color:var(--ink)}
.sch-toggle{display:inline-flex;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.sch-toggle__btn{background:#fff;padding:10px 18px;font-weight:700;font-size:14px;cursor:pointer;color:var(--muted);display:flex;gap:7px;align-items:center}
.sch-toggle__btn svg{width:16px;height:16px}
.sch-toggle__btn.is-active{background:var(--blue);color:#fff}

/* ---------- КАЛЕНДАРЬ ---------- */
.cal-nav{display:flex;align-items:center;justify-content:center;gap:20px;margin-bottom:22px}
.cal-nav__btn{width:40px;height:40px;border-radius:50%;border:1px solid var(--line);background:#fff;cursor:pointer;font-size:18px;color:var(--blue);display:flex;align-items:center;justify-content:center}
.cal-nav__btn:hover{border-color:var(--blue)}
.cal-nav h2{font-size:22px;min-width:240px;text-align:center}
.cal{display:grid;grid-template-columns:repeat(7,1fr);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:var(--line);gap:1px}
.cal__dow{background:#fff;padding:10px;text-align:center;font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase}
.cal__day{background:#fff;min-height:116px;padding:8px;display:flex;flex-direction:column;gap:6px;min-width:0;overflow:hidden}
.cal__day.is-out{background:#fafbfd}
.cal__num{font-size:13px;font-weight:700;color:var(--muted)}
.cal__day.is-today .cal__num{background:var(--blue);color:#fff;width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center}

/* отметки событий в дне (компактные, не распирают колонку) */
.cal__marks{display:flex;flex-wrap:wrap;gap:4px;min-width:0;margin-top:2px}
.ev{display:block;background:var(--t-default);cursor:pointer}
/* grid: цветная полоска фиксированного размера */
.cal__marks:not(.cal__marks--list) .ev{width:22px;height:6px;border-radius:99px;flex:none}
.cal__marks:not(.cal__marks--list) .ev:hover{outline:2px solid rgba(0,0,0,.12);outline-offset:1px}
.cal__marks .ev--more{background:none!important;color:var(--muted);font-weight:700;font-size:11px;width:auto;height:auto;align-self:center;flex:none}
.ev__label{display:none}
.ev__card{display:none}
.schedule .ev--seminar{background:var(--t-seminar)}
.schedule .ev--video{background:var(--t-video)}
.schedule .ev--marafon{background:var(--t-marafon)}
.schedule .ev--konsultarium{background:var(--t-konsultarium)}
.schedule .ev--konsultatsiya{background:var(--t-konsultatsiya)}
.schedule .ev--game{background:var(--t-game)}
.schedule .ev--lektoriy{background:var(--t-lektoriy)}
.schedule .ev--kniga{background:var(--t-kniga)}
.schedule .ev--podpiska{background:var(--t-podpiska)}
.schedule .ev--oplata{background:var(--t-oplata)}
.schedule .ev--webinar{background:var(--t-webinar)}
.schedule .ev--kurs{background:var(--t-kurs)}
.schedule .ev--marathon{background:var(--t-marathon)}
.schedule .ev--game-complex{background:var(--t-game-complex)}

.legend{display:flex;flex-wrap:wrap;gap:14px;margin-top:22px;font-size:13px;color:var(--muted)}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend i{width:12px;height:12px;border-radius:3px;display:inline-block;background:var(--t-default)}

/* строки-события (мобильный список по дням) */
.cal__marks--list{flex-direction:column;align-items:stretch;gap:6px}
.cal__marks--list .ev--row{display:flex;align-items:center;gap:8px;width:auto;height:auto;border-radius:8px;padding:8px 12px;color:#fff;font-size:13px;font-weight:600}
.cal__marks--list .ev__label{display:block;white-space:normal;line-height:1.3}

/* мини-карточка (поповер): position:fixed, не обрезается ячейкой */
.schedule .ev-pop{position:fixed;z-index:1000;width:270px;max-width:calc(100vw - 24px);background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 44px rgba(21,87,155,.20);overflow:hidden}
.schedule .ev-pop[hidden]{display:none}
.schedule .ev-pop .ev__card{display:block}
.schedule .ev-pop .ev__thumb img{width:100%;height:140px;object-fit:cover;display:block}
.schedule .ev-pop .ev__cbody{display:flex;flex-direction:column;gap:6px;padding:13px 15px}
.schedule .ev-pop .ev__ctype{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--blue)}
.schedule .ev-pop .ev__ctitle{font-weight:800;font-size:14.5px;line-height:1.25}
.schedule .ev-pop .ev__cmeta{color:var(--muted);font-size:12.5px}
.schedule .ev-pop .ev__cfoot{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:6px}
.schedule .ev-pop .ev__cprice{font-weight:800;font-size:15px}
.schedule .ev-pop .ev__cbtn{color:var(--blue);font-weight:700;white-space:nowrap}
/* мобильный bottom-sheet */
.schedule .ev-pop--sheet{left:12px;right:12px;bottom:12px;top:auto!important;width:auto;max-width:none}

/* мобильный календарь = список по дням */
.cal-mobile{display:none;margin-top:8px}
.cal-mobile__day{border:1px solid var(--line);border-radius:12px;padding:14px 16px;margin-bottom:12px}
.cal-mobile__date{font-weight:800;color:var(--blue);margin-bottom:8px}
.sch-empty{color:var(--muted);font-size:14px}

/* список: пусто */
.schedule .no-products{text-align:center;padding:48px 16px;color:var(--muted)}
.schedule .no-products h3{font-size:20px;margin-bottom:8px}
.schedule .no-products a{color:var(--blue);text-decoration:underline}

/* ---------- АДАПТИВ ---------- */
@media (max-width:680px){
  .cal,.cal__dow{display:none}
  .cal-mobile{display:block}
  .sch-f select,.sch-f input{min-width:0;width:100%}
  .sch-f{flex:1 1 45%}
  .sch-apply{flex:1 1 100%}
  .sch-apply .sch-btn{flex:1}
}
.schedule :focus-visible{outline:3px solid #ffcf3f;outline-offset:2px;border-radius:6px}
