/*
 * BTLH Оформление — единый стиль материалов на страницах сайта.
 * Цвета — из настроек темы Graphene: заголовки/ссылки #008C9E, кнопки #005F6B, полоса виджетов #04d6b3.
 * Файл собирается из oformlenie.src.css: body.page:not(.btlh-ch-page) .entry-content — область действия (страницы сайта или окно редактора).
 */
body.page:not(.btlh-ch-page) .entry-content{
  --b-teal:#008C9E; --b-teal-dark:#005F6B; --b-mint:#04d6b3; --b-mint-ink:#06454c;
  --b-head:#1f2a2c; --b-muted:#6b7274; --b-line:#dde5e5; --b-panel:#f6f8f8;
  --b-pdf:#b5443b; --b-word:#2b5fa8; --b-ppt:#c0621d; --b-xls:#2e7d4f; --b-img:#5f7a2e; --b-video:#7a3f9a; --b-disk:#50627a; --b-site:#6b7274;
}

/* ---------- 1. Ссылки и значок типа — автоматически, по адресу ---------- */
body.page:not(.btlh-ch-page) .entry-content a{text-decoration:none}
body.page:not(.btlh-ch-page) .entry-content a:hover{text-decoration:underline;text-underline-offset:3px}
body.page:not(.btlh-ch-page) .entry-content a[style*="color"]{color:var(--b-teal)!important}

