/* ── Shared styles for readingstori.es ── */

/* Typography */
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: 70ch;
  margin: 2em auto;
  padding: 0 1em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Type scale: Cormorant Garamond for headings */
h1 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.8rem, 1.4rem + 2vw, 2.5rem); line-height: 1.15; margin: 0 0 0.2em; font-weight: 600; }
h2 { font-size: 1.5rem; line-height: 1.2; margin: 1.5em 0 0.5em; font-weight: 600; }
h3 { font-size: 1.2rem; line-height: 1.25; margin: 1.2em 0 0.4em; font-weight: 600; }
p { margin: 0 0 1em; }

/* Nav */
nav a { text-decoration: none; }
nav a:hover { text-decoration: underline; }

/* Shared footer */
footer { margin-top: 2em; font-size: 0.85em; opacity: 0.75; }
footer hr { border: none; border-top: 1px solid #444; }
@media (prefers-color-scheme: light) {
  footer hr { border-top-color: #ccc; }
}
footer a { text-decoration: none; }
footer a:hover { text-decoration: underline; }
.footer-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5em 2em; margin: 1em 0; }
.footer-columns h3 { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 0.85em; opacity: 0.6; margin: 0 0 0.3em; font-weight: normal; }
.footer-columns ul { list-style: none; padding: 0; margin: 0 0 1em; }
.footer-columns li { margin: 0.2em 0; }
.footer-copyright { margin-top: 1em; }

/* ── Checklist pages (caldecott, cbca, greenaway, newbery) ── */
.grid {
  display: inline-grid;
  gap: 0.25em;
  align-items: center;
  justify-items: center;
  margin: 1em 0;
}
.grid .label { font-size: 0.7em; color: gray; }
.grid .cell {
  width: 1.2em;
  height: 1.2em;
  border-radius: 0.2em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.unread { background: #444; }
.read { background: #2ea043; }
.starred { background: #2ea043; color: white; font-size: 0.9em; }
.empty { }
@media (prefers-color-scheme: light) {
  .unread { background: #ddd; }
}
.legend { margin: 1em 0; font-size: small; }
.legend .swatch {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  border-radius: 0.15em;
  vertical-align: middle;
  margin-right: 0.2em;
}
.list-read cite { font-weight: bold; }
.list-unread { opacity: 0.5; }

/* ── Controls: filter rows and pill buttons ── */
#controls { margin: 1.2em 0; }
.filter-row { display: flex; gap: 0.4em; flex-wrap: wrap; align-items: center; margin: 0.5em 0; }
.filter-label { font-size: 0.85em; opacity: 0.5; min-width: 2.5em; }
@media (max-width: 480px) {
  .pill-text { display: none; }
  .filter-label { display: none; }
}

.pill {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.85em;
  padding: 0.25em 0.7em;
  border: 1.5px solid;
  border-radius: 3px;
  cursor: pointer;
  background: transparent;
  color: inherit;
  opacity: 0.35;
  transition: all 0.15s;
  white-space: nowrap;
}
.pill:hover { opacity: 0.6; }
.pill:focus-visible { outline: 2px solid; outline-offset: 2px; opacity: 0.6; }
.pill.on { opacity: 1; font-weight: bold; }
.pill.struck { opacity: 1; text-decoration: line-through; }

/* Pill color variants */
.pill.star-pill.on { border-color: #d4a017; color: #d4a017; }
.pill.award-pill.on { border-color: #4a90d9; color: #4a90d9; }
.pill.sort-pill.on { border-color: #e05555; color: #e05555; }
@media (prefers-color-scheme: light) {
  .pill.star-pill.on { border-color: #a07800; color: #a07800; }
  .pill.award-pill.on { border-color: #2a60a9; color: #2a60a9; }
  .pill.sort-pill.on { border-color: #c03535; color: #c03535; }
}
