/* Shared responsive polish for the page layouts. */
html,
body {
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

.footer {
  width: min(100%, 1440px);
}

@media (max-width: 1360px) {
  .container,
  .top-wrapper,
  .wrapper {
    max-width: 100%;
  }

  .header {
    max-width: 100%;
    padding-right: 18px;
  }

  .footer {
    border-radius: 28px;
  }
}

@media (max-width: 1200px) {
  .nav {
    gap: 16px;
  }

  .nav a {
    font-size: 15px;
  }

  .search {
    width: 180px;
  }

  .layout {
    grid-template-columns: 190px minmax(0, 1fr) 260px;
    gap: 14px;
  }

  .main-content {
    width: 100%;
  }

  .hero-content {
    padding: 32px;
    max-width: 64%;
  }

  .hero-content h1 {
    font-size: 32px;
  }

  .project-card {
    gap: 18px;
    padding: 18px;
  }

  .project-preview,
  .project-preview-link,
  .project-card > img {
    width: 210px;
    height: 180px;
  }

  .collection-banner {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .catalog-layout {
    padding: 0 18px;
    gap: 16px;
  }

  .sidebar {
    width: 240px;
  }

  .sidebar-block {
    padding: 16px;
  }

  .sidebar-top h3,
  .sidebar-item span,
  .version-item span,
  .show-all span,
  .loader-item span,
  .license-item span,
  .platform-item span {
    font-size: 15px;
  }

  .catalog-card {
    padding: 16px;
    gap: 14px;
  }

  .catalog-card-image {
    width: 104px;
    height: 104px;
  }

  .catalog-card-top h3 {
    font-size: 20px;
  }

  .catalog-card-info p,
  .catalog-tag,
  .catalog-stat span,
  .catalog-date span {
    font-size: 14px;
  }

  .mods-grid {
    gap: 16px;
  }

  .mod-card {
    padding: 18px;
  }

  .footer {
    height: auto;
    min-height: 340px;
    padding: 32px;
  }

  .footer-links {
    gap: 48px;
  }

  .footer-column a {
    font-size: 16px;
  }
}

@media (max-width: 1024px) {
  .header {
    gap: 18px;
  }

  .logo img {
    max-width: 116px;
    height: auto;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .left-sidebar {
    display: none;
  }

  .catalog-tabs {
    max-width: calc(100vw - 36px);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .catalog-tabs::-webkit-scrollbar {
    display: none;
  }

  .catalog-card {
    align-items: stretch;
  }

  .catalog-card-right {
    justify-content: space-between;
  }

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

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

  .mod-sidebar .ads-block {
    grid-column: 1 / -1;
  }

  .footer-content {
    gap: 28px;
  }

  .footer-links {
    gap: 28px;
  }
}

@media (max-width: 900px) {
  .header {
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

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

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

  .right-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .right-sidebar .rs-ads {
    grid-column: 1 / -1;
    margin-top: 14px;
  }

  .hero-content {
    max-width: 70%;
  }

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

  .project-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .project-preview,
  .project-preview-link,
  .project-card > img {
    width: 220px;
    height: 100%;
    min-height: 210px;
  }

  .project-bottom {
    gap: 14px;
  }

  .collection-banner {
    grid-template-columns: 1fr;
  }

  .collection-banner > img {
    max-height: 260px;
    object-fit: cover;
  }

  .catalog-layout {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .catalog-card {
    flex-direction: column;
  }

  .catalog-card-right {
    flex-direction: row;
    align-items: center;
  }

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

  .mod-card-image {
    height: 240px;
  }

  .footer-content {
    flex-direction: column;
  }

  .footer-right {
    align-items: flex-start;
  }

  .footer-made-btn {
    margin-bottom: 24px;
  }

  .footer-bottom {
    position: static;
    margin-top: 26px;
  }
}

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

  .header {
    padding-inline: 12px;
  }

  .catalog-layout {
    padding: 0;
  }

  .mod-sidebar {
    display: none;
  }

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

  .container,
  .wrapper {
    padding: 12px;
  }

  .header {
    gap: 12px;
    padding-inline: 0;
  }

  .nav {
    display: none;
  }

  .search {
    width: 100%;
    height: 36px;
    padding: 0;
    color: transparent;
  }

  .search::placeholder {
    color: transparent;
  }

  .search-wrapper {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    max-width: 36px;
  }

  .hero-main-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .hero-image {
    position: relative;
    order: -1;
    right: auto;
    top: auto;
    width: 100%;
    height: 260px;
    border-radius: 24px 24px 0 0;
  }

  .hero-main-content::before {
    display: none;
  }

  .hero-content {
    max-width: 100%;
    min-height: 0;
    padding: 20px;
  }

  .hero-content h1 {
    font-size: 28px;
  }

  .hero-buttons,
  .catalog-card-left,
  .catalog-card-right,
  .mod-header-right {
    align-items: stretch;
  }
  .catalog-card-left{
    flex-direction: column;
  }

  .green-btn,
  .light-btn {
    width: 100%;
  }

  .discover-grid,
  .collections-grid,
  .news-grid,
  .right-sidebar {
    grid-template-columns: 1fr;
  }

  .layout{
    display:block;
  }

  .catalog-card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .catalog-filter-top,
  .catalog-filters {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .filter-btn {
    flex: 1 1 160px;
    justify-content: center;
  }

  .mod-header-left {
    flex-direction: column;
  }

  .mod-tabs {
    width: max-content;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .description-subtitle{
    height: auto;
  }

  .mod-tabs::-webkit-scrollbar {
    display: none;
  }

  .description-title,
  .description-subtitle {
    font-size: 28px;
    letter-spacing: 0;
  }

  .footer {
    width: 100%;
    padding: 28px 18px;
    text-align: center;
  }

  .footer-content {
    align-items: center;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 18px;
    order: 2;
  }

  .footer-column {
    gap: 12px;
  }

  .footer-bottom {
    display: none;
  }

  .footer-bottom-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    order: 3;
  }

  .footer-right {
    display: contents;
  }

  .footer-logo {
    order: 1;
    margin: 0 auto;
  }

  .footer-socials {
    order: 4;
    justify-content: center;
  }

  .footer-made-btn {
    display: none;
  }
}
