/* Liturgy Planning — mobile-first, no framework. */

:root {
  --ink: #26323f;
  --muted: #6b7a89;
  --accent: #5b3a8e;        /* cathedral purple */
  --accent-dark: #43296b;
  --paper: #f7f6f3;
  --card: #ffffff;
  --line: #ddd8ce;
  --danger: #a33a2e;
  --ok: #2e6b3a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

main { max-width: 900px; margin: 0 auto; padding: 0.75rem 0.75rem 3rem; }

h1 { font-size: 1.45rem; margin: 0.8rem 0 0.5rem; }
h2 { font-size: 1.15rem; margin: 1.2rem 0 0.4rem; }
a { color: var(--accent); }

/* --- header / nav ------------------------------------------------------ */

.site-header { background: var(--accent-dark); color: #fff; }

.brand {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.9rem 0.2rem;
}
.brand .logo { height: 38px; width: auto; border-radius: 4px; background: #fff; }
.org-name { font-weight: 700; font-size: 1.05rem; }
.app-name { font-size: 0.75rem; opacity: 0.75; letter-spacing: 0.04em;
            text-transform: uppercase; }

.site-nav {
  display: flex; align-items: center; gap: 0.15rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0.5rem 0.45rem;
}
.site-nav a {
  color: #e8e2f2; text-decoration: none; white-space: nowrap;
  padding: 0.5rem 0.7rem; border-radius: 6px; font-size: 0.95rem;
}
.site-nav a.active { background: var(--accent); color: #fff; }
.site-nav a:active { background: var(--accent); }
.nav-spacer { flex: 1; }

/* --- cards, tables, lists ---------------------------------------------- */

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 0.8rem 1rem; margin: 0.6rem 0;
}

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.list { border-collapse: collapse; width: 100%; background: var(--card); }
table.list th, table.list td {
  text-align: left; padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
table.list th { font-size: 0.8rem; text-transform: uppercase;
                letter-spacing: 0.04em; color: var(--muted); }
table.list tr:active td { background: #f1edf7; }

.muted { color: var(--muted); }
.pre { white-space: pre-wrap; font-family: inherit; }

/* --- forms & buttons ---------------------------------------------------- */

label { display: block; margin: 0.7rem 0 0.2rem; font-weight: 600;
        font-size: 0.92rem; }

input[type=text], input[type=password], input[type=email], input[type=date],
input[type=time], input[type=number], select, textarea {
  width: 100%; max-width: 30rem;
  padding: 0.55rem 0.6rem; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--ink);
}
textarea { max-width: 100%; font-family: inherit; }

.btn, button {
  display: inline-block; min-height: 44px; padding: 0.55rem 1rem;
  font-size: 1rem; border: none; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: #fff; text-decoration: none;
  line-height: 1.3;
}
.btn.secondary, button.secondary {
  background: #fff; color: var(--accent); border: 1px solid var(--accent);
}
.btn.danger, button.danger { background: var(--danger); }
.btn.small, button.small { min-height: 34px; padding: 0.25rem 0.7rem;
                           font-size: 0.9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.9rem 0; }

.flash {
  background: #e7f3e9; border: 1px solid #bcd9c2; color: var(--ok);
  padding: 0.6rem 0.9rem; border-radius: 8px; margin: 0.6rem 0;
}
.error {
  background: #f7e8e6; border: 1px solid #e0b8b2; color: var(--danger);
  padding: 0.6rem 0.9rem; border-radius: 8px; margin: 0.6rem 0;
}

/* --- breadcrumbs -------------------------------------------------------- */

.crumbs { font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0; }
.crumbs a { color: var(--muted); }

/* --- home page service accordion ---------------------------------------- */

.svc-row { cursor: pointer; }
.svc-detail td { background: #faf8fc; }
.svc-detail table { width: 100%; }
.svc-detail th { width: 34%; font-weight: 600; text-align: left;
                 padding: 0.2rem 0.5rem 0.2rem 0; vertical-align: top;
                 color: var(--muted); }
.svc-detail td.v { padding: 0.2rem 0; }

/* --- sortable lists (drag & drop) --------------------------------------- */

ul.sortable { list-style: none; margin: 0.4rem 0; padding: 0; }
ul.sortable li {
  display: flex; align-items: flex-start; gap: 0.6rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.5rem 0.6rem; margin: 0.35rem 0;
}
ul.sortable li .grip {
  cursor: grab; touch-action: none; user-select: none;
  color: var(--muted); font-size: 1.2rem; line-height: 1.2;
  padding: 0.15rem 0.35rem;
}
ul.sortable li.sortable-ghost { opacity: 0.4; }
ul.sortable li.sortable-chosen { box-shadow: 0 3px 10px rgba(0,0,0,0.15); }

/* --- autocomplete -------------------------------------------------------- */

.ac-wrap { position: relative; max-width: 30rem; }
.ac-list {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  background: #fff; border: 1px solid var(--line); border-radius: 0 0 8px 8px;
  max-height: 14rem; overflow-y: auto; box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}
.ac-item { padding: 0.55rem 0.7rem; cursor: pointer; }
.ac-item:hover, .ac-item:active { background: #f1edf7; }

/* --- print (pewsheet) ---------------------------------------------------- */

@media print {
  .site-header, .btn, button, .crumbs, .no-print { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
}
