/*
Theme Name: ЦПТО
Description: Тема для сайта образовательной организации. Работает вместе с плагином «ЦПТО — ядро сайта образовательной организации»: адаптивная вёрстка, версия для слабовидящих, страницы программ, цен и контактов. Вся логика соответствия требованиям вынесена в плагин.
Version: 1.0.1
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Text Domain: cpto
*/

:root{
  --ink:#0e1013;
  --ink-2:#1b1f26;
  --muted:#6b7280;
  --line:#e4e5e8;
  --line-2:#f0f0f2;
  --bg:#f7f7f5;
  --surface:#ffffff;
  --accent:#ffc633;
  --accent-dp:#e9ad06;
  --ok:#137a4a;
  --ok-bg:#e9f5ee;
  --warn:#8a5a00;
  --warn-bg:#fdf3e0;
  --err:#b3261e;
  --err-bg:#fdeceb;
  --r:14px;
  --fs:16px;
  --maxw:1080px;
  --shadow:0 1px 2px rgba(16,18,22,.05), 0 8px 24px -12px rgba(16,18,22,.14);
}

/* ---------- Версия для слабовидящих ----------
   Не отдельный сайт, а режим того же самого — контент один,
   расходиться нечему. Обязанность отменена приказом № 1353,
   но людям это по-прежнему нужно. */
