@import url('/shared/page-shell.css');
@import url('/shared/theme-header.css');

.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.75rem) clamp(1rem, 4vw, 2rem) 3rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.brand {
  font-weight: 800;
  font-size: clamp(1.75rem, 4.5vw, 2.35rem);
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.1;
}

.brand__accent {
  color: var(--header-accent);
}

.lede {
  max-width: 36rem;
  margin: 0.5rem 0 0;
  font-weight: 600;
  color: var(--page-fg-muted);
}

.hub-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.hub-search {
  flex: 1 1 14rem;
  min-width: 12rem;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--page-fg);
}

.hub-search:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.chip {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--page-fg);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.chip[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.section-heading {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--page-fg-muted);
  margin: 0 0 0.75rem;
}

.app-grid {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.15rem;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.app-card__title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
}

.app-card__desc {
  margin: 0;
  flex: 1;
  font-size: 0.875rem;
  color: var(--page-fg-muted);
}

.app-card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.pill {
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--header-accent);
}

.pill--sponsored {
  background: var(--sunshine);
  color: #1a2332;
  border-color: transparent;
}

.pill--popular {
  background: var(--mint-soft);
  color: #1a4a3a;
  border-color: transparent;
}

.ad-slot {
  min-height: 90px;
  margin: 1rem 0 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--page-fg-muted);
  background: var(--surface);
}

.ad-slot[data-live='true'] {
  border-style: solid;
}

.site-footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--page-fg-muted);
}

.site-footer a {
  color: var(--header-accent);
}

.footer-donate,
.footer-affiliates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.footer-donate a,
.footer-affiliates a {
  text-decoration: none;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

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