/** Hub page: the game catalogue grid. */

body.pd-hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top: 5px solid #000;
}

.pd-hub-main {
  flex: 1;
  width: 100%;
  max-width: var(--pd-content-width);
  min-height: 700px;
  padding: var(--pd-spacing-8) 20px 96px 48px;
  background: var(--pd-colour-background);
}

.pd-hub-header {
  padding-bottom: 44px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--pd-colour-border);
}

.pd-hub-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: clamp(28px, 3.5vw, 52px);
  row-gap: clamp(44px, 4.5vw, 72px);
  align-items: start;
}

/* --- Card --------------------------------------------------------------- */

.pd-card {
  position: relative;
  min-width: 0;
  padding-bottom: var(--pd-spacing-4);
  border-bottom: 1px solid var(--pd-colour-border);
}

.pd-card-thumb-link {
  display: block;
  text-decoration: none;
}

/*
  Capped rather than left to fill the column: the three- and two-column
  breakpoints give a card far more width than the six-column desktop layout
  does, and an uncapped thumbnail grows to 350px and swamps its own title.
*/
.pd-card-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  max-width: 200px;
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.04);
  transition: transform var(--pd-transition-fast);
}

.pd-card-thumb img {
  display: block;
  width: 70%;
  height: 70%;
  object-fit: contain;
}

.pd-card-thumb-link:hover .pd-card-thumb,
.pd-card-thumb-link:focus-visible .pd-card-thumb {
  transform: scale(1.02);
}

.pd-card-copy {
  padding-top: var(--pd-spacing-3);
}

.pd-card-name {
  margin: 0 0 2px;
  font-family: var(--pd-font-heading);
  font-weight: var(--pd-weight-black);
  font-size: 26px;
  line-height: 1.1;
  color: var(--pd-colour-heading);
}

.pd-card-name a {
  color: inherit;
  text-decoration: none;
}

.pd-card-tagline {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
  color: var(--pd-colour-muted);
}

.pd-card-streak {
  display: inline-block;
  margin-top: var(--pd-spacing-2);
  font-size: 13px;
  font-weight: var(--pd-weight-bold);
  color: var(--pd-colour-heading);
}

.pd-card-beta {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 4px 7px;
  background: var(--pd-colour-danger);
  color: #fff;
  font-size: 10px;
  font-weight: var(--pd-weight-bold);
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}

/*
  Play / Archive buttons are built but hidden: the whole thumbnail is already
  a link, so they were redundant. Switch to `grid` to bring them back — the
  archive gating in hub.js is wired and working either way.
*/
.pd-card-actions {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: var(--pd-spacing-3);
}

.pd-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 6px;
  border: 2px solid var(--pd-colour-heading);
  border-radius: var(--pd-radius-pill);
  font-family: var(--pd-font-body);
  font-size: clamp(11px, 0.9vw, 12px);
  font-weight: var(--pd-weight-bold);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition: background var(--pd-transition-fast), color var(--pd-transition-fast);
}

.pd-card-btn-primary {
  background: var(--pd-colour-heading);
  color: var(--pd-colour-background);
}

.pd-card-btn-secondary {
  background: transparent;
  color: var(--pd-colour-heading);
}

@media (hover: hover) and (pointer: fine) {
  .pd-card-btn-primary:hover {
    background: #2b2b2b;
    border-color: #2b2b2b;
  }
  .pd-card-btn-secondary:hover {
    background: rgba(22, 22, 19, 0.06);
  }
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 1100px) {
  .pd-hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 40px;
    row-gap: 56px;
  }
  .pd-card-name {
    font-size: 24px;
  }
  .pd-card-tagline {
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .pd-hub-main {
    padding: var(--pd-spacing-7) 20px 80px;
    min-height: 0;
  }
  .pd-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    row-gap: var(--pd-spacing-8);
  }
  .pd-card-name {
    font-size: 22px;
  }
  .pd-card-tagline {
    font-size: 14px;
  }
}
