/*
 * itolma.ch: the home page (bio and the shelf of books) and one page per book.
 * Type comes from assets/theme.css (EB Garamond, IM Fell English, Source Sans 3,
 * self-hosted). Each book carries its own cover colour in --book.
 */

:root {
  --itl-paper: #fbfaf6;
  --itl-ink: #1f2428;
  --itl-slate: #5a636a;
  --itl-rule: #d9d6cc;
  --itl-cream: #f4efe4;
  --itl-serif: "EB Garamond", Garamond, "Iowan Old Style", Palatino, Georgia, serif;
  --itl-sans: "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
  --itl-fell: "IM Fell English", "EB Garamond", Georgia, serif;
}

html.itl body {
  margin: 0;
  background: var(--itl-paper);
  color: var(--itl-ink);
  font-family: var(--itl-serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html.itl a {
  color: inherit;
}
html.itl .itl-bar {
  background: var(--itl-paper);
}
.itl-bar nav {
  display: flex;
  gap: 1.4rem;
}

.itl-wrap {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}

/* --- Home: introduction ---------------------------------------------------- */

.intro {
  max-width: 40rem;
  padding: clamp(4rem, 12vh, 8rem) 0 clamp(3rem, 8vh, 5rem);
}
.intro h1 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(2.8rem, 8vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.01em;
}
.intro__tagline {
  margin: 1.4rem 0 0;
  font-family: var(--itl-fell);
  font-style: italic;
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  line-height: 1.35;
}
.intro__bio p {
  margin: 1.1rem 0 0;
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--itl-ink);
  text-wrap: pretty;
}
.intro__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin: 1.8rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
  font-variant-caps: all-small-caps;
  font-feature-settings: "kern", "smcp", "c2sc";
  letter-spacing: 0.14em;
}
.intro__links a {
  text-decoration: none;
  border-bottom: 1px solid var(--itl-rule);
}
.intro__links a:hover {
  border-color: currentColor;
}

/* --- Home: the shelf ------------------------------------------------------- */

.shelf {
  padding: 2.5rem 0 6rem;
  border-top: 1px solid var(--itl-rule);
}
.shelf h2 {
  margin: 0 0 2rem;
  font-size: 1.05rem;
  font-weight: 500;
  font-variant-caps: all-small-caps;
  font-feature-settings: "kern", "smcp", "c2sc";
  letter-spacing: 0.18em;
  color: var(--itl-slate);
}
.covers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 760px) {
  .covers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.cover {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  aspect-ratio: 2 / 3;
  padding: 12% 10% 10%;
  background: var(--book);
  color: var(--itl-cream);
  text-decoration: none;
  text-align: center;
  box-shadow: inset 6px 0 0 rgb(0 0 0 / 0.18), 0 1px 2px rgb(0 0 0 / 0.12);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* A fine inset frame, as on a cloth binding. */
.cover::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid rgb(244 239 228 / 0.35);
  pointer-events: none;
}
.cover:hover,
.cover:focus-visible {
  transform: translateY(-4px);
  box-shadow: inset 6px 0 0 rgb(0 0 0 / 0.18), 0 14px 28px rgb(0 0 0 / 0.18);
}
.cover__no {
  font-size: 0.95rem;
  font-variant-caps: all-small-caps;
  font-feature-settings: "kern", "smcp", "c2sc";
  letter-spacing: 0.2em;
  opacity: 0.85;
}
.cover__title {
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 500;
  line-height: 1.12;
  text-wrap: balance;
}
.cover__count {
  font-family: var(--itl-fell);
  font-style: italic;
  font-size: 1rem;
  opacity: 0.9;
}
.covers li p {
  margin: 0.9rem 0 0;
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--itl-slate);
}

/* --- A book's page --------------------------------------------------------- */

.book-hero {
  background: var(--book);
  color: var(--itl-cream);
}
.book-hero .itl-wrap {
  max-width: 44rem;
  padding-top: clamp(3rem, 9vh, 5.5rem);
  padding-bottom: clamp(2.5rem, 7vh, 4rem);
}
.book-hero__back {
  font-size: 0.95rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.16em;
  text-decoration: none;
  opacity: 0.85;
}
.book-hero__no {
  display: block;
  margin-top: 2.4rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.2em;
  opacity: 0.85;
}
.book-hero h1 {
  margin: 0.5rem 0 0;
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 4.25rem);
  line-height: 1.02;
}
.book-hero__summary {
  margin: 1.2rem 0 0;
  max-width: 34rem;
  font-size: 1.25rem;
  line-height: 1.55;
}
.book-hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.14em;
}
.book-hero__links a {
  text-decoration: none;
  border-bottom: 1px solid rgb(244 239 228 / 0.45);
}
.pieces {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem clamp(1.25rem, 5vw, 3rem) 6rem;
  list-style: none;
}
.pieces li {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--itl-rule);
}
.pieces time {
  font-family: var(--itl-fell);
  font-style: italic;
  font-size: 1rem;
  color: var(--itl-slate);
}
.pieces h2 {
  margin: 0.25rem 0 0;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
}
.pieces h2 a {
  text-decoration: none;
}
.pieces h2 a:hover {
  color: var(--book);
}
.pieces p {
  margin: 0.4rem 0 0;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--itl-slate);
}
.pieces__empty {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem clamp(1.25rem, 5vw, 3rem) 6rem;
  font-size: 1.25rem;
  line-height: 1.6;
}

.itl-foot {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--itl-rule);
  font-size: 0.95rem;
  color: var(--itl-slate);
}

@media (prefers-reduced-motion: reduce) {
  .cover {
    transition: none;
  }
}

/* The shared theme sets the body face with !important and links inherit colour;
   covers and book headers set their own. */
html.itl .cover,
html.itl .book-hero,
html.itl .book-hero a {
  color: var(--itl-cream);
}
html.itl .cover,
html.itl .book-hero h1,
html.itl .pieces h2 {
  font-family: var(--itl-serif);
}
