* {
  box-sizing: border-box;
}

body {
  background: #f5f7f9;
}

body.is_dialog_open {
  overflow: hidden;
}

.video_page {
  width: min(1440px, calc(100% - 64px));
  min-height: 70vh;
  margin: 0 auto;
  padding: 42px 0 72px;
}

.video_page_header {
  margin-bottom: 28px;
}

.video_page_header h1 {
  margin: 0;
  color: #20242a;
  font-size: 34px;
  line-height: 1.25;
}

.video_page_header p {
  max-width: 720px;
  margin: 10px 0 0;
  color: #66707c;
  font-size: 15px;
  line-height: 1.7;
}

.video_toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid #dfe4e9;
}

.video_filters {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.video_filters::-webkit-scrollbar {
  display: none;
}

.video_filter {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #555f6b;
  background: transparent;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.video_filter:hover {
  color: #0469e3;
  background: #edf5ff;
}

.video_filter.is_active {
  border-color: #0469e3;
  color: #fff;
  background: #0469e3;
}

.video_filter:focus-visible,
.video_card:focus-visible,
.video_dialog_close:focus-visible {
  outline: 3px solid rgba(4, 105, 227, 0.25);
  outline-offset: 2px;
}

.video_count {
  flex: 0 0 auto;
  margin: 0;
  color: #7a838e;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

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

.video_card {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid #dfe3e8;
  border-radius: 6px;
  color: inherit;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.video_card[hidden] {
  display: none;
}

.video_cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-bottom: 1px solid #e7eaee;
  background: #eef1f4;
}

.video_cover::after {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 33, 0.1);
  content: "";
  transition: background-color 0.2s ease;
}

.video_cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.video_play {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 3px 12px rgba(15, 25, 38, 0.18);
  transform: translate(-50%, -50%);
}

.video_play::after {
  position: absolute;
  top: 50%;
  left: 52%;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid #0469e3;
  content: "";
  transform: translate(-40%, -50%);
}

.video_card_content {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  padding: 16px 17px 18px;
}

.video_category {
  align-self: flex-start;
  margin-bottom: 8px;
  padding: 2px 6px;
  border-radius: 3px;
  color: #075bbf;
  background: #e9f3ff;
  font-size: 12px;
  line-height: 1.5;
}

.video_card h2 {
  display: -webkit-box;
  min-height: 50px;
  margin: 0 0 8px;
  overflow: hidden;
  color: #252a31;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video_card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #69727e;
  font-size: 13px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (hover: hover) and (pointer: fine) {
  .video_card:hover {
    border-color: #91b8e8;
    box-shadow: 0 7px 20px rgba(29, 54, 85, 0.1);
    transform: translateY(-2px);
  }

  .video_card:hover .video_cover::after {
    background: rgba(17, 24, 33, 0.18);
  }

  .video_card:hover .video_cover img {
    transform: scale(1.025);
  }
}

.video_dialog {
  width: min(960px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  color: #252a31;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.video_dialog::backdrop {
  background: rgba(12, 17, 23, 0.72);
}

.video_dialog_panel {
  display: flex;
  max-height: calc(100vh - 32px);
  flex-direction: column;
}

.video_dialog_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  padding: 10px 12px 10px 20px;
}

.video_dialog_header h2 {
  margin: 0;
  overflow: hidden;
  color: #252a31;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video_dialog_close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: #3b424b;
  background: transparent;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.video_dialog_close:hover {
  background: #eef1f4;
}

.video_dialog video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 170px);
  background: #000;
}

.video_dialog_panel > p {
  margin: 0;
  padding: 14px 20px 18px;
  overflow-y: auto;
  color: #68717d;
  font-size: 14px;
  line-height: 1.65;
}

@media screen and (max-width: 1280px) {
  .video_page {
    width: min(1120px, calc(100% - 48px));
  }

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

@media screen and (max-width: 900px) {
  .video_page {
    width: calc(100% - 40px);
    padding-top: 34px;
  }

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

@media screen and (max-width: 620px) {
  .video_page {
    width: 100%;
    padding: 24px 14px 48px;
  }

  .video_page_header {
    margin-bottom: 20px;
  }

  .video_page_header h1 {
    font-size: 28px;
  }

  .video_page_header p {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.6;
  }

  .video_toolbar {
    display: block;
    margin-right: -14px;
    margin-bottom: 16px;
    margin-left: -14px;
    padding-bottom: 12px;
  }

  .video_filters {
    padding: 0 14px;
  }

  .video_filter {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13px;
  }

  .video_count {
    margin: 10px 14px 0;
  }

  .video_grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .video_card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 112px;
  }

  .video_cover {
    width: 112px;
    border-right: 1px solid #e7eaee;
    border-bottom: 0;
  }

  .video_play {
    width: 40px;
    height: 40px;
  }

  .video_play::after {
    border-top-width: 7px;
    border-bottom-width: 7px;
    border-left-width: 10px;
  }

  .video_card_content {
    justify-content: center;
    padding: 10px 12px;
  }

  .video_category {
    margin-bottom: 5px;
    font-size: 11px;
  }

  .video_card h2 {
    min-height: 0;
    margin-bottom: 5px;
    font-size: 15px;
    line-height: 1.4;
  }

  .video_card p {
    font-size: 12px;
    line-height: 1.5;
  }

  .video_dialog {
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
  }

  .video_dialog_panel {
    max-height: calc(100vh - 20px);
  }

  .video_dialog_header {
    min-height: 52px;
    padding: 8px 8px 8px 14px;
  }

  .video_dialog_header h2 {
    font-size: 15px;
  }

  .video_dialog_panel > p {
    padding: 12px 14px 15px;
    font-size: 13px;
  }
}

@media screen and (max-width: 360px) {
  .video_card {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .video_cover {
    width: 100px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video_card,
  .video_cover img,
  .video_cover::after {
    transition: none;
  }
}
