/* ── Reset & base ──────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: #f8f8f8;
  color: #1a1a1a;
  line-height: 1.6;
}

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
  text-align: center;
  padding: 3rem 1.5rem 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.site-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

/* About toggle (now in header) */
.about-toggle {
  display: block;
  margin: 0.3rem auto 0;
  background: none;
  border: none;
  font-size: 0.82rem;
  color: #777;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-toggle:hover {
  color: #333;
}

.about-text {
  max-width: 700px;
  margin: 0 auto;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 1rem;
  font-size: 0.92rem;
  color: #444;
  line-height: 1.7;
  text-align: left;
}

.about-text.open {
  max-height: 300px;
  padding: 0.75rem 1rem;
}

.about-text a {
  color: #555;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-text a:hover {
  color: #111;
}

/* ── Prompt selector bar (sticky) ──────────────────────────────── */
.prompt-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #f8f8f8;
  border-bottom: 1px solid #e0e0e0;
  padding: 0.75rem 1.5rem 0.75rem;
}

/* ── Controls row (view + sort toggles) ────────────────────────── */
.controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.view-toggle {
  display: inline-flex;
  border-radius: 999px;
  overflow: hidden;
}

.view-toggle button {
  appearance: none;
  border: 2px solid #333;
  background: transparent;
  color: #333;
  padding: 0.3rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.view-toggle button:first-child {
  border-right: none;
  border-radius: 999px 0 0 999px;
}

.view-toggle button:last-child {
  border-radius: 0 999px 999px 0;
}

.view-toggle button.active {
  background: #333;
  color: #fff;
}

.view-toggle button:hover:not(.active) {
  background: #eee;
}

/* ── Prompt / model pills ──────────────────────────────────────── */
.prompt-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
}

.prompt-pill {
  appearance: none;
  border: 2px solid #333;
  background: transparent;
  color: #333;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.prompt-pill:hover {
  background: #eee;
}

.prompt-pill.active {
  background: #333;
  color: #fff;
}

/* Color dot inside model pills */
.pill-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
}

/* ── LLM card grid (single column) ────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

/* ── Individual card (horizontal layout with left accent) ─────── */
.llm-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-left: 4px solid #ccc;
}

.card-body {
  padding: 1rem 1.25rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Card header: title on left, audio + PDF on right */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  flex-shrink: 1;
  min-width: 0;
}

.piece-title {
  font-weight: 400;
  font-style: italic;
}

.card-media {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.card-media audio {
  width: 260px;
  min-width: 180px;
  outline: none;
}

.short-desc {
  font-size: 0.9rem;
  color: #555;
}

.pdf-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #777;
  transition: color 0.15s, background 0.15s;
}

.pdf-link:hover {
  color: #333;
  background: #f0f0f0;
}

.pdf-icon {
  height: 28px;
  width: auto;
}

.expand-toggle {
  appearance: none;
  border: none;
  background: none;
  font-size: 0.82rem;
  color: #777;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  align-self: flex-start;
  padding: 0;
}

.expand-toggle:hover {
  color: #333;
}

.long-desc {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease;
  font-size: 0.88rem;
  color: #444;
  line-height: 1.7;
}

/* max-height is set by JS via scrollHeight for smooth expand/collapse */

.long-desc p {
  margin-bottom: 0.5em;
}

.long-desc p:last-child {
  margin-bottom: 0;
}

.long-desc strong {
  font-weight: 600;
  color: #333;
}

.long-desc ol,
.long-desc ul {
  padding-left: 1.4em;
  margin-bottom: 0.5em;
}

.long-desc li {
  margin-bottom: 0.25em;
}

/* ── Provider section headers ──────────────────────────────────── */
.provider-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.provider-header span {
  font-size: 0.82rem;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.provider-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ddd;
}

/* ── Version bar ───────────────────────────────────────────────── */
.version-bar {
  text-align: center;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  color: #888;
}

.version-bar a {
  color: #888;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.version-bar a:hover {
  color: #333;
}

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  font-size: 0.82rem;
  color: #999;
}

.site-footer a {
  color: #555;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer a:hover {
  color: #111;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .card-header {
    flex-wrap: wrap;
  }

  .card-media {
    width: 100%;
  }

  .card-media audio {
    width: 100%;
    flex: 1;
  }

  .controls-row {
    flex-wrap: wrap;
  }
}
