/* ספרייה מונפשת — מעון איריס. RTL, עברית, ללא משאבים חיצוניים (CSP מחמיר). */
@font-face {
  font-family: "Heebo"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/_lib/fonts/heebo.woff2") format("woff2");
}
@font-face {
  font-family: "Assistant"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/_lib/fonts/assistant.woff2") format("woff2");
}

:root {
  --brand-blue: #1F5FA8;
  --brand-blue-dark: #16467E;
  --brand-blue-tint: #EAF1FA;
  --brand-red: #D62F2F;
  --paper: #FAF7F1;
  --surface: #FFFFFF;
  --text: #1A1F2B;
  --text-muted: #5B6472;
  --border: #E6E1D6;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(26,31,43,.05), 0 6px 22px rgba(26,31,43,.07);
  --shadow-hover: 0 2px 4px rgba(26,31,43,.06), 0 14px 36px rgba(26,31,43,.13);
  --font: "Assistant", "Heebo", system-ui, "Segoe UI", Arial, sans-serif;
  --font-head: "Heebo", "Assistant", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand-blue); }
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 3px;
  border-radius: 10px;
}

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ===== כותרת ===== */
.top {
  padding: 22px 0 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 16px;
  color: var(--text); text-decoration: none;
}
.brand img { width: 30px; height: 30px; display: block; }

.hero { padding: 44px 0 34px; }
.hero h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(34px, 5.2vw, 56px);
  line-height: 1.1;
  letter-spacing: -.01em;
  margin: 0 0 14px;
}
.hero h1 .accent {
  color: var(--brand-blue);
  background: linear-gradient(transparent 72%, rgba(214,47,47,.18) 72%);
  padding: 0 .08em;
}
.hero p {
  margin: 0;
  max-width: 40em;
  font-size: 19px;
  color: var(--text-muted);
}

/* ===== רשת ספרים ===== */
main { flex: 1; padding-bottom: 56px; }

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 28px;
  margin: 0; padding: 0; list-style: none;
}

.book {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.book:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.book-cover {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--brand-blue-tint);
  overflow: hidden;
  position: relative;
}
.book-cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.book-cover .placeholder {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.22), transparent 45%),
    linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
  color: #fff;
  font-family: var(--font-head); font-weight: 800; font-size: 72px;
}

.book-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.book-title {
  font-family: var(--font-head); font-weight: 800;
  font-size: 26px; line-height: 1.2; margin: 0 0 4px;
}
.book-title a { color: var(--text); text-decoration: none; }
.book-title a:hover { color: var(--brand-blue); }
.book-subtitle { margin: 0 0 10px; color: var(--brand-blue); font-weight: 700; font-size: 16px; }
.book-desc { margin: 0 0 14px; color: var(--text-muted); }
.book-meta {
  margin: 0 0 18px; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.book-meta li {
  font-size: 14px; font-weight: 600;
  background: var(--paper); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 12px; color: var(--text-muted);
}

.book-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border-radius: 12px;
  font-family: var(--font-head); font-weight: 700; font-size: 17px;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--brand-blue); color: #fff; }
.btn-primary:hover { background: var(--brand-blue-dark); }
.btn-ghost { background: transparent; color: var(--brand-blue); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--brand-blue); background: var(--brand-blue-tint); }

.empty {
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; color: var(--text-muted);
}

/* ===== טיפים ותחתית ===== */
.tips {
  margin-top: 40px;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.tip {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 18px; font-size: 15px; color: var(--text-muted);
}
.tip strong { display: block; color: var(--text); font-family: var(--font-head); font-size: 16px; margin-bottom: 2px; }

footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 28px;
  font-size: 14px; color: var(--text-muted);
}

/* ===== דף 404 ===== */
.notfound { text-align: center; padding: 80px 0; }
.notfound h1 { font-family: var(--font-head); font-size: 40px; margin: 0 0 10px; }
.notfound p { color: var(--text-muted); margin: 0 0 24px; }

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 28px 0 24px; }
  .hero p { font-size: 17px; }
  .shelf { gap: 20px; }
  .book-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .book, .btn { transition: none; }
  .book:hover { transform: none; }
}