/* :where — нулевой «вес»: правила конкретных типов ниже всегда перебивают общее «САЙТ» */
body.page:not(.btlh-ch-page) .entry-content :where(a[href$=".pdf" i],a[href$=".doc" i],a[href$=".docx" i],a[href$=".rtf" i],a[href$=".odt" i],
  a[href$=".ppt" i],a[href$=".pptx" i],a[href$=".xls" i],a[href$=".xlsx" i],a[href$=".zip" i],a[href$=".rar" i],
  a[href$=".jpg" i],a[href$=".jpeg" i],a[href$=".png" i],a[href$=".mp4" i],a[href^="http"]:not([href*="btlh.ru"]))::before{
  display:inline-block;vertical-align:.12em;margin-right:7px;padding:3px 5px 2px;border-radius:3px;
  font-family:Arial,sans-serif;font-size:10px;font-weight:700;line-height:1;letter-spacing:.05em;font-style:normal;
  color:#fff;background:var(--b-site);content:"САЙТ";text-decoration:none}
body.page:not(.btlh-ch-page) .entry-content a[href$=".pdf" i]::before{content:"PDF";background:var(--b-pdf)}
body.page:not(.btlh-ch-page) .entry-content :is(a[href$=".doc" i],a[href$=".docx" i],a[href$=".rtf" i],a[href$=".odt" i])::before{content:"WORD";background:var(--b-word)}
body.page:not(.btlh-ch-page) .entry-content :is(a[href$=".ppt" i],a[href$=".pptx" i])::before{content:"PPT";background:var(--b-ppt)}
body.page:not(.btlh-ch-page) .entry-content :is(a[href$=".xls" i],a[href$=".xlsx" i])::before{content:"EXCEL";background:var(--b-xls)}
body.page:not(.btlh-ch-page) .entry-content :is(a[href$=".zip" i],a[href$=".rar" i])::before{content:"АРХИВ";background:var(--b-disk)}
body.page:not(.btlh-ch-page) .entry-content :is(a[href$=".jpg" i],a[href$=".jpeg" i],a[href$=".png" i])::before{content:"ФОТО";background:var(--b-img)}
body.page:not(.btlh-ch-page) .entry-content :is(a[href$=".mp4" i],a[href*="rutube.ru"],a[href*="vkvideo.ru"],a[href*="vk.ru/wall"],a[href*="vk.com/video"],a[href*="youtube.com"],a[href*="youtu.be"])::before{content:"ВИДЕО";background:var(--b-video)}
body.page:not(.btlh-ch-page) .entry-content :is(a[href*="disk.yandex"],a[href*="docs.yandex"],a[href*="drive.google"],a[href*="cloud.mail.ru"])::before{content:"ДИСК";background:var(--b-disk)}

/* ссылка на другой раздел сайта — стрелка после */
body.page:not(.btlh-ch-page) .entry-content :is(a[href*="btlh.ru"],a[href^="/"]):not([href*="/wp-content/"]):not([href*="#"]):not([href*="wp-login"])::after{content:"\00a0→";display:inline-block;text-decoration:none}

/* где значки не нужны: картинки-ссылки, галереи, кнопки, карточки педагогов */
body.page:not(.btlh-ch-page) .entry-content :is(a:has(>img),.gallery a,a.btlh-button,.btlh-root a,a.su-button,.su-spoiler-title a)::before,
body.page:not(.btlh-ch-page) .entry-content :is(a:has(>img),.gallery a,a.btlh-button,.btlh-root a,a.su-button,.su-spoiler-title a)::after{content:none!important}

/* строки ссылок через перенос — чуть свободнее */
body.page:not(.btlh-ch-page) .entry-content p:has(>a){line-height:1.9}

/* ---------- 2. Картинки: миниатюры не растягиваются, картинки-ссылки — аккуратные плитки ---------- */
body.page:not(.btlh-ch-page) .entry-content img[src*="-300x"],body.page:not(.btlh-ch-page) .entry-content img[src*="x300."],body.page:not(.btlh-ch-page) .entry-content img[src*="-150x"]{width:auto;height:auto}
body.page:not(.btlh-ch-page) .entry-content a:has(>img):not(.btlh-root a){display:inline-block;margin:0 8px 10px 0;border:1px solid var(--b-line);border-radius:6px;overflow:hidden;line-height:0;vertical-align:top;transition:border-color .15s,box-shadow .15s}
body.page:not(.btlh-ch-page) .entry-content a:has(>img):not(.btlh-root a):hover{border-color:var(--b-teal);box-shadow:0 4px 14px rgba(0,60,70,.15)}
body.page:not(.btlh-ch-page) .entry-content a:has(>img.aligncenter){display:table;margin-left:auto;margin-right:auto}
body.page:not(.btlh-ch-page) .entry-content a:has(>img.alignleft){float:left;margin:0 1em 1em 0}
body.page:not(.btlh-ch-page) .entry-content a:has(>img.alignright){float:right;margin:0 0 1em 1em}
body.page:not(.btlh-ch-page) .entry-content a:has(>img) img{margin:0}

/* ---------- 3. Спойлеры (Shortcodes Ultimate) — все существующие, без правки ---------- */
body.page:not(.btlh-ch-page) .entry-content .su-spoiler-style-fancy{border:1px solid var(--b-line);border-left:4px solid var(--b-mint);border-radius:6px;background:#fff}
body.page:not(.btlh-ch-page) .entry-content .su-spoiler-style-fancy>.su-spoiler-title{background:var(--b-panel);border-radius:0 5px 5px 0;border-bottom:1px solid var(--b-line);color:var(--b-teal-dark);font-size:15px;line-height:1.35;padding:11px 12px 11px 38px}
body.page:not(.btlh-ch-page) .entry-content .su-spoiler-style-fancy.su-spoiler-closed>.su-spoiler-title{border-bottom:0}
body.page:not(.btlh-ch-page) .entry-content .su-spoiler-style-fancy>.su-spoiler-title:hover{background:#eef6f6}
body.page:not(.btlh-ch-page) .entry-content .su-spoiler-style-fancy .su-spoiler-icon{color:var(--b-teal);top:11px}

/* ---------- 4. Заголовки и разделители ---------- */
body.page:not(.btlh-ch-page) .entry-content h3:not(.btlh-root h3){color:var(--b-teal);font-size:22px;line-height:1.3;font-weight:bold;margin:32px 0 12px}
body.page:not(.btlh-ch-page) .entry-content h3:not(.btlh-root h3)::after{content:"";display:block;width:56px;height:3px;background:var(--b-mint);margin-top:8px}
body.page:not(.btlh-ch-page) .entry-content h3[style*="center"]::after{margin-left:auto;margin-right:auto}
body.page:not(.btlh-ch-page) .entry-content h4:not(.btlh-root h4){color:var(--b-head);font-size:17px;line-height:1.35;font-weight:bold;margin:22px 0 10px}
body.page:not(.btlh-ch-page) .entry-content hr{border:0;border-top:1px solid var(--b-line);margin:24px 0}

/* ---------- 5. Форматы редактора ---------- */
/* Список материалов */
body.page:not(.btlh-ch-page) .entry-content ul.btlh-materials{list-style:none;margin:0 0 18px;padding:0;border-top:1px solid var(--b-line)}
body.page:not(.btlh-ch-page) .entry-content ul.btlh-materials li{padding:9px 6px 9px 2px;margin:0;border-bottom:1px solid var(--b-line);line-height:1.45;background:none}
body.page:not(.btlh-ch-page) .entry-content ul.btlh-materials li::before{content:none}
body.page:not(.btlh-ch-page) .entry-content ul.btlh-materials li:hover{background:#f7fbfb}
/* Подпись (формат, год) */
body.page:not(.btlh-ch-page) .entry-content small.btlh-cap{color:var(--b-muted);font-size:13px;white-space:nowrap}
body.page:not(.btlh-ch-page) .entry-content small.btlh-cap::before{content:"· "}
/* Метка «Новое» */
body.page:not(.btlh-ch-page) .entry-content mark.btlh-new{background:var(--b-mint);color:var(--b-mint-ink);font-size:10.5px;font-weight:700;line-height:1;text-transform:uppercase;letter-spacing:.06em;padding:3px 6px;border-radius:3px;vertical-align:.12em}
/* Рамка «Важно» */
body.page:not(.btlh-ch-page) .entry-content .btlh-note{background:#eefaf7;border-left:4px solid var(--b-mint);padding:14px 16px;margin:18px 0 22px;color:var(--b-head)}
body.page:not(.btlh-ch-page) .entry-content .btlh-note>:first-child{margin-top:0}
body.page:not(.btlh-ch-page) .entry-content .btlh-note>:last-child{margin-bottom:0}
/* Кнопка */
body.page:not(.btlh-ch-page) .entry-content a.btlh-button{display:inline-block;background:var(--b-teal-dark);color:#fff!important;font-weight:bold;padding:11px 20px;border-radius:6px;text-decoration:none!important;line-height:1.3}
body.page:not(.btlh-ch-page) .entry-content a.btlh-button:hover{background:#004a53}

/* ---------- 6. Галерея WordPress — плитки с подписями ---------- */
body.page:not(.btlh-ch-page) .entry-content .gallery{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;margin:6px 0 20px}
/* число колонок — из настроек галереи (WordPress ставит класс gallery-columns-N), как в редакторе */
body.page:not(.btlh-ch-page) .entry-content .gallery-columns-1{grid-template-columns:1fr}
body.page:not(.btlh-ch-page) .entry-content .gallery-columns-2{grid-template-columns:repeat(2,minmax(0,1fr))}
body.page:not(.btlh-ch-page) .entry-content .gallery-columns-3{grid-template-columns:repeat(3,minmax(0,1fr))}
body.page:not(.btlh-ch-page) .entry-content .gallery-columns-4{grid-template-columns:repeat(4,minmax(0,1fr))}
body.page:not(.btlh-ch-page) .entry-content .gallery-columns-5{grid-template-columns:repeat(5,minmax(0,1fr))}
body.page:not(.btlh-ch-page) .entry-content .gallery-columns-6{grid-template-columns:repeat(6,minmax(0,1fr))}
body.page:not(.btlh-ch-page) .entry-content .gallery-columns-7{grid-template-columns:repeat(7,minmax(0,1fr))}
body.page:not(.btlh-ch-page) .entry-content .gallery-columns-8{grid-template-columns:repeat(8,minmax(0,1fr))}
body.page:not(.btlh-ch-page) .entry-content .gallery-columns-9{grid-template-columns:repeat(9,minmax(0,1fr))}
/* на телефоне — не больше двух колонок */
@media (max-width:600px){body.page:not(.btlh-ch-page) .entry-content .gallery:not(.gallery-columns-1){grid-template-columns:repeat(2,minmax(0,1fr))}}
body.page:not(.btlh-ch-page) .entry-content .gallery>br{display:none}
body.page:not(.btlh-ch-page) .entry-content .gallery .gallery-item{float:none!important;width:auto!important;margin:0!important;text-align:left!important;background:#fff;border:1px solid var(--b-line);border-radius:6px;overflow:hidden;transition:border-color .15s,box-shadow .15s}
body.page:not(.btlh-ch-page) .entry-content .gallery .gallery-item:hover{border-color:var(--b-teal);box-shadow:0 4px 14px rgba(0,60,70,.15)}
body.page:not(.btlh-ch-page) .entry-content .gallery .gallery-icon{margin:0}
body.page:not(.btlh-ch-page) .entry-content .gallery .gallery-icon a{display:block;margin:0;border:0;border-radius:0;background:var(--b-panel)}
body.page:not(.btlh-ch-page) .entry-content .gallery img{display:block;width:100%!important;height:auto!important;aspect-ratio:1;object-fit:contain;border:0!important;margin:0}
/* подпись всегда видна под плиткой: тема Graphene прячет её в плашку поверх картинки с opacity:0 (видно только при наведении) */
body.page:not(.btlh-ch-page) .entry-content .gallery .gallery-caption{position:static;opacity:1;width:auto;background:none;border:0;padding:7px 9px 9px;margin:0;font-size:13px;line-height:1.35;color:var(--b-head);text-align:left}

/* ---------- 7. Просмотр картинок: сверху счётчик и крестик, по краям стрелки, снизу подпись в одну строку ---------- */
html.btlh-lb-open{overflow:hidden}
dialog.btlh-lb{border:0;padding:0;margin:auto;width:min(100vw,1100px);height:min(100dvh,860px);max-width:100vw;max-height:100dvh;
  background:#0d1417;color:#fff;border-radius:8px;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.45)}
dialog.btlh-lb[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
@media (max-width:760px){dialog.btlh-lb{width:100vw;height:100dvh;border-radius:0}}
dialog.btlh-lb::backdrop{background:rgba(5,10,12,.85)}
dialog.btlh-lb button{margin:0;padding:0;border:0;min-width:0;box-shadow:none;text-shadow:none;font-family:Arial,sans-serif;font-weight:400;color:#fff;cursor:pointer;-webkit-appearance:none;appearance:none}
.btlh-lb__top{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:52px;padding:4px 4px 4px 16px}
.btlh-lb__count{font:14px/1.2 Arial,sans-serif;color:#b9c7c8;font-variant-numeric:tabular-nums}
dialog.btlh-lb .btlh-lb__close{width:44px;height:44px;border-radius:50%;background:transparent;font-size:34px;line-height:44px;text-align:center}
dialog.btlh-lb .btlh-lb__close:hover,dialog.btlh-lb .btlh-lb__close:focus-visible{background:rgba(255,255,255,.14);outline:0}
.btlh-lb__stage{position:relative;min-height:0;display:flex;align-items:center;justify-content:center;padding:0 8px;touch-action:pan-y}
.btlh-lb__stage img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}
dialog.btlh-lb .btlh-lb__arrow{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:64px;background:rgba(0,0,0,.4);font-size:36px;line-height:60px;text-align:center}
dialog.btlh-lb .btlh-lb__prev{left:0;border-radius:0 6px 6px 0}
dialog.btlh-lb .btlh-lb__next{right:0;border-radius:6px 0 0 6px}
dialog.btlh-lb .btlh-lb__arrow:hover{background:rgba(0,0,0,.65)}
dialog.btlh-lb .btlh-lb__arrow[hidden]{display:none}
.btlh-lb__cap{padding:10px 16px calc(12px + env(safe-area-inset-bottom));font:14px/1.35 Arial,sans-serif;color:#dfe7e8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:42px}
