@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("fonts/jost.woff2") format("woff2");
}

/* Colours taken from the snec.org.uk logo and website */
:root {
  --indigo: #1e1d3d;
  --violet: #363b8c;
  --raspberry: #db0f4f;
  --page: #ffffff;
  --ink: #222222;
  --soft: #5f6175;
  --tint: #eeeef7;
  --rule: #dcdce8;
  --link: #363b8c;
  --font: "Jost", "Futura", "Century Gothic", sans-serif; /* Jost is bundled: a Futura-like font that works offline */
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #16152d;
    --ink: #ecebf5;
    --soft: #a9a8c2;
    --tint: #23224a;
    --rule: #33325c;
    --link: #a8adf0;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  background: var(--page);
  color: var(--ink);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible { outline: 3px solid var(--raspberry); outline-offset: 2px; }

a { color: var(--link); }

/* ---------- masthead ---------- */

.masthead {
  background: var(--indigo);
  color: #fff;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 18px;
}

.masthead-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 560px;
  margin: 0 auto;
  font-size: 14px;
  flex-wrap: wrap;
  gap: 0 16px;
}
.masthead-links { display: flex; gap: 16px; margin-left: auto; }

.logo { display: block; height: 44px; width: auto; }

.help-link {
  border: 0;
  background: none;
  padding: 6px 0;
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--raspberry);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

.day {
  max-width: 560px;
  margin: 22px auto 0;
  text-align: center;
}

/* Echoes the spaced-out "WELCOME" heading on snec.org.uk */
.weekday {
  margin: 0;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: .4em;
  text-transform: uppercase;
  padding-left: .4em; /* balance the trailing letter-space so it centres */
}

.date {
  position: relative;
  display: inline-block;
  font-size: 40px;
  font-weight: 400;
  line-height: 1.15;
  cursor: pointer;
}

/* Native date input laid invisibly over the date, so tapping it opens the picker */
.date input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.back-today {
  display: block;
  margin: 8px auto 0;
  border: 0;
  background: none;
  font-size: 15px;
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--raspberry);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* Week strip: one dot per day, filled when that day's reading is marked as read */
.week {
  display: flex;
  align-items: center;
  max-width: 420px;
  margin: 18px auto 0;
}

.step {
  flex: 0 0 40px;
  height: 40px;
  border: 0;
  background: none;
  padding: 0;
}
.step svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.week-days {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.week-days button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 0;
  background: none;
  padding: 4px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, .7);
}

.week-days .pip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45);
}
.week-days .read .pip { background: var(--raspberry); border-color: var(--raspberry); }
.week-days .is-today { color: #fff; font-weight: 600; }
.week-days [aria-current="date"] { color: #fff; }
.week-days [aria-current="date"] .pip { transform: scale(1.35); border-color: #fff; }
.week-days [aria-current="date"].read .pip { border-color: var(--raspberry); }

/* ---------- content ---------- */

.data-note {
  margin: 0;
  padding: 8px 16px;
  text-align: center;
  font-size: 14px;
  background: var(--raspberry);
  color: #fff;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 20px 32px;
}

.message { color: var(--soft); text-align: center; padding: 48px 0; }

.block { padding: 26px 0 4px; }

.block h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 500;
  color: var(--soft);
}

.passage {
  margin: 0;
  font-size: 38px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--violet);
}
@media (prefers-color-scheme: dark) { .passage { color: #fff; } }

/* Weekends inside the plan */
.catchup-text { margin: 10px 0 14px; }
.catchup-status { margin: 0 0 8px; font-size: 16px; color: var(--soft); }
.catchup-status:empty { display: none; }
.catchup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.catchup-day {
  display: flex;
  gap: 12px;
  align-items: baseline;
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  text-align: left;
  color: var(--ink);
  background: none;
  border: 2px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
}
.catchup-date { min-width: 7em; font-size: 15px; color: var(--soft); }
.catchup-reading { font-weight: 500; color: var(--link); }

/* Stacked, so the tickbox doesn't jump about when its label changes length */
.reading-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
}

/* The reference, with a small "Bible Gateway" link beside it (below it if there's no room) */
.passage-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.gateway {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 14px;
  font-weight: 500;
  color: var(--link);
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: var(--raspberry);
  text-underline-offset: 3px;
}
.gateway svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* "Mark as read" tickbox: a real checkbox, visually replaced by .box */
.mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 12px;
  border: 2px solid var(--rule);
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s, background-color .2s, color .2s;
}
.mark input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.mark .box {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--soft);
  border-radius: 5px;
  background: var(--page);
  transition: background-color .2s, border-color .2s;
}
.mark .box svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s, transform .2s;
}
.mark:has(input:checked) { border-color: var(--raspberry); color: var(--raspberry); }
.mark input:checked + .box { background: var(--raspberry); border-color: var(--raspberry); }
.mark input:checked + .box svg { opacity: 1; transform: none; }
.mark:has(input:focus-visible) { outline: 3px solid var(--raspberry); outline-offset: 2px; }

