/* tricotmail — façade publique. Aucune ressource externe (polices système, pas de script). */

:root {
  --paper:  #f2f3f0;   /* fond, gris-blanc froid */
  --ink:    #1c2433;   /* texte, encre bleu marine */
  --muted:  #5b6472;   /* texte secondaire */
  --rule:   #c9ccc6;   /* traits, bordures de champs */
  --wool:   #2e4a7d;   /* accent : laine indigo (bouton, focus, liens) */
  --wool-d: #233a63;   /* accent foncé (survol) */

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --seam: 22px;        /* largeur de la couture de mailles */
}

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

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--wool); text-underline-offset: 0.18em; }
a:hover { color: var(--wool-d); }
:focus-visible { outline: 3px solid var(--wool); outline-offset: 3px; }

/* ---------- Mise en page : photo | couture | panneau ---------- */

.page {
  display: grid;
  grid-template-columns: minmax(280px, 42vw) var(--seam) 1fr;
  min-height: 100vh;
}

.photo {
  margin: 0;
  position: sticky;                 /* la photo reste en place quand une page longue défile */
  top: 0;
  height: 100vh;
  align-self: start;
  overflow: hidden;
  background: #8a6a4f;              /* teinte bois, visible tant que l'image charge */
}
.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Couture : une colonne de mailles en V, comme le bord d'un tricot */
.seam {
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='M4 5 L11 15 L18 5' fill='none' stroke='%232e4a7d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' opacity='.55'/%3E%3C/svg%3E");
  background-repeat: repeat-y;
  background-position: center top;
}

.panel {
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.5rem, 5vw, 5rem);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.lang { display: flex; gap: 0.9rem; font-size: 0.9rem; }
.lang a { color: var(--muted); text-decoration: none; }
.lang a:hover { color: var(--ink); text-decoration: underline; }
.lang [aria-current="true"] { color: var(--ink); font-weight: 600; }

/* ---------- Contenu principal ---------- */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 30rem;
  padding: 3rem 0;
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 5.2vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
}

.lead {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.45;
  margin: 0 0 0.5rem;
}

.motto {
  color: var(--muted);
  margin: 0 0 2.5rem;
}
.motto:lang(fr) { font-style: italic; }   /* sur la page anglaise : citation en français */
.motto:lang(fr):is(html:lang(fr) *) { font-style: normal; }

/* ---------- Connexion ---------- */

.login {
  border-top: 2px solid var(--ink);
  padding-top: 1.5rem;
}

.login h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
}

.field { margin-bottom: 1rem; }

.field label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.field input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
}
.field input:focus-visible { outline-offset: 0; border-color: var(--wool); }

.login button {
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--wool);
  border: 0;
  border-radius: 6px;
  padding: 0.75rem 1.4rem;
  margin-top: 0.5rem;
  cursor: pointer;
}
.login button:hover { background: var(--wool-d); }

.error {
  margin: 0 0 1.25rem;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid #a23b2a;
  background: #f7e9e6;
  color: #6e2418;
  font-size: 0.95rem;
}

.invite {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 1.25rem 0 0;
}

/* ---------- Pied de page ---------- */

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }

/* ---------- Pages de texte (mentions légales) ---------- */

.doc main { max-width: 40rem; justify-content: flex-start; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.doc h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
  margin: 2.25rem 0 0.6rem;
}
.doc p, .doc ul { margin: 0 0 0.9rem; }
.doc ul { padding-left: 1.2rem; }
.doc address { font-style: normal; margin: 0 0 0.9rem; }
.back { display: inline-block; margin-bottom: 1.5rem; font-size: 0.9rem; }

/* ---------- Mobile : la photo devient un bandeau, la couture horizontale ---------- */

@media (max-width: 760px) {
  .page {
    grid-template-columns: 1fr;
    grid-template-rows: 34vh var(--seam) auto;
  }
  .seam {
    background-repeat: repeat-x;
    background-position: left center;
  }
  .photo { position: relative; height: 34vh; }
  .photo img { object-position: center 40%; }
  main { padding: 2rem 0; }
  .doc .photo { display: none; }
  .doc .page { grid-template-rows: auto; }
  .doc .seam { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
