/* HOMEF — Health of Mother Earth Foundation · Announcement Lists
   Earth-tone design system. Adjust the tokens below to match exact brand hex codes. */

:root {
  /* Exact colors sampled from the HOMEF logo */
  --forest-900: #0b2f13;
  --forest-800: #10471c;
  --forest-700: #145722;
  --forest-600: #186725;   /* logo green */
  --forest-500: #1f8230;
  --leaf-400: #4aa25a;
  --leaf-100: #e3f0e5;
  --earth-500: #feba12;    /* logo amber */
  --earth-100: #fdf0d0;
  --teal-500: #41889b;     /* logo teal */
  --teal-100: #e2eef1;
  --paper: #f4f3ec;       /* warm off-white background */
  --card: #ffffff;
  --ink: #22281f;
  --muted: #6d7468;
  --border: #e0e0d4;
  --danger: #b23a2e;
  --danger-bg: #f9e8e5;
  --ok-bg: #e4f0e6;
  --ok-ink: #1b5e2f;
  --warn-bg: #f7ead9;
  --warn-ink: #8a5414;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(18, 41, 27, 0.06), 0 4px 16px rgba(18, 41, 27, 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

/* ---------- Top bar ---------- */

header.topbar {
  background: linear-gradient(135deg, var(--forest-900), var(--forest-700));
  color: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
header.topbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}
header.topbar .brand .logo-badge {
  width: 42px;
  height: 42px;
  flex: none;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
header.topbar .brand .logo-badge img { width: 32px; height: 32px; display: block; }
header.topbar .brand .brand-text { line-height: 1.2; }
header.topbar .brand .brand-org {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
}
header.topbar .brand .brand-app {
  font-size: 12px;
  color: #f3c94f;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
header.topbar form { margin: 0; }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a {
  color: #d6e6d8;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.topnav a:hover { color: #fff; text-decoration: underline; }
header.topbar button {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
header.topbar button:hover { background: rgba(255, 255, 255, 0.22); }

main { max-width: 980px; margin: 28px auto 64px; padding: 0 20px; }

/* ---------- Typography ---------- */

h1 { font-size: 24px; font-weight: 700; margin: 0 0 6px; color: var(--forest-900); letter-spacing: -0.01em; }
h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--forest-600);
  margin: 32px 0 10px;
}
.page-sub { color: var(--muted); margin: 0 0 20px; }

/* ---------- Cards & flash ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.flash {
  background: var(--leaf-100);
  border: 1px solid #c4dcc8;
  color: var(--ok-ink);
  border-radius: var(--radius);
  padding: 11px 16px;
  margin-bottom: 18px;
}

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td, tr:hover td { background: #fafaf5; }
td a { color: var(--forest-600); font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }

/* ---------- Forms ---------- */

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--forest-500);
  box-shadow: 0 0 0 3px rgba(58, 138, 77, 0.15);
}
textarea { min-height: 120px; resize: vertical; }
label { display: block; font-weight: 600; font-size: 13.5px; margin: 14px 0 5px; color: var(--forest-900); }
label .hint { font-weight: 400; color: var(--muted); }

/* ---------- Buttons ---------- */

button, .btn {
  display: inline-block;
  background: var(--forest-600);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, transform 0.05s;
}
button:hover, .btn:hover { background: var(--forest-500); }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary {
  background: #fff;
  color: var(--forest-700);
  border: 1px solid var(--border);
}
button.secondary:hover, .btn.secondary:hover { background: var(--leaf-100); }
button.danger, .btn.danger { background: transparent; color: var(--danger); padding: 5px 10px; }
button.danger:hover, .btn.danger:hover { background: var(--danger-bg); }
button.small, .btn.small { padding: 5px 12px; font-size: 13px; }

/* ---------- Layout helpers ---------- */

.row { display: flex; gap: 18px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 220px; }
.muted { color: var(--muted); font-size: 13px; }
.inline-form { display: inline; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Pills ---------- */

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 12px;
  font-weight: 700;
  background: #eeeee6;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.pill.sent, .pill.subscribed { background: var(--ok-bg); color: var(--ok-ink); }
.pill.sending, .pill.draft { background: var(--warn-bg); color: var(--warn-ink); }
.pill.info { background: var(--teal-100); color: var(--teal-500); }
.pill.failed, .pill.unsubscribed, .pill.cancelled { background: var(--danger-bg); color: var(--danger); }

/* ---------- Stats ---------- */

.statgrid { display: flex; gap: 36px; flex-wrap: wrap; margin-bottom: 6px; }
.stat { font-size: 30px; font-weight: 700; color: var(--forest-800); line-height: 1.1; }
.statgrid .muted { text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.1em; }

/* ---------- Login / public pages ---------- */

.center-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(31, 130, 48, 0.22), transparent 60%),
    radial-gradient(900px 480px at -10% 110%, rgba(254, 186, 18, 0.12), transparent 60%),
    radial-gradient(700px 400px at 110% 90%, rgba(65, 136, 155, 0.15), transparent 60%),
    var(--forest-900);
  padding: 24px;
}
.center-page .card { width: 400px; max-width: 100%; padding: 32px; }
.center-page .brand-block { text-align: center; margin-bottom: 18px; }
.center-page .brand-block img.logo { width: 76px; height: 76px; }
.center-page .brand-block .brand-org {
  font-weight: 700;
  color: var(--forest-800);
  margin-top: 8px;
  font-size: 15px;
}
.center-page .brand-block .brand-app {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.center-page h1 { font-size: 20px; text-align: center; }
.subtle-link { color: var(--muted); font-size: 13.5px; text-decoration: none; }
.subtle-link:hover { color: var(--forest-600); text-decoration: underline; }
.center-page p { color: var(--ink); }

details summary { cursor: pointer; font-weight: 600; margin: 8px 0; color: var(--muted); }

/* ---------- Help page ---------- */

.toc ol { margin: 8px 0 0; padding-left: 20px; columns: 2; }
.toc a { color: var(--forest-600); text-decoration: none; font-weight: 600; }
.toc a:hover { text-decoration: underline; }
code {
  background: #f0f0e7;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
}

/* ---------- Pagination ---------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.pager-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-page, .pager-current, .pager-ellipsis {
  display: inline-block;
  min-width: 32px;
  text-align: center;
  padding: 5px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
}
.pager-page { color: var(--forest-700); text-decoration: none; border: 1px solid var(--border); background: #fff; }
.pager-page:hover { background: var(--leaf-100); }
.pager-current { background: var(--forest-600); color: #fff; }
.pager-ellipsis { color: var(--muted); }

/* ---------- WYSIWYG editor ---------- */

.editor { border: 1px solid var(--border); border-radius: 8px; background: #fff; overflow: hidden; }
.editor:focus-within { border-color: var(--forest-500); box-shadow: 0 0 0 3px rgba(58, 138, 77, 0.15); }
.editor-toolbar {
  display: flex; gap: 4px; flex-wrap: wrap; align-items: center;
  padding: 7px 9px; background: #f7f7f0; border-bottom: 1px solid var(--border);
}
.editor-toolbar button {
  background: #fff; border: 1px solid var(--border); color: var(--ink);
  padding: 3px 10px; font-size: 13px; font-weight: 600; border-radius: 6px; cursor: pointer;
}
.editor-toolbar button:hover { background: var(--leaf-100); border-color: var(--leaf-400); }
.editor-sep { width: 1px; height: 20px; background: var(--border); margin: 0 5px; }
.editor-area { min-height: 220px; padding: 14px 16px; outline: none; }
.editor-area h2 { font-size: 20px; margin: 0.5em 0 0.3em; text-transform: none; letter-spacing: 0; color: var(--ink); }
.editor-area a { color: var(--forest-600); }
#ed-src { border: none; border-radius: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; box-shadow: none; }

pre { background: #f7f7f0; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; }
