html,
body,
.container,
.container::before,
.container::after {
  box-sizing: border-box;
}

html {
  block-size: 100%;
}

.page {
  inline-size: 90%;
  max-inline-size: 1200px;
  block-size: 100%;
  margin: auto;
  color: #fff;
  font-family: 'Fira Sans Condensed', sans-serif;
  font-size: 18px;
  background-color: #1b1919;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 30px;
}

@media (max-width: 768px) {
  .page {
    padding: 0 15px;
  }
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
li,
blockquote,
fieldset {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Кастомный скроллбар */
.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgb(217 217 217 / 10%);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #D9D9D9;
}

/* Основной блок */

.content {
  display: grid;
  grid-template-columns: 711px 399px;
  grid-template-rows: auto;
  grid-template-areas:
    "result details";
  align-items: end; 
  justify-content: center;
  gap: 30px; 
  width: 100%;
  max-width: 1140px;
}

/* Блок вывода результатов (слева) */

.result {
  grid-area: result;
  display: flex;
  flex-direction: column;
  height: auto;
}

.result__video-container {
  width: 711px;
  height: 386px;
  margin-block-end: 16px;
  position: relative;
}

.result__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center
}

/* Строка поиска */

.search-form {
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.search-form__fieldset {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: none;
} 

.search-form__fieldset-title {
  font-size: 18px;
  font-weight: 400;
  line-height: 100%;
  padding-bottom: 4px;
}

.search-form__label {
  display: flex;
  width: fit-content;
  gap: 5px;
  cursor: pointer;
  justify-content: center;
  align-items: center;
}

.search-form__textfield {
  min-width: 220px; /* ? */
  border: 1px solid #fff; 
  border-left-width: 0;
  border-right-width: 0;
  background-color: #1b1919;
  font-family: 'Fira Sans Condensed', sans-serif;
  font-weight: 400;
  font-size: 18px;
  appearance: none;
  outline: none;
  color: #fff;
}

.search-form__label:has(.search-form__textfield:focus-visible) {
  outline: 1px solid #fff;
  outline-offset: 1px;
  border-radius: 0px;
}

/* Чекбоксы */

.search-form__checkbox-list {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding-bottom: 2px;
}

.search-form__pseudo-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fff;
  inline-size: 17px;
  block-size: 17px;
  position: relative;
}

.search-form__pseudo-checkbox::after {
  content: "";
  display: none; /* Скрыт по умолчанию */
  background-color: #fff;
  inline-size: 15px;
  block-size: 15px;
}

.search-form__checkbox:checked + .search-form__pseudo-checkbox::after {
  display: block;
}

.search-form__label-text {
  text-decoration: none;
}

.search-form__label:has(.search-form__checkbox:focus-visible) {
  outline: 1px solid #fff;
  outline-offset: 1px;
  border-radius: 0px;
}

.search-form__label:hover .search-form__label-text {
  text-decoration: underline;
}

/* Блок навигации (справа) */

.content__details {
  grid-area: details;
  height: 100%;
  width: 100%;
}

.title {
  padding-bottom: 26px;
  color: #fff;
  font-family: Oswald, sans-serif;
  font-weight: 700;
  font-size: 75px;
  line-height: 94%;
  text-transform: uppercase;
}

.content__accent {
  color: #545050;
}

.content__list-container {
  position: relative;
  height: 298px;
  overflow-y: auto;
}

.content__list {
  display: flex;
  flex-direction: column;
  gap: 30px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.content__card-link {
  text-decoration: none;
  color: #fff;
}

.content__video-card {
  display: flex;
  flex-direction: row; 
  align-items: flex-start; 
}

.content__video-card-title {
  margin-bottom: 6px;
  font-family: Oswald, sans-serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  width: 100%;
  max-width: 196px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis; 
}

.content__video-card-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  font-family: "Fira Sans Condensed", sans-serif;
  font-weight: 400;
  line-height: 16.2px;
  font-size: 18px;
}

.content__video-card-thumbnail {
  width: 194px;
  height: 103px;
  object-fit: cover;
  object-position: center;
}

.content__video-card-description-container {
  flex-grow: 1;
}

/* Кнопки */

/* Общий стиль для всех кнопок */
.button {
  border: 1px solid #fff;
  background-color: transparent;
  color: #fff;
  font-family: "Fira Sans Condensed", sans-serif;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px;
  height: 34px;
  transition: background-color 0.2s ease-in-out, color 0.5s ease-in-out;
}

/* Индивидуальные стили для кнопки "Найти" */
.search-form__submit-button {
  align-self: flex-end;
  min-width: 194px;
  height: 34px;
}

/* Индивидуальные стили для кнопки "Показать ещё" */
.more-button {
  width: 100%;
  margin-top: 30px;
  position: relative;
}

/* Ховер-эффект: подчёркивание текста */
.button:hover {
  text-decoration: underline;
}

/* Активное состояние: изменение цвета фона и текста */
.button:active {
  background-color: #545050;
}

/* Сброс стандартного фокуса */
.button:focus {
  outline: none;
}

/* Фокусное состояние: обводка */
.button:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 1px;
}

/* Карточки */

/* Отступы для карточек */
.content__list-item {
  padding: 1px; 
}

/* Основные стили карточки */
.content__card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Фон для активной карточки */
.content__card-link_current {
  background-color: #545050;
}

/* Подчёркивание текста при наведении */
.content__card-link:hover .content__video-card-title,
.content__card-link:hover .content__video-card-description {
  text-decoration: underline;
}

/* Фокусное состояние */
.content__card-link:focus {
  outline: none;
}

/* Обводка при фокусе через клавиатуру */
.content__card-link:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Активное состояние (при нажатии) */
.content__card-link:active {
  background-color: #545050;
}

/* Прелоадеры */

.result__video-container,
.content__list-container {
  position: relative;
}

.preloader {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.7); 
  z-index: 10;
}
