.media-page {
  min-height: 100vh;
  background-color: #2f2d35;
  color: #fff;
}

.media-page__main {
  padding: 76px 16px 88px;
}

.media-page__content {
  max-width: 820px;
  margin: 0 auto;
}

.media-page--list .media-page__content {
  max-width: 980px;
}

.media-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 28px;
  padding: 0 12px;
  border-radius: 14px;
  background-color: #3a3740;
  color: #cfcfd7;
  font-size: 14px;
  text-decoration: none;
}

.media-back::before {
  content: "‹";
  font-size: 18px;
  line-height: 1;
}

.media-panel {
  max-width: 572px;
  margin: 0 auto;
}

.media-page--list .media-panel {
  max-width: 900px;
}

.media-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 18px;
}

.media-title-row h1 {
  margin: 0;
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.media-layout-toggle {
  position: absolute;
  top: 4px;
  right: 0;
  display: inline-flex;
  gap: 10px;
}

.media-layout-toggle__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #8b8893;
}

.media-layout-toggle__icon--active {
  color: #1d84f3;
}

.media-layout-toggle__list {
  width: 12px;
  height: 10px;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 4px / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 8px / 100% 2px no-repeat;
}

.media-layout-toggle__grid {
  width: 12px;
  height: 12px;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 5px 5px no-repeat,
    linear-gradient(currentColor, currentColor) 7px 0 / 5px 5px no-repeat,
    linear-gradient(currentColor, currentColor) 0 7px / 5px 5px no-repeat,
    linear-gradient(currentColor, currentColor) 7px 7px / 5px 5px no-repeat;
}

.media-filter-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 16px;
  background-color: #1d84f3;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.media-filter-toggle::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.85);
  color: #1d84f3;
  content: "−";
  font-size: 14px;
  font-weight: 700;
}

.media-search-area {
  margin-top: 14px;
}

.media-search-label {
  display: block;
  margin: 0 0 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.media-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #3a3740;
  background-color: #2b2931;
}

.media-search-box::before {
  color: #85818d;
  content: "⌕";
  font-size: 14px;
}

.media-search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #d6d5dc;
  font-size: 14px;
}

.media-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.media-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.media-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8f8b96;
  font-size: 14px;
}

.media-tab::before {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid currentColor;
  box-sizing: border-box;
  content: "";
}

.media-tab--active {
  color: #1d84f3;
}

.media-tab--active::before {
  background-color: currentColor;
}

.media-toolbar__actions {
  display: inline-flex;
  gap: 8px;
}

.media-toolbar__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid #1d84f3;
  background-color: transparent;
  color: #1d84f3;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.media-toolbar__button--primary {
  background-color: #1d84f3;
  color: #fff;
}

.media-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.media-list li + li {
  margin-top: 12px;
}

.media-row-card {
  display: grid;
  grid-template-columns: 103px minmax(0, 1fr);
  gap: 12px;
  min-height: 78px;
  padding: 10px;
  border: 1px solid #45414a;
  background-color: #2c2a32;
  color: inherit;
  text-decoration: none;
}

.media-page--list .media-row-card {
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  min-height: 94px;
}

.media-row-card__thumb {
  overflow: hidden;
  background-color: #1f1d23;
}

.media-page--list .media-row-card__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background-color: #232129;
}

.media-row-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: bottom;
}

.media-page--list .media-row-card__thumb img {
  object-fit: contain;
}

.media-row-card__title {
  margin: 0 0 6px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.media-row-card__excerpt,
.media-row-card__meta {
  margin: 0;
  color: #b1adb8;
  font-size: 14px;
  line-height: 1.65;
}

.media-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.media-pagination__arrow,
.media-pagination__current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #3b3841;
  color: #9e9aa5;
  font-size: 14px;
}

.media-pagination__current {
  background-color: #1d84f3;
  color: #fff;
}

.media-detail {
  max-width: 610px;
  margin: 0 auto;
}

.media-detail h1 {
  margin: 0 0 20px;
  color: #fff;
  font-size: 28px;
  line-height: 1.4;
  text-align: center;
}

.media-detail__image {
  margin-bottom: 16px;
  background-color: #242229;
}

.media-detail__image img {
  display: block;
  width: 100%;
  height: auto;
}

.media-detail__article-title {
  margin: 0 0 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}

.media-detail__lead,
.media-detail__body {
  margin: 0 0 18px;
  color: #d2d0d8;
  font-size: 14px;
  line-height: 1.9;
}

.media-detail__link {
  color: #3da0ff;
  font-size: 14px;
  text-decoration: none;
}

.media-detail__link:hover {
  text-decoration: underline;
}

@media screen and (max-width: 850px) {
  .media-page__main {
    padding: 72px 12px 72px;
  }

  .media-back {
    margin-bottom: 18px;
  }

  .media-title-row {
    margin-bottom: 14px;
    padding-right: 34px;
  }

  .media-title-row h1,
  .media-detail h1 {
    font-size: 28px;
  }

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

  .media-toolbar__actions {
    width: 100%;
    justify-content: flex-end;
  }

  .media-row-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .media-page--list .media-panel {
    max-width: 100%;
  }

  .media-page--list .media-row-card {
    grid-template-columns: 122px minmax(0, 1fr);
    min-height: 88px;
  }
}
