@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;1,400&family=IM+Fell+English:ital@0;1&family=IM+Fell+English+SC&display=swap");

:root {
  --black: #26221d;
  --accent: #8b3a3a;        /* oxblood — link */
  --accent-light: #d8b3b3;  /* faded rose — underline */
  --blue: #2f4a35;          /* deep library green — heading */
  --blue-light: #bfd1bf;
  --white: #f4ecd8;         /* warm cream — paper */
  --svg-width: 1989px;

  /* shelf theme variables — cross into the SVG via JS (and default here) */
  --wall: #f4ecd8;
  --frame: #5a3a24;
  --shelf: #6b4a30;
}

/* ############################# global ############################# */

body {
  font-family: "EB Garamond", "Adobe Caslon Pro", Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--black);
  width: 725px;
  padding: 0 50px;
  margin: 0 auto;
  background-color: var(--white);
  line-height: 1.5;
}

h1, h2, h3 { font-family: "IM Fell English", "EB Garamond", serif; }

.enable_transition { transition: background-color 0.15s; }

a, a:visited, a:active {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-light);
}
a:hover { border-bottom: 3px solid var(--accent); }
.enable_transition_a { transition: 0.15s; }

h1, h2, h3 {
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -0.01em;
}

h1 {
  font-size: 48px;
  text-align: center;
  margin: 0 0 14px;
}

h2 { font-size: 24px; text-align: center; }
h3 { font-size: 22px; }

p { margin: 0 0 1em; }

em { font-style: italic; }

ul {
  list-style: none;
  padding: 0;
  line-height: 1.4;
}

li { margin-bottom: 8px; }

section h2 {
  font-size: 22px;
  font-weight: 700;
  text-align: left;
  color: var(--blue);
  margin: 1.4em 0 0.5em;
}

/* Individual book pages (/books/<slug>/) */
article.book-page {
  margin: 1em 0 3em;
}
article.book-page h1 {
  font-family: "IM Fell English", serif;
  font-size: 34px;
  color: var(--blue);
  margin: 0.2em 0 0.6em;
  letter-spacing: 0.01em;
}
article.book-page h2 {
  font-size: 24px;
  text-align: left;
  margin: 1.4em 0 0.5em;
}
article.book-page h3 { font-size: 20px; margin: 1.2em 0 0.4em; }
article.book-page ul { margin: 0.6em 0 1em; padding-left: 1.2em; list-style: disc; }
article.book-page li { margin-bottom: 4px; }
article.book-page code {
  font-family: "Courier New", monospace;
  background: #ede3c9;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.9em;
}
article.book-page hr {
  border: 0;
  border-top: 1px solid rgba(46, 34, 24, 0.25);
  margin: 1.8em 0;
}
article.book-page blockquote {
  margin: 1em 0 1em 0.4em;
  padding: 0.2em 0 0.2em 1.1em;
  border-left: 3px solid rgba(46, 34, 24, 0.35);
  color: #3d342a;
  font-style: italic;
}
article.book-page blockquote p { margin: 0.6em 0; }

/* Library accordion on the home page */
button.library-toggle {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  border-bottom: 1px solid var(--accent-light);
  line-height: 1;
}
button.library-toggle:hover { border-bottom: 3px solid var(--accent); }
button.library-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

ul.library-list {
  margin: 0.8em 0 0;
  padding-left: 1.4em;
  list-style: disc;
  line-height: 1.5;
}
ul.library-list li { margin-bottom: 4px; }

/* Decorative end-of-page flourish */
footer.flourish {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin: 3em 0 2em;
  padding: 1.5em 0 0;
  border-top: 1px solid rgba(46, 34, 24, 0.18);
}
footer.flourish .flourish-item { flex-shrink: 0; }
footer.flourish .flourish-boroughs {
  /* PNG is black-on-white — blend the white into the cream page */
  mix-blend-mode: multiply;
  opacity: 0.9;
}


ul.contact-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

ul.contact-list .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--blue);
}

ul.writing-list li {
  margin-bottom: 10px;
}

ul.writing-list .icon {
  width: 18px;
  height: 18px;
  color: var(--blue);
  vertical-align: -4px;
  margin-right: 8px;
}

hr {
  border: none;
  height: 1px;
  background: var(--blue-light);
  margin: 20px 250px 30px;
}

/* ############################# shelves ############################# */

div.shelves {
  position: relative;
  height: 570px;
  width: 100vw;
  margin-left: calc(50% - 50vw);   /* break out of body's width to full viewport */
  margin-bottom: 20px;
  overflow: hidden;
}

object.shelves {
  position: absolute;
  display: block;
  top: -150px;
  left: 50%;
  transform: translate(-50%);
  width: var(--svg-width);
}

/* ############################# accessibility ############################# */

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

/* Restock button — floats in the top-right corner of the viewport */

a.restock {
  position: fixed;
  top: 22px;
  right: 22px;
  display: inline-block;
  border: 2px solid var(--accent-light);
  border-radius: 10px;
  padding: 1px 0 0 2px;
  width: 44px;
  height: 30px;
  text-align: center;
  z-index: 10;
  background: var(--white);
  font-size: 20px;
  line-height: 26px;
}

a.restock:hover {
  color: var(--white);
  background-color: var(--accent);
  border-color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

/* ############################# mobile ############################# */

@media screen and (max-width: 860px) {
  body { font-size: 36px; line-height: 1.4; }
  h2 { font-size: 40px; }
  section h2 { font-size: 34px; }
  h3 { font-size: 32px; }
  ul.contact-list li { gap: 18px; margin-bottom: 16px; }
  ul.contact-list .icon { width: 32px; height: 32px; }
  ul.writing-list li { margin-bottom: 16px; }
  ul.writing-list .icon { width: 28px; height: 28px; vertical-align: -7px; margin-right: 12px; }
  a.restock { width: 48px; height: 34px; font-size: 22px; line-height: 30px; }

  /* Zoom the shelves slightly on mobile so the nameplate and menu books
     read larger. Everything scales uniformly; boroughs/flag at the edges
     of the visible slice clip a little more. */
  object.shelves {
    transform: translate(-50%) scale(1.1);
  }
}
