/* Land Between the Rivers - shared styles.
   Large type and strong contrast so it's easy to read for every generation. */

:root {
  --bg: #f6f2ea;
  --card: #ffffff;
  --ink: #23211d;
  --muted: #5e5a52;
  --line: #ddd5c6;
  --river: #24566b;
  --river-dark: #173d4d;
  --earth: #8a5a2b;
  --ok-bg: #e5f4e4;
  --ok-ink: #1f5b23;
  --err-bg: #fbebeb;
  --err-ink: #8a1f1f;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.55 Georgia, 'Times New Roman', serif;
}

h1, h2, h3 { line-height: 1.2; color: var(--river-dark); }
h1 { font-size: 1.9rem; margin: 0 0 .4em; }
h2 { font-size: 1.35rem; margin: 1.4em 0 .5em; }
a { color: var(--river); }
p { margin: 0 0 1em; }

main { max-width: 760px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
main.narrow { max-width: 460px; }

/* ---------- Top navigation ---------- */
#nav {
  background: var(--river-dark);
  color: #fff;
  padding: .6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem 1rem;
}
#nav .brand { color: #fff; font-weight: bold; font-size: 1.1rem; text-decoration: none; }
#nav .nav-links { display: flex; flex-wrap: wrap; gap: .2rem .9rem; align-items: center; }
#nav .nav-links a, #nav .link-button { color: #d9ecf3; font: inherit; font-size: 1rem; text-decoration: none; }
#nav a[aria-current="page"] { color: #fff; text-decoration: underline; }
.link-button { background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- Cards and forms ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

label { display: block; font-weight: bold; margin: .9rem 0 .3rem; }
.hint { font-weight: normal; color: var(--muted); font-size: .9rem; }

input[type=text], input[type=email], input[type=password], textarea {
  width: 100%;
  font: inherit;
  padding: .7rem .8rem;
  border: 1px solid #b9b0a0;
  border-radius: 8px;
  background: #fffdf9;
}
textarea { min-height: 7rem; resize: vertical; }
.search-row { display: flex; gap: .5rem; align-items: stretch; }
.search-row input { flex: 1; min-width: 0; }
.result-list { list-style: none; padding: 0; margin: .5rem 0 0; }
.result-list li { margin: .3rem 0; }
input:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid #7fb4c8;
  outline-offset: 1px;
}

button.primary, a.button {
  display: inline-block;
  font: inherit;
  font-weight: bold;
  background: var(--river);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: .75rem 1.3rem;
  margin-top: 1.1rem;
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
}
button.primary:hover, a.button:hover { background: var(--river-dark); }
button.primary[disabled] { opacity: .6; cursor: wait; }
button.primary.full { width: 100%; }

button.small {
  font: inherit;
  font-size: .9rem;
  padding: .4rem .8rem;
  border-radius: 6px;
  border: 1px solid #b9b0a0;
  background: #fff;
  cursor: pointer;
  min-height: 38px;
}
button.small.danger { color: var(--err-ink); border-color: #d9a3a3; }

.message { padding: .75rem 1rem; border-radius: 8px; margin: 1rem 0 0; }
.message.error { background: var(--err-bg); color: var(--err-ink); }
.message.ok { background: var(--ok-bg); color: var(--ok-ink); }

.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Landing page tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 6px solid var(--earth);
  border-radius: var(--radius);
  padding: 1rem;
  text-decoration: none;
  color: var(--ink);
}
.tile strong { display: block; font-size: 1.15rem; color: var(--river-dark); }
.tile span { color: var(--muted); font-size: .95rem; }
.tile.soon { opacity: .6; border-left-color: var(--line); }
a.tile:hover { border-color: var(--river); }

