/* Mobile layout corrections for the standalone CVE Database.
 *
 * Result cards previously inherited `height: 100%` from the two-column desktop
 * grid. On narrow screens that could preserve the expanded row height after a
 * <details> record was closed, leaving a very tall empty card. Keep mobile rows
 * content-sized and let the catalog use the same practical viewport width as
 * the documentation content column.
 */
@media (max-width: 760px) {
  html[data-cve-database-page="true"] .cve-database__catalog-region {
    width: calc(100vw - 24px);
    max-width: none;
    margin-inline: auto;
  }

  html[data-cve-database-page="true"] .cve-catalog,
  html[data-cve-database-page="true"] .cve-catalog__shell,
  html[data-cve-database-page="true"] .cve-catalog__results {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  html[data-cve-database-page="true"] .cve-catalog__results {
    align-items: start;
    grid-auto-rows: auto;
  }

  html[data-cve-database-page="true"] .cve-catalog__result {
    height: auto;
    min-height: 0;
    align-self: start;
  }

  html[data-cve-database-page="true"] .cve-catalog__record:not([open]) > .cve-catalog__record-summary {
    height: auto;
  }

  html[data-cve-database-page="true"] .cve-catalog__record-actions {
    position: static;
  }
}

@media (max-width: 480px) {
  html[data-cve-database-page="true"] .cve-database__catalog-region {
    width: calc(100vw - 16px);
  }

  html[data-cve-database-page="true"] .cve-catalog__record-summary {
    padding-inline: 0.9rem 2.65rem;
  }
}