.tabletalk {
  margin: 26px -20px 0;
  padding: 22px 20px 24px;
  background: var(--tint);
}

blockquote {
  margin: 4px 0 10px;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--indigo);
}
@media (prefers-color-scheme: dark) { blockquote { color: #fff; } }

.ref { margin: 0; font-weight: 500; color: var(--raspberry); }

.name {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.25;
}

.desc { margin: 6px 0 4px; max-width: 34em; }

.praying {
  margin: 6px 0 0;
  padding-left: 1.1em;
  font-size: 20px;
  line-height: 1.35;
}
.praying li { margin: 0 0 8px; padding-left: 2px; }
.praying li::marker { color: var(--raspberry); }
.praying .partner { font-weight: 500; }
.praying .desc { font-size: 16px; color: var(--soft); }
.praying a { font-size: 16px; }

.credit {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 20px calc(env(safe-area-inset-bottom) + 28px);
  border-top: 1px solid var(--rule);
  font-size: 12px;
  line-height: 1.5;
  color: var(--soft);
}

/* ---------- buttons shared by banner and help ---------- */

.solid {
  border: 0;
  border-radius: 4px;
  padding: 10px 18px;
  background: var(--raspberry);
  color: #fff;
  font-weight: 500;
}
.quiet { border: 0; background: none; padding: 10px 6px; color: var(--soft); }
.wide { width: 100%; padding: 14px; font-size: 18px; }
.solid:disabled { opacity: .6; cursor: default; }

.text-button {
  border: 0;
  background: none;
  padding: 6px 0;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- prayer diary sign-in ---------- */

.locked-text { margin: 4px 0 14px; max-width: 30em; }

.account {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--soft);
}
.account strong { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
/* The credit footer below has its own top rule; one is enough */
.account:not([hidden]) + .credit { border-top: 0; padding-top: 0; }

.signin .help-intro { margin-bottom: 22px; }

.field { display: block; margin-bottom: 16px; }
.field span { display: block; margin-bottom: 6px; font-size: 16px; font-weight: 500; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--rule);
  border-radius: 4px;
  background: var(--page);
  color: var(--ink);
  font: inherit;
  font-size: 20px; /* 16px+ stops iOS zooming in on focus */
}
.field input:focus { border-color: var(--link); outline: none; }
.field input[name="code"] { letter-spacing: .3em; font-weight: 500; }

.form-error { margin: -6px 0 16px; color: var(--raspberry); font-weight: 500; }

.signin-alt {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 14px 0 6px;
  font-size: 16px;
}

/* ---------- install banner ---------- */

.install-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 16px 20px calc(env(safe-area-inset-bottom) + 16px);
  background: var(--indigo);
  color: #fff;
  border-top: 4px solid var(--raspberry);
}
.install-banner p { max-width: 520px; margin: 0 auto 12px; }
.banner-actions { display: flex; justify-content: flex-end; gap: 8px; max-width: 520px; margin: 0 auto; }
.install-banner .quiet { color: rgba(255, 255, 255, .75); }

/* ---------- install help ---------- */

.help {
  width: 100%;
  max-width: 560px;
  max-height: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: var(--page);
  color: var(--ink);
}
.help::backdrop { background: rgba(30, 29, 61, .6); }

.help-inner {
  padding: calc(env(safe-area-inset-top) + 28px) 22px calc(env(safe-area-inset-bottom) + 28px);
}

.help h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--violet);
}
@media (prefers-color-scheme: dark) { .help h2 { color: #fff; } }

.help-intro { margin: 10px 0 0; color: var(--soft); }

.help-platform { margin-top: 30px; }
.help h3 { margin: 0 0 12px; font-size: 20px; font-weight: 500; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 18px 48px;
}
/* Step numbers sit in raspberry dots, after the logo */
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--raspberry);
  color: #fff;
  font-weight: 500;
  text-align: center;
  line-height: 32px;
}
.steps p { margin: 0; }
.steps .aside { margin-top: 4px; font-size: 16px; color: var(--soft); }

.glyph {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.25em;
  fill: none;
  stroke: #0a84ff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.glyph circle { fill: #0a84ff; stroke: none; }

.help-after {
  margin: 12px 0 24px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

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