/* ---------- шрифты ---------- */

@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/pt-sans-400-normal-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/pt-sans-700-normal-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/pt-serif-700-normal-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --brand: #0792b0;
  --brand-dark: #02799a;
  --brand-darker: #015d77;
  --brand-light: #e6f2f6;
  --accent: #f2c534;
  --ink: #16191c;
  --ink-2: #525a61;
  --ink-3: #5f686e;
  --line: #dde3e6;
  --soft: #f6f8f9;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 10px 30px rgba(1, 93, 119, 0.08);
  --sans: 'PT Sans', Arial, sans-serif;
  --serif: 'PT Serif', Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--soft);
}

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

a {
  color: var(--brand-dark);
}

a:hover {
  color: var(--brand-darker);
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---------- верхняя строка ---------- */

.topbar {
  background: var(--brand-dark);
  color: #fff;
  font-size: 0.875rem;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 40px;
  flex-wrap: wrap;
}

.topbar__title {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.topbar__link {
  color: #d9f0f6;
  text-decoration: none;
}

.topbar__link:hover {
  color: #fff;
  text-decoration: underline;
}

/* ---------- шапка ---------- */

.head {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.head__inner {
  display: flex;
  align-items: center;
  min-height: 84px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.brand__logo {
  display: block;
  width: 48px;
  height: 48px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand__small {
  font-size: 0.75rem;
  color: var(--ink-2);
  line-height: 1.3;
}

.brand__big {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--brand-darker);
  line-height: 1.2;
}

/* ---------- меню ---------- */

.nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding-top: 0.4rem;
  padding-bottom: 0.5rem;
}

.nav a {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--ink);
  text-decoration: none;
}

.nav a:hover {
  background: var(--brand-light);
  color: var(--brand-darker);
}

.nav a.is-active {
  background: var(--brand);
  color: #fff;
}

/* ---------- содержимое ---------- */

.main {
  padding-top: 1.75rem;
  padding-bottom: 3rem;
  min-height: 45vh;
}

.page-head {
  margin-bottom: 1.25rem;
}

.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.2;
  color: var(--brand-darker);
  margin: 0 0 0.5rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.875rem;
  color: var(--ink-3);
}

/* Переключатель разреза: группы / преподаватели / аудитории */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
}

.tab {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink);
}

.tab:hover {
  border-color: var(--brand);
  color: var(--brand-darker);
}

.tab.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ---------- карточки на главной ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.35rem 1.25rem;
}

.card__title {
  font-family: var(--serif);
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
  color: var(--brand-darker);
}

.card__text {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card__link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--brand-darker);
  background: #fff;
}

.card__link:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.card__link.is-missing {
  border-color: var(--line);
  color: var(--ink-3);
  pointer-events: none;
}

.notice {
  margin-top: 1.75rem;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: #fffdf3;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1.5rem;
  font-size: 0.9375rem;
}

.quick-links__label {
  color: var(--ink-3);
}

.quick-links a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 700;
  color: var(--brand-darker);
}

.quick-links a:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.notice p {
  margin: 0;
}

/* ---------- расписание ---------- */

.schedule {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  overflow-x: auto;
}

.schedule table {
  width: 100% !important;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* Ширины колонок задаются colgroup при сборке страницы */

.schedule td,
.schedule th {
  border: 1px solid var(--line);
  padding: 7px 9px;
  vertical-align: top;
  height: auto !important;
}

.schedule td.m0 {
  background: #fbfcfc;
}

.schedule td.m2,
.schedule td.m3 {
  background: var(--brand-light);
}

.schedule td.m4 {
  background: #fff;
}

/* Ячейки расписания: день, пара, предмет, аудитория, преподаватель */
.schedule td.hd {
  white-space: normal;
}

.schedule td.ur {
  white-space: normal;
  text-align: left;
}

/* Подгруппы в одной паре: дополнительные строки */
.schedule tr.sub-row td:first-child {
  border-top-style: dashed;
}

.schedule tr.sub-row td:nth-child(2) {
  color: var(--ink-3);
}



.schedule ul {
  margin: 0;
  padding-left: 1.1rem;
}

.schedule li {
  margin: 0 0 2px;
}

.schedule a {
  color: var(--brand-dark);
  text-decoration: none;
}

.schedule a:hover {
  text-decoration: underline;
}

.schedule b,
.schedule strong {
  color: var(--brand-darker);
}

/* Индикатор «процент выполнения» */
.bar {
  display: inline-block;
  width: 72px;
  height: 8px;
  border-radius: 4px;
  background: var(--brand-light);
  overflow: hidden;
  vertical-align: middle;
}

.bar__fill {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
}

.bar__num {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.8125rem;
  color: var(--ink-2);
  vertical-align: middle;
}

.empty {
  margin: 0;
  padding: 1.5rem;
  color: var(--ink-3);
}

/* ---------- плитка групп, преподавателей, аудиторий ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.75rem;
}

.tile {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.9rem 1.05rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.tile:hover {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand-darker);
  transform: translateY(-1px);
}

.tile__num {
  min-width: 1.75rem;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ink-3);
  text-align: right;
}

.tile__name {
  font-size: 1rem;
  line-height: 1.3;
}

/* ---------- поиск ---------- */

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.search {
  display: flex;
  gap: 0.6rem;
  margin: 1.25rem 0 0.75rem;
  max-width: 720px;
}

.search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  background: #fff;
}

.search input:focus {
  outline: 3px solid var(--brand);
  outline-offset: 1px;
}

.search button {
  padding: 0.85rem 1.4rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.search button:hover {
  background: var(--brand-dark);
}

.search__hint {
  color: var(--ink-3);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.search__count {
  color: var(--ink-3);
  font-size: 0.875rem;
  margin: 0 0 0.75rem;
}

.search__results {
  display: grid;
  gap: 0.5rem;
  max-width: 900px;
}

.result {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
}

.result:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}

.result__title {
  font-weight: 700;
  color: var(--brand-darker);
}

.result__snippet {
  font-size: 0.875rem;
  color: var(--ink-2);
}

.result mark,
.search mark {
  background: #fff3b0;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

.search__empty {
  color: var(--ink-2);
}

/* ---------- журнал ---------- */

.journal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem 1.5rem;
  columns: 2;
  column-gap: 2.5rem;
}

.journal .letter {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--brand-darker);
  margin: 1rem 0 0.35rem;
  break-after: avoid;
}

.journal .letter:first-child {
  margin-top: 0;
}

.journal-link {
  display: block;
  padding: 0.25rem 0;
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--ink);
  break-inside: avoid;
}

.journal-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

/* ---------- подвал ---------- */

.foot {
  background: var(--brand-dark);
  color: #fff;
  padding: 1.75rem 0;
  font-size: 0.875rem;
}

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

.foot p {
  margin: 0;
}

.foot a {
  color: #d9f0f6;
}

.foot a:hover {
  color: #fff;
}

/* ---------- адаптив ---------- */

@media (max-width: 1000px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .journal {
    columns: 1;
  }
}

@media (max-width: 700px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .schedule {
    padding: 0.5rem;
    border-radius: var(--radius);
  }

  .schedule table {
    font-size: 0.75rem;
    min-width: 680px;
  }

  .brand__small {
    display: none;
  }

  .brand__big {
    font-size: 1.05rem;
  }

  .nav__inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.6rem;
  }

  .nav a {
    white-space: nowrap;
  }
}
