/* ─────────────────────────────────────────────
   Shiny Apps Splash Page — BYU Digital Humanities
   Warm editorial aesthetic
   ───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Source+Sans+3:wght@300;400;500&display=swap');

/* ── Reset & base ─────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: #f5f1ea;
}

body {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  color: #2b2318;
  background-color: #f5f1ea;
  -webkit-font-smoothing: antialiased;
}

/* R Markdown injects a .container-fluid wrapper — neutralize it */
.container-fluid {
  padding: 0 !important;
  max-width: none !important;
}

a {
  color: #7a4a1e;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Page wrapper ─────────────────────────── */

.page-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

/* ── Header ───────────────────────────────── */

.site-header {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid #d4c9b5;
  margin-bottom: 3rem;
}

.site-eyebrow {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9a8670;
  margin-bottom: 0.75rem;
}

.site-title {
  font-family: 'Lora', serif;
  font-weight: 500;
  font-size: 2.4rem;
  line-height: 1.2;
  color: #1e1610;
  margin-bottom: 1rem;
}

.site-tagline {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #5c4e3d;
  max-width: 580px;
  font-weight: 300;
}

/* ── App grid ─────────────────────────────── */

.app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

/* ── App card ─────────────────────────────── */

.app-card {
  background: #fdfaf5;
  border: 1px solid #ddd5c2;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.app-card:hover {
  box-shadow: 0 4px 18px rgba(43, 35, 24, 0.10);
  transform: translateY(-2px);
}

/* ── Thumbnail ────────────────────────────── */

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #ede7da;
  border-bottom: 1px solid #ddd5c2;
  position: relative;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
}

/* Fallback when screenshot is missing */
.card-thumb img[src=""],
.card-thumb img:not([src]) {
  visibility: hidden;
}

/* ── Card body ────────────────────────────── */

.card-body {
  padding: 1.1rem 1.25rem 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ── Category tag ─────────────────────────── */

.card-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a4a1e;
  background: #f0e4d2;
  border: 1px solid #d9c5a8;
  border-radius: 3px;
  padding: 2px 7px;
  margin-bottom: 0.55rem;
  align-self: flex-start;
}

/* ── Card title ───────────────────────────── */

.card-title {
  font-family: 'Lora', serif;
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.3;
  color: #1e1610;
  margin-bottom: 0.5rem;
}

/* ── Card description ─────────────────────── */

.card-desc {
  font-size: 0.88rem;
  line-height: 1.65;
  color: #5c4e3d;
  flex: 1;
  margin-bottom: 0.9rem;
}

/* ── Card link ────────────────────────────── */

.card-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: #7a4a1e;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.card-link:hover {
  color: #5a3212;
  border-bottom-color: #7a4a1e;
  text-decoration: none;
}

.link-arrow {
  font-style: normal;
  transition: transform 0.15s ease;
}

.card-link:hover .link-arrow {
  transform: translateX(3px);
}

/* ── Footer ───────────────────────────────── */

.site-footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d4c9b5;
  font-size: 0.82rem;
  color: #9a8670;
  line-height: 1.6;
}

.site-footer a {
  color: #7a4a1e;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ── Responsive ───────────────────────────── */

@media (max-width: 600px) {
  .app-grid {
    grid-template-columns: 1fr;
  }

  .site-title {
    font-size: 1.8rem;
  }

  .page-wrap {
    padding: 0 1.25rem 3rem;
  }
}
