/* ===========================================================================
   Страницы справочника «100 вопросов и решений по Windows 11».
   Этот файл подключается только к оглавлению и отдельным главам книги.
   =========================================================================== */

.guide-index-hero { position: relative; min-height: 295px; padding: 62px 0 42px; overflow: hidden; }
.guide-index-hero::after { content: ""; position: absolute; z-index: -1; top: -140px; right: -70px; width: 480px; aspect-ratio: 1; border: 37px solid rgba(43, 143, 255, .3); border-right-color: rgba(126, 54, 255, .55); border-radius: 42% 58% 48% 62%; box-shadow: 0 0 65px rgba(41, 102, 255, .3); transform: rotate(-26deg); }
.guide-index-hero h1 { max-width: 790px; margin: 0 0 10px; font-size: clamp(38px, 5.2vw, 62px); line-height: 1.04; letter-spacing: -2.2px; }
.guide-index-hero h1 span { color: var(--blue); }
.guide-index-hero > p:not(.section-kicker) { max-width: 610px; margin: 0; color: var(--muted); font-size: 16px; }
.guide-index-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.guide-index-stats div { min-width: 128px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 9px; background: rgba(7, 20, 50, .58); }
.guide-index-stats b { display: block; color: var(--blue-bright); font-size: 23px; line-height: 1; }
.guide-index-stats span { color: var(--muted); font-size: 10px; }

