/* newsletter.vashonpto.com: family pages and the board's sender.
   Tokens match site/assets/css/site.css so it feels like the same place. */

:root {
  --cream: #FAF5EA;
  --paper: #FFFFFF;
  --line: #EADFC8;
  --green: #1E4D3B;
  --green-dark: #163B2D;
  --ink: #33302A;
  --muted: #5A554B;
  --pink: #FBDAD3;
  --pink-deep: #B3454E;
  --peri: #99ACE7;
  --leaf: #82C277;
  --gold: #F3C947;
  --ces: #FBDAD3;  --on-ces: #7A2C33;
  --mcm: #D6DEF7;  --on-mcm: #1E2B5E;
  --vhs: #D7EDD2;  --on-vhs: #1E4D3B;
  --display: 'HelloImperfectRegular', 'Nunito Sans', sans-serif;
  --body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.55 var(--body); }
a { color: var(--green); }
[hidden] { display: none !important; }
h1, h2, h3 { color: var(--green); line-height: 1.2; margin: 0; }
h1 { font-family: var(--display); font-weight: normal; font-size: clamp(30px, 6vw, 42px); }
h2 { font-size: 20px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 800; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* -- layout --------------------------------------------------------------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar .brand { white-space: nowrap; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green); font-weight: 800; }
.topbar .brand img { height: 36px; width: auto; display: block; }
.topbar .who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); min-width: 0; }
.topbar .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 28px 16px 64px; }
.narrow { max-width: 560px; }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.center-page .card { width: 100%; max-width: 440px; text-align: center; }
.logo-lg { width: 200px; height: auto; margin: 0 auto 18px; display: block; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card + .card { margin-top: 16px; }
.stack > * + * { margin-top: 16px; }

/* -- form bits ------------------------------------------------------------ */
label.field { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=search], select {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px;
}
input:focus, select:focus, .btn:focus-visible, .chip input:focus-visible + span { outline: 3px solid var(--peri); outline-offset: 1px; border-color: var(--green); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 800;
  border: 0; border-radius: 999px; padding: 11px 22px; cursor: pointer; background: var(--green); color: #fff; text-decoration: none; }
.btn:hover { background: var(--green-dark); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: transparent; color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.btn.secondary:hover { background: #F1EBDD; }
.btn.gold { background: var(--gold); color: var(--ink); }
.btn.danger { background: transparent; color: var(--pink-deep); box-shadow: inset 0 0 0 1.5px var(--pink-deep); }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn.link { white-space: nowrap; background: none; color: var(--muted); padding: 4px 6px; font-weight: 600; text-decoration: underline; }
.btn.block { width: 100%; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14px;
  border: 1.5px solid var(--line); background: #fff; color: var(--muted); user-select: none; }
.chip input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.chip input:disabled + span { opacity: .6; }

.tag { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .02em; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tag.ces { background: var(--ces); color: var(--on-ces); }
.tag.mcm { background: var(--mcm); color: var(--on-mcm); }
.tag.vhs { background: var(--vhs); color: var(--on-vhs); }
.tag.grey { background: #EFE9DC; color: var(--muted); }
.tag.warn { background: #FCEFC4; color: #6B4A25; }
.tag.bad { background: var(--pink); color: var(--pink-deep); }

.notice { border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.notice.info { background: #FCEFC4; color: #5A4214; }
.notice.good { background: #DDF0D8; color: var(--green); }
.notice.bad { background: var(--pink); color: #7A2C33; }

/* -- kids editor ---------------------------------------------------------- */
.kid { display: grid; grid-template-columns: 1fr 150px auto; gap: 10px; align-items: center; }
.kid + .kid { margin-top: 10px; }
.kid .remove { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.kid .remove:hover { background: #F1EBDD; color: var(--pink-deep); }
@media (max-width: 480px) { .topbar .who span { display: none; } .kid { grid-template-columns: 1fr 120px auto; } }

/* -- admin ---------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs button { font: inherit; font-weight: 800; color: var(--muted); background: none; border: 0; padding: 10px 16px; cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--green); border-bottom-color: var(--green); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-size: 26px; color: var(--green); line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 700; }

.compose { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .compose { grid-template-columns: 1fr; } }
.audience-count { font-size: 15px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--cream); }
.audience-count b { color: var(--green); font-size: 22px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--green); width: 17px; height: 17px; flex: none; }

/* The min-height goes on the editable area itself, so a click anywhere in the box starts typing. */
#editor .ql-editor { min-height: 320px; font: 16px/1.6 var(--body); }
.ql-toolbar.ql-snow { border-color: var(--line) !important; border-radius: 12px 12px 0 0; background: #FDFBF6; }
.ql-container.ql-snow { border-color: var(--line) !important; border-radius: 0 0 12px 12px; background: #fff; font-family: var(--body) !important; font-size: 16px !important; }

.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); background: #FDFBF6; }
table.list td { padding: 11px 14px; border-bottom: 1px solid #F3ECDD; vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover td { background: #FDFAF2; }
table.list .email { color: var(--muted); font-size: 13px; word-break: break-all; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { flex: 1 1 220px; }
.toolbar select { width: auto; flex: 0 0 auto; }

/* -- dialogs -------------------------------------------------------------- */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); color: var(--ink); }
dialog::backdrop { background: rgba(30, 35, 30, .45); }
dialog .dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
dialog .dlg-body { padding: 20px 22px; overflow: auto; }
dialog .dlg-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 22px 20px; }
dialog.wide { width: min(760px, calc(100vw - 24px)); }
dialog iframe { width: 100%; height: 70vh; border: 0; background: var(--cream); border-radius: 12px; }
.close-x { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--green); color: #fff; font-weight: 700;
  padding: 12px 20px; border-radius: 999px; box-shadow: 0 6px 24px rgba(0,0,0,.18); z-index: 50; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--pink-deep); }
