@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Roboto:wght@400;500;700&display=swap");

:root {
  --text-color-dark: #2d2d2d;
  --text-color-grey: #666;
  --text-color-light-grey: #999;
  --text-color-dark-purple: #5b2c6f;
  --border-color-light: #eee;
  --border-color-light-grey: #ddd;
  --border-color-purple: #5b2c6f;
  --main-bg: #f3f4f6;
  --bg-purple: #8248ac;
  --bg-dark-magenta: #6b2d84;
  --bg-indigo: #472567;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  padding-top: 130px;

  display: flex;
  flex-direction: column;

  font-family: "Roboto", sans-serif;
  background: var(--main-bg);
  color: var(--text-color-dark);
}

.container {
  max-width: 1400px;
  margin: 40px auto;
}

.cards-container {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 40px;
  padding: 0 20px;
}

/* ШАПКА */
.header-wrapper {
  padding-top: env(safe-area-inset-top);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
}

.topbar {
  background: linear-gradient(90deg, var(--bg-purple), var(--bg-indigo));
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 60px;
  filter: saturate(150%);
}

.social-networks {
  display: flex;
  gap: 20px;
}

.social-media {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.social-media:hover {
  opacity: 1;
}

.social-media-link {
  width: 100%;
  height: 100%;
}

.social-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

header {
  background: #ffffff;
  padding: 20px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color-light);
}

.logo {
  font-family: "Playfair Display", serif;
  font-size: 32px;
}

.logo a {
  text-decoration: none;
  color: #000;
}

.logo span {
  color: var(--text-color-dark-purple);
}

nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-weight: 500;
  font-size: 18px;
}

.about-us__link {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.about-us__link:hover {
  color: var(--text-color-dark-purple);
}

.dropdown {
  position: relative;
  cursor: pointer;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-arrow {
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 10px 0;
  min-width: 180px;
  display: none;
  flex-direction: column;
  z-index: 10;
}

.dropdown-menu-categorie {
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text-color-dark);
  font-size: 14px;
}

.dropdown-menu-categorie:hover {
  background-color: var(--bg-dark-magenta);
  color: white;
}

.dropdown:hover .dropdown-menu {
  display: flex;
}

.btn-login {
  padding: 10px 20px;
  background: var(--bg-dark-magenta);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.5s ease;
}

.btn-login:active {
  transform: scale(0.95);
}

/* КАРТОЧКИ */
.cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 30px;
}

.card {
  grid-column: span 2;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  animation: fadeInUp 2s ease forwards;
  transition: all 0.4s ease;
}

.card:nth-child(1),
.card:nth-child(2) {
  grid-column: span 3;
}
.card:nth-child(6),
.card:nth-child(7) {
  grid-column: span 3;
}

.card:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 16 / 10;
}

.card:nth-child(1) img,
.card:nth-child(2) img,
.card:nth-child(6) img,
.card:nth-child(7) img {
  aspect-ratio: 4 / 3;
}

.card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.tags-list {
  width: 100%;
  flex-wrap: wrap;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.tag {
  display: inline-block;
  background: #6b2d84;
  color: white;
  font-size: 14px;
  padding: 5px 10px;
  border-radius: 6px;
  width: fit-content;
}

.card h3 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}

.card p {
  font-size: 18px;
  color: var(--text-color-grey);
}

.date {
  font-size: 16px;
  color: var(--text-color-dark);
  margin-top: auto;
  padding-top: 10px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-end;
  margin-top: auto;
  padding: 6px 0;
  color: var(--text-color-grey);
  font-size: 16px;
  text-decoration: none;
  opacity: 0;
  transition: all 0.3s ease;
}

.card-link span {
  font-size: 16px;
  line-height: 1;
  position: relative;
  top: -1px;
}

.card:hover .card-link {
  opacity: 1;
}

.card-link:hover {
  color: var(--text-color-dark-purple);
}