html.cpto-a11y{
  --ink:#000; --ink-2:#000; --muted:#000; --line:#000; --line-2:#d8d8d8;
  --bg:#fff; --surface:#fff; --accent:#000; --accent-dp:#000;
  --fs:21px; --shadow:none; --r:0;
}
html.cpto-a11y .cpto-hero-media,
html.cpto-a11y .cpto-decor,
html.cpto-a11y .cpto-card-ico{ display:none !important; }
html.cpto-a11y .cpto-btn-primary{ background:#000 !important; color:#fff !important; border:2px solid #000; }
html.cpto-a11y .cpto-dark{ background:#fff !important; }
html.cpto-a11y .cpto-dark *{ color:#000 !important; }
html.cpto-a11y a{ text-decoration:underline; }
html.cpto-a11y .cpto-card,
html.cpto-a11y .cpto-panel,
html.cpto-a11y .cpto-table,
html.cpto-a11y .cpto-tablewrap{ border:2px solid #000 !important; }
html.cpto-a11y .cpto-topline,
html.cpto-a11y .cpto-footer{ background:#000; }
html.cpto-a11y .cpto-footer *{ color:#fff !important; }

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0; background:var(--bg); color:var(--ink);
  font:var(--fs)/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased; -webkit-text-size-adjust:100%;
}
img{ max-width:100%; height:auto; display:block; }
a{ color:var(--ink); }
a:hover{ color:var(--accent-dp); }

.cpto-container{ max-width:var(--maxw); margin:0 auto; padding:0 20px; }
.cpto-skip{ position:absolute; left:-9999px; top:0; background:var(--ink); color:#fff; padding:10px 16px; z-index:100; }
.cpto-skip:focus{ left:0; color:#fff; }

/* ---------- Верхняя строка ---------- */
.cpto-topline{ background:var(--ink-2); color:#c9ccd2; font-size:13px; }
.cpto-topline-in{ display:flex; gap:16px; align-items:center; justify-content:space-between; min-height:38px; flex-wrap:wrap; }
.cpto-topline a{ color:#c9ccd2; text-decoration:none; }
.cpto-a11y-btn{
  background:none; border:1px solid #454a53; color:#c9ccd2; font:inherit; font-size:13px;
  padding:3px 11px; border-radius:20px; cursor:pointer; display:inline-flex; gap:7px; align-items:center;
}
.cpto-a11y-btn:hover{ border-color:#c9ccd2; color:#fff; }

/* ---------- Шапка ---------- */
.cpto-header{ position:sticky; top:0; z-index:50; background:var(--surface); border-bottom:1px solid var(--line); }
.cpto-header-in{ display:flex; align-items:center; gap:18px; min-height:70px; position:relative; }
/* Логотип должен сжиматься: длинное название организации не имеет права
   выдавливать кнопку меню за край экрана. */
.cpto-logo{ display:flex; align-items:center; gap:11px; text-decoration:none; flex:0 1 auto; min-width:0; }
.cpto-logo-txt{ min-width:0; }
.cpto-logo-mark{
  width:42px; height:42px; border-radius:11px; background:var(--ink); color:var(--accent);
  display:grid; place-items:center; font-weight:800; font-size:14px; flex:none;
}
html.cpto-a11y .cpto-logo-mark{ background:#000; color:#fff; border:2px solid #000; }
.cpto-logo-txt strong{ display:block; font-size:16px; line-height:1.15; letter-spacing:-.01em; }
.cpto-logo-txt > span{ display:block; font-size:11.5px; color:var(--muted); line-height:1.3; margin-top:2px; }

.cpto-nav{ margin-left:auto; }
.cpto-menu{ display:flex; gap:3px; align-items:center; list-style:none; margin:0; padding:0; }
.cpto-menu a{
  text-decoration:none; font-size:14.5px; padding:8px 12px; border-radius:8px;
  white-space:nowrap; color:var(--ink-2); display:block;
}
.cpto-menu a:hover{ background:var(--line-2); }
.cpto-menu .current-menu-item > a,
.cpto-menu .current_page_item > a{ background:var(--ink); color:#fff; }
.cpto-menu .sub-menu{ display:none; }

.cpto-hcta{ display:flex; gap:10px; align-items:center; flex:none; }
.cpto-hphone{ font-weight:650; font-size:15px; text-decoration:none; white-space:nowrap; }

.cpto-burger{
  display:none; margin-left:auto; background:none; border:1px solid var(--line);
  width:44px; height:40px; border-radius:9px; cursor:pointer; align-items:center; justify-content:center;
}
.cpto-burger span{ display:block; width:19px; height:2px; background:var(--ink); position:relative; }
.cpto-burger span::before,
.cpto-burger span::after{ content:""; position:absolute; left:0; width:19px; height:2px; background:var(--ink); }
.cpto-burger span::before{ top:-6px; }
.cpto-burger span::after{ top:6px; }

/* ---------- Кнопки ---------- */
.cpto-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font:inherit; font-size:15px; font-weight:600; text-decoration:none; cursor:pointer;
  padding:11px 20px; border-radius:10px; border:1px solid transparent; transition:.15s;
}
.cpto-btn-primary{ background:var(--accent); color:var(--ink); border-color:var(--accent-dp); }
.cpto-btn-primary:hover{ background:var(--accent-dp); color:var(--ink); }
.cpto-btn-ghost{ background:transparent; border-color:var(--line); }
.cpto-btn-ghost:hover{ border-color:var(--ink); }
.cpto-btn-sm{ padding:8px 15px; font-size:14px; }

/* ---------- Типографика ---------- */
.cpto-main{ padding:36px 0 60px; }
h1{ font-size:clamp(28px,5vw,44px); line-height:1.12; letter-spacing:-.025em; margin:0 0 16px; font-weight:750; }
h2{ font-size:clamp(22px,3.2vw,30px); line-height:1.22; letter-spacing:-.02em; margin:34px 0 10px; font-weight:700; }
h3{ font-size:18px; line-height:1.3; margin:24px 0 8px; font-weight:650; }
p{ margin:0 0 14px; }
ul,ol{ margin:0 0 16px; padding-left:22px; }
li{ margin:0 0 6px; }
.cpto-lead{ font-size:clamp(16px,2vw,18.5px); line-height:1.55; color:var(--ink-2); max-width:680px; }
.cpto-eyebrow{ font-size:12px; letter-spacing:.13em; text-transform:uppercase; color:var(--muted); margin:0 0 12px; font-weight:600; }
.cpto-sechead{ margin-bottom:26px; max-width:660px; }
.cpto-sechead p{ color:var(--muted); margin:0; }

.cpto-breadcrumbs{ font-size:13px; color:var(--muted); margin:0 0 18px; display:flex; gap:7px; flex-wrap:wrap; }
.cpto-breadcrumbs a{ color:var(--muted); }
.cpto-breadcrumbs a:hover{ color:var(--ink); }

/* ---------- Секции ---------- */
.cpto-section{ padding:52px 0; }
.cpto-section-tight{ padding:34px 0; }
.cpto-dark{ background:var(--ink); color:#fff; }
.cpto-dark h2, .cpto-dark h3{ color:#fff; }
.cpto-dark p{ color:#c9ccd2; }
.cpto-dark .cpto-eyebrow{ color:#8b929c; }

/* ---------- Первый экран ---------- */
.cpto-hero{ position:relative; padding:56px 0 46px; overflow:hidden; }
.cpto-hero-grid{ display:grid; grid-template-columns:1.15fr .85fr; gap:44px; align-items:center; }
.cpto-hero-btns{ display:flex; gap:12px; flex-wrap:wrap; margin:24px 0 26px; }
.cpto-hero-note{ font-size:13.5px; color:var(--muted); display:flex; gap:8px; align-items:flex-start; max-width:470px; }
.cpto-decor{
  position:absolute; right:-90px; top:-90px; width:280px; height:280px; border-radius:50%;
  background:radial-gradient(circle, rgba(255,198,51,.20), transparent 68%); pointer-events:none;
}
.cpto-hero-media{
  aspect-ratio:4/3.4; border-radius:20px; background:var(--ink);
  position:relative; overflow:hidden; box-shadow:var(--shadow);
}
.cpto-hero-media img{ width:100%; height:100%; object-fit:cover; }
.cpto-road{ position:absolute; inset:0; background:radial-gradient(130% 90% at 50% 118%, #343a44 0%, #0e1013 72%); }
/* Полотно дороги и разметка нарисованы clip-path, а не 3D-трансформацией:
   при perspective() браузер не всегда обрезает содержимое по скруглению
   родителя, и полоса вылезала за пределы блока. */
.cpto-road::before{
  content:""; position:absolute; left:0; right:0; bottom:0; height:74%;
  background:linear-gradient(to top, #2f343d, #1a1e24);
  clip-path:polygon(42% 0, 58% 0, 104% 100%, -4% 100%);
}
.cpto-road::after{
  content:""; position:absolute; left:0; right:0; bottom:0; height:74%;
  background:repeating-linear-gradient(to bottom, var(--accent) 0 4.5%, transparent 4.5% 13%);
  clip-path:polygon(49.4% 0, 50.6% 0, 53.4% 100%, 46.6% 100%);
  opacity:.95;
}
/* Подпись поверх заглушки: пока нет фотографии, блок не выглядит пустым */
.cpto-hero-badge{
  position:absolute; left:16px; right:16px; bottom:16px; background:rgba(255,255,255,.95);
  border-radius:12px; padding:12px 15px; display:flex; gap:13px; align-items:center; z-index:2;
}
.cpto-hero-badge b{ display:block; font-size:15px; line-height:1.2; }
.cpto-hero-badge span{ font-size:12.5px; color:var(--muted); }
.cpto-hero-badge-ico{ width:38px; height:38px; border-radius:9px; background:var(--accent); display:grid; place-items:center; flex:none; }
html.cpto-a11y .cpto-hero-badge{ display:none; }

/* ---------- Цифры ---------- */
.cpto-stats{
  display:grid; grid-template-columns:repeat(4,1fr); gap:1px; background:var(--line);
  border:1px solid var(--line); border-radius:var(--r); overflow:hidden;
}
.cpto-stat{ background:var(--surface); padding:20px 18px; }
.cpto-stat b{ display:block; font-size:25px; line-height:1.1; letter-spacing:-.02em; font-weight:750; }
.cpto-stat span{ font-size:13px; color:var(--muted); display:block; margin-top:5px; line-height:1.35; }

/* ---------- Карточки ---------- */
.cpto-cards{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.cpto-cards-2{ grid-template-columns:repeat(2,1fr); }
.cpto-card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  padding:22px; display:flex; flex-direction:column; text-decoration:none; transition:.15s;
}
a.cpto-card:hover{ border-color:var(--ink); transform:translateY(-2px); box-shadow:var(--shadow); }
.cpto-card h3{ margin:0 0 8px; }
.cpto-card p{ font-size:14.5px; color:var(--muted); margin:0 0 14px; }
.cpto-card-ico{ width:38px; height:38px; border-radius:10px; background:var(--accent); display:grid; place-items:center; margin-bottom:14px; font-size:18px; flex:none; }
.cpto-card-foot{ margin-top:auto; display:flex; align-items:baseline; gap:9px; flex-wrap:wrap; }
.cpto-price-tag{ font-weight:700; font-size:17px; }
.cpto-price-sub{ font-size:13px; color:var(--muted); }

/* ---------- Панели, таблицы, списки ---------- */
.cpto-panel{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:22px; }
.cpto-tablewrap{
  overflow-x:auto; -webkit-overflow-scrolling:touch; border:1px solid var(--line);
  border-radius:var(--r); background:var(--surface); margin:0 0 18px;
}
.cpto-table{ border-collapse:collapse; width:100%; font-size:15px; min-width:560px; }
.cpto-table th,
.cpto-table td{ text-align:left; padding:12px 16px; border-bottom:1px solid var(--line-2); vertical-align:top; }
.cpto-table th{ background:var(--line-2); font-size:12.5px; font-weight:650; letter-spacing:.01em; }
.cpto-table tbody tr:last-child td{ border-bottom:none; }
.cpto-num{ white-space:nowrap; font-weight:650; }
.cpto-filecell{ font-size:13.5px; }
.cpto-empty{ color:var(--muted); font-style:italic; font-size:.95em; }

.cpto-doclist{ list-style:none; margin:0 0 22px; padding:0; }
.cpto-doclist li{ padding:11px 0; border-bottom:1px solid var(--line-2); margin:0; }
.cpto-doclist li:last-child{ border-bottom:none; }
.cpto-filemeta{ color:var(--muted); font-size:12.5px; }
.cpto-doc-group{ margin:26px 0 6px; }

/* ---------- Сведения ---------- */
.cpto-sveden-body{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:6px 22px; margin:0 0 22px; }
.cpto-dl-row{ display:grid; grid-template-columns:minmax(200px,290px) 1fr; gap:0; border-bottom:1px solid var(--line-2); }
.cpto-dl-row:last-child{ border-bottom:none; }
.cpto-dl-term{ padding:13px 16px 13px 0; color:var(--muted); font-size:14px; }
.cpto-dl-def{ padding:13px 0; font-size:15.5px; }
.cpto-block{ padding:16px 0; border-bottom:1px solid var(--line-2); }
.cpto-block:last-child{ border-bottom:none; }
.cpto-block h2{ margin:0 0 12px; font-size:18px; }

.cpto-sveden-index{ list-style:none; margin:24px 0; padding:0; display:grid; gap:10px; }
.cpto-sveden-index a{
  display:flex; justify-content:space-between; gap:14px; align-items:baseline;
  background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:14px 18px; text-decoration:none;
}
.cpto-sveden-index a:hover{ border-color:var(--ink); }
.cpto-sveden-index-title{ font-weight:600; }
.cpto-sveden-index-url{ font-family:ui-monospace,Menlo,monospace; font-size:12px; color:var(--muted); flex:none; }
.cpto-sveden-more{ margin:30px 0 0; }
.cpto-sveden-more h2{ font-size:17px; }
.cpto-sveden-more ul{ list-style:none; padding:0; display:flex; flex-wrap:wrap; gap:8px; }
.cpto-sveden-more a{ font-size:13.5px; text-decoration:none; padding:7px 13px; border:1px solid var(--line); border-radius:20px; background:var(--surface); display:block; }
.cpto-sveden-more a:hover{ border-color:var(--ink); }
.cpto-sveden-updated{ font-size:13px; color:var(--muted); margin-top:24px; }

/* ---------- Флаги ---------- */
.cpto-note{ border-left:4px solid var(--muted); border-radius:10px; padding:13px 16px; margin:0 0 18px; font-size:14.5px; }
.cpto-note p:last-child{ margin-bottom:0; }
.cpto-note-ok{ border-left-color:var(--ok); background:var(--ok-bg); color:#0f5c39; }
.cpto-note-err{ border-left-color:var(--err); background:var(--err-bg); color:#8d1e18; }
.cpto-note-warn{ border-left-color:var(--warn); background:var(--warn-bg); color:#6d4700; }

/* ---------- Формы ---------- */
.cpto-form-wrap{ max-width:640px; }
.cpto-form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.cpto-field label{ display:block; font-size:13.5px; color:var(--muted); margin:0 0 6px; font-weight:500; }
.cpto-form input[type=text],
.cpto-form input[type=tel],
.cpto-form input[type=email],
.cpto-form select,
.cpto-form textarea{
  width:100%; font:inherit; font-size:15.5px; padding:12px 14px; border-radius:10px;
  border:1px solid var(--line); background:var(--surface); color:var(--ink);
}
.cpto-form input:focus,
.cpto-form select:focus,
.cpto-form textarea:focus{ outline:2px solid var(--ink); outline-offset:1px; border-color:var(--ink); }
.cpto-consent{ display:flex; gap:11px; align-items:flex-start; font-size:13.5px; color:var(--muted); line-height:1.5; }
.cpto-consent input{ width:19px; height:19px; flex:none; margin:2px 0 0; accent-color:var(--ink); }
.cpto-consent label{ color:var(--muted); font-size:13.5px; margin:0; }
.cpto-consent a{ color:var(--ink); }
.cpto-req{ color:var(--err); font-weight:700; }
/* Ловушка для ботов — скрыта от людей, но не через display:none,
   чтобы простые скрипты её всё-таки заполняли. */
.cpto-hp{ position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }

/* ---------- Подвал ---------- */
.cpto-footer{ background:var(--ink); color:#9ba1aa; padding:44px 0 24px; font-size:14px; margin-top:40px; }
.cpto-footer a{ color:#9ba1aa; text-decoration:none; }
.cpto-footer a:hover{ color:#fff; }
.cpto-footer h4{ color:#fff; font-size:14px; margin:0 0 12px; font-weight:650; }
.cpto-footer-cols{ display:grid; grid-template-columns:1.5fr 1fr 1.2fr; gap:32px; margin-bottom:28px; }
.cpto-footer-list{ list-style:none; margin:0; padding:0; }
.cpto-footer-list li{ margin:0 0 7px; }
.cpto-footer-fine{ border-top:1px solid #262a31; padding-top:16px; font-size:12.5px; line-height:1.6; }
.cpto-footer-widgets{ margin-bottom:24px; display:grid; grid-template-columns:repeat(3,1fr); gap:26px; }
.cpto-widget ul{ list-style:none; margin:0; padding:0; }
.cpto-widget li{ margin:0 0 6px; }

/* ---------- Служебное ---------- */
.screen-reader-text{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.cpto-pagination{ display:flex; gap:8px; flex-wrap:wrap; margin-top:26px; }
.cpto-pagination .page-numbers{ padding:8px 13px; border:1px solid var(--line); border-radius:8px; text-decoration:none; background:var(--surface); }
.cpto-pagination .current{ background:var(--ink); color:#fff; border-color:var(--ink); }

@media(max-width:940px){
  .cpto-hero-grid{ grid-template-columns:1fr; gap:28px; }
  .cpto-hero-media{ max-width:440px; }
  .cpto-cards{ grid-template-columns:repeat(2,1fr); }
  .cpto-stats{ grid-template-columns:repeat(2,1fr); }
  .cpto-footer-cols{ grid-template-columns:1fr 1fr; }
}
@media(max-width:760px){
  .cpto-nav{
    display:none; position:absolute; top:100%; left:0; right:0; background:var(--surface);
    border-bottom:1px solid var(--line); padding:10px; box-shadow:var(--shadow); z-index:60;
  }
  .cpto-nav.is-open{ display:block; }
  .cpto-menu{ flex-direction:column; align-items:stretch; gap:2px; }
  .cpto-menu a{ padding:12px 14px; font-size:16px; }
  .cpto-burger{ display:flex; flex:none; }
  .cpto-hcta{ display:none; }
  /* На узком экране описание организации убираем, название переносим —
     иначе кнопка меню уезжает за границу экрана и становится недоступной. */
  .cpto-logo-txt > span{ display:none; }
  .cpto-logo-txt strong{ font-size:15px; white-space:normal; }
  .cpto-header-in{ gap:12px; }
  .cpto-cards, .cpto-cards-2{ grid-template-columns:1fr; }
  .cpto-form-grid{ grid-template-columns:1fr; }
  .cpto-dl-row{ grid-template-columns:1fr; }
  .cpto-dl-term{ padding:12px 0 0; }
  .cpto-dl-def{ padding:2px 0 12px; }
  .cpto-footer-cols, .cpto-footer-widgets{ grid-template-columns:1fr; }
  .cpto-section{ padding:38px 0; }
  .cpto-sveden-index a{ flex-direction:column; gap:4px; }
}
