/* EverWilds shared component styles.
   References global --sh-* tokens defined in base.html. */

/* ── Page wrappers ──────────────────────────────────────── */
.ew-board { color: var(--sh-ink); max-width: 760px; margin: 1.5rem auto 3rem; }
.ew-pack  { color: var(--sh-ink); max-width: 860px; margin: 1.5rem auto 3rem; }
.ew-profile { color: var(--sh-ink); }

/* ── Navigation ─────────────────────────────────────────── */
.ew-back {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--sh-muted); text-decoration: none;
}
.ew-back:hover { color: var(--sh-accent); }

/* ── Button ─────────────────────────────────────────────── */
.ew-submit {
  background: var(--sh-accent); color: #fff; border: none;
  border-radius: 8px; padding: .4rem 1.1rem; font-size: .9rem; cursor: pointer;
}
.ew-submit:hover { background: var(--sh-bark); }

/* ── Empty state ────────────────────────────────────────── */
.ew-none { color: var(--sh-muted); font-style: italic; padding: .4rem .2rem; }

/* ── Edit chip ──────────────────────────────────────────── */
.ew-edit {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  text-decoration: none; color: var(--sh-muted);
  border: 1px solid var(--sh-line); border-radius: 6px; padding: .1rem .5rem;
}
.ew-edit:hover { color: var(--sh-accent); border-color: var(--sh-accent); }

/* ── Spectral section heading ───────────────────────────── */
.ew-h {
  font-family: 'Spectral', Georgia, serif; font-weight: 600; font-size: 1.35rem;
  letter-spacing: .02em; color: var(--sh-accent); text-transform: lowercase;
  margin: 0 0 .75rem;
}
.ew-h-row {
  display: flex; justify-content: space-between; align-items: baseline;
}

/* ── Collapsible (details / summary) ───────────────────── */
.ew-lore-toggle { margin: 1.25rem 0; }
.ew-lore-toggle > summary {
  cursor: pointer; font-family: 'Spectral', Georgia, serif;
  color: var(--sh-accent); font-size: 1.05rem; user-select: none; padding: .15rem 0;
}
.ew-lore-toggle > summary:hover { color: var(--sh-bark); }
.ew-lore-toggle > summary::marker { color: var(--sh-muted); }

/* ── Board header row ───────────────────────────────────── */
.ew-board-header {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 2px solid var(--sh-line); padding-bottom: .5rem; margin-bottom: 1.25rem;
}
.ew-board-header h1 {
  font-family: 'Spectral', Georgia, serif; font-size: 1.7rem; margin: 0; color: var(--sh-bark);
}

/* ── Post / new-thread form ─────────────────────────────── */
.ew-post-form {
  background: var(--sh-panel); border: 1px solid var(--sh-line);
  border-radius: 12px; padding: 1rem 1.25rem; margin: .75rem 0;
}
.ew-post-form h2 {
  font-family: 'Spectral', serif; color: var(--sh-accent); font-size: 1.1rem; margin: 0 0 .75rem;
}
.ew-post-form input[type=text],
.ew-post-form textarea {
  width: 100%; border: 1px solid var(--sh-line); border-radius: 8px;
  padding: .45rem .7rem; font-size: .95rem; background: #fff;
  color: var(--sh-ink); margin-bottom: .6rem;
}
.ew-post-form textarea { height: 95px; resize: vertical; }
.ew-post-form input:focus,
.ew-post-form textarea:focus { outline: none; border-color: var(--sh-accent); }

/* ── Board post cards (thread detail) ──────────────────── */
.ew-post {
  background: #fff; border: 1px solid var(--sh-line); border-radius: 11px;
  padding: .85rem 1.1rem; margin-bottom: .75rem;
}
.ew-post-meta { font-size: .75rem; color: var(--sh-muted); margin-bottom: .45rem; }
.ew-post-meta strong { color: var(--sh-ink); font-size: .85rem; }
.ew-post-body { line-height: 1.7; }
.ew-post-body p:last-child { margin-bottom: 0; }

/* ── Reply form ─────────────────────────────────────────── */
.ew-reply-form {
  background: var(--sh-panel); border: 1px solid var(--sh-line);
  border-radius: 12px; padding: 1rem 1.25rem; margin-top: 1.25rem;
}
.ew-reply-form h2 {
  font-family: 'Spectral', serif; color: var(--sh-accent); font-size: 1.05rem; margin: 0 0 .6rem;
}
.ew-reply-form textarea {
  width: 100%; border: 1px solid var(--sh-line); border-radius: 8px;
  padding: .45rem .7rem; font-size: .95rem; background: #fff;
  color: var(--sh-ink); height: 100px; resize: vertical;
}
.ew-reply-form textarea:focus { outline: none; border-color: var(--sh-accent); }

