/* Shepherd's Embrace Ministries — Pastoral Care Hub
   Mobile-first · light theme · bookish serif (Literata) */

:root {
  --white:        #ffffff;
  --paper:        #fafbfd;   /* page background */
  --mist:         #eef2f7;   /* light grey */
  --cloud:        #e3ebf4;   /* grey-blue */
  --sky:          #dcebf9;   /* light blue */
  --powder:       #cfe2f3;   /* deeper light blue */
  --ink:          #2e3a4a;   /* main text, soft slate */
  --ink-soft:     #5b6b7e;
  --accent:       #4a7fb5;   /* pastoral blue */
  --accent-deep:  #3a6795;
  --victory-bg:   #e2f2e4;
  --victory-ink:  #2f7a43;
  --prayer-bg:    #e7e4f6;
  --prayer-ink:   #5b4ea8;
  --check-green:  #3aa05a;
  --radius:       14px;
  --shadow:       0 2px 10px rgba(74, 127, 181, 0.10);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Literata", "Iowan Old Style", Georgia, "Times New Roman", serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 17px;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

/* ---------- header / start page ---------- */

.hub-header {
  text-align: center;
  padding: 1.5rem 0 1rem;
}

.logo {
  width: 96px;
  height: 96px;
  display: block;
  margin: 0 auto 0.9rem;
}

.ministry-name {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 0.2rem;
  color: var(--ink);
}

.hub-subtitle {
  margin: 0;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ---------- top bar on friend page ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0 0.75rem;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
}
.back-link:hover, .back-link:focus-visible { text-decoration: underline; }

.logo-small { width: 40px; height: 40px; margin: 0; }

.friend-header {
  background: var(--white);
  border: 1px solid var(--cloud);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.4rem;
}

.friend-name {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 600;
}

.friend-about {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* ---------- sections ---------- */

.section { margin-bottom: 1.75rem; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 2px solid var(--sky);
  padding-bottom: 0.35rem;
  margin-bottom: 0.75rem;
}

.section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent-deep);
}

.add-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--white);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, transform 0.1s ease;
}
.add-btn:hover { background: var(--accent-deep); }
.add-btn:active { transform: scale(0.94); }
.add-btn:focus-visible { outline: 3px solid var(--powder); outline-offset: 2px; }

/* ---------- friends list (cycling tints) ---------- */

.friend-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.friend-row {
  border-radius: var(--radius);
  margin-bottom: 0.55rem;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.friend-row:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.tint-0 { background: var(--sky); }
.tint-1 { background: var(--mist); }
.tint-2 { background: var(--powder); }
.tint-3 { background: var(--cloud); }

.friend-link {
  display: block;
  padding: 0.9rem 1rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: var(--radius);
}
.friend-link:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

.empty-note {
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
}

/* ---------- simple lists (struggles / helping) ---------- */

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.plain-item {
  background: var(--white);
  border: 1px solid var(--cloud);
  border-left: 4px solid var(--powder);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.5rem;
}

/* ---------- to-dos ---------- */

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  background: var(--white);
  border: 1px solid var(--cloud);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.5rem;
}

.todo-check {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  border-radius: 8px;
  border: 2px solid var(--powder);
  background: var(--white);
  color: var(--check-green);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.todo-check:hover { border-color: var(--accent); }
.todo-check:focus-visible { outline: 3px solid var(--powder); outline-offset: 2px; }

.todo-item.done .todo-check {
  border-color: var(--check-green);
  background: var(--victory-bg);
}

/* Checked: crossed out, but NOT lightened */
.todo-item.done .todo-text {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  color: var(--ink); /* keep full-strength text color */
}

/* ---------- updates & sessions ---------- */

.update-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.update-item {
  background: var(--white);
  border: 1px solid var(--cloud);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
  box-shadow: var(--shadow);
}

.session-item { border-left: 4px solid var(--accent); }

.update-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.update-time {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-style: italic;
}

.update-text {
  margin: 0;
  white-space: pre-wrap;
}

/* ---------- pill badges ---------- */

.pill {
  display: inline-block;
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill-victory { background: var(--victory-bg); color: var(--victory-ink); }
.pill-prayer  { background: var(--prayer-bg);  color: var(--prayer-ink); }
.pill-none    { background: var(--mist);       color: var(--ink-soft); }

/* ---------- modals ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(46, 58, 74, 0.35);
  display: flex;
  align-items: flex-end;      /* sheet-style on mobile */
  justify-content: center;
  padding: 0;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.modal-backdrop[hidden] { display: none; }

.modal-backdrop.open { opacity: 1; }

.modal {
  background: var(--white);
  width: 100%;
  max-width: 560px;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: 0 -6px 30px rgba(46, 58, 74, 0.18);
  transform: translateY(12px);
  transition: transform 0.18s ease;
  max-height: 88vh;
  overflow-y: auto;
}
.modal-backdrop.open .modal { transform: translateY(0); }

.modal-title {
  margin: 0 0 0.9rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent-deep);
}

.field { display: block; margin-bottom: 0.9rem; }

.field-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}

input[type="text"], textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--cloud);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
}
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
}
textarea { resize: vertical; }

.badge-choice {
  border: none;
  margin: 0 0 0.6rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.badge-choice legend { padding: 0; margin-bottom: 0.4rem; }

.badge-option { cursor: pointer; }
.badge-option input { position: absolute; opacity: 0; pointer-events: none; }
.badge-option .pill {
  border: 2px solid transparent;
  transition: border-color 0.12s ease;
  padding: 0.35rem 0.85rem;
  font-size: 0.9rem;
}
.badge-option input:checked + .pill { border-color: var(--accent); }
.badge-option input:focus-visible + .pill { outline: 3px solid var(--powder); outline-offset: 2px; }

.hint {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 0.9rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease;
}
.btn:focus-visible { outline: 3px solid var(--powder); outline-offset: 2px; }

.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-deep); }

.btn-quiet { background: var(--mist); color: var(--ink-soft); }
.btn-quiet:hover { background: var(--cloud); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--white);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- larger screens ---------- */

@media (min-width: 600px) {
  .page { padding-top: 2rem; }
  .modal-backdrop { align-items: center; padding: 1rem; }
  .modal { border-radius: var(--radius); }
  .logo { width: 120px; height: 120px; }
  .ministry-name { font-size: 1.9rem; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
