/* Shared header for every page. */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: #000000;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #000000;
  color: #aeb5c1;
  line-height: 1.5;
}

header .nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1140px;
  height: auto;
  min-height: 86.4px;
  margin: 0 auto;
  padding: 1.2rem 1.25rem;
}

header .logo-link { display: flex; align-items: center; color: #ffffff; text-decoration: none; }
header .logo-img,
.footer-logo { height: 52px; width: 208px; max-width: 100%; object-fit: cover; }
header .nav-links { display: flex; list-style: none; gap: 1.6rem 2rem; align-items: center; }
header .nav-links a { color: #aeb5c1; text-decoration: none; font-size: 1.1rem; font-weight: 600; transition: color 0.2s; }
header .nav-links a:hover { color: #ffffff; }
header .nav-links a.active { color: #ffffff; }
header .nav-links a:focus-visible { outline: 2px solid #ffffff; outline-offset: 4px; }

/* Let short Websites pages fill the screen before the footer. */
.websites-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.websites-page > header,
.websites-page > footer { flex-shrink: 0; }
.websites-page > main { width: 100%; flex: 1 0 auto; }

/* App and game card grid */
.card-grid {
  display: grid;
  /* Consistent 243.6px cards across all catalog pages. */
  grid-template-columns: repeat(auto-fill, minmax(0, min(100%, 15.225rem)));
  gap: 0.8rem 1.25rem;
  margin-bottom: 1.6rem;
}

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0.6rem 0.75rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #d1d5db;
  background: var(--bg-card-hover);
}

/* Card image area */
.card-square-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-square-placeholder);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  margin-bottom: 0.6rem;
}
.card-square-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-square-img .shotle-logo { transform: scale(1.232); }
.card-square-img-placeholder {
  font-size: 3rem;
}

/* Card titles and category details */
.card-details {
  margin-bottom: 0.6rem;
  margin-left: 2px;
  margin-right: 2px;
}
.card-details h3 {
  font-family: var(--font-card-title);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0.16rem;
  line-height: 1.2;
}
.card-details p {
  font-size: 0.85rem;
  color: var(--text-dark-grey);
  font-weight: 400;
}

/* Store buttons and availability states */
.card-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.5rem;
  margin-top: auto;
  margin-left: 2px;
  margin-right: 2px;
}
.card-buttons-single { grid-template-columns: 1fr; }
.store-btn {
  background: var(--bg-btn);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.36rem 0.25rem;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-dark);
  text-align: center;
  transition: all 0.2s;
}
.store-btn:hover:not(.coming-soon) { background: var(--bg-btn-hover); border-color: #cbd5e1; }
.store-btn:focus-visible { outline: 2px solid var(--text-dark); outline-offset: 3px; }
.store-btn svg { width: 16px; height: 16px; fill: currentColor; margin-bottom: 1.6px; }
.store-btn .subtext { font-size: 0.6rem; color: var(--text-dark-grey); text-transform: uppercase; letter-spacing: 0.5px; }
.store-btn .label { font-size: 0.75rem; font-weight: 600; }

.store-btn.coming-soon { opacity: 0.6; cursor: not-allowed; border-style: dashed; background: #f9fafb; }
.store-btn.coming-soon .subtext { color: var(--text-dark-grey); }
.store-btn.coming-soon .label { font-size: 0.7rem; color: var(--text-dark-grey); }

@media (max-width: 800px) {
  .card-grid { justify-content: center; }
  header .nav-bar {
    gap: 0.8rem 1rem;
    flex-wrap: wrap;
  }
  header .nav-links { gap: 0.8rem 1rem; flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 420px) {
  header .nav-bar { padding-left: 1rem; padding-right: 1rem; }
  header .logo-img { height: 44px; width: 176px; }
  header .nav-links a { font-size: 1rem; }
  main .section-title { scroll-margin-top: 11rem; }
}