/* ПАГИНАЦИЯ */
.pagination {
  grid-column: 1 / 2;
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.pagination-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-link {
  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 36px;
  height: 36px;

  padding: 0 12px;

  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;

  color: var(--text-color-dark);
  background: transparent;

  transition: all 0.25s ease;
}

.pagination-link:hover {
  background: var(--bg-purple);
  color: #fff;
}

.pagination-link--active {
  background: var(--bg-dark-magenta);
  color: #fff;
}

.pagination-next-link {
  background: var(--bg-dark-magenta);
  color: #fff;
  padding: 0 16px;
  gap: 6px;
}

.pagination-next-link:hover {
  background: var(--bg-purple);
}

.pagination-arrow {
  width: 12px;
  height: 12px;
  display: inline-block;
}

/* САЙДБАР */
.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.sidebar-search-block {
  padding: 20px 0px;
}

.sidebar-title {
  font-size: 22px;
  margin-bottom: 20px;
  font-weight: 600;
}

.search-input-wrapper {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 40px 10px 14px;
  border: 1px solid var(--border-color-light-grey);
  border-radius: 4px;
  font-size: 18px;
}

.search-input:focus {
  outline: none;
  border-color: var(--border-color-purple);
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.popular-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.popular-link {
  text-decoration: none;
  color: #2d2d2d;
  font-size: 16px;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.popular-link:hover {
  color: #5b2c6f;
}

.popular {
  background: white;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.popular-item {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  align-items: center;
  animation: fadeInUp 2s ease both;
}

.popular-item:nth-child(1) {
  animation-delay: 0.5s;
}
.popular-item:nth-child(2) {
  animation-delay: 1s;
}
.popular-item:nth-child(3) {
  animation-delay: 1.5s;
}
.popular-item:nth-child(4) {
  animation-delay: 2s;
}
.popular-item:nth-child(5) {
  animation-delay: 2.5s;
}

.popular-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.categories-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.category-link {
  display: block;
  padding: 6px 0;
  border-radius: 6px;
  text-decoration: none;
  color: #2d2d2d;
  font-size: 16px;
  transition: all 0.25s ease;
}

.category-link:hover {
  background: #f4f4f4;
  color: var(--bg-dark-magenta);
}

.sidebar-video-card {
  background: var(--bg-dark-magenta);
  border-radius: 16px;
  overflow: hidden;
}

.video-card-header {
  min-height: 89px;
  padding: 20px;

  position: relative;
  top: 5px;
  z-index: 2;

  background: var(--bg-dark-magenta);
  color: white;
  font-size: 16px;
  line-height: 1.4;
}

.video-card-header h5 {
  font-size: 18px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-video-card video {
  width: 100%;
  height: 365px;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ПОДВАЛ */
.footer {
  padding: 40px 60px 20px;
  margin-top: auto;
  background: linear-gradient(0deg, #4f2d67, #472567);
  color: #ffffff;
  filter: saturate(140%);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.footer-subscribe-form {
  display: flex;
  gap: 20px;
  align-items: center;
}

.footer__input-email {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  padding: 8px 0;
  width: 250px;
  color: #ffffff;
  font-size: 14px;
}

.footer__input-email::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.footer__input-email:focus {
  outline: none;
  border-bottom: 1px solid #ffffff;
}

.btn-subsribe {
  background: transparent;
  border: 1px solid #ffffff;
  border-radius: 4px;
  padding: 8px 16px;
  color: #ffffff;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-subsribe:hover {
  background: #ffffff;
  color: #5b2c6f;
}
.btn-subsribe:active {
  transform: scale(0.95);
}

.footer-contacts {
  display: flex;
  gap: 40px;
  align-items: center;
}

.footer-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
  font-size: 14px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.footer-contact:hover {
  opacity: 1;
}

.footer-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.footer-copyright {
  text-align: center;
  margin-top: 30px;
  font-size: 13px;
  opacity: 0.8;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Планшет — до 1280px */
@media (max-width: 1280px) {
  .logo {
    font-size: 28px;
  }

  nav {
    gap: 20px;
  }
}

/* Планшет — до 1024px */
@media (max-width: 1024px) {
  .logo {
    font-size: 24px;
  }

  nav {
    gap: 14px;
  }

  .cards-container {
    grid-template-columns: 1fr;
    padding: 0 20px;
  }

  .sidebar {
    order: -1;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .sidebar-search-block {
    grid-column: 1 / -1;
    order: -1;
    padding: 0;
  }

  .sidebar-video-card {
    display: none;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .card,
  .card:nth-child(1),
  .card:nth-child(2),
  .card:nth-child(6),
  .card:nth-child(7) {
    grid-column: span 1;
  }

  .card img,
  .card:nth-child(1) img,
  .card:nth-child(2) img,
  .card:nth-child(6) img,
  .card:nth-child(7) img {
    aspect-ratio: 16 / 10;
  }

  .card h3 {
    font-size: 18px;
  }

  .card p {
    font-size: 15px;
  }

  .pagination {
    grid-column: 1 / -1;
  }

  .footer {
    padding: 32px 24px 16px;
  }

  .footer-content {
    gap: 24px;
  }
}

/* Мобильный — до 640px */
@media (max-width: 640px) {
  .topbar {
    padding: 0 16px;
    justify-content: center;
  }

  header {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .logo {
    margin: 0 auto;
    font-size: 22px;
  }

  nav {
    width: 100%;
    gap: 12px;
    font-size: 16px;
  }

  .btn-login {
    margin-left: auto;
    padding: 8px 14px;
    font-size: 13px;
  }

  .cards-container {
    padding: 0 12px;
    margin: 50px auto 24px;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card h3 {
    font-size: 16px;
  }

  .card p {
    font-size: 14px;
  }

  .card-link {
    opacity: 1;
  }

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

  .sidebar-video-card {
    grid-column: auto;
  }

  .footer {
    padding: 28px 16px 16px;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .footer-subscribe-form {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer__input-email {
    width: 100%;
  }

  .footer-contacts {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
