/* elenbaas.com.au — shared styles
   Palette: the Via Dolorosa cover's red, set against deep mahogany, on a quiet warm page.
   Type: Spectral, self-hosted (SIL Open Font License, see fonts/OFL-Spectral.txt). */

@font-face {
  font-family: "Spectral";
  font-weight: 200;
  font-style: normal;
  font-display: swap;
  src: url("fonts/spectral-latin-200-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Spectral";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("fonts/spectral-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Spectral";
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url("fonts/spectral-latin-400-italic.woff2") format("woff2");
}

:root {
  --mahogany: #4a1810;    /* hero, header and footer ground */
  --on-mahogany: #f6ece4; /* text on mahogany */
  --red: #ed1c24;         /* the cover's ground: route stops */
  --red-text: #c8141c;    /* the same red, deepened for links on the light page */
  --page: #f8f4ef;        /* body ground */
  --ink: #1d1613;         /* text */
  --ash: #5f524b;         /* secondary text on the page */
  --on-mahogany-dim: #dcc3b6; /* secondary text on mahogany */

  --serif: "Spectral", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 76rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.65;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--red-text);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--page);
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: translateY(0);
}

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header + hero ---------- */

.hero {
  background: var(--mahogany);
  color: var(--on-mahogany);
}

.hero a,
.topbar a {
  color: inherit;
}

.topbar {
  background: var(--mahogany);
  color: var(--on-mahogany);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.5rem;
  font-size: 1.0625rem;
}

.site-header__name {
  font-style: italic;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

.hero__body {
  display: grid;
  gap: 3.5rem;
  padding-block: clamp(2.5rem, 7vw, 6rem) clamp(3.5rem, 8vw, 6.5rem);
}

@media (min-width: 56rem) {
  .hero__body {
    grid-template-columns: minmax(0, 1fr) 20rem;
    gap: 4rem;
    align-items: end;
  }
}

.title {
  margin: 0;
  font-weight: 200;
  font-size: clamp(3.75rem, 12vw, 8.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

/* The two words are set as two lines of verse, the second stepped in. */
.title__line {
  display: block;
}

.title__line--step {
  padding-left: 0.9em;
}

.hero__by {
  margin: 2.5rem 0 0;
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.3;
}

.hero__lede {
  max-width: 28em;
  margin: 1rem 0 0;
  color: var(--on-mahogany-dim);
}

.cover {
  margin: 0;
  width: 100%;
  max-width: 20rem;
  box-shadow: 0 1.5rem 2.5rem -1rem rgba(10, 2, 0, 0.6);
}

.cover img {
  display: block;
  width: 100%;
  height: auto;
}

/* One orchestrated moment on load: the second line steps into place. */
@media (prefers-reduced-motion: no-preference) {
  .title__line {
    animation: line-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .title__line--step {
    animation-delay: 0.2s;
  }
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: translateX(-0.3em);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

.section + .section {
  padding-top: 0;
}

.split {
  display: grid;
  gap: 1.5rem 4rem;
}

@media (min-width: 56rem) {
  .split {
    grid-template-columns: 5fr 7fr;
  }
}

.section h2 {
  margin: 0;
  font-weight: 200;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.prose {
  max-width: 34em;
}

.prose p {
  margin: 0 0 1.25rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* The route: a line with a stop for each figure the poems visit. */
.route {
  position: relative;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.route li {
  position: relative;
  padding: 0 0 2.25rem 2.5rem;
}

.route li::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0.8rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--red);
}

.route li::after {
  content: "";
  position: absolute;
  left: calc(0.75rem - 1px);
  top: 1.5rem;
  bottom: -0.7rem;
  width: 2px;
  background: var(--mahogany);
}

.route li:last-child {
  padding-bottom: 0;
}

.route li:last-child::after {
  display: none;
}

.route li:last-child::before {
  left: 0.15rem;
  top: 0.55rem;
  width: 1.2rem;
  height: 1.2rem;
}

.stop__name {
  display: block;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-style: italic;
  line-height: 1.3;
}

.stop__note {
  margin: 0.5rem 0 0;
  color: var(--ash);
}

/* Book details */
.details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 2rem;
  margin: 0;
}

.details dt {
  color: var(--ash);
  font-style: italic;
}

.details dd {
  margin: 0;
}

/* ---------- Buttons + home ---------- */

.hero .button {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.7rem 1.5rem;
  background: var(--on-mahogany);
  color: var(--mahogany);
  font-size: 1.125rem;
  text-decoration: none;
}

.hero .button:hover {
  background: #fff;
}

.hero .button + .button {
  margin-left: 0.75rem;
}

.home__body {
  padding-block: clamp(4rem, 12vw, 9rem);
}

/* ---------- Contents (book page) ---------- */

.contents {
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.contents li {
  margin: 0 0 0.9rem;
}

.contents a {
  display: block;
  text-decoration: none;
}

.contents a:hover .contents__title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.contents__title {
  display: block;
  font-size: 1.1875rem;
  line-height: 1.35;
}

/* Poems without a title are listed by their first line, in italics. */
.contents .untitled .contents__title {
  font-style: italic;
}

/* ---------- Poem pages ---------- */

.poem-layout {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2.5rem, 6vw, 4rem);
}

.poem-title {
  margin: 0 0 clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 200;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.poem {
  max-width: 46rem;
}

.stanza {
  margin: 0 0 1.75rem;
  font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.3125rem);
  line-height: 1.55;
}

/* Each line hangs, so a line too long for the column wraps under an indent. */
.line {
  display: block;
  padding-left: 2em;
  text-indent: -2em;
}

.poem-alt {
  margin: 2.5rem 0 0;
  color: var(--ash);
  font-size: 1.0625rem;
  font-style: italic;
}

.poem-alt a {
  font-style: normal;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.poem-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2rem;
  padding-block: 2rem clamp(3.5rem, 8vw, 6rem);
  border-top: 1px solid rgba(29, 22, 19, 0.25);
}

.poem-nav a {
  display: block;
  text-decoration: none;
  line-height: 1.35;
  font-size: 1.125rem;
}

.poem-nav a:hover .poem-nav__title {
  text-decoration: underline;
}

.poem-nav__next {
  grid-column: 2;
  text-align: right;
}

.poem-nav__dir {
  display: block;
  color: var(--ash);
  font-size: 1rem;
  font-style: italic;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--mahogany);
  color: var(--on-mahogany);
  padding-block: 2.5rem;
  font-size: 1rem;
}

.site-footer p {
  margin: 0;
}
