/* Carnets de recherche — feuille de style sobre, mode sombre, mobile-first. */

:root {
  --bg: #0f1419;
  --bg-elev: #161c23;
  --bg-elev-2: #1d242c;
  --border: #2a323c;
  --text: #e6edf3;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --accent: #c9a76f;
  --accent-soft: #c9a76f33;
  --listened: #4ade80;
  --radius: 12px;
  --radius-sm: 6px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-color 0.15s ease;
}
a:hover, a:focus-visible {
  border-bottom-color: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- header */

.site-header {
  padding: 1.25rem 1rem 1rem;
  background: linear-gradient(180deg, var(--bg-elev) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  max-width: 760px;
  margin: 0 auto;
}

.brand-cover {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-elev-2);
}

.brand-text { min-width: 0; }

.brand-text h1 {
  margin: 0 0 0.15rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 0 0 0.35rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.feed-hint {
  margin: 0;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.search {
  display: block;
  max-width: 760px;
  margin: 1rem auto 0;
}

#search {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  -webkit-appearance: none;
  appearance: none;
}

#search:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------------------------------------------------------------- main */

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem;
}

.episodes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.placeholder, .empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.empty-state[hidden] { display: none; }

/* ---------------------------------------------------------------- episode card */

.episode {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.episode.listened {
  border-color: var(--listened);
  border-color: color-mix(in oklab, var(--listened) 35%, var(--border));
}

.episode-head {
  display: flex;
  gap: 0.875rem;
}

.episode-cover {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-elev-2);
}

.episode-meta { min-width: 0; flex: 1; }

.episode-title {
  margin: 0 0 0.25rem;
  font-size: 1.075rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  word-break: break-word;
}

.episode-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.825rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.episode-sub .listened-badge {
  color: var(--listened);
  font-weight: 600;
}

.episode-description {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.925rem;
  line-height: 1.55;
}

.episode-player audio {
  width: 100%;
  display: block;
}

.episode-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.episode-controls .speed-control {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
}

.episode-controls .speed-control select {
  background: transparent;
  color: var(--text);
  border: none;
  font: inherit;
  padding: 0.05rem 0.15rem;
  -webkit-appearance: none;
  appearance: none;
}

.episode-controls .speed-control select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.episode-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  font-size: 0.85rem;
  margin-left: auto;
}

.episode-links a {
  white-space: nowrap;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------- breakpoints */

@media (min-width: 600px) {
  .episode-head { gap: 1.125rem; }
  .episode-cover { width: 120px; height: 120px; }
  .episode-title { font-size: 1.175rem; }
}

@media (min-width: 760px) {
  .site-header { padding: 1.75rem 1.5rem 1.25rem; }
  main { padding: 1.5rem; }
  .episode { padding: 1.25rem; }
}
