
/* =========================
   1. Змінні та базові стилі
   ========================= */

:root {
  --color-primary: #1764e8;
  --color-primary-dark: #104fbe;
  --color-heading: #142b50;
  --color-text: #344866;
  --color-muted: #7b8ca7;
  --color-border: #e2eaf5;
  --color-surface: #ffffff;
  --color-surface-soft: #f5f8fe;
  --color-hero: #edf4ff;

  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;

  --container-width: 1180px;
  --page-padding: clamp(20px, 4vw, 48px);

  --radius-small: 10px;
  --radius-medium: 16px;
  --radius-large: 24px;

  --shadow-card: 0 8px 24px rgb(31 65 115 / 5%);
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

button,
summary {
  cursor: pointer;
}

svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container {
  width: min(
    calc(100% - 2 * var(--page-padding)),
    var(--container-width)
  );
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid rgb(23 100 232 / 45%);
  outline-offset: 4px;
}

/* =========================
   2. Шапка
   ========================= */

.site-header {
  position: relative;
  z-index: 5;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 36px;
}

.logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--color-heading);
  text-decoration: none;
}

.logo svg {
  display: block;
  width: 200px;
  height: auto;
}

/* Пошук */
.search {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 560px;
  margin-inline: auto;

  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 15px;

  color: var(--color-muted);
  background: var(--color-surface-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-small);

  transition:
    border-color var(--transition),
    background var(--transition);
}

.search:focus-within {
  background: var(--color-surface);
  border-color: var(--color-border);
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;

  color: var(--color-heading);
  background: transparent;
  border: 0;
  outline: none;

  font: inherit;
  font-size: 14px;
}

.search input::placeholder {
  color: var(--color-muted);
  opacity: 1;
}

.search button {
  width: 34px;
  height: 34px;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  color: var(--color-primary);
  background: transparent;
  border: 0;
  border-radius: 6px;

  cursor: pointer;

  transition:
    color var(--transition),
    background var(--transition);
}

.search button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search button:hover {
  color: var(--color-primary-dark);
  background: var(--color-surface);
}


.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.icon-link {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  color: var(--color-text);
  border-radius: var(--radius-small);
}

.icon-link svg {
  width: 22px;
  height: 22px;
}

.icon-link:hover {
  color: var(--color-primary);
  background: var(--color-surface-soft);
}

.country-selector {
  position: relative;
}

.country-selector > summary {
  list-style: none;
}

.country-selector > summary::-webkit-details-marker {
  display: none;
}

.country-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-card);
}

.country-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
}

.country-menu a:hover {
  background: var(--color-surface-soft);
}

/* панель навігації, поки відключена */
/*
.main-nav {
  border-top: 1px solid #f0f3f9;
}

.main-nav > .container {
  display: flex;
  align-items: center;
  min-height: 48px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
}

.nav-link.active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--color-primary);
  border-radius: 3px 3px 0 0;
  content: "";
}
*/

/* =========================
   3. Головний банер
   ========================= */

