/* Dream Dictionary — dreams.mobilepress.org */

:root {
  --sky:      #96b3e0;   /* the original 2006 backdrop blue */
  --sky-deep: #7e9ed4;
  --paper:    #fdfdfb;
  --ink:      #26303f;
  --soft:     #6b7484;
  --line:     #dcdfe6;
  --accent:   #28477e;
  --accent-2: #4a6db3;
  --tint:     #f3f6fb;   /* definition panel */
  --serif: "Charter", "Iowan Old Style", "Palatino", Georgia, serif;
  --sans: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sky:      #10151f;
    --sky-deep: #0b0f17;
    --paper:    #1a212e;
    --ink:      #e6e9f0;
    --soft:     #97a1b3;
    --line:     #303a4c;
    --accent:   #a9c2f2;
    --accent-2: #7e9ed4;
    --tint:     #20293a;
  }
}

* { box-sizing: border-box; }

html {
  background: linear-gradient(175deg, var(--sky) 0%, var(--sky-deep) 100%) fixed;
}

body {
  max-width: 44rem;
  margin: 2.5rem auto;
  padding: 2.5rem 3rem 2rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid rgb(0 0 0 / 0.15);
  box-shadow: 0 10px 40px rgb(10 25 60 / 0.25);
  font: 1.05rem/1.7 var(--serif);
}

@media (max-width: 48rem) {
  body { margin: 0; padding: 1.5rem 1.25rem; border: 0; box-shadow: none; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* In running prose, links must be visible without hovering: clear blue
   plus an always-on underline. Nav/list links are obvious from context. */
.interpretation a, .definition a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent-2) 55%, transparent);
  text-underline-offset: 3px;
}
.interpretation a:hover, .definition a:hover {
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent-2);
}

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

header { text-align: center; }

header h1 {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: normal;
  font-variant: small-caps;
  letter-spacing: 0.14em;
}
header h1 a { color: var(--ink); }
header h1 a:hover { text-decoration: none; }

.ornament {
  margin: 1.1rem 0 0;
  color: var(--soft);
  letter-spacing: 0.4em;
  font-size: 0.9rem;
  text-align: center;
  user-select: none;
}

/* ---------- search ---------- */

.search { position: relative; max-width: 26rem; margin: 0 auto 1.25rem; }
.search input {
  width: 100%;
  padding: 0.45rem 1rem;
  font: 0.95rem var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.search input::placeholder { color: var(--soft); font-style: italic; }
.search input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 25%, transparent);
}
.search ul {
  position: absolute;
  z-index: 10;
  left: 0; right: 0;
  margin: 0.3rem 0 0;
  padding: 0.3rem 0;
  list-style: none;
  text-align: left;
  font-family: var(--sans);
  font-size: 0.95rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.18);
}
.search li a { display: block; padding: 0.35rem 1rem; }
.search li a:hover { background: var(--tint); text-decoration: none; }

/* ---------- letter navigation ---------- */

.letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.1rem 0;
}
.letters a {
  min-width: 1.4rem;
  padding: 0.1rem 0.05rem;
  font-family: var(--serif);
  font-size: 1rem;
  font-variant: small-caps;
  text-align: center;
  border-bottom: 2px solid transparent;
}
.letters a:hover {
  text-decoration: none;
  border-bottom-color: var(--accent-2);
}
.letters a.here {
  color: var(--ink);
  font-weight: bold;
  border-bottom-color: var(--accent);
}

main { padding: 1.75rem 0 1rem; }

/* ---------- home ---------- */

.home { text-align: center; }
.home .yume {
  margin: 1rem 0 1.5rem;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: 7rem;
  line-height: 1.15;
  color: var(--accent);
  text-shadow: 0 3px 22px color-mix(in srgb, var(--sky) 80%, transparent);
}

/* ---------- term pages ---------- */

article h1 {
  margin: 0 0 0.4rem;
  font-size: 2.1rem;
  font-weight: normal;
  color: var(--accent);
}
article h1::after {
  content: "";
  display: block;
  width: 3.5rem;
  margin-top: 0.5rem;
  border-bottom: 3px double var(--accent-2);
}

article h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.35rem;
  font-weight: normal;
  color: var(--accent);
}

/* the interpretation and the dictionary definition each live in their
   own bounded card, so it's clear they are separate things */
.card {
  padding: 0.4rem 1.5rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.interpretation { hanging-punctuation: first; }
.interpretation p { margin: 0.9rem 0; text-align: justify; hyphens: auto; }

.definition { background: var(--tint); }
.definition ul { margin: 0.9rem 0; padding: 0; list-style: none; }
.definition li {
  margin: 0.45rem 0;
  padding-left: 1.4rem;
  text-indent: -1.4rem;   /* hanging indent, dictionary style */
  font-size: 0.97rem;
}
.definition em { color: var(--accent-2); }

.prevnext {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  font-style: italic;
}
.prevnext a:last-child { margin-left: auto; text-align: right; }

/* ---------- letter index ---------- */

.termlist {
  columns: 3 11rem;
  gap: 2.5rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}
.termlist li {
  break-inside: avoid;
  padding: 0.12rem 0;
}

/* ---------- footer ---------- */

footer {
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--soft);
  text-align: center;
}
footer .ornament { margin: 0 0 0.75rem; }
footer a { color: var(--soft); text-decoration: underline; text-underline-offset: 2px; }
