/*
 * Site du serveur de mises à jour (https://sync.fairweb-factory.fr), aux couleurs de la page d'admin
 * (admin/src/styles/variables.css) : sarcelle et anthracite du logo Fairweb Factory, bannière sur le même fond.
 * Copié dans assets/ par web/build.mjs, avec les images et la police qu'il cite. Aucun style inline : la politique
 * de sécurité du contenu (web/.htaccess) n'autorise que cette feuille.
 */

@font-face {
  font-family: "Fws Montserrat";
  src: url("montserrat-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --page: #f4f6f6;
  --surface: #fff;
  --surface-muted: #eef3f3;
  --text: #1d2327;
  --text-muted: #50575e;
  --border: #d5dcdc;
  --brand: #20a8a0;
  --brand-dark: #137f79;
  --brand-light: #8fdcd5;
  --banner: #0b1515;
  --banner-text: #fff;
  --banner-text-muted: rgba(255, 255, 255, 0.78);
  --banner-shade: linear-gradient(100deg, rgba(8, 16, 16, 0.94) 0%, rgba(8, 16, 16, 0.8) 34%, rgba(0, 72, 68, 0.52) 68%, rgba(0, 128, 120, 0.3) 100%);
  --code: #e4eded;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-display: "Fws Montserrat", var(--font);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.05);
  --width: 960px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0f1818;
    --surface: #162222;
    --surface-muted: #1c2b2b;
    --text: #e6eeee;
    --text-muted: #a5b3b3;
    --border: #2a3b3b;
    --brand-dark: #5cc9c1;
    --code: #223434;
    --shadow: none;
  }
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.6 var(--font);
}

a {
  color: var(--brand-dark);
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--code);
  font: 0.9em var(--font-mono);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.25;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 600;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Bannière : fond abstrait sous un voile anthracite qui vire au sarcelle, comme la page d'admin. */

.banner {
  background: var(--banner-shade), url("banner-background.webp") center / cover, var(--banner);
  color: var(--banner-text);
}

.banner-inner {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
  max-width: var(--width);
  margin: 0 auto;
  padding: 3rem 1rem;
}

.banner h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 300;
  letter-spacing: 0.01em;
}

.banner h1 span {
  color: var(--brand-light);
  font-weight: 600;
}

.tagline {
  max-width: 36rem;
  margin: 0.75rem 0 0;
  color: var(--banner-text-muted);
  font-size: 1.1rem;
}

.banner-logo {
  flex: none;
  padding: 0.6rem;
  border-radius: var(--radius);
  background: #fff;
  line-height: 0;
}

.banner-logo img {
  width: 96px;
  height: auto;
}

/* Contenu */

main {
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

main > section {
  margin-top: 3rem;
}

.card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* Dernière version, à cheval sur la bannière. */

.latest {
  position: relative;
  margin-top: -1.5rem;
}

.latest-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.latest h2 {
  margin: 0;
}

.badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1em 0.6em;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.8em;
  vertical-align: 0.1em;
}

.meta {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  background: var(--brand-dark);
  color: #fff;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s ease;
}

@media (prefers-color-scheme: dark) {
  .button {
    background: var(--brand);
    color: #062120;
  }
}

.button:hover {
  background: var(--brand);
}

.button small {
  font-weight: 400;
  opacity: 0.85;
}

.notes {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.notes h3 {
  margin: 0 0 0.5rem;
}

/* En bref */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.features li {
  padding: 1.1rem 1.25rem;
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.features h3 {
  margin: 0 0 0.35rem;
}

.features p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.steps {
  padding-left: 1.4rem;
}

.steps li + li {
  margin-top: 0.35rem;
}

/* Versions précédentes */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.releases {
  width: 100%;
  border-collapse: collapse;
}

.releases th,
.releases td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.releases thead th {
  background: var(--surface-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.releases tbody tr:last-child > * {
  border-bottom: 0;
}

.releases .links {
  text-align: right;
}

/* Journal des modifications : sections du README, converties par web/build.mjs. */

.release-notes {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-margin-top: 1rem;
}

.release-notes + .release-notes {
  margin-top: 1rem;
}

.release-notes:target {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand);
}

.release-notes h3 {
  margin: 0;
  font-size: 1.25rem;
}

.release-notes time {
  margin-left: 0.5rem;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 400;
}

.release-notes h4,
.notes h4 {
  margin: 1rem 0 0.25rem;
  color: var(--brand-dark);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.release-notes ul,
.notes ul {
  margin: 0;
  padding-left: 1.25rem;
}

.release-notes li + li,
.notes li + li {
  margin-top: 0.35rem;
}

footer {
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 600px) {
  .banner-inner {
    flex-direction: column-reverse;
    align-items: flex-start;
    padding: 2rem 1rem 2.5rem;
  }

  .banner-logo img {
    width: 64px;
  }

  .button {
    width: 100%;
  }
}
