/*
 * Openshelf.
 *
 * One stylesheet, three pages. Hand-written rather than generated, because the
 * site is fifteen static list items and a build step would exist only to
 * produce class names nobody needs.
 *
 * The classes a scraper reads — book, book-title, book-author, book-level,
 * book-licence, book-year — are the contract between this page and the
 * collector. Styling can change freely; renaming one of those is the breaking
 * change the fixture exists to demonstrate.
 */

:root {
  --paper: #fbfaf7;
  --card: #ffffff;
  --ink: #1c1b18;
  --soft: #57544e;
  --faint: #8d8a83;
  --line: #e6e3dc;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.notice {
  margin: 0 0 2rem;
  padding: 0.8rem 1rem;
  border: 1px solid #e8d5a0;
  border-radius: 8px;
  background: #fff8e6;
  color: #6b5518;
  font-size: 13px;
  line-height: 1.5;
}

h1 {
  margin: 0 0 0.4rem;
  font: 400 2.4rem/1 var(--serif);
  letter-spacing: -0.015em;
}

.tagline {
  margin: 0 0 2.5rem;
  color: var(--soft);
  font-size: 15px;
}

/* The state switcher is deliberately visible: anyone should be able to see all
   three versions for themselves rather than take a claim on trust. */
.states-label {
  margin: 0 0 0.55rem;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.states {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 3rem;
}

.states a {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
}

.states a:hover {
  border-color: #c9c5bb;
  color: var(--ink);
}

.states a[aria-current='page'] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.level {
  margin-bottom: 3rem;
}

.level-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.85rem;
  padding-bottom: 0.7rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.level-head h2 {
  margin: 0;
  font: 400 19px var(--serif);
}

.level-head p {
  margin: 0;
  color: var(--soft);
  font-size: 13px;
}

.level-count {
  margin-left: auto;
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.shelf {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 40rem) {
  .shelf {
    grid-template-columns: 1fr 1fr;
  }
}

.book {
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  transition: box-shadow 0.18s ease;
}

.book:hover {
  box-shadow:
    0 1px 2px rgba(28, 27, 24, 0.04),
    0 10px 28px -12px rgba(28, 27, 24, 0.18);
}

.book-title {
  margin: 0 0 0.25rem;
  font: 400 17px/1.35 var(--serif);
}

.book-title a {
  color: var(--ink);
  text-decoration: none;
}

.book-title a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.book-author {
  margin: 0 0 0.9rem;
  color: var(--soft);
  font-size: 13.5px;
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.book-level,
.book-licence,
.licence-tag {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.book-level {
  background: #f0efec;
  color: #57544e;
}

/* Both names carry the same look, so the renamed variant is invisible to a
   reader and visible only to a scraper. A break that also changed the design
   would be caught by eye, which is not the failure worth demonstrating. */
.book-licence,
.licence-tag {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #eaf3ec;
  color: #2f5d3c;
}

.book-year {
  margin-left: auto;
  color: var(--faint);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

footer {
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}

footer p {
  margin: 0 0 0.4rem;
}

.site-licence {
  font-style: italic;
}
