:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --accent: #b71c1c;
  --accent-dark: #8e0000;
  --text: #1c2430;
  --muted: #5f6b7a;
  --border: #e3e8ef;
  --shadow: 0 8px 24px rgba(28, 36, 48, 0.06);
  --font-body: "PT Sans", "Segoe UI", Tahoma, sans-serif;
  --font-heading: "PT Serif", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

button,
input {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 0 16px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  min-width: 0;
}

.site-logo:hover {
  text-decoration: none;
}

.site-logo__text {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.site-search {
  display: flex;
  gap: 10px;
  flex: 1;
}

.site-search__input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.site-search__input:focus {
  outline: none;
  border-color: #c5ced8;
  background: #fff;
}

.site-search__button {
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease;
}

.site-search__button:hover {
  background: var(--accent-dark);
}

.site-nav {
  border-top: 1px solid var(--border);
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  list-style: none;
  margin: 0;
  padding: 10px 0 14px;
}

.site-nav__link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.site-nav__link:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-main {
  padding: 32px 0 56px;
}

.site-footer {
  padding: 28px 0 44px;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
}

.page-head {
  margin-bottom: 28px;
}

.page-title {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.page-intro {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.video-grid > [id^="update_"] {
  display: contents;
}

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(28, 36, 48, 0.1);
}

.video-card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #dfe5ec;
  overflow: hidden;
}

.video-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-weight: 700;
}

.video-card__duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(20, 26, 34, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.video-card__body {
  padding: 14px 16px 18px;
}

.video-card__title {
  margin: 0 0 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.video-card__title a {
  color: var(--text);
}

.video-card__title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.video-card__meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.video-card__separator {
  margin: 0 6px;
}

.paginator {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.paginator__status {
  color: var(--muted);
  font-size: 14px;
}

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

.paginator__link,
.paginator__current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.paginator__link {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.paginator__link:hover {
  text-decoration: none;
  border-color: #c5ced8;
}

.paginator__current {
  background: var(--accent);
  color: #fff;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.load-more {
  min-width: 200px;
  height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.load-more:hover {
  background: var(--accent-dark);
}

.video-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

.video-page__main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.video-page__title {
  margin: 0 0 20px;
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.video-player {
  margin-bottom: 20px;
}

.video-player__element,
.video-player__fallback img {
  width: 100%;
  border-radius: 10px;
  background: #111;
}

.video-player__fallback {
  overflow: hidden;
  border-radius: 10px;
  background: #1c2430;
}

.video-player__notice {
  margin: 0;
  padding: 14px 16px;
  color: #fff;
  background: #1c2430;
  font-size: 14px;
}

.video-page__meta,
.video-page__tags,
.video-page__description,
.video-page__download {
  margin-bottom: 16px;
}

.video-page__meta {
  color: var(--muted);
  font-size: 14px;
}

.video-page__separator {
  margin: 0 8px;
}

.video-page__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-page__tag {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.video-page__tag:hover {
  background: #e4eaf0;
  text-decoration: none;
}

.video-page__description {
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
}

.video-page__download-link {
  display: inline-flex;
  align-items: center;
  padding: 11px 18px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.video-page__download-link:hover {
  background: var(--accent-dark);
  text-decoration: none;
}

.video-page__sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.sidebar-title {
  margin: 0 0 16px;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-list {
  display: grid;
  gap: 16px;
}

.sidebar-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
}

.sidebar-card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: #dfe5ec;
}

.sidebar-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-card__duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(20, 26, 34, 0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-card__title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.sidebar-card__title a {
  color: var(--text);
}

.sidebar-card__title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.sidebar-card__meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .video-page {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .site-header__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .site-logo__text {
    font-size: 19px;
  }

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

  .page-title,
  .video-page__title {
    font-size: 26px;
  }

  .video-page__main,
  .video-page__sidebar {
    padding: 18px;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(1180px, calc(100% - 20px));
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .site-search {
    flex-direction: column;
  }

  .sidebar-card {
    grid-template-columns: 1fr;
  }
}
