/* ————— Plume : le livre et la machine ————— */

:root {
  --bg: #f7f3e8; --ink: #2f2a22; --faded: #8a8070;
  --rule: #dcd4c2; --surface: #fbf8ef;
  --ring-ok: #d8d0be; --warn: #e07b26; --late: #b23b31; --oktext: #5f7a52;
  --serif: Georgia, "Times New Roman", serif;
  --mono: "Courier New", Courier, monospace;
}
.theme-machine {
  --bg: #0e1410; --ink: #d6e2cf; --faded: #6e816e;
  --rule: #263226; --surface: #131b14;
  --ring-ok: #3c4c3c; --warn: #ffb454; --late: #ff6b5e; --oktext: #7ee787;
  --serif: var(--mono);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--serif); line-height: 1.7;
  transition: background .3s, color .3s;
}
.page { max-width: 40rem; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
.hidden { display: none !important; }

/* ————— en-tête ————— */
.masthead { text-align: center; }
.brand { font-size: 1.9rem; font-weight: 500; letter-spacing: .45em; }
.tagline { color: var(--faded); font-style: italic; margin-top: .5rem; }
.rule { display: flex; align-items: center; gap: .8rem; margin: .8rem auto 0; }
.rule span { flex: 1; height: 1px; background: var(--rule); }
.rule em { color: var(--faded); font-size: .8rem; font-style: normal; }

/* ————— éléments génériques ————— */
.linklike {
  background: none; border: none; color: var(--faded);
  font: inherit; font-size: .8rem; font-style: italic;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.linklike.small { font-size: .75rem; }
.btn {
  font: inherit; font-size: .9rem; border: 1px solid var(--ink);
  background: transparent; color: var(--ink);
  padding: .5rem 1.1rem; cursor: pointer; transition: opacity .2s;
}
.btn.solid { background: var(--ink); color: var(--bg); }
.btn:disabled { opacity: .45; cursor: not-allowed; background: transparent; color: var(--faded); }

/* ————— auth ————— */
.auth { margin-top: 3rem; }
.tabs { display: flex; border-bottom: 1px solid var(--rule); }
.tab {
  flex: 1; background: none; border: none; font: inherit; font-style: italic;
  color: var(--faded); padding: .7rem; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.auth-form { margin-top: 1.5rem; display: flex; flex-direction: column; }
.auth-form label { font-size: .75rem; text-transform: uppercase; letter-spacing: .2em; color: var(--faded); margin-top: 1rem; }
.auth-form input {
  font: inherit; background: transparent; color: var(--ink);
  border: none; border-bottom: 1px solid var(--rule);
  padding: .35rem 0; outline: none; font-size: 1rem;
}
.auth-form .btn { margin-top: 1.8rem; }
.optional { text-transform: none; letter-spacing: 0; }
.field-hint { color: var(--faded); font-size: .8rem; font-style: italic; margin-top: .8rem; }
.auth-msg { margin-top: 1rem; font-size: .85rem; font-style: italic; color: var(--late); text-align: center; }

/* ————— ma page ————— */
.me { display: flex; align-items: center; gap: 1rem; margin-top: 2.5rem; }
.avatar-wrap { position: relative; width: 52px; height: 52px; cursor: pointer; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  position: absolute; top: 5px; left: 5px; background: #5b6470;
}
.avatar.placeholder { display: flex; align-items: center; justify-content: center; color: #fdfbf4; font-size: .8rem; }
.ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2.5px solid var(--ring-ok); pointer-events: none;
}
.ring.warn { border-color: var(--warn); }
.ring.late { border-color: var(--late); }
.me-info { flex: 1; }
.me-name { font-weight: 600; }
.me-status { font-size: .85rem; font-style: italic; color: var(--faded); }
.me-status.warn { color: var(--warn); } .me-status.late { color: var(--late); }
.me-meta { font-size: .75rem; font-style: italic; color: var(--faded); margin-top: .15rem; }
.me-actions { display: flex; flex-direction: column; gap: .5rem; align-items: flex-end; }

.flash { text-align: center; color: var(--oktext); font-style: italic; font-size: .85rem; margin-top: 1rem; }

/* ————— pastilles ————— */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.chip {
  font: inherit; font-size: .75rem; border: 1px solid var(--rule);
  background: transparent; color: var(--faded);
  border-radius: 999px; padding: .2rem .7rem; cursor: pointer;
}
.chip.on { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.terrains { margin-top: 1.5rem; }

/* ————— rédaction ————— */
.composer { margin-top: 1.5rem; border: 1px solid var(--rule); background: var(--surface); padding: 1.2rem; }
.composer textarea {
  width: 100%; margin-top: .8rem; background: transparent; color: var(--ink);
  font: inherit; font-size: 1.05rem; border: none; outline: none; resize: vertical; min-height: 7rem;
}
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .5rem; }
.char-count { font-size: .75rem; font-style: italic; color: var(--faded); }
.char-count.valid { color: var(--oktext); }

/* ————— le fil ————— */
.feed { margin-top: 1rem; }
.post { padding: .5rem 0 1rem; }
.asterism { text-align: center; color: var(--faded); margin: 2rem 0; font-size: 1.1rem; }
.post-head { display: flex; align-items: baseline; gap: .6rem; }
.post-head .avatar-wrap { width: 32px; height: 32px; cursor: default; }
.post-head .avatar { width: 24px; height: 24px; top: 4px; left: 4px; font-size: .55rem; }
.post-author { font-size: .8rem; text-transform: uppercase; letter-spacing: .15em; font-weight: 600; }
.post-when { font-size: .75rem; font-style: italic; color: var(--faded); }
.post-meta { font-size: .75rem; font-style: italic; color: var(--faded); margin: .2rem 0 0 2rem; }
.post-text { margin-top: .8rem; font-size: 1.05rem; text-align: justify; hyphens: auto; }
.post-text::first-letter { font-size: 1.6rem; font-weight: 600; }

.replies-toggle { margin-top: .7rem; }
.replies { margin-top: 1rem; margin-left: 1.2rem; border-left: 1px solid var(--rule); padding-left: 1rem; }
.reply { display: flex; gap: .6rem; margin-top: 1rem; }
.reply .avatar-wrap { width: 28px; height: 28px; flex-shrink: 0; }
.reply .avatar { width: 20px; height: 20px; top: 4px; left: 4px; font-size: .5rem; }
.reply-head { font-size: .75rem; }
.reply-head strong { text-transform: uppercase; letter-spacing: .15em; }
.reply-head em { color: var(--faded); }
.reply-text { font-size: .9rem; opacity: .85; margin-top: .2rem; }
.reply-composer textarea {
  width: 100%; background: transparent; color: var(--ink); font: inherit;
  font-size: .9rem; border: none; outline: none; resize: vertical; min-height: 2.5rem; margin-top: .8rem;
}
.reply-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.reply-hint { font-size: .7rem; font-style: italic; color: var(--faded); }

/* ————— colophon ————— */
.colophon { margin-top: 3.5rem; text-align: center; font-size: .75rem; color: var(--faded); }
.legend { margin-top: .5rem; }
.legend.italic { font-style: italic; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid; vertical-align: middle; }
.dot.ok { border-color: var(--ring-ok); } .dot.warn { border-color: var(--warn); } .dot.late { border-color: var(--late); }
