/* Static site styles — supplements shared_layout.css */

@font-face {
  font-family: "Nunito";
  src: url("/static/fonts/Nunito-Variable.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

body {
  font-size: 18px;
}

.loading-msg {
  padding: 40px;
  text-align: center;
  color: #6b7280;
}

/* ── Home layout ─────────────────────────────────────────────── */

.home-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.content-panel {
  min-width: 0;
}

.side-panel {
  position: sticky;
  top: calc(var(--header-height, 57px) + 14px);
  max-height: calc(100vh - var(--header-height, 57px) - 28px);
  overflow-y: auto;
}

.side-title {
  margin: 0 0 12px;
  font-size: 20px;
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  color: #1f2937;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 7px;
  background: #f9fafb;
  border: 1px solid transparent;
  font-weight: 700;
}

.side-link:hover { background: #f0fdfa; border-color: #ccfbf1; }
.side-link.active { background: #0f766e; color: #fff; }

.side-count {
  font-size: 13px;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(0,0,0,0.08);
  white-space: nowrap;
}

.side-link.active .side-count { background: rgba(255,255,255,0.22); }

.content-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); }
.muted { color: #667085; font-size: 14px; }

/* ── Book grid ───────────────────────────────────────────────── */

.book-grid {
  display: grid;
  grid-template-columns: repeat(6, 177px);
  gap: 18px;
  justify-content: start;
}

.book-card .cover { transition: transform 0.12s ease; }
.book-card:hover .cover { transform: translateY(-3px); }
.book-card a { display: block; text-decoration: none; color: inherit; }

.cover {
  position: relative;
  width: 177px;
  height: 266px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
}

.cover img {
  width: 177px;
  height: 266px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.empty-cover {
  color: #6b7280;
  font-size: 13px;
  border: 1px dashed #d1d5db;
  box-sizing: border-box;
}

.book-title {
  padding: 10px 12px 4px;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.3;
}

.book-author {
  display: block;
  padding: 0 12px 10px;
  color: #667085;
  font-size: 12px;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-author:hover { color: #0f766e; text-decoration: underline; }

/* ── Cloud lists (genres / authors) ─────────────────────────── */

.cloud-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.cloud-link {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  color: #1f2937;
  background: #fbfcfe;
  border: 1px solid #edf0f5;
  border-radius: 12px;
  padding: 10px 12px;
}

.cloud-link:hover { background: #f0fdfa; border-color: #ccfbf1; }

.empty {
  border: 1px dashed #d1d5db;
  border-radius: 14px;
  padding: 22px;
  color: #667085;
  background: #fbfcfe;
}

/* ── Book detail layout ──────────────────────────────────────── */

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

.detail-main { min-width: 0; }

.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 18px;
}

.card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.cover-box {
  background: #f3f4f6;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 320px;
}

.cover-media {
  min-height: 320px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.cover-box img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 8px;
}

.book-rating {
  color: #f59e0b;
  font-size: 24px;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
  padding-top: 10px;
  text-align: center;
}

.book-detail-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 36px;
  line-height: 1.1;
  margin: 0 0 8px;
}

.author-signature {
  display: block;
  text-align: right;
  margin-bottom: 12px;
  color: #374151;
  font-size: 30px;
  line-height: 1.2;
  font-family: "Dancing Script", "Brush Script MT", cursive;
  text-decoration: none;
}

.genres { margin: 10px 0 14px; }
.tags { margin: -4px 0 14px; }

.tag {
  display: inline-block;
  background: #e6f7f5;
  color: #0d5a54;
  border-radius: 999px;
  padding: 6px 10px;
  margin: 0 8px 8px 0;
  font-size: 13px;
  text-decoration: none;
}

.genres .tag:hover { background: #ccfbf1; }

.tags .tag {
  background: #fff4e6;
  color: #9a3412;
  border: 1px solid #fdba74;
  font-weight: 700;
}

.description {
  white-space: normal;
  line-height: 1.55;
  font-family: "Nunito", Arial, sans-serif;
  font-weight: 400;
}

.description p { margin: 0 0 1em; }
.description p:last-child { margin-bottom: 0; }
.description ul { margin: 0.2em 0 0.65em 1.2em; padding: 0; }
.description img { max-width: 100%; height: auto; display: block; border-radius: 10px; margin: 0.4em 0 0.7em; }

.resource-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 0;
}

.resource-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed #d1d5db;
}

.resource-group:first-child { border-top: 0; padding-top: 0; }

.resource-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: #0f766e;
  color: white;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.18s ease;
}

.resource-link:hover { background: #0d5a54; }

/* ── Search results ──────────────────────────────────────────── */

.search-note {
  text-align: center;
  color: #6b7280;
  margin-top: 16px;
  font-size: 14px;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 1200px) {
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(177px, 1fr)); }
}

@media (max-width: 900px) {
  .home-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; max-height: none; }
  .detail-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card { grid-template-columns: 1fr; }
  .cover-box { min-height: auto; }
  .cover-media { min-height: 200px; }
}