/* ---------- People ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #d7e6ec; }
.avatar.sm { width: 40px; height: 40px; }
.avatar.md { width: 64px; height: 64px; }
.avatar.lg { width: 128px; height: 128px; }
.avatar.initials {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--river-dark); font-weight: bold; font-family: Arial, sans-serif;
}
.avatar.lg.initials { font-size: 2.6rem; }

.person-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.person-head h1 { margin: 0; }

.list-row {
  display: flex; gap: .8rem; align-items: center; flex-wrap: wrap;
  padding: .8rem 0; border-top: 1px solid var(--line);
}
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1 1 200px; min-width: 0; }
.list-row .actions { display: flex; gap: .4rem; flex-wrap: wrap; }

.badge {
  display: inline-block; font-size: .8rem; font-family: Arial, sans-serif;
  padding: .1rem .5rem; border-radius: 99px; background: #e7f1fb; color: var(--river-dark);
  vertical-align: middle;
}
.badge.warn { background: #f9eeda; color: #7a4b00; }
.badge.bad { background: var(--err-bg); color: var(--err-ink); }
.badge.good { background: var(--ok-bg); color: var(--ok-ink); }

.invite-link {
  word-break: break-all; background: #f0efec; padding: .6rem .8rem; border-radius: 8px;
  font-family: Consolas, monospace; font-size: .95rem;
}

.welcome-banner { margin-bottom: 1.4rem; }
.welcome-banner p { color: var(--muted); }

/* ---------- Steps 2-7 additions ---------- */
main.wide { max-width: 1000px; }
select, input[type=date] {
  font: inherit; padding: .6rem .7rem; border: 1px solid #b9b0a0;
  border-radius: 8px; background: #fffdf9; max-width: 100%;
}
input[type=file] { font: inherit; font-size: .95rem; max-width: 100%; }
label.check { font-weight: normal; display: flex; gap: .5rem; align-items: center; }
label.check input { width: 1.3rem; height: 1.3rem; }
.small-text { font-size: .88rem; }
.grow { flex: 1 1 200px; min-width: 0; }

/* People list links */
a.person-link { color: inherit; text-decoration: none; }
a.person-link:hover strong { text-decoration: underline; color: var(--river); }
.avatar.xs { width: 32px; height: 32px; font-size: .8rem; }

/* News feed */
.post-head { display: flex; gap: .7rem; align-items: center; margin-bottom: .6rem; }
.post-body p:last-child { margin-bottom: .6rem; }
.post-body textarea { margin-bottom: .4rem; }
.post-photo { display: block; max-width: 100%; max-height: 560px; border-radius: 8px; margin: .4rem 0 .6rem; }
.post-actions { display: flex; gap: .4rem; margin-bottom: .4rem; }
.comments { border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .4rem; }
.comment { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem 0; font-size: .95rem; }
.comment p { margin: 0; }
.comment-form { display: flex; gap: .4rem; margin-top: .4rem; }
.comment-form input { flex: 1; padding: .5rem .7rem; }
.more { display: block; margin: 0 auto; }

/* Announcements */
.announcement.pinned, .announcement-teaser.pinned { border-left: 6px solid var(--earth); }
a.announcement-teaser, a.article-link {
  display: block; color: inherit; text-decoration: none;
}
a.announcement-teaser span, a.article-link span { display: block; }
a.announcement-teaser:hover, a.article-link:hover { border-color: var(--river); }
a.article-link strong { font-size: 1.15rem; color: var(--river-dark); }
a.article-link p { margin: .4rem 0; }
.article-body { font-size: 1.05rem; }

/* Filter buttons (history topics, map kinds) */
.topic-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0; }
button.small.active { background: #e7f1fb; color: var(--river-dark); border: 2px solid var(--river); font-weight: bold; }
.dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; flex-shrink: 0; }
.thumb { display: block; max-width: 200px; border-radius: 8px; margin-bottom: .4rem; }

/* Map */
.map { height: 60vh; min-height: 320px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; }
.place-link { color: var(--river); text-align: left; font-size: 1rem; text-decoration: underline; }
.leaflet-popup-content { font: 15px/1.45 Georgia, serif; }
.leaflet-popup-content p { margin: .4rem 0; }
