/* The app's own colors (apps/ios/ReBible/Shared/BrandColor.swift): the white page and the night page, the dusk
   sky above the book, the light behind its fold, and the red of its ribbon. */
:root {
  color-scheme: light dark;
  --page: #ffffff;
  --dusk: #f5e9f0;
  --ink: #1d1d1f;
  --quiet: #6e6a70;
  --rule: #e6dde2;
  --glow: #a2520d;
  --ribbon: #c81e1a;
  --serif: 'Noto Serif KR', 'Noto Serif', 'AppleMyungjo', 'Batang', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Apple SD Gothic Neo', 'Segoe UI', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0c0c1b;
    --dusk: #3a182a;
    --ink: #f5f5f7;
    --quiet: #a39fa8;
    --rule: #2c2a40;
    --glow: #f7b66a;
    --ribbon: #f4483a;
  }
}

html {
  background: var(--page);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  /* The sky tints the top of the page and is gone by the time the reading starts. */
  background: linear-gradient(to bottom, var(--dusk), var(--page) 20rem) no-repeat;
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
}

.page {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-width: 40rem;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(1.5rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right)) 2rem
    max(1.5rem, env(safe-area-inset-left));
}

main {
  flex: 1;
  padding: 3.5rem 0 4rem;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 3px;
  border-radius: 4px;
}

/* The top of a page: the app's icon and name. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img,
.app-icon {
  /* The corner of an iOS app icon. */
  border-radius: 22.5%;
}

/* The top of the front page: the app, and where to get it. */
.app {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-name {
  flex: 1;
  min-width: 0;
}

.app-name h1 {
  margin: 0;
  font: 600 1.25rem/1.2 var(--sans);
  letter-spacing: -0.01em;
}

.app-name p {
  margin: 0.15rem 0 0;
  color: var(--quiet);
  font-size: 0.9375rem;
}

/* A passage, set as the app sets one to share: light serif, a short stroke of the glow, verse numbers in the glow. */
.passage h1 {
  margin: 0;
  font: 200 2.25rem/1.25 var(--serif);
  letter-spacing: -0.01em;
}

.mark {
  width: 2rem;
  height: 2px;
  margin: 1.75rem 0;
  border: 0;
  background: var(--glow);
}

.verses p {
  margin: 0;
  font: 300 1.3125rem/2 var(--serif);
  word-break: keep-all;
  overflow-wrap: break-word;
}

:lang(en) .verses p,
:lang(fil) .verses p {
  line-height: 1.8;
}

.verses[data-numbered] p {
  position: relative;
  padding-left: 2.5rem;
}

/* On the front page the day's passage is what the page is, and is set larger. */
.today .verses p {
  font-size: clamp(1.375rem, 3.4vw, 1.875rem);
  line-height: 1.8;
}

.verses[data-numbered] p + p {
  margin-top: 0.6rem;
}

.numeral {
  position: absolute;
  left: 0;
  /* Sits on the first line of its verse. */
  top: 0.95em;
  color: var(--glow);
  font: 600 0.75rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
}

.translation,
.cite {
  margin: 1.75rem 0 0;
  color: var(--quiet);
  font-size: 0.9375rem;
}

.cite {
  margin-top: 0;
}

.cite a {
  text-decoration: none;
}

.cite a:hover {
  color: var(--ink);
}

/* What to do with a passage: get the app, open it, read on. */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 2.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-sizing: border-box;
  min-height: 3rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--page);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.button.quiet {
  background: none;
  box-shadow: inset 0 0 0 1px var(--quiet);
  color: var(--ink);
}

.button .logo {
  width: 0.95rem;
  height: 1.17rem;
  /* The logo's own box puts the leaf above the cap height. */
  margin-top: -0.2rem;
}

.link {
  color: var(--ink);
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
}

.link:hover {
  text-decoration-color: currentColor;
}

/* Running text: the privacy policy. */
.article {
  max-width: 34rem;
}

.article h1 {
  margin: 0;
  font: 200 2.25rem/1.25 var(--serif);
  letter-spacing: -0.01em;
}

.article .lead {
  margin: 0.75rem 0 0;
  color: var(--quiet);
  font-size: 0.9375rem;
}

.article h2 {
  margin: 2.5rem 0 0.5rem;
  font: 600 1rem/1.4 var(--sans);
}

.article p {
  margin: 0.5rem 0 0;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.article .contact {
  margin-top: 1.5rem;
  font-size: 1.125rem;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--quiet);
  font-size: 0.875rem;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.foot a {
  text-decoration: none;
}

.foot a:hover,
.foot a[aria-current] {
  color: var(--ink);
}

@media (max-width: 30rem) {
  main {
    padding-top: 2.5rem;
  }

  .passage h1,
  .article h1 {
    font-size: 1.75rem;
  }

  .verses p {
    font-size: 1.1875rem;
  }

  .today .verses p {
    font-size: 1.375rem;
  }

  .verses[data-numbered] p {
    padding-left: 2rem;
  }

  /* The store's button drops under the app's name where the two do not fit side by side. */
  .app {
    flex-wrap: wrap;
  }

  .app .button {
    flex-basis: 100%;
    margin-top: 0.5rem;
  }

  .actions .button {
    flex: 1 1 100%;
  }
}
