/* 
  Feuille de styles minimale pour le portail des classes
  - Variables pour couleurs/espaces
  - Grille responsive
  - Focus visibles et contrastés
  - BEM-like classes
*/

:root {
  --bg: #0b1220;
  --surface: #121a2a;
  --surface-2: #0f1626;
  --text: #e6edf6;
  --muted: #a5b4c7;
  --primary: #60a5fa;
  --primary-2: #3b82f6;
  --border: #20304d;
  --ring: #93c5fd;
  --error: #f87171;

  --radius: 14px;
  --radius-sm: 10px;

  --container: 1100px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --shadow: 0 6px 24px rgba(2, 6, 23, 0.5);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: radial-gradient(1200px 800px at 20% 5%, #0e1830, #091021), var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  padding: var(--space-8) 0 var(--space-6);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}

.site-title {
  margin: 0 0 var(--space-2);
  font-size: clamp(22px, 3.5vw, 32px);
}

.site-subtitle {
  margin: 0 0 var(--space-6);
  color: var(--muted);
}

.search {
  position: relative;
  display: flex;
  gap: var(--space-3);
  align-items: center;
  max-width: 520px;
}

.search__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.search__input {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 40px 10px 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.search__input:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(147,197,253,0.25);
}

.search__btn {
  position: absolute;
  right: 6px;
  border-radius: var(--radius-sm);
  opacity: .8;
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .06s ease;
}

.btn:hover { background: #172138; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(147,197,253,0.35);
  border-color: var(--ring);
}

.toolbar {
  margin: var(--space-6) 0 var(--space-4);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
}

.status {
  min-height: 1.2em;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-6);
  padding-bottom: var(--space-8);
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: clip;
}

.card__link {
  display: grid;
  text-decoration: none;
  color: inherit;
  grid-template-rows: 140px auto;
  height: 100%;
}

.card__media {
  margin: 0;
  background: #0a1326;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--border);
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__body { padding: var(--space-4); }

.card__title {
  margin: 0 0 var(--space-2);
  font-size: 18px;
}

.card__meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.card__slug {
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.35);
  color: #cfe8ff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-6) 0;
  color: var(--muted);
}

/* Visually hidden (screen-reader only) */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Noscript block */
.noscript {
  margin: var(--space-6) auto;
  background: #261018;
  border: 1px solid #4d2030;
  color: #ffd5d5;
  padding: var(--space-4);
  border-radius: var(--radius);
}

/* Error badge inside status */
.status--error {
  color: #ffe4e6;
}

.retry-btn {
  margin-left: 8px;
  color: #111827;
  background: #fbbf24;
  border-color: #f59e0b;
}
.retry-btn:hover { background: #f59e0b; }
