/* ==========================================================================
   responsive.css — ALL MEDIA QUERIES
   Mobile-first. Type size and spacing are fluid (clamp() in variables.css).
   DIWA / YONO columns: --catalog-columns-mobile / -tablet / -desktop.

   Breakpoints actually used:
     768px  (md)  tablet and up — footer row, fixed background
     1024px (lg)  desktop navigation (keep in sync with config.js desktopNavMinWidth)
     1280px (xl)  large desktop — slightly wider content
   ========================================================================== */

/* ---------- md: 768px and up (tablets and desktops) ---------- */
@media (min-width: 768px) {
  :root {
    --catalog-columns: var(--catalog-columns-tablet);
  }

  body {
    background-attachment: fixed;
  }

  .category-related-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .category-related-list .button {
    width: auto;
    flex: 1 1 10rem;
  }

  .footer-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "brand nav"
      "copy copy";
    align-items: center;
    column-gap: var(--space-xl);
    row-gap: var(--space-2xs);
  }

  .footer-brand {
    grid-area: brand;
  }

  #footer-navigation {
    grid-area: nav;
    justify-self: end;
    max-width: 100%;
  }

  .footer-menu {
    justify-content: flex-end;
  }

  .footer-copyright {
    grid-area: copy;
  }

  #trending-apps-section {
    padding: var(--space-xl);
  }

  /* Three featured cards, stacked content, full-width download button */
  .app-list--trending {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trending-app-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 0 var(--space-md);
    text-align: center;
  }

  .trending-app-card .trending-card-link,
  .trending-app-card:has(.app-new-badge) .trending-card-link {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xl) var(--space-md) var(--space-md);
    text-align: center;
  }

  .trending-app-card .app-icon {
    width: 6.75rem;
    height: 6.75rem;
  }

  .trending-app-card .app-card-body {
    align-items: center;
    text-align: center;
  }

  .trending-app-card .app-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .trending-app-card .app-rating {
    justify-content: center;
  }

  .trending-meta {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
  }

  .trending-app-card .app-download-button {
    width: calc(100% - (var(--space-md) * 2));
    margin-inline: var(--space-md);
  }

  .trending-app-card .app-new-badge {
    top: var(--space-sm);
    right: var(--space-sm);
    left: auto;
  }

  .trending-app-card:has(.app-new-badge) .app-card-body {
    padding-top: 0;
  }

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

  .app-screenshot-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    overflow: visible;
  }

  .app-screenshot-list li {
    flex: none;
    max-width: none;
  }
}

/* ---------- lg: 1024px and up (desktop navigation) ---------- */
@media (min-width: 1024px) {
  :root {
    --catalog-columns: var(--catalog-columns-desktop);
  }

  .catalog-app-card {
    padding: var(--space-md) var(--space-sm) var(--space-sm);
  }

  .catalog-app-card .app-icon {
    width: var(--catalog-icon-size-desktop);
    height: var(--catalog-icon-size-desktop);
  }

  .catalog-app-card .app-name {
    font-size: var(--font-size-base);
  }

  .js #nav-toggle {
    display: none;
  }

  .js #nav-menu,
  #nav-menu {
    display: flex;
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: var(--space-3xs);
    width: auto;
    max-height: none;
    padding: 0;
    overflow: visible;
    background: none;
    border: 0;
    box-shadow: none;
  }

  #nav-menu .nav-link {
    width: auto;
    padding-inline: var(--space-xs);
    font-size: var(--font-size-sm);
    white-space: nowrap;
  }

  /* Detail page: icon and actions in a side column, facts on the right. */
  .app-detail-overview {
    grid-template-columns: 16rem minmax(0, 1fr);
    grid-template-areas:
      "icon heading"
      "icon summary"
      "actions facts"
      "share share";
    column-gap: var(--space-xl);
    align-items: start;
  }

  .app-detail-icon {
    width: 7.5rem;
    height: 7.5rem;
  }

  #app-title {
    font-size: var(--font-size-3xl);
  }

  .app-detail-actions .button {
    width: 100%;
  }
}

/* ---------- xl: 1280px and up (large desktops) ---------- */
@media (min-width: 1280px) {
  :root {
    --max-width-content: 1240px;
  }
}
