/*
  Этот комментарий и " --- " — обязательны для Jekyll,
  чтобы файл обрабатывался как Jekyll-документ и получал URL /assets/css/style.css
*/

/* Стили в стиле «Metro + Trello» + Windows-меню */
:root {
  --win-blue: #0084d0;
  --win-dark: #1a1a1a;
  --win-light: #f0f0f0;
  --win-border: #c0c0c0;
  --card-bg: #ffffff;

  /* Новые переменные для нежно зелёного фона */
  --soft-green-bg: #e6f5ea;
  --soft-green-light: #f0f8f2;
  --soft-green-accent: #4caf84;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #e8f0e8;
}

/* Основной контент (initial-content из default.html) */
.initial-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  background-color: var(--soft-green-light);
  min-height: calc(100vh - 200px);
}

.initial-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

.initial-content th,
.initial-content td {
  border: 1px solid var(--win-border);
  padding: 8px 12px;
  text-align: left;
}

.initial-content th {
  background-color: var(--soft-green-bg);
  font-weight: 600;
}

.initial-content img {
  max-width: 100%;
  height: auto;
}

.initial-content a {
  color: var(--win-blue);
  text-decoration: none;
}

.initial-content a:hover {
  text-decoration: underline;
}

.initial-content ul,
.initial-content ol {
  line-height: 1.6;
}

/* Меню в стиле Windows */
.win-menu {
  background: var(--win-blue);
  padding: 8px 16px;
  font-size: 14px;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  display: flex;
  gap: 16px;
}
.win-menu a {
  color: white;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 3px;
  font-weight: 500;
}
.win-menu a:hover,
.win-menu a.active {
  background: rgba(255,255,255,0.2);
}

/* Заголовок */
.hero {
  background: linear-gradient(135deg, var(--win-blue), #006bb8);
  color: white;
  padding: 48px 24px;
  text-align: center;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: 2.5rem;
  font-weight: 700;
}
.hero p {
  margin: 0;
  font-size: 1.1rem;
  opacity: 0.95;
}

/* Основной контент */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Карточки (Trello-style) */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--win-border);
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: transform 0.1s, box-shadow 0.1s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.card h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: var(--win-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h3::before {
  content: "📌";
}
.card p {
  color: #555;
  line-height: 1.5;
}
.card .footer {
  margin-top: 16px;
  font-size: 0.9rem;
  color: #777;
}
.card .footer a {
  color: var(--win-blue);
  text-decoration: none;
}

/* ================================================
   Нежно голубоватый фон для контента страниц
   ================================================ */

/* Для всех страниц (about, contact, textbook и т.д.) */
.page__content {
  background-color: var(--soft-green-light);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  margin-top: 1rem;
  margin-bottom: 2rem;
}

/* Для заголовков страниц */
.page__header {
  background-color: var(--soft-green-bg);
  padding: 1.5rem;
  border-bottom: 1px solid #c8e6c9;
  margin-bottom: 1.5rem;
}

/* Для профиля автора */
.author-profile {
  background-color: var(--soft-green-bg);
  padding: 1rem;
  border-left: 4px solid var(--soft-green-accent);
  margin-top: 2rem;
  border-radius: 4px;
}

/* Для заголовков глав и разделов */
.chapter-header h1,
.chapter-content {
  background-color: var(--soft-green-light);
  padding: 2rem;
  border-radius: 8px;
  margin: 1rem 0;
}

/* Пункты списков и абзацы — чуть увеличим отступ */
.page__content p {
  line-height: 1.65;
  margin-bottom: 1rem;
}

/* Акценты на синем */
.page__content a {
  color: var(--soft-green-accent);
}
.page__content a:hover {
  color: #388e3c;
  text-decoration: underline;
}

/* ================================================
   Боковая панель (sidebar) — на всю высоту
   ================================================ */

.page-container {
  display: flex;
  min-height: calc(100vh - 100px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

.sidebar {
  width: 280px;
  min-width: 280px;
  background-color: var(--soft-green-bg);
  border-right: 1px solid #c8e6c9;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: calc(100vh - 60px);
}

.sidebar-nav h3 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--win-blue);
  border-bottom: 2px solid var(--soft-green-accent);
  padding-bottom: 0.5rem;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: 0.25rem;
}

.sidebar-nav li a {
  display: block;
  padding: 6px 10px;
  border-radius: 4px;
  color: var(--win-dark);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.15s;
  line-height: 1.3;
}

.sidebar-nav li a:hover {
  background-color: rgba(77, 166, 255, 0.15);
  color: var(--win-blue);
}

.sidebar-nav li a.active {
  background-color: var(--soft-green-accent);
  color: white;
  font-weight: 600;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 2rem;
}

/* Навигация по главам (prev/next) */
.chapter-nav {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--win-border);
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.15s, transform 0.1s;
}

.btn--secondary {
  background-color: var(--soft-green-bg);
  color: var(--win-dark);
  border: 1px solid var(--win-border);
}

