/* ---- Variables & thème clair/sombre ---- */
:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #595959;
  --accent: #0b5cad;        /* contraste AA sur blanc */
  --accent-fg: #ffffff;
  --border: #c9c9c9;
  --surface: #f4f6f8;
  --focus: #c2410c;
  --maxw: 70rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --fg: #f1f1f1;
    --muted: #b9b9b9;
    --accent: #7db4ec;       /* contraste AA sur fond sombre */
    --accent-fg: #0a0f16;
    --border: #3a3f46;
    --surface: #1e2228;
    --focus: #ff9d54;
  }
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  font-size: 1.0625rem;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 2rem; margin: 0 0 .5rem; }
h2 { font-size: 1.5rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.2rem; }

a { color: var(--accent); }
a:hover { text-decoration: none; }

img { max-width: 100%; height: auto; }

/* ---- Accessibilité : focus visible partout ---- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Lecteurs d'écran uniquement */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Lien d'évitement */
.skip-link {
  position: absolute;
  left: 0; top: -3rem;
  background: var(--accent);
  color: var(--accent-fg);
  padding: .6rem 1rem;
  z-index: 100;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; }

/* Honeypot caché */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- En-tête ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding-top: .75rem;
  padding-bottom: .75rem;
}
.site-brand { margin: 0; font-weight: 700; font-size: 1.05rem; }
.site-brand a { color: var(--fg); text-decoration: none; }

.nav-list, .lang-switcher ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0; padding: 0;
}
.site-header nav a { color: var(--fg); text-decoration: none; padding: .25rem 0; }
.site-header nav a:hover { text-decoration: underline; }
.site-header nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; }
.lang-switcher { margin-left: auto; }
.lang-switcher [aria-current="true"] { font-weight: 700; }

/* ---- Hero ---- */
.hero { padding: 2.5rem 1.25rem 1rem; }
.hero-tagline { font-size: 1.3rem; color: var(--muted); margin: 0 0 1rem; }

/* ---- Grille d'apps ---- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2.5rem;
}
.app-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--surface);
}
.app-card-title { margin: 0 0 .35rem; }
.app-card-title a { text-decoration: none; }
.app-card-title a:hover { text-decoration: underline; }
.app-card-tagline { margin: 0 0 .75rem; }
.app-card-platforms { font-size: .9rem; color: var(--muted); }
.app-card-platforms .label { font-weight: 600; }

/* ---- Boutons ---- */
.btn {
  display: inline-block;
  padding: .55rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.btn:hover { background: var(--accent); color: var(--accent-fg); }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { filter: brightness(1.1); }

/* ---- Fiche app ---- */
.app-detail { padding-top: 1.5rem; }
.app-detail-tagline { font-size: 1.2rem; color: var(--muted); }
.app-shot { margin: 1.5rem 0; }
.app-shot img { border: 1px solid var(--border); border-radius: 8px; }
.app-shot figcaption { font-size: .9rem; color: var(--muted); margin-top: .4rem; }
.app-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 1.25rem 0; }
.app-meta dt { font-weight: 700; }
.app-meta dd { margin: 0; }
.app-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0; }

/* ---- Listes (blog) & prose ---- */
.prose { max-width: 44rem; }
.prose p, .prose li { font-size: 1.0625rem; }
.post-list { list-style: none; padding: 0; }
.post-item { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.post-item-title { margin: 0 0 .25rem; }
.post-meta { color: var(--muted); margin: .15rem 0 .6rem; font-size: .95rem; }
.back-link { margin-top: 2rem; }

/* ---- Formulaire de contact ---- */
.contact-form { max-width: 40rem; }
.form-row { margin: 0 0 1.1rem; }
.contact-form label { display: block; font-weight: 600; margin-bottom: .3rem; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: .6rem .7rem;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.contact-form textarea { resize: vertical; }
.contact-form button {
  padding: .6rem 1.4rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-fg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
}
.contact-form button[disabled] { opacity: .6; cursor: progress; }
.form-status { font-weight: 600; min-height: 1.5rem; }
.form-status.is-error { color: var(--focus); }

/* ---- Pied de page ---- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 3rem;
  padding: 1.5rem 0;
}
.footer-note { color: var(--muted); font-size: .9rem; }

/* ---- Préférence de mouvement réduit ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