.hero {
  overflow: hidden;
  background:
    radial-gradient(
      ellipse at 82% 45%,
      rgb(208 226 255 / 70%),
      transparent 42%
    ),
    linear-gradient(120deg, #f4f8ff, var(--color-hero));
}

.hero-inner {
  min-height: 350px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  align-items: center;
  gap: 48px;
  padding-block: 44px;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 580px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 16px;
  padding: 5px 12px;
  color: var(--color-primary);
  background: #dce9ff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  color: var(--color-heading);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 780;
  letter-spacing: -1.6px;
  line-height: 1.14;
}

.hero-description {
  max-width: 510px;
  margin-bottom: 24px;
  color: #617493;
  font-size: 16px;
  line-height: 1.75;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 650;
  transition:
    background var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.button-primary {
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 5px 14px rgb(23 100 232 / 15%);
}

.button-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 8px 20px rgb(23 100 232 / 22%);
  transform: translateY(-1px);
}

.button svg {
  width: 20px;
  height: 20px;
}

/* Ілюстрація з книжками — CSS, без зовнішнього зображення */

.hero-art {
  position: relative;
  min-height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}


/* =========================
   4. Контентні секції
   ========================= */

.page-content {
  padding-block: 38px 64px;
}

.content-section + .content-section {
  margin-top: 38px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.section-heading h2 {
  margin-bottom: 0;
  color: var(--color-heading);
  font-size: clamp(21px, 2.4vw, 27px);
  font-weight: 750;
  letter-spacing: -0.65px;
  line-height: 1.3;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-block: 6px;
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 600;
}

.text-link span {
  font-size: 20px;
  transition: transform var(--transition);
}

.text-link:hover span {
  transform: translateX(4px);
}

/* =========================
   5. Картки предметів
   ========================= */

.subject-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.subject-card {
  min-width: 0;
  min-height: 174px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.subject-card:hover {
  border-color: #b6cefb;
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
}

.subject-icon,
.material-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
}

.subject-icon {
  width: 62px;
  height: 62px;
  padding: 16px;
}

.subject-icon svg,
.material-icon svg {
  width: 100%;
  height: 100%;
}

.icon-blue {
  color: #2472e9;
  background: #e0ebff;
}

.icon-orange {
  color: #c27a09;
  background: #fff0cd;
}

.icon-purple {
  color: #7542e8;
  background: #eee4ff;
}

.icon-green {
  color: #13976c;
  background: #d8f5e6;
}

.icon-teal {
  color: #078c83;
  background: #d5f5f0;
}

.icon-red {
  color: #dc514b;
  background: #ffe1de;
}

.subject-name {
  color: var(--color-heading);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.subject-count {
  color: var(--color-muted);
  font-size: 12px;
}

/* =========================
   6. Списки матеріалів
   ========================= */

.material-list {
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
}

.material-row {
  min-width: 0;
  min-height: 74px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  transition: background var(--transition);
}

.material-row + .material-row {
  border-top: 1px solid #edf1f8;
}

.material-row:hover {
  background: #f8faff;
}

.material-icon {
  width: 42px;
  height: 42px;
  padding: 11px;
}

.material-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.material-title {
  overflow: hidden;
  color: var(--color-heading);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--transition);
}

.material-row:hover .material-title {
  color: var(--color-primary);
}

.material-subtitle {
  overflow: hidden;
  color: var(--color-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-date {
  color: var(--color-muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.material-arrow {
  color: #a5b4ca;
  font-size: 18px;
  text-align: right;
  transition:
    color var(--transition),
    transform var(--transition);
}

.material-row:hover .material-arrow {
  color: var(--color-primary);
  transform: translateX(3px);
}

/* =========================
   7. Підвал
   ========================= */

.site-footer {
  margin-top: auto;
  background: #f1f6ff;
  border-top: 1px solid #e7eefb;
}

.footer-inner {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-block: 22px;
}

.footer-logo {
  font-size: 20px;
}

.footer-logo .logo-mark {
  width: 34px;
  height: 34px;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links a,
.copyright {
  color: #687e9f;
  font-size: 12px;
}

.footer-links a {
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--color-primary);
}

.copyright {
  margin: 0;
  white-space: nowrap;
}

/* =========================
   8. Адаптивність
   ========================= */

@media (max-width: 1000px) {
  .header-inner {
    gap: 22px;
  }

  .subject-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-inner {
    gap: 24px;
  }

  .hero-art {
    transform: scale(0.9);
  }

  .footer-inner {
    flex-wrap: wrap;
  }

  .footer-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    padding-top: 12px;
    border-top: 1px solid #e0e9f8;
  }
}

@media (max-width: 680px) {
  :root {
    --page-padding: 18px;
  }

  .header-inner {
    min-height: 70px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding-block: 12px;
  }

  .logo {
    gap: 7px;
    font-size: 48px;
  }


  .header-actions {
    justify-content: flex-end;
  }

  .icon-link {
    width: 38px;
    height: 38px;
  }

  .search {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .search-toggle {
    min-height: 42px;
  }

  .search-form {
    width: 100%;
  }

  .main-nav > .container {
    min-height: 44px;
  }

  .nav-link {
    min-height: 44px;
    font-size: 13px;
  }

  .hero-inner {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 12px;
    padding-block: 34px 18px;
  }

  .hero-content {
    max-width: 540px;
  }

  .eyebrow {
    margin-bottom: 12px;
    font-size: 12px;
  }

  h1 {
    font-size: clamp(32px, 8vw, 42px);
    letter-spacing: -1.1px;
  }

  .hero-description {
    font-size: 15px;
    line-height: 1.65;
  }

  .hero-art {
    min-height: 210px;
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
    transform: scale(0.88);
  }

  .page-content {
    padding-block: 30px 44px;
  }

  .content-section + .content-section {
    margin-top: 32px;
  }

  .section-heading {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
  }

  .section-heading h2 {
    font-size: 21px;
  }

  .section-kicker {
    font-size: 11px;
  }

  .text-link {
    gap: 5px;
    padding-top: 4px;
    font-size: 12px;
  }

  .subject-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .subject-card {
    min-height: 155px;
    gap: 8px;
    padding: 16px 8px;
  }

  .subject-icon {
    width: 54px;
    height: 54px;
    padding: 14px;
  }

  .subject-name {
    font-size: 13px;
  }

  .subject-count {
    font-size: 11px;
  }

  .material-row {
    grid-template-columns: 38px minmax(0, 1fr) 16px;
    gap: 10px;
    min-height: 70px;
    padding: 11px 12px;
  }

  .material-icon {
    width: 38px;
    height: 38px;
    padding: 10px;
  }

  .material-title {
    font-size: 13px;
  }

  .material-subtitle {
    font-size: 11px;
  }

  .material-date {
    display: none;
  }

  .footer-inner {
    min-height: auto;
    gap: 18px;
    padding-block: 24px;
  }

  .footer-logo {
    font-size: 18px;
  }

  .footer-links {
    gap: 12px 20px;
    padding-top: 16px;
  }

  .copyright {
    width: 100%;
  }
}

@media (max-width: 360px) {
  :root {
    --page-padding: 14px;
  }

  .logo {
    font-size: 17px;
  }

  .logo-mark {
    width: 30px;
    height: 30px;
  }

  .header-actions {
    gap: 4px;
  }

  .hero-art {
    transform: scale(0.78);
    margin-block: -12px;
  }

  .section-heading {
    flex-direction: column;
    gap: 8px;
  }

  .text-link {
    align-self: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}












/* ==== Стилі для відображення категорій, класів, списку матеріалів == */
/* =========================
   1. Загальна структура
   ========================= */

.catalog-page {
  flex: 1;
  padding-top: 22px;
  padding-bottom: 64px;
}

/* =========================
   2. Навігаційний ланцюжок
   ========================= */

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 30px;
  color: var(--color-muted);
  font-size: 13px;
}

.breadcrumbs a {
  transition: color var(--transition);
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

.breadcrumbs [aria-current="page"] {
  color: var(--color-heading);
  font-weight: 600;
}

/* =========================
   3. Заголовок категорії
   ========================= */

.catalog-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 36px;
  padding: 30px 34px;
  background:
    radial-gradient(
      ellipse at 95% 10%,
      rgb(202 222 255 / 65%),
      transparent 45%
    ),
    linear-gradient(120deg, #f2f7ff, #eaf2ff);
  border: 1px solid #e5edfc;
  border-radius: var(--radius-large);
}

.catalog-heading {
  max-width: 700px;
}

.catalog-heading .section-kicker {
  margin-bottom: 8px;
}

.catalog-heading h1 {
  margin-bottom: 12px;
  font-size: clamp(30px, 3.5vw, 40px);
}

.catalog-heading p {
  max-width: 620px;
  margin-bottom: 0;
  color: #637795;
  font-size: 15px;
  line-height: 1.75;
}

.catalog-summary {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-shrink: 0;
  padding: 16px 18px;
  background: rgb(255 255 255 / 75%);
  border: 1px solid rgb(255 255 255 / 90%);
  border-radius: var(--radius-medium);
}

.summary-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 14px;
}

.catalog-summary strong,
.catalog-summary small {
  display: block;
}

.catalog-summary strong {
  color: var(--color-heading);
  font-size: 14px;
}

.catalog-summary small {
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 12px;
}

/* =========================
   4. Вибір класу
   ========================= */

.class-section {
  margin-bottom: 38px;
}

.class-section .section-heading {
  margin-bottom: 16px;
}

.class-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.class-selector a {
  min-width: 80px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 17px;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition:
    color var(--transition),
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

.class-selector a:hover {
  color: var(--color-primary);
  border-color: #b9cff9;
  background: #f7faff;
}

.class-selector a.selected {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgb(23 100 232 / 16%);
}

/* =========================
   5. Заголовок списку
   ========================= */

.materials-section {
  min-width: 0;
}

.materials-heading {
  align-items: flex-end;
}

.materials-count {
  flex-shrink: 0;
  padding: 5px 11px;
  color: var(--color-primary);
  background: #edf4ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.materials-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 13px 16px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
}

.materials-toolbar p {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-size: 13px;
}

.sort-control select {
  max-width: 180px;
  padding: 7px 28px 7px 10px;
  color: var(--color-heading);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  font: inherit;
}

/* =========================
   6. Картки матеріалів
   ========================= */

.catalog-material-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.catalog-material {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.catalog-material:hover {
  border-color: #c8d9fa;
  box-shadow: var(--shadow-card);
}

.catalog-material-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px;
  border-radius: 14px;
}

.catalog-material-info {
  min-width: 0;
}

.catalog-material-info h3 {
  margin: 0 0 5px;
  color: var(--color-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.catalog-material-info h3 a {
  transition: color var(--transition);
}

.catalog-material-info h3 a:hover {
  color: var(--color-primary);
}

.catalog-material-info > p {
  margin: 0 0 10px;
  color: #71829b;
  font-size: 13px;
  line-height: 1.6;
}

.material-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.material-meta span {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  color: #637795;
  background: #f3f6fb;
  border-radius: 5px;
  font-size: 11px;
}

.material-meta span:first-child {
  color: #2767ce;
  background: #eaf2ff;
  font-weight: 700;
}

.download-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  color: var(--color-primary);
  background: #f0f5ff;
  border: 1px solid #e0eaff;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  transition:
    color var(--transition),
    background var(--transition),
    border-color var(--transition);
}

.download-link svg {
  width: 17px;
  height: 17px;
}

.download-link:hover {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* =========================
   7. Пагінація
   ========================= */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.page-number,
.page-arrow {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  transition:
    color var(--transition),
    background var(--transition),
    border-color var(--transition);
}

.page-number:hover,
.page-arrow:hover {
  color: var(--color-primary);
  border-color: #b9cff9;
}

.page-number.current {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.page-arrow.disabled {
  color: #b8c3d2;
  background: #f7f9fc;
  cursor: default;
}

.page-dots {
  color: var(--color-muted);
}

/* =========================
   8. Адаптивність
   ========================= */

@media (max-width: 760px) {
  .catalog-page {
    padding-top: 18px;
    padding-bottom: 44px;
  }

  .breadcrumbs {
    gap: 7px;
    margin-bottom: 22px;
    font-size: 12px;
  }

  .catalog-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    padding: 24px;
  }

  .catalog-summary {
    width: 100%;
  }

  .class-section {
    margin-bottom: 30px;
  }

  .class-selector {
    gap: 8px;
  }

  .class-selector a {
    min-width: 68px;
    padding-inline: 12px;
  }

  .catalog-material {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .catalog-material-icon {
    width: 42px;
    height: 42px;
    padding: 11px;
  }

  .download-link {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 480px) {
  .catalog-intro {
    padding: 20px;
    border-radius: var(--radius-medium);
  }

  .catalog-heading h1 {
    font-size: 30px;
    letter-spacing: -0.8px;
  }

  .catalog-heading p {
    font-size: 14px;
  }

  .class-selector {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .class-selector a {
    min-width: 0;
    padding-inline: 5px;
    font-size: 12px;
  }

  .materials-heading {
    align-items: flex-start;
  }

  .materials-count {
    font-size: 11px;
  }

  .materials-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .sort-control {
    width: 100%;
    justify-content: space-between;
  }

  .sort-control select {
    flex: 1;
    max-width: 200px;
  }

  .catalog-material {
    gap: 12px;
    padding: 14px;
  }

  .catalog-material-info h3 {
    font-size: 14px;
  }

  .catalog-material-info > p {
    font-size: 12px;
  }

  .download-link {
    min-height: 38px;
  }

  .pagination {
    gap: 5px;
  }

  .page-number,
  .page-arrow {
    width: 36px;
    height: 36px;
  }
}









/* ==== Стилі для відображення окремого матеріалу == */

/* =========================
   1. Основна структура
   ========================= */

.material-page {
  flex: 1;
  padding-top: 22px;
  padding-bottom: 64px;
}

/* =========================
   2. Навігаційний ланцюжок
   ========================= */

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 28px;
  color: var(--color-muted);
  font-size: 13px;
}

.breadcrumbs a {
  transition: color var(--transition);
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

.breadcrumbs [aria-current="page"] {
  color: var(--color-heading);
  font-weight: 600;
}

/* =========================
   3. Заголовок матеріалу
   ========================= */

.material-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  gap: 40px;
  margin-bottom: 32px;
  padding: 32px;
  background:
    radial-gradient(
      ellipse at 88% 20%,
      rgb(207 225 255 / 75%),
      transparent 42%
    ),
    linear-gradient(120deg, #f3f7ff, #eaf2ff);
  border: 1px solid #e4edfc;
  border-radius: var(--radius-large);
}

.material-heading {
  min-width: 0;
}

.material-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  color: #647895;
  background: rgb(255 255 255 / 75%);
  border: 1px solid rgb(220 231 248 / 80%);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
}

.tag-subject {
  color: var(--color-primary);
  background: #dfeaff;
  border-color: #dfeaff;
}

.material-heading h1 {
  margin-bottom: 14px;
  color: var(--color-heading);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 780;
  letter-spacing: -1.3px;
  line-height: 1.2;
}

.material-lead {
  max-width: 690px;
  margin: 0;
  color: #637795;
  font-size: 16px;
  line-height: 1.8;
}

/* Ілюстрація формули — без JavaScript та зображень */

.material-cover {
  position: relative;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.cover-circle {
  position: absolute;
  z-index: -1;
  width: 220px;
  height: 190px;
  background: linear-gradient(140deg, #d5e5ff, #edf4ff);
  border-radius: 42% 58% 65% 35% / 48% 42% 58% 52%;
  transform: rotate(-10deg);
}

.formula-card {
  width: min(100%, 250px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 25px 18px;
  color: var(--color-heading);
  background: rgb(255 255 255 / 90%);
  border: 1px solid rgb(255 255 255 / 95%);
  border-radius: 20px;
  box-shadow: 0 16px 35px rgb(41 80 145 / 10%);
  transform: rotate(3deg);
}

.formula-label {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
}

.formula {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
  font-size: 29px;
  font-weight: 700;
}

.fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-size: 22px;
  line-height: 1.5;
}

.fraction span:first-child {
  padding: 0 5px 3px;
  border-bottom: 2px solid currentColor;
}

.fraction span:last-child {
  padding-top: 2px;
}

.formula-small {
  color: #667d9e;
  font-size: 14px;
}

.cover-spark {
  position: absolute;
  color: #4b8cf1;
  font-size: 26px;
  font-weight: 700;
}

.spark-a {
  top: 12px;
  left: 10%;
}

.spark-b {
  top: 36px;
  right: 2%;
  color: #e8b34c;
}

.spark-c {
  bottom: 16px;
  left: 13%;
  color: #3aaf9a;
}

/* =========================
   4. Дві колонки контенту
   ========================= */

.material-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  align-items: start;
  gap: 26px;
}

.material-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.material-sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-card {
  min-width: 0;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
}

.detail-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-card-heading h2,
.info-card h2 {
  margin: 0;
  color: var(--color-heading);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.35px;
  line-height: 1.4;
}

.heading-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 11px;
  border-radius: 12px;
}

.detail-card > p {
  margin-bottom: 14px;
  color: #566b89;
  font-size: 14px;
  line-height: 1.85;
}

.detail-card > p strong {
  color: var(--color-heading);
}

.detail-card > h3 {
  margin: 24px 0 12px;
  color: var(--color-heading);
  font-size: 15px;
  font-weight: 700;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: 28px;
  color: #566b89;
  font-size: 14px;
  line-height: 1.65;
}

.feature-list li::before {
  position: absolute;
  top: 2px;
  left: 0;
  width: 19px;
  height: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #16865e;
  background: #dff7eb;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  content: "✓";
}

/* =========================
   5. Завантаження
   ========================= */

.download-panel {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: #f1f7ff;
  border: 1px solid #dce9ff;
  border-radius: var(--radius-medium);
}

.download-panel-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  color: var(--color-primary);
  background: #dceaff;
  border-radius: 15px;
}

.download-panel-content h2 {
  margin: 0 0 5px;
  color: var(--color-heading);
  font-size: 18px;
  font-weight: 750;
}

.download-panel-content p {
  margin: 0;
  color: #6c809c;
  font-size: 13px;
  line-height: 1.6;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.file-meta span {
  padding: 3px 8px;
  color: #547096;
  background: #fff;
  border: 1px solid #e0eaff;
  border-radius: 5px;
  font-size: 11px;
}

.file-meta span:first-child {
  color: var(--color-primary);
  font-weight: 700;
}

.download-button {
  grid-column: 1 / -1;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  color: #fff;
  background: var(--color-primary);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  transition:
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.download-button svg {
  width: 19px;
  height: 19px;
}

.download-button:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 6px 16px rgb(23 100 232 / 18%);
  transform: translateY(-1px);
}

/* =========================
   6. Інші матеріали
   ========================= */

.related-section {
  padding-bottom: 18px;
}

.related-list {
  display: flex;
  flex-direction: column;
}

.related-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  padding-block: 13px;
  border-bottom: 1px solid #edf1f8;
}

.related-file {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px;
  border-radius: 11px;
}

.related-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.related-info strong {
  overflow: hidden;
  color: var(--color-heading);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--transition);
}

.related-info small {
  color: var(--color-muted);
  font-size: 11px;
}

.related-arrow {
  color: #9aabc2;
  font-size: 18px;
  text-align: right;
  transition:
    color var(--transition),
    transform var(--transition);
}

.related-item:hover .related-info strong,
.related-item:hover .related-arrow {
  color: var(--color-primary);
}

.related-item:hover .related-arrow {
  transform: translateX(3px);
}

.all-materials-link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.6;
}

.all-materials-link span {
  flex-shrink: 0;
  font-size: 18px;
}

/* =========================
   7. Бічна інформація
   ========================= */

.info-card h2 {
  margin-bottom: 20px;
}

.info-list {
  margin: 0;
}

.info-list > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-block: 13px;
  border-bottom: 1px solid #edf1f8;
}

.info-list > div:first-child {
  padding-top: 0;
}

.info-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.info-list dt {
  color: var(--color-muted);
  font-size: 12px;
}

.info-list dd {
  margin: 0;
  color: var(--color-heading);
  font-size: 14px;
  font-weight: 600;
}

.info-list dd a {
  transition: color var(--transition);
}

.info-list dd a:hover {
  color: var(--color-primary);
}

.help-card {
  padding: 22px;
  background: #f5f8fe;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
}

.help-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  padding: 10px;
  color: var(--color-primary);
  background: #e2edff;
  border-radius: 12px;
}

.help-card h2 {
  margin: 0 0 8px;
  color: var(--color-heading);
  font-size: 16px;
  font-weight: 750;
}

.help-card p {
  margin-bottom: 14px;
  color: #6c809c;
  font-size: 13px;
  line-height: 1.7;
}

.help-card > a {
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 650;
}

/* =========================
   8. Адаптивність
   ========================= */

@media (max-width: 900px) {
  .material-header {
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 20px;
    padding: 26px;
  }

  .material-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 18px;
  }

  .detail-card {
    padding: 20px;
  }

  .material-cover {
    transform: scale(0.9);
  }
}

@media (max-width: 720px) {
  .material-page {
    padding-top: 18px;
    padding-bottom: 44px;
  }

  .breadcrumbs {
    gap: 7px;
    margin-bottom: 22px;
    font-size: 12px;
  }

  .material-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 24px;
    padding: 24px;
  }

  .material-heading h1 {
    font-size: clamp(30px, 7vw, 38px);
  }

  .material-lead {
    font-size: 14px;
  }

  .material-cover {
    min-height: 190px;
    max-width: 320px;
    width: 100%;
    margin-inline: auto;
    transform: none;
  }

  .material-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .material-main {
    gap: 18px;
  }

  .material-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
  }

  .info-card,
  .help-card {
    height: 100%;
  }
}

@media (max-width: 480px) {
  .material-header {
    padding: 20px;
    border-radius: var(--radius-medium);
  }

  .material-tags {
    gap: 6px;
    margin-bottom: 14px;
  }

  .tag {
    padding: 4px 8px;
    font-size: 11px;
  }

  .material-heading h1 {
    font-size: 30px;
    letter-spacing: -0.8px;
  }

  .material-cover {
    min-height: 180px;
  }

  .detail-card {
    padding: 18px;
  }

  .detail-card-heading {
    gap: 10px;
  }

  .detail-card-heading h2,
  .info-card h2 {
    font-size: 17px;
  }

  .download-panel {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
  }

  .download-panel-icon {
    width: 44px;
    height: 44px;
    padding: 11px;
  }

  .download-panel-content h2 {
    font-size: 16px;
  }

  .download-panel-content p {
    font-size: 12px;
  }

  .material-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .help-card {
    height: auto;
  }
}

