/* Styles for the Apps page (apps/index.php) and the product pages under it (apps/app_page.php).
   Colors and shapes are the homepage's: white sections (.section, in responsive/header.php),
   light gray cards, and buttons in the menu's charcoal (#303030). */

.app-page {
  text-align: left;
}

.app-page .section {
  margin-bottom: 20px;
}

/* A plain logo at the top: on a product page the product's name is the page's heading. */
.app-logo {
  margin: 8px 0 10px;
}

.app-logo img {
  width: 68.1%;
}

/* ---- The Apps page: cards ---- */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-card {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  border-radius: 8px;
  background-color: #f8f8f8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* Touch screens keep :hover on after a tap, which would leave the card lifted. */
@media (hover: hover) {
  .app-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
  }
}

.app-card-icon {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 22%;
}

.app-card-text {
  min-width: 0;
}

.app-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.app-card h3 a,
.app-card h3 a:visited {
  color: #2c3e50;
  text-decoration: none;
  cursor: pointer;
}

.app-card h3 a:hover,
.app-card h3 a:focus {
  color: #000;
  text-decoration: underline;
}

/* The whole card is the link. */
.app-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
}

.app-card h3 a:focus-visible::after {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

.app-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}

.app-stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
}

/* ---- Buttons ---- */

.app-page .app-button,
.app-page .app-button:visited {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 2px solid #303030;
  border-radius: 6px;
  background: #303030;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}

.app-page .app-button:hover,
.app-page .app-button:focus {
  border-color: #000;
  background: #000;
  color: #fff;
}

.app-page .app-button-quiet,
.app-page .app-button-quiet:visited {
  background: #fff;
  color: #303030;
}

.app-page .app-button-quiet:hover,
.app-page .app-button-quiet:focus {
  background: #303030;
  color: #fff;
}

.app-button-arrow {
  flex: none;
}

/* ---- A product page ---- */

.app-crumbs {
  margin: 0 0 12px;
  font-size: 15px;
}

.app-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-crumbs li + li::before {
  content: "\203A";
  margin-right: 8px;
  color: #666;
}

.app-hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.app-hero-icon {
  flex: none;
  width: 120px;
  height: 120px;
  border-radius: 22%;
}

.app-hero-text {
  min-width: 0;
}

.app-hero h1 {
  margin: 0 0 4px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.15;
  color: #2c3e50;
}

.app-kind {
  margin: 0 0 12px;
  font-size: 15px;
  color: #555;
}

.app-pitch {
  margin: 0 0 18px;
  max-width: 46em;
  font-size: 18px;
  line-height: 1.5;
}

.app-status {
  margin: 0 0 18px;
  padding: 10px 14px;
  max-width: 46em;
  border-left: 4px solid #303030;
  border-radius: 4px;
  background: #f4f4f4;
  font-size: 15px;
  line-height: 1.5;
}

.app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

/* The trailer */
.app-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #000;
}

.app-small {
  margin: 10px 0 0;
  font-size: 14px;
  color: #555;
}

/* Screenshots: phone-sized, side by side, wrapping onto more rows as the page narrows. */
.app-shots {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-shots li {
  flex: 0 0 200px;
}

.app-shots img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 12px;
}

.app-about p {
  margin: 0 0 14px;
  max-width: 46em;
  font-size: 16px;
  line-height: 1.6;
}

.app-about ul,
.app-links ul {
  margin: 0 0 14px;
  padding-left: 22px;
  max-width: 46em;
  font-size: 16px;
  line-height: 1.6;
}

.app-about li,
.app-links li {
  margin-bottom: 6px;
}

.app-about > :last-child,
.app-links > :last-child {
  margin-bottom: 0;
}

.app-about p.app-small {
  font-size: 14px;
}

@media (max-width: 767px) {
  .app-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The name sits beside the icon; the description and the buttons get the full width under
     them, so a button's label stays on one line. */
  .app-hero {
    display: block;
  }

  .app-hero::after {
    content: "";
    display: block;
    clear: both;
  }

  .app-hero-icon {
    float: left;
    width: 84px;
    height: 84px;
    margin: 0 14px 10px 0;
  }

  .app-hero h1 {
    padding-top: 6px;
    font-size: 28px;
  }

  .app-pitch,
  .app-status,
  .app-actions {
    clear: both;
  }

  /* Two to a row. */
  .app-shots {
    gap: 12px;
  }

  .app-shots li {
    flex-basis: calc(50% - 6px);
  }

  /* The trailer reaches the edges of its section, as the videos in blog posts do. */
  .app-video {
    width: calc(100% + 30px);
    max-width: none;
    margin-left: -15px;
    margin-right: -15px;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-card {
    transition: none;
  }
}