.btn--primary {
  background-color: var(--win-blue);
  color: white;
}

.btn--primary:hover {
  background-color: #006bb8;
  transform: translateY(-1px);
}

.btn--secondary:hover {
  background-color: #c8e6c9;
}

/* ================================================
   Стили для страниц задач (task)
   ================================================ */

.task {
  background-color: var(--soft-green-light);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.task-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--soft-green-accent);
}

.task-header h1 {
  color: var(--win-dark);
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
}

.task-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.task-meta .difficulty,
.task-meta .topic {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  background-color: var(--soft-green-bg);
  color: var(--win-dark);
  font-weight: 500;
}

.task-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.task-tags .tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.task-content {
  line-height: 1.7;
  font-size: 1rem;
}

.task-content h2 {
  color: var(--win-blue);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--win-border);
  padding-bottom: 0.3rem;
}

.task-content h3 {
  color: var(--win-dark);
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}

.task-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--win-border);
  font-size: 0.9rem;
  color: #777;
}

.task-footer p {
  margin: 0.25rem 0;
}

/* ================================================
   Стили для секций задач в главах
   ================================================ */

.chapter-tasks {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--soft-green-accent);
  background-color: var(--soft-green-light);
  padding: 1.5rem;
  border-radius: 8px;
}

.chapter-tasks h2 {
  color: var(--win-dark);
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--win-border);
}

.task-group {
  margin-bottom: 1.5rem;
}

.task-group h3 {
  color: var(--win-blue);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.task-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.task-group li {
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 4px;
  background-color: white;
  border: 1px solid var(--win-border);
  transition: background-color 0.15s;
}

.task-group li:hover {
  background-color: #f0f8f2;
}

.task-group li a {
  color: var(--win-blue);
  text-decoration: none;
  font-weight: 500;
}

.task-group li a:hover {
  text-decoration: underline;
}

.difficulty-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}

.difficulty-badge.easy {
  background-color: #c8e6c9;
  color: #2e7d32;
}

.difficulty-badge.medium {
  background-color: #fff3e0;
  color: #e65100;
}

.difficulty-badge.hard {
  background-color: #ffcdd2;
  color: #c62828;
}

/* Стили для подвала */
.site-footer {
  background-color: var(--win-dark);
  color: #ccc;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--soft-green-accent);
}

/* Стили для шапки */
.win-menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.win-menu .site-title a {
  font-weight: 700;
  font-size: 1.1rem;
}

.win-menu .nav-links {
  display: flex;
  gap: 8px;
}

/* ================================================
   Главная страница с фоном practika.png
   ================================================ */

.home-page {
  position: relative;
  min-height: 100vh;
  display: flex;
}

.home-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
  opacity: 0.4;
  pointer-events: none;
}

.home-content {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.home-inner {
  background-color: rgba(240, 248, 242, 0.85);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(4px);
}

.home-inner h1,
.home-inner h2,
.home-inner h3 {
  color: var(--win-dark);
}

.home-inner table {
  background-color: rgba(255, 255, 255, 0.9);
}

.home-inner th {
  background-color: var(--soft-green-bg) !important;
}

.home-inner img {
  max-width: 60%;
  display: block;
  margin: 1.5rem auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.home-inner a {
  color: var(--win-blue);
}

.home-inner a:hover {
  text-decoration: underline;
}

/* Правая боковая панель с задачами по датам */
.home-sidebar {
  width: 300px;
  min-width: 300px;
  background-color: rgba(230, 245, 234, 0.95);
  border-left: 1px solid #c8e6c9;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: calc(100vh - 60px);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05);
}

.home-sidebar h3 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--win-blue);
  border-bottom: 2px solid var(--soft-green-accent);
  padding-bottom: 0.5rem;
}

.tasks-date-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tasks-date-list li {
  margin-bottom: 0.5rem;
}

.tasks-date-list li a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--win-dark);
  font-size: 0.85rem;
  line-height: 1.4;
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid transparent;
  transition: all 0.15s;
}

.tasks-date-list li a:hover {
  background-color: rgba(255, 255, 255, 0.95);
  border-color: var(--soft-green-accent);
  color: var(--win-blue);
}

.task-date {
  display: block;
  font-size: 0.75rem;
  color: #777;
  margin-bottom: 2px;
}

.task-title {
  display: block;
  font-weight: 500;
  line-height: 1.3;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
  .home-page {
    flex-direction: column;
  }

  .home-sidebar {
    width: 100%;
    min-width: auto;
    position: static;
    max-height: none;
    border-left: none;
    border-top: 1px solid #c8e6c9;
    margin-top: 2rem;
  }

  .home-inner {
    padding: 1rem;
  }

  .home-inner img {
    max-width: 100%;
  }


  .page-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: auto;
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #c8e6c9;
    padding: 1rem;
  }

  .main-content {
    padding: 1rem;
  }

  .win-menu {
    flex-direction: column;
    gap: 8px;
  }

  .win-menu .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-buttons {
    flex-direction: column;
  }
}