/* Шаблон «Aperture Science»: обычный вид «Игрового портала», к нему — оранжевый и голубой порталы,
   полоса камеры под шапкой и расписанная стена в подвале. Работает в светлой и тёмной теме. */

html[data-tpl="aperture"] { --ap-blue: #1596dc; --ap-orange: #f5871f; }
html[data-tpl="aperture"][data-theme="light"] { --accent: #c45f00; --on-accent: #ffffff; --link: #0a6ea8; }
html[data-tpl="aperture"][data-theme="dark"] { --accent: #ff9a2e; --on-accent: #1a1206; --link: #55bdf2; }

/* знак-диафрагма вместо букв (если свой логотип не загружен) */
html[data-tpl="aperture"] .logo__mark { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 0; box-shadow: none; font-size: 0; color: transparent !important;
  background: linear-gradient(135deg, var(--ap-orange) 50%, var(--ap-blue) 50%);
  -webkit-mask: url(../img/aperture-mark.svg) center / contain no-repeat; mask: url(../img/aperture-mark.svg) center / contain no-repeat; }

/* картинка камеры фоном шапки (не повторяется) и расписанная стена фоном подвала */
/* картинка камеры целиком; «Help» стоит у левого края окна, левее логотипа (на узких экранах может уйти под него) */
html[data-tpl="aperture"] .header.header.header--wall { background-image: url(../img/aperture/top.png); background-size: max(100%, calc(var(--ap-row) * 50)) auto; background-position: calc(var(--ap-row) * -1.55) top; }
@media (max-width: 980px) {
  html[data-tpl="aperture"] .header.header.header--wall { background-size: auto 124px; background-position: -90px top; }
}

/* фон сайта — стена из светлых (в тёмной теме — тёмных) панелей камеры */
html[data-tpl="aperture"][data-theme="light"] body { background: #e7e8e8 url(../img/aperture/wall.webp) repeat; }
/* в тёмной теме та же стена, сильно приглушённая */
html[data-tpl="aperture"][data-theme="dark"] body { background: linear-gradient(rgba(10, 11, 13, .9), rgba(10, 11, 13, .9)), url(../img/aperture/wall.webp) repeat, #121315; }

/* ссылка под курсором — оранжевая; цветные плитки, слайдер и кнопки не перекрашиваются */
html[data-tpl="aperture"][data-theme="light"] { --hover: #e86f00; }
html[data-tpl="aperture"][data-theme="dark"] { --hover: #ff9a2e; }
html[data-tpl="aperture"] :is(.content, .crumbs, .post__meta, .footer__links, .footer__docs, .gh-block h2) a:not(.btn):not(.file):hover,
html[data-tpl="aperture"] .gh-news a:hover b, html[data-tpl="aperture"] .gmore a:hover span,
html[data-tpl="aperture"] a.gh-card:hover .gh-card__title, html[data-tpl="aperture"] a:hover .card__title { color: var(--hover); }
html[data-tpl="aperture"] .header .nav a:hover, html[data-tpl="aperture"] .header .nav__drop:hover > .nav__link { color: var(--hover) !important; }
/* плитка раздела под курсором: текст остаётся белым, сама плитка светлеет */
html[data-tpl="aperture"] .gh-games a:hover { color: #fff; filter: brightness(1.14); }

/* свой курсор на странице; на ссылках и кнопках — обычная «рука», в полях ввода — текстовый */
html[data-tpl="aperture"], html[data-tpl="aperture"] * { cursor: url(../img/aperture/cursor.png), auto !important; }
html[data-tpl="aperture"] :is(a, a *, button, button *, summary, summary *, label, select, [role="button"], [role="button"] *) { cursor: pointer !important; }
html[data-tpl="aperture"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="range"]), textarea) { cursor: text !important; }

/* разделы и заголовки блоков: порталы по очереди */
/* плитки, блоки и ярлыки красятся в цвет своей рубрики (--c задаётся на элементе) */
html[data-tpl="aperture"] .gh-block h2 { border-left-color: var(--c, var(--ap-orange)); }
html[data-tpl="aperture"] .gh-slider { border: 2px solid var(--ap-orange); }
html[data-tpl="aperture"] .gh-news { border: 2px solid var(--ap-blue); }
html[data-tpl="aperture"] .gh-slide__text em { background: var(--c, var(--ap-orange)); color: var(--on-accent, #1a1206); }
html[data-tpl="aperture"] .gh-slide:not([style]) .gh-slide__text em { color: #1a1206; }
html[data-tpl="aperture"] .gmore__empty { background: linear-gradient(135deg, var(--ap-blue), #14161b 70%); }
html[data-tpl="aperture"] .side-title { border-left-color: var(--accent); }
html[data-tpl="aperture"] .content blockquote { border-left-color: var(--accent); }
html[data-tpl="aperture"] .read-progress span { background: linear-gradient(90deg, var(--ap-blue), var(--ap-orange)); }

/* пустая обложка — тёмная панель со знаком вместо красного пятна */
html[data-tpl="aperture"] .cover-empty { position: relative; overflow: hidden; background: #22272d; color: #eef0ed; }
html[data-tpl="aperture"] .cover-empty::before { content: ""; position: absolute; right: -14%; bottom: -24%; width: 62%; aspect-ratio: 1; background: rgba(255, 255, 255, .09);
  -webkit-mask: url(../img/aperture-mark.svg) center / contain no-repeat; mask: url(../img/aperture-mark.svg) center / contain no-repeat; }
/* шапка страницы автора — на расписанной стене */
html[data-tpl="aperture"] .authorhero { background: linear-gradient(90deg, rgba(14, 15, 20, .92) 0%, rgba(14, 15, 20, .7) 45%, rgba(14, 15, 20, .25) 100%), url(../img/aperture/art.jpg) right 30% / cover, #101216; }

/* боковые кнопки «поделиться» — белая «закладка», приклеенная к левому краю статьи: линии плиточного фона их не режут.
   Отступы: поле панели статьи 40px + ширина закладки 52px. */
html[data-tpl="aperture"] .post-page.panel .post-rail { left: -92px; width: 52px; }
html[data-tpl="aperture"] .post-page.panel .post-rail__in { justify-items: center; padding: 8px; border-radius: 14px 0 0 14px; background: var(--panel);
  box-shadow: -6px 6px 16px rgba(0, 0, 0, .16); clip-path: inset(-24px 0 -24px -24px); }

/* оценка статьи: вместо звёзд — кубы-компаньоны; не выбранные — серые и бледные */
html[data-tpl="aperture"] .rate .rate__stars .rate__star svg { width: 32px; height: 32px; fill: transparent; stroke: none; background: url(../img/aperture/cube.svg) center / contain no-repeat; filter: grayscale(1) opacity(.55); transition: filter .12s; }
html[data-tpl="aperture"] .rate .rate__stars .rate__star path { display: none; }
html[data-tpl="aperture"] .rate .rate__stars .rate__star.is-on svg,
html[data-tpl="aperture"] .rate .rate__stars:hover .rate__star svg { filter: none; }
html[data-tpl="aperture"] .rate .rate__stars .rate__star:hover svg { filter: drop-shadow(0 2px 6px rgba(238, 92, 147, .55)); }
html[data-tpl="aperture"] .rate .rate__stars .rate__star:hover ~ .rate__star svg { filter: grayscale(1) opacity(.55); }
