@charset "utf-8";
@import url('https://fonts.googleapis.com/css2?family=Klee+One&display=swap');

:root {
  --background: #fff;
  --surface: #fffff;
  --text: #292921;
  --muted: #77736c;
  --line: #e3dfd6;
  --accent: #a39476;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family:'Klee One','Noto Serif JP', serif;
  line-height: 1.8;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  min-height: 72px;
  padding: 18px 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.site-logo {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 3px;
}

.back-link {
  color: var(--muted);
  font-size: 13px;
}

.container {
  width: min(1080px, 90%);
  margin: 0 auto;
}

.page-heading {
  padding: 65px 0 45px;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 2px;
}

.page-heading h1 {
font-family:'Noto Serif JP';
  margin: 12px 0;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 500;
}

.lead {
  color: var(--muted);
  font-size: 14px;
}

.library {
  padding-bottom: 80px;
}

.library-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  margin-bottom: 25px;
}

.library-heading h2 {
  font-size: 16px;
  letter-spacing: 2px;
}

.library-heading p {
  color: var(--muted);
  font-size: 12px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 32px;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.filters label span {
  color: var(--muted);
  font-size: 12px;
}

.filters input,
.filters select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.filters input:focus,
.filters select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.book-card {
  min-width: 0;
  padding: 23px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}

.book-category {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 1px;
}

.book-card h3 {
  margin: 14px 0 5px;
  font-size: 19px;
  line-height: 1.6;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.book-author {
  color: var(--muted);
  font-size: 13px;
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.book-meta span,
.tag {
  padding: 3px 8px;
  background: #f0ede6;
  border-radius: 3px;
  font-size: 11px;
}

.book-summary {
  margin: 17px 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.book-tags .tag {
  border: none;
  border-radius: 3px;
  padding: 3px 8px;
  background: #f0ede6;
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.8;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.book-tags .tag:hover {
  background: #e3dfd6;
}

.book-tags .tag.is-active {
  background: var(--accent);
  color: #fff;
}

.book-tags .tag:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.book-link {
  display: inline-block;
  align-self: flex-start;
  margin-top: 16px;
  padding: 6px 0;
  color: var(--accent);
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s ease;
}

.book-link:hover {
  color: var(--text);
}

.message {
  grid-column: 1 / -1;
  color: var(--muted);
  padding: 25px 0;
}

.site-footer {
  padding: 24px 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 800px) {
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .page-heading {
    padding: 45px 0 30px;
  }

  .filters,
  .book-grid {
    grid-template-columns: 1fr;
  }

  .book-card {
    padding: 20px;
  }
}