/* ── Inline note cards (board embedded in pack detail) ─── */
.ew-note {
  background: #fff; border: 1px solid var(--sh-line); border-radius: 11px;
  padding: .85rem 1.1rem; margin-top: .6rem;
}
.ew-note-header { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
.ew-note-title { font-weight: 600; font-size: .95rem; }
.ew-note-title a { color: var(--sh-ink); text-decoration: none; }
.ew-note-title a:hover { color: var(--sh-accent); }
.ew-note-meta { font-size: .75rem; color: var(--sh-muted); }
.ew-note-body { line-height: 1.7; font-size: .95rem; }
.ew-note-body p:last-child { margin-bottom: 0; }
.ew-note-footer { margin-top: .5rem; font-size: .78rem; }
.ew-note-footer a { color: var(--sh-muted); text-decoration: none; }
.ew-note-footer a:hover { color: var(--sh-accent); }

/* ── Thread list (pack board standalone) ────────────────── */
.ew-thread {
  background: #fff; border: 1px solid var(--sh-line); border-radius: 11px;
  padding: .75rem 1rem; margin-bottom: .65rem;
  display: flex; align-items: center; gap: .75rem;
  text-decoration: none; color: var(--sh-ink);
}
.ew-thread:hover { border-color: var(--sh-accent); }
.ew-thread-body { flex: 1; min-width: 0; }
.ew-thread-title { font-weight: 600; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ew-thread-meta { font-size: .75rem; color: var(--sh-muted); margin-top: .15rem; }
.ew-thread-count { flex: 0 0 auto; font-size: .8rem; color: var(--sh-muted); text-align: right; }

/* ── Online dot ─────────────────────────────────────────── */
.ew-dot { width: .5rem; height: .5rem; border-radius: 50%; background: #b9b1a6; flex: 0 0 auto; }
.ew-dot.on,
.ew-presence.is-online .ew-dot { background: #5fa052; box-shadow: 0 0 0 3px rgba(95,160,82,.2); }
.ew-member .ew-dot { margin-left: auto; }

/* ── Presence indicator ─────────────────────────────────── */
.ew-presence {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .9rem; color: var(--sh-muted); margin-bottom: 1rem;
}
.ew-presence.is-online { color: var(--sh-accent); font-weight: 600; }

/* ── Field panel (stats / skills) ───────────────────────── */
.ew-field { border: 1px solid var(--sh-line); border-radius: 10px; overflow: hidden; margin-bottom: 1rem; }
.ew-field-head {
  background: var(--sh-accent-soft); color: var(--sh-accent); font-weight: 600;
  padding: .5rem .9rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
}
.ew-field-body { padding: .8rem .9rem; }

/* ── Tales list (character profile) ────────────────────── */
.ew-tale {
  display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .2rem;
  border-bottom: 1px dashed var(--sh-line); text-decoration: none; color: var(--sh-ink);
}
.ew-tale:hover { background: var(--sh-panel); }
.ew-tale-num { font-family: 'Spectral', serif; font-weight: 600; color: var(--sh-accent); }
.ew-tale-meta { color: var(--sh-muted); font-size: .88rem; }

/* ── Pack detail: crest header ──────────────────────────── */
.ew-crest {
  position: relative; border: 1px solid var(--sh-line); border-radius: 16px;
  padding: 2rem 1.5rem; text-align: center; overflow: hidden;
  background: linear-gradient(160deg, #f3efe6 0%, #e7ecdd 60%, #dfe6cf 100%);
}
.ew-crest .ew-paw { font-size: 2.4rem; line-height: 1; opacity: .5; }
.ew-crest h1 {
  font-family: 'Spectral', Georgia, serif; font-size: 2.8rem;
  margin: .3rem 0 .1rem; color: var(--sh-bark); letter-spacing: .01em;
}
.ew-crest .ew-sub { color: var(--sh-muted); font-style: italic; }

/* ── Pack detail: stat tiles ────────────────────────────── */
.ew-tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: .75rem; margin: 1.25rem 0 1.75rem;
}
.ew-tile {
  background: var(--sh-panel); border: 1px solid var(--sh-line); border-radius: 11px;
  padding: .8rem .6rem; text-align: center;
}
.ew-tile .ew-num { font-family: 'Spectral', serif; font-size: 1.5rem; font-weight: 600; color: var(--sh-bark); }
.ew-tile .ew-lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--sh-muted); }

/* ── Pack detail: roster sections ───────────────────────── */
.ew-pack .ew-section { margin-bottom: 1.5rem; }
.ew-pack .ew-section h2 {
  font-family: 'Spectral', serif; color: var(--sh-accent); text-transform: lowercase;
  font-size: 1.25rem; margin: 0 0 .6rem;
  border-bottom: 1px solid var(--sh-line); padding-bottom: .25rem;
}
.ew-role-row { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; }
.ew-role-row .ew-section { flex: 1; margin-bottom: 0; }

/* ── Pack detail: member cards ──────────────────────────── */
.ew-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.ew-member {
  display: flex; align-items: center; gap: .6rem; background: #fff;
  border: 1px solid var(--sh-line); border-radius: 11px; padding: .55rem .7rem;
}
.ew-avatar {
  width: 2.2rem; height: 2.2rem; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(160deg, #e9efe0, #dfe6cf);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.ew-member a { color: var(--sh-ink); font-weight: 600; text-decoration: none; }
.ew-member a:hover { color: var(--sh-accent); }
.ew-member .ew-tag { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sh-muted); }

/* ── Pack detail: description box ───────────────────────── */
.ew-desc {
  background: #fff; border: 1px solid var(--sh-line); border-left: 4px solid var(--sh-accent);
  border-radius: 10px; padding: 1rem 1.25rem; margin: 1.25rem 0 0; line-height: 1.7; color: #52483f;
}
.ew-desc.empty { color: var(--sh-muted); font-style: italic; }

/* ── Character profile: layout ──────────────────────────── */
.ew-profile .ew-section {
  padding: 1.25rem 0; border-bottom: 1px solid var(--sh-line); line-height: 1.7; color: #52483f;
}
.ew-profile .ew-section:last-child { border-bottom: 0; }
