/* ============================================================
   styles.css
   Minimal, typography-focused PDF index page.
   ============================================================ */


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

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f8f9fa;
  color: #1a1a1a;
  line-height: 1.6;
  min-height: 100vh;
  padding: 3rem 1.25rem 5rem;
}


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

.page {
  max-width: 900px;
  margin: 0 auto;

  /* Fade-in the whole page on load */
  animation: pageFadeIn 0.45s ease both;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}


/* ── Page heading area ────────────────────────────────────── */

.page-intro {
  margin-bottom: 2.75rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111;
  margin-bottom: 0.35rem;
}

.page-subtitle {
  font-size: 0.9375rem;
  color: #6b7280;
  font-weight: 400;
}


/* ── Search bar ───────────────────────────────────────────── */

.search-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.search-input {
  width: 100%;
  max-width: 420px;
  padding: 0.625rem 0.9rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  appearance: none;
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-input:focus {
  border-color: #a0aec0;
  box-shadow: 0 0 0 3px rgba(160, 174, 192, 0.2);
}

/* ── GitHub link & icon ───────────────────────────────────── */

.github-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 8px;
  color: #6b7280;
  transition: color 0.18s ease, background-color 0.18s ease;
  text-decoration: none;
}

.github-link:hover {
  color: #111827;
  background-color: #f3f4f6;
}

.github-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
  display: block;
}


/* ── Category section ─────────────────────────────────────── */

.category {
  margin-bottom: 2.75rem;
}

.category-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid #e5e7eb;
}


/* ── Card list ────────────────────────────────────────────── */

.card-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}


/* ── Individual card ──────────────────────────────────────── */

.card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.125rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;

  /* Start invisible; script.js adds .card--visible after stagger delay */
  opacity: 0;
  transform: translateY(6px);
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    opacity 0.3s ease;
}

/* Triggered by JS after stagger delay */
.card--visible {
  opacity: 1;
  transform: translateY(0);
}

.card:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);
  border-color: #d1d5db;
  transform: translateY(-1px);
}

.card:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}


/* ── Card body (title + description) ─────────────────────── */

.card-body {
  flex: 1;
  min-width: 0; /* allow text truncation on narrow screens */
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.2rem;
  line-height: 1.4;
}

.card-desc {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.55;
}


/* ── Card date ────────────────────────────────────────────── */

.card-date {
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: #9ca3af;
  white-space: nowrap;
  padding-top: 0.1rem; /* align with first line of title */
}


/* ── Empty state ──────────────────────────────────────────── */

.empty-state {
  color: #9ca3af;
  font-size: 0.9375rem;
  padding: 2rem 0;
  text-align: center;
}


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

@media (max-width: 600px) {
  body {
    padding: 2rem 1rem 4rem;
  }

  .page-title {
    font-size: 1.375rem;
  }

  .card {
    flex-direction: column;
    gap: 0.5rem;
  }

  .card-date {
    padding-top: 0;
    align-self: flex-start;
  }

  .search-input {
    max-width: 100%;
  }
}