.guide-contents { padding-top: 24px; padding-bottom: 18px; }
.guide-group { margin: 0 0 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(135deg, var(--surface), rgba(4, 10, 25, .45)); }
.guide-group-heading { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: rgba(15, 38, 82, .27); }
.guide-group-heading > span { padding: 4px 8px; border: 1px solid rgba(54, 151, 255, .58); border-radius: 5px; color: var(--blue-bright); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.guide-group-heading h2 { margin: 0; font-size: 18px; }
.guide-group-heading small { color: var(--muted); font-size: 10px; }
.guide-group ol { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; margin: 0; padding: 0 20px; list-style: none; }
.guide-group li { border-bottom: 1px solid rgba(113, 141, 197, .16); }
.guide-group li:nth-last-child(-n + 2) { border-bottom: 0; }
.guide-group li a { min-height: 57px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 8px; }
.guide-group li a:hover span, .guide-group li a:hover em { color: var(--blue-bright); }
.guide-group li b { color: var(--blue); font-size: 12px; }
.guide-group li span { font-size: 12px; font-weight: 700; line-height: 1.32; transition: color .2s; }
.guide-group li em { color: var(--muted); font-size: 10px; font-style: normal; white-space: nowrap; transition: color .2s; }
.guide-group li.is-planned { opacity: .68; }
.guide-group li.is-planned b { color: #71809e; }
.guide-group li.is-planned em { color: #919caf; }

.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) 245px; gap: 24px; padding-top: 30px; }
.breadcrumbs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 11px; }
.breadcrumbs a:hover { color: var(--blue-bright); }
.guide-article { min-width: 0; padding: 0 0 30px; }
.guide-article h1 { max-width: 830px; margin: 0 0 12px; font-size: clamp(34px, 4.7vw, 52px); line-height: 1.08; letter-spacing: -1.65px; }
.guide-intro { max-width: 780px; margin: 0; color: #c5cedd; font-size: 18px; line-height: 1.6; }
.guide-meta { margin: 15px 0 31px; color: var(--muted); font-size: 11px; }
.windows-md-article { display:grid; grid-template-columns:minmax(0, .95fr) minmax(330px, .85fr); column-gap:42px; align-items:center; }
.windows-md-article > .section-kicker, .windows-md-article > h1, .windows-md-article > .guide-intro, .windows-md-article > .guide-meta { grid-column:1; }
.windows-md-article > .windows-article-cover { grid-column:2; grid-row:1 / span 4; }
.windows-md-article > h2, .windows-md-article > h3, .windows-md-article > p:not(.section-kicker):not(.guide-intro):not(.guide-meta), .windows-md-article > ul, .windows-md-article > ol, .windows-md-article > .guide-pagination { grid-column:1 / -1; max-width:860px; }
.windows-article-cover { display:block; width:100%; max-width:none; max-height:420px; margin:0; object-fit:cover; border:1px solid rgba(86,180,255,.36); border-radius:16px; box-shadow:0 22px 48px rgba(1,8,27,.34); }
body.light-mode .windows-article-cover { border-color:rgba(215,135,255,.42); }
.guide-layout:has(.windows-md-article) { grid-template-columns: minmax(0, 1fr) 270px; }
.windows-md-article { display:block; max-width: 920px; }
.windows-md-article > .windows-article-cover { display:block; width:100%; max-width:820px; margin:25px 0 14px; }
.guide-layout:has(.windows-md-article) .guide-sidebar { display:flex; min-height:0; max-height:560px; height:55vh; overflow:hidden; }
.windows-block-sidebar .sidebar-lessons { flex:1; overflow:hidden; }
.windows-block-sidebar .sidebar-nav { margin-top:auto; }
.windows-block-sidebar .sidebar-lessons { gap:6px; margin:10px 0; }
.windows-block-sidebar .sidebar-lessons li a { padding:9px 10px; border-color:transparent; background:rgba(12,40,82,.22); line-height:1.32; }
.windows-block-sidebar .sidebar-lessons li a:hover { color:#e7f8ff; border-color:rgba(72,184,255,.48); background:rgba(47,146,255,.17); box-shadow:inset 3px 0 #65caff; }
.windows-block-sidebar .sidebar-lessons li.is-active a { color:#fff; border-color:rgba(86,190,255,.6); background:linear-gradient(110deg,rgba(44,151,255,.34),rgba(72,91,215,.24)); box-shadow:inset 3px 0 #8edbff,0 0 18px rgba(47,146,255,.15); }
.guide-article h2 { margin: 33px 0 10px; font-size: 27px; line-height: 1.2; }
.guide-article h3 { margin: 22px 0 8px; color: var(--blue-bright); font-size: 19px; }
.guide-article p { max-width: 810px; margin: 0 0 15px; color: #c7d0df; font-size: 16px; }
.guide-article ul { max-width: 800px; margin: 0 0 18px; padding: 3px 0 3px 23px; color: #c7d0df; }
.guide-article li { margin: 7px 0; padding-left: 2px; }
.guide-article li::marker { color: var(--blue-bright); }
.guide-article code { padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; color: #a9d8ff; background: rgba(28, 61, 125, .34); }
.guide-article a:not(.button) { color: var(--blue-bright); text-decoration: underline; text-underline-offset: 3px; }
.guide-placeholder { max-width: 780px; margin-top: 26px; padding: 22px; border: 1px dashed rgba(80, 142, 255, .65); border-radius: 11px; background: rgba(20, 51, 108, .18); }
.guide-placeholder h2 { margin-top: 0; }
.guide-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 46px; padding-top: 20px; border-top: 1px solid var(--line); }
.guide-pagination a { min-height: 72px; display: flex; flex-direction: column; justify-content: center; padding: 12px 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); transition: border-color .2s, transform .2s; }
.guide-pagination a:hover { border-color: var(--blue); transform: translateY(-2px); }
.guide-pagination .next { text-align: right; }
.guide-pagination small { color: var(--muted); font-size: 10px; }
.guide-pagination b { margin-top: 3px; color: var(--blue-bright); font-size: 12px; line-height: 1.35; }

/* ========== БОКОВАЯ ПАНЕЛЬ (Sidebar) ========== */
.guide-sidebar { position: sticky; top: 100px; height: fit-content; padding: 19px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; transition: transform 0.3s ease; }

/* ==========
   Умная прокрутка: Если высота окна вашего браузера станет меньше 850 пикселей (как на 19" мониторе),
   сайдбар автоматически перестанет «прилипать» к верху и станет обычным блоком, чтобы кнопки не уходили под экран.
   ========== */
@media (max-height: 850px) {
  .guide-sidebar { position: static; }
}

.guide-sidebar .sidebar-back { display: block; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--blue-bright); font-size: 12px; font-weight: 700; }
.guide-sidebar h2 { margin: 0; font-size: 18px; }
.guide-sidebar p:not(.section-kicker) { margin: 0; color: var(--muted); font-size: 12px; }

.sidebar-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; padding-top: 15px; border-top: 1px solid var(--line); }

.sidebar-lessons { margin: 5px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.sidebar-lessons li a { display: block; padding: 6px 12px; font-size: 11px; color: var(--muted); border-radius: 8px; transition: all 0.2s ease; border: 1px solid transparent; }
.sidebar-lessons li a:hover { color: var(--blue-bright); background: rgba(47, 146, 255, 0.05); border-color: rgba(47, 146, 255, 0.1); }
.sidebar-lessons li.is-active a { color: #fff; background: rgba(47, 146, 255, 0.15); border-color: rgba(47, 146, 255, 0.3); font-weight: 700; }

.sidebar-current { padding: 8px 12px; border-radius: 8px; background: rgba(47, 146, 255, 0.1); border: 1px solid rgba(47, 146, 255, 0.2); color: var(--blue-bright); font-size: 12px; font-weight: 700; line-height: 1.3; margin-bottom: 5px; }

/* Зеленая тема для Linux */
body[data-page="linux"] .sidebar-lessons li.is-active a { color: #fff; background: rgba(51, 255, 102, 0.12); border-color: rgba(51, 255, 102, 0.3); }
body[data-page="linux"] .sidebar-lessons li a:hover { color: #33ff66; background: rgba(51, 255, 102, 0.05); border-color: rgba(51, 255, 102, 0.1); }
body[data-page="linux"] .sidebar-current { background: rgba(51, 255, 102, 0.08); border-color: rgba(51, 255, 102, 0.2); color: #33ff66; }
body[data-page="linux"] .sidebar-nav a:hover { border-color: #33ff66; background: rgba(51, 255, 102, 0.08); }

.sidebar-nav a { display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, 0.03); transition: all 0.2s ease; text-decoration: none !important; }
.sidebar-nav a:hover { border-color: var(--blue-bright); background: rgba(47, 146, 255, 0.1); transform: translateY(-2px); }
.sidebar-nav a small { font-size: 8px; color: var(--muted); text-transform: uppercase; margin-bottom: 2px; }
.sidebar-nav a b { font-size: 10px; color: var(--text); line-height: 1.2; }
.sidebar-nav .next { text-align: right; }

@media (max-width: 760px) {
  .windows-md-article { display:block; }
  .windows-article-cover { margin:22px 0 18px; }
  .guide-layout { grid-template-columns: 1fr; }
  .guide-sidebar { position: static; }
  .guide-group ol { grid-template-columns: 1fr; }
  .guide-group li:nth-last-child(-n + 2) { border-bottom: 1px solid rgba(113, 141, 197, .16); }
  .guide-group li:last-child { border-bottom: 0; }
}

@media (max-width: 470px) {
  .guide-index-hero { padding-top: 42px; }
  .guide-index-hero h1 { font-size: 37px; letter-spacing: -1.5px; }
  .guide-index-hero > p:not(.section-kicker), .guide-article p { font-size: 15px; }
  .guide-index-stats { gap: 7px; }
  .guide-index-stats div { min-width: 107px; padding: 9px 10px; }
  .guide-group-heading { grid-template-columns: 1fr; gap: 5px; padding: 14px; }
  .guide-group-heading > span { justify-self: start; }
  .guide-group { margin-bottom: 10px; }
  .guide-group ol { padding: 0 14px; }
  .guide-group li a { grid-template-columns: 34px 1fr; padding: 9px 0; }
  .guide-group li em { display: none; }
  .guide-article h1 { font-size: 34px; }
  .guide-article h2 { font-size: 23px; }
  .guide-article h3 { font-size: 18px; }
  .guide-pagination { grid-template-columns: 1fr; }
  .guide-pagination .next { text-align: left; }
}

/* Неоновая тема учебников: основной текст и навигация сохраняют мягкий, но уверенный контраст. */
body.light-mode .guide-index-stats div,
body.light-mode .guide-group,
body.light-mode .guide-pagination a,
body.light-mode .guide-sidebar
{
  background: #251340;
  border-color: rgba(215, 135, 255, .28);
}
body.light-mode .guide-group { background: linear-gradient(135deg, #46246d, #21113a); }
body.light-mode .guide-group-heading { background: #542b78; }
body.light-mode .guide-article .guide-intro,
body.light-mode .guide-article p,
body.light-mode .guide-article ul
{
  color: #f1e7fa;
}
body.light-mode .guide-article code
{
  color: #f0bbff;
  background: #44205f;
  border-color: rgba(234, 174, 255, .35);
}
body.light-mode .guide-sidebar .sidebar-back,
body.light-mode .sidebar-lessons li a,
body.light-mode .guide-sidebar p:not(.section-kicker)
{
  color: #d7c4e5;
}
body.light-mode .sidebar-lessons li.is-active a { color: #fff0ff; background: #603284; border-color: rgba(235, 174, 255, .38); }
body.light-mode .sidebar-current { color: #f0bbff; background: #4a216a; border-color: rgba(235, 174, 255, .34); }

/* ===========================================================================
   Герой-заголовок блока (для курсов)
   =========================================================================== */
/* ========== ГЕРОЙ-ЗАГОЛОВОК БЛОКА (для страниц курсов) ========== */
.block-header-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 35px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.block-header-hero .hero-copy { flex: 1; }
.block-header-hero h1 { margin: 0; font-size: clamp(30px, 4.5vw, 48px); line-height: 1.05; letter-spacing: -1.2px; }

/* Контейнер для иллюстрации (35% ширины, пропорции 16:9) */
.block-header-hero .hero-visual { flex: 0 0 35%; max-width: 420px; }

.block-header-hero .hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  /* Мягкая маска только по самым краям (прозрачность начинается с 75% радиуса) */
  mask-image: radial-gradient(circle, black 75%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle, black 75%, transparent 100%);
  filter: drop-shadow(0 0 25px rgba(51, 255, 102, 0.2));
}

@media (max-width: 800px) {
  .block-header-hero { gap: 25px; }
  .block-header-hero .hero-visual { flex: 0 0 40%; }
}

@media (max-width: 650px) {
  .block-header-hero { flex-direction: column; text-align: center; gap: 20px; }
  .block-header-hero .hero-visual { flex: 0 0 auto; width: 100%; max-width: 320px; }
}
