/* Refugia Hub: colors and fonts from the Refugia brand profile.
   Fonts are served from this site (no Google requests, kinder to privacy). */

@font-face { font-family: 'Quicksand'; font-weight: 500; font-display: swap; src: url('/static/fonts/quicksand-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Quicksand'; font-weight: 600; font-display: swap; src: url('/static/fonts/quicksand-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Quicksand'; font-weight: 700; font-display: swap; src: url('/static/fonts/quicksand-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url('/static/fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 400; font-style: italic; font-display: swap; src: url('/static/fonts/poppins-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url('/static/fonts/poppins-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url('/static/fonts/poppins-latin-600-normal.woff2') format('woff2'); }

:root {
  --forest: #1D2F19;
  --plum: #6D454E;
  --mist: #EEEFF4;
  --white: #FFFFFF;
  --haze: #E3D9C3;
  --text: #342427;
  --muted: #5E5154;
  --moss: #637D5E;
  --sage: #A3B6AC;
  --ochre: #CAAC69;
  --rose: #BA8876;
  --dusk: #3C475D;
  --soil: #5D493E;
  --radius: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--mist); color: var(--text);
  font-family: 'Poppins', system-ui, sans-serif; font-size: 17px; line-height: 1.65;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: var(--forest); text-underline-offset: 3px; }
a:hover { color: var(--plum); }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; }
h1, h2, h3 { font-family: 'Quicksand', sans-serif; font-weight: 600; color: var(--forest); line-height: 1.25; margin: 0; }
h1 { font-size: 32px; }
h2 { font-size: 25px; }
h3 { font-size: 19px; }
p { margin: 0; }
b i, i b { font-style: italic; font-weight: 600; }
.skip { position: absolute; left: -999px; top: 0; background: var(--white); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 640px; margin: 0 auto; padding: 0 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 32px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.page { padding: 28px 0 48px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.label { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--forest); margin: 0; }

/* Top bar */
.topbar { background: var(--white); border-bottom: 1px solid var(--haze); }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding-top: 12px; padding-bottom: 12px; }
.brand { font-family: 'Quicksand', sans-serif; font-weight: 700; letter-spacing: .12em; font-size: 15px; text-decoration: none; color: var(--forest); }
.nav { display: flex; flex-wrap: wrap; gap: 2px 18px; flex: 1 1 420px; }
.nav a { text-decoration: none; color: var(--text); font-size: 15px; padding: 8px 0; min-height: 44px; display: inline-flex; align-items: center; }
.nav a[aria-current="page"] { color: var(--forest); font-weight: 600; box-shadow: inset 0 -2px 0 var(--forest); }
.topbar-actions { display: flex; gap: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 22px; border-radius: 999px;
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 16px; text-decoration: none; border: 2px solid var(--plum);
  background: var(--plum); color: var(--white); cursor: pointer; }
.btn:hover { background: #5a3840; color: var(--white); }
.btn-ghost { background: var(--white); color: var(--forest); border-color: var(--forest); }
.btn-ghost:hover { background: var(--mist); color: var(--forest); }
.btn-moss { background: var(--moss); border-color: var(--moss); }
.btn-small { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--forest); text-decoration: underline; font: inherit; cursor: pointer; min-height: 0; }

/* Cards */
.card { background: var(--white); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.card-quiet { background: var(--haze); }
.card-forest { background: var(--forest); color: var(--white); }
.card-forest h1, .card-forest h2, .card-forest h3, .card-forest .label { color: var(--white); }
.card-forest a { color: var(--white); }
.card-forest a.btn-ghost { color: var(--forest); }
.card-forest .muted { color: #E3D9C3; }
.card a.cover { text-decoration: none; color: inherit; }
.tag { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--mist); color: var(--text); }
.tag-open { background: var(--moss); color: var(--white); }
.tag-done { background: var(--forest); color: var(--white); }
.tag-draft { background: var(--ochre); color: var(--text); }

/* Banner with landscape */
.banner { position: relative; overflow: hidden; border-radius: 24px; background: var(--haze); padding: 30px 28px 92px; display: flex; flex-direction: column; gap: 10px; }
.banner > * { position: relative; }
.banner .landscape { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 110px; }
.banner p { max-width: 620px; }

/* Arrival and leaving */
.arrive { min-height: 100vh; display: flex; flex-direction: column; background: var(--mist); }
.arrive-sky { position: relative; height: 200px; background: linear-gradient(var(--haze), var(--mist)); }
.arrive-sky .landscape { position: absolute; inset: auto 0 0 0; width: 100%; height: 150px; }
.arrive-sky .brand { position: absolute; top: 20px; left: 20px; }
.arrive-body { padding: 8px 20px 32px; }
.leaving { background: var(--forest); color: var(--white); }
.leaving h1, .leaving .label, .leaving .brand { color: var(--white); }
.leaving .arrive-sky { background: linear-gradient(#2b3f26, var(--forest)); }
.leaving .muted { color: var(--haze); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 16px; background: var(--white);
  border: 2px solid var(--white); color: var(--forest); font: inherit; text-align: left; cursor: pointer; min-height: 92px; }
.choice strong { font-family: 'Quicksand', sans-serif; font-size: 17px; }
.choice span { font-size: 14px; color: var(--muted); line-height: 1.4; }
.choice:hover { border-color: var(--forest); }
.leaving .choice { background: rgba(255,255,255,.1); border-color: transparent; color: var(--white); min-height: 56px; }
.leaving .choice:hover { border-color: var(--white); }
.practice { background: var(--haze); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.care { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* Progress */
.progress { display: flex; gap: 5px; }
.progress span { flex: 1 1 0; height: 9px; border-radius: 5px; background: var(--haze); }
.progress span.done { background: var(--moss); }
.progress span.open { background: var(--ochre); }

/* Journey list */
.module { display: flex; gap: 16px; align-items: center; text-decoration: none; color: var(--text); }
.module-num { flex: 0 0 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-family: 'Quicksand', sans-serif; font-weight: 700; background: var(--mist); color: var(--forest); }
.module.is-open .module-num { background: var(--moss); color: var(--white); }
.module.is-locked { color: var(--muted); }

/* Theme page */
.prose { display: flex; flex-direction: column; gap: 14px; }
.threads { margin: 0; padding-left: 22px; }
.reflection { font-weight: 500; font-size: 18px; }
.list-plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item-link { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--mist); text-decoration: none; color: var(--text); }

/* Ask Lana */
details.qa { background: var(--white); border-radius: 16px; padding: 4px 18px; }
details.qa summary { cursor: pointer; padding: 12px 0; font-weight: 500; list-style-position: outside; }
details.qa div { padding: 0 0 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; color: var(--forest); flex: 1 1 180px; }
.field input, .field select, .field textarea { font: inherit; font-weight: 400; font-size: 16px; color: var(--text); padding: 11px 13px; border-radius: 12px; border: 1.5px solid var(--muted); background: var(--white); width: 100%; }
.field textarea { min-height: 110px; resize: vertical; }

/* Calls */
.card.call { flex-direction: row; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.call-date { flex: 0 0 auto; min-width: 74px; text-align: center; background: var(--mist); border-radius: 14px; padding: 8px 10px; font-family: 'Quicksand', sans-serif; font-weight: 700; color: var(--forest); line-height: 1.2; }
.call-date small { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.call-body { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.call.is-past { opacity: .85; }

/* Conversation */
.post { display: flex; flex-direction: column; gap: 8px; }
.post-meta { font-size: 14px; color: var(--muted); }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.replies { border-left: 3px solid var(--haze); padding-left: 14px; display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }

.notice { background: var(--white); border-left: 4px solid var(--moss); padding: 12px 16px; border-radius: 10px; }
.avatar { width: 84px; height: 84px; border-radius: 50%; background: var(--sage); border: 3px solid var(--ochre); display: flex; align-items: center; justify-content: center;
  font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 26px; color: var(--forest); flex-shrink: 0; }

/* Footer */
.footer { background: var(--forest); color: var(--white); margin-top: 24px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 20px; padding-bottom: 20px; font-size: 14px; }
.footer a { color: var(--white); }

/* Gentle mode: when someone arrives running low or tender */
body.gentle .banner { background: #E9E2D2; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  h1 { font-size: 27px; }
  h2 { font-size: 22px; }
  .banner { padding: 24px 20px 84px; }
  .topbar-actions { width: 100%; }
}

/* Side panels: Ask Lana and Pocket Refugia */
.float-bar { position: fixed; right: 16px; bottom: 16px; z-index: 20; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.float-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--forest);
  background: var(--white); color: var(--forest); font: 600 15px 'Poppins', sans-serif; cursor: pointer; box-shadow: 0 6px 18px rgba(29,47,25,.18); }
.float-btn-forest { background: var(--forest); color: var(--white); }
.float-btn:hover { transform: translateY(-1px); }
body { padding-bottom: 72px; }

dialog.drawer { margin: 0 0 0 auto; padding: 0; border: 0; width: min(440px, 100vw); max-width: 100vw; height: 100%; max-height: 100%;
  background: var(--mist); color: var(--text); box-shadow: -12px 0 32px rgba(29,47,25,.2); }
dialog.drawer[open] { display: flex; flex-direction: column; animation: slide-in .22s ease-out; }
dialog.drawer::backdrop { background: rgba(29,47,25,.35); }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.drawer[open] { animation: none; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 20px 14px; background: var(--white); border-bottom: 1px solid var(--haze); }
.drawer-forest .drawer-head { background: var(--forest); border-color: var(--forest); }
.drawer-forest .drawer-head h2, .drawer-forest .drawer-head .label { color: var(--white); }
.drawer-close { flex: 0 0 44px; height: 44px; border-radius: 50%; border: 2px solid currentColor; background: transparent; color: var(--forest); font-size: 24px; line-height: 1; cursor: pointer; }
.drawer-forest .drawer-close { color: var(--white); }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }

@media (max-width: 560px) {
  .float-bar { left: 12px; right: 12px; bottom: 12px; flex-direction: row; justify-content: center; }
  .float-btn { flex: 1 1 0; justify-content: center; padding: 10px 12px; font-size: 14px; }
  dialog.drawer { width: 100vw; }
}
.stack > .field, .drawer-body .field { flex: 0 0 auto; }

/* Conversation by theme */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; background: var(--white);
  color: var(--forest); text-decoration: none; font-size: 14px; font-weight: 500; border: 1.5px solid var(--haze); }
.chip[aria-current="true"] { background: var(--forest); color: var(--white); border-color: var(--forest); }
.chip-count { font-size: 12px; font-weight: 600; background: var(--mist); color: var(--forest); border-radius: 999px; padding: 0 7px; }
.chip[aria-current="true"] .chip-count { background: var(--moss); color: var(--white); }
a.tag { text-decoration: none; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details.qa > summary { list-style: revert; }
.form-gap { margin-top: 16px; }
@media (max-width: 560px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-right: -20px; padding-right: 20px; scrollbar-width: thin; }
  .chip { flex: 0 0 auto; }
}

/* Full schedule of calls */
.schedule { list-style: none; margin: 0; padding: 0; background: var(--white); border-radius: var(--radius); overflow: hidden; }
.schedule-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto 64px; gap: 4px 16px; align-items: center;
  padding: 12px 18px; border-top: 1px solid var(--mist); font-variant-numeric: tabular-nums; }
.schedule-row:first-child { border-top: 0; }
.schedule-row.is-learning .schedule-what strong { color: var(--forest); }
.schedule-row.is-next { background: #F1F4EE; box-shadow: inset 4px 0 0 var(--moss); }
.schedule-row.is-past { color: var(--muted); }
.schedule-date { font-weight: 600; font-size: 15px; }
.schedule-what { min-width: 0; }
.schedule-status { text-align: right; }
@media (max-width: 640px) {
  .schedule-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 16px; }
  .schedule-date { grid-column: 1; }
  .schedule-status { grid-column: 2; grid-row: 1; }
  .schedule-what, .schedule-time { grid-column: 1 / -1; }
}

/* Admin area */
.admin-list { list-style: none; margin: 0; padding: 0; background: var(--white); border-radius: var(--radius); overflow: hidden; }
.card .admin-list { background: var(--mist); }
.admin-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; padding: 14px 18px; border-top: 1px solid var(--mist); }
.card .admin-item { border-top-color: var(--white); }
.admin-item:first-child { border-top: 0; }
.admin-item.is-past { color: var(--muted); }
.admin-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; overflow-wrap: anywhere; }
.admin-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.admin-item-form form { flex: 2 1 420px; }
.admin-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 10px 14px; background: var(--mist); border-radius: 12px; }
.row-tight { gap: 8px 14px; }
.form-row { align-items: flex-end; }
.select-small { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--muted); background: var(--white); color: var(--text); min-height: 40px; }
.hint { font-weight: 400; font-size: 13px; color: var(--muted); }
.stat { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 36px; color: var(--forest); line-height: 1.1; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--forest); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card-forest .notice { color: var(--text); }
body:not(:has(.float-bar)) { padding-bottom: 0; }
summary.btn.fit { width: fit-content; }
.tend .item-link { background: var(--white); }

/* Slides and HTML materials */
.viewer-head { justify-content: space-between; }
.viewer { background: var(--white); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--haze); }
.viewer iframe { display: block; width: 100%; height: min(78vh, 900px); min-height: 480px; border: 0; background: var(--white); }
.viewer:fullscreen { border-radius: 0; border: 0; }
.viewer:fullscreen iframe { height: 100vh; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
body.viewing .float-bar { display: none; }
body.viewing { padding-bottom: 0; }
