/* Макет «Игровой портал» */

/* Тёмная шапка с двухцветной чертой — в светлой и тёмной теме */
html[data-layout="games"] .header { background: #101216; border-bottom: 3px solid; border-image: linear-gradient(90deg, #2f9bff 50%, #ff8a1f 50%) 1; box-shadow: none; }
/* такая же черта перед подвалом */
html[data-layout="games"] .footer { border-top: 3px solid; border-image: linear-gradient(90deg, #2f9bff 50%, #ff8a1f 50%) 1; }
html[data-layout="games"] .header .logo, html[data-layout="games"] .header .logo * { color: #fff; }
html[data-layout="games"] .header .tool { color: #c9ced8; }
html[data-layout="games"] .header .tool:hover { background: #272b33; color: #fff; }
@media (min-width: 981px) {
  html[data-layout="games"] .header .nav > .nav__link, html[data-layout="games"] .header .nav__drop > .nav__link { color: #c9ced8; }
  html[data-layout="games"] .header .nav > .nav__link:hover, html[data-layout="games"] .header .nav > .nav__link.on,
  html[data-layout="games"] .header .nav__drop:hover > .nav__link, html[data-layout="games"] .header .nav__drop.on > .nav__link { background: #272b33; color: #fff; }
}

/* общая подложка главной — такая же, как под статьёй */
.gh-sheet { margin-top: 8px; padding: 20px 24px 28px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.gh-sheet--solid { background: var(--surface); }
.gh-sheet--none { padding: 0; border: 0; background: none; }
.gh-sheet > .gh-top { margin-top: 0; }
@media (max-width: 600px) { .gh-sheet:not(.gh-sheet--none) { padding: 10px 10px 16px; } }

/* Слайдер и новости */
/* высота задана: картинка получается широкой (примерно 16:9), а новости не растягивают блок */
.gh-top { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); grid-template-rows: 420px; gap: 16px; margin-top: 16px; }
.gh-slider { position: relative; overflow: hidden; border-radius: 14px; background: #14161b; touch-action: pan-y; }
.gh-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s, visibility .6s; }
.gh-slide.is-on { opacity: 1; visibility: visible; }
.gh-slide img, .gh-slide .cover-empty { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.gh-slide__text { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 20px 34px; background: linear-gradient(transparent, rgba(0, 0, 0, .88)); color: #fff; }
.gh-slide__text em { display: inline-block; margin-bottom: 8px; padding: 3px 9px; border-radius: 6px; background: var(--accent); font-size: 12px; font-style: normal; font-weight: 700; line-height: 1.4; text-transform: uppercase; }
.gh-slide__text b { display: block; font-size: clamp(17px, 1.7vw, 22px); line-height: 1.25; }
.gh-arrow { position: absolute; top: 45%; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; font-size: 24px; cursor: pointer; opacity: 0; transition: opacity .2s; }
.gh-arrow--prev { left: 12px; }
.gh-arrow--next { right: 12px; }
.gh-slider:hover .gh-arrow, .gh-arrow:focus-visible { opacity: 1; }
.gh-dots { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 10px; display: flex; gap: 8px; }
.gh-dots button { flex: 1; max-width: 72px; height: 14px; padding: 5px 0; border: 0; background: none; cursor: pointer; }
.gh-dots i { display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; position: relative; }
.gh-dots .is-on i { background: rgba(255, 255, 255, .45); }
.gh-dots .is-on i::after { content: ""; position: absolute; inset: 0; background: #fff; transform-origin: left; }
/* полоска показывает, сколько осталось до следующей статьи */
.gh-slider.is-playing .gh-dots .is-on i::after { animation: gh-progress var(--sec) linear forwards; }
.gh-slider.is-paused .gh-dots .is-on i::after { animation-play-state: paused; }
@keyframes gh-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.gh-news { display: flex; flex-direction: column; min-height: 0; overflow: hidden auto; scrollbar-width: thin; padding: 4px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.gh-news h2 { flex: none; margin: 8px 0 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
/* статьи делят высоту поровну и не могут вытолкнуть ссылку «Все статьи» за край блока */
.gh-news a { display: flex; flex: 1 1 0; min-height: 62px;   /* Яндекс вставляет в список свои объявления: пункты не сжимаются, а блок прокручивается */ overflow: hidden; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); color: var(--text); }
.gh-news img, .gh-news__empty { flex: none; width: 62px; height: 62px; border-radius: 8px; object-fit: cover; object-position: 50% 20%; }
.gh-news__empty { background: linear-gradient(135deg, var(--c, #2f9bff), #14161b 80%); }
.gh-news a > span { flex: 1; min-width: 0; }
.gh-news b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15.5px; font-weight: 600; line-height: 1.28; }
.gh-news a:hover { color: var(--accent); }
.gh-news small { display: block; margin-top: 1px; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.gh-news .gh-news__all { flex: none; padding: 7px 0 5px; border: 0; font-weight: 700; font-size: 14px; }

/* Плитки разделов */
.gh-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.gh-games a { padding: 13px 18px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--c), #14161b 85%); transition: transform .15s; }
.gh-games a:hover { transform: translateY(-3px); }
.gh-games b { display: block; font-size: 21px; line-height: 1.2; }
.gh-games span { opacity: .85; font-size: 14px; }
.gh-games__cnt { font-style: normal; }
.gh-games__num { display: none; } /* крупное число показывает только шаблон «Aperture Science» */

/* Блоки главной: фраза, счётчик, опрос, случайная статья */
.hw { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.hw__box { display: flex; flex-direction: column; min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-top: 3px solid #2f9bff; border-radius: 14px; background: var(--surface); }
.hw__box + .hw__box { border-top-color: #ff8a1f; }
.hw__box + .hw__box + .hw__box { border-top-color: #2f9bff; }
.hw__box h2 { margin: 0 0 10px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hw-quote blockquote { flex: 1; margin: 0; padding: 0; border: 0; font-size: 17px; line-height: 1.5; font-style: italic; }
.hw__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 14px; font-weight: 600; }
.hw__btn { padding: 8px 16px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent, #fff); font: inherit; cursor: pointer; }
.hw__btn:hover { filter: brightness(1.1); }
.hw-count { align-items: center; justify-content: center; text-align: center; }
.hw-count b { font-size: 52px; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); }
.hw-count span { font-size: 15px; color: var(--muted); }
.hw-poll .poll__q { font-size: 16px; margin-bottom: 10px; }
.hw-poll .poll__opt { padding: 8px 12px; font-size: 14px; }
.hw-poll .poll__res { padding: 7px 12px; font-size: 14px; }
.hw-strip { display: flex; justify-content: center; margin-top: 16px; }
.hw-strip__random { padding: 11px 28px; border-radius: 999px; background: var(--accent); color: var(--on-accent, #fff); font-weight: 700; }
.hw-strip__random:hover { filter: brightness(1.1); color: var(--on-accent, #fff); }

/* Блоки статей */
.gh-block { margin-top: 30px; }
.gh-block h2 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; padding-left: 10px; border-left: 4px solid var(--c, var(--accent)); font-size: 15px; letter-spacing: .08em; text-transform: uppercase; }
.gh-block h2 a { color: var(--text); }
.gh-block h2 a:hover { color: var(--accent); }
.gh-block__all { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.gh-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.gh-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); transition: transform .15s, border-color .15s; }
.gh-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.gh-card__img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #14161b; }
/* портреты и персонажи: кадр берётся ближе к верху, чтобы не резать лица */
.gh-card__img img, .gh-card__img .cover-empty { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.gh-card__title { padding: 10px 12px 14px; font-weight: 700; font-size: 15px; line-height: 1.35; }

/* Статья: широкий текст и справа «ещё по теме». Содержание — кнопкой у левого края. Уже 1180px колонку прячет общий стиль. */
@media (min-width: 1181px) {
  html[data-layout="games"][data-article="classic"] .post-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; }
  html[data-layout="games"][data-article="classic"] .post-layout > .post-info { display: none; }
  html[data-layout="games"][data-article="classic"] .post-layout > .post { grid-column: 1; grid-row: 1; max-width: none; }
  html[data-layout="games"][data-article="classic"] .post-layout > .post-aside { grid-column: 2; grid-row: 1; }
  /* колонка прокручивается вместе со страницей */
  html[data-layout="games"][data-article="classic"] .post-aside .aside-sticky { position: static; height: auto; max-height: none; overflow: visible; }
}
.gmore a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); font-size: 17px; font-weight: 700; line-height: 1.35; }
.gmore a:last-child { border-bottom: 0; }
.gmore a > span { display: block; margin-top: 8px; }
.gmore a:hover { color: var(--accent); }
.gmore img, .gmore__empty { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 10px; object-fit: cover; object-position: 50% 15%; }
.gmore__empty { background: linear-gradient(135deg, #2f9bff, #14161b 70%); }

/* на узких экранах новости уходят под слайдер */
@media (max-width: 1100px) {
  .gh-top { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .gh-slider { aspect-ratio: 16 / 9; }
  .gh-news a:not(.gh-news__all) { flex: none; padding: 8px 0; }
}
@media (max-width: 600px) {
  .gh-slider { aspect-ratio: 4 / 3; }
}
@media (max-width: 900px) {
  .gh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gh-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gh-slide { transition: none; }
  .gh-card, .gh-games a { transition: none; }
}
