/* pdfbooks – books/volumes index (test.php inside the site template,
   test.html standalone). Light palette that matches contentver3/style.css
   (navy #002d6a, plum #ab1e56, grey #757575, bg #f9f9f9). All rules are
   scoped to .pvindex. */

.pvindex {
  direction: rtl;
  text-align: right;
  color: #555;
  font-size: 15px;
  line-height: 1.7;
  padding: 6px 0 24px;
}
.pvindex, .pvindex * { box-sizing: border-box; }

.pvindex-intro { color: #757575; margin: 0 0 14px; }

.pvindex-book { margin: 0 0 26px; }
.pvindex-book h2 {
  font-size: 18px;
  font-weight: bold;
  color: #002d6a;
  margin: 0 0 12px;
  padding: 0 0 8px;
  border-bottom: 2px solid #f0f0f0;
}
.pvindex-book h2 small { font-size: 13px; font-weight: normal; color: #757575; }

.pvindex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.pvindex-card {
  display: block;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  padding: 0;
  margin: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.pvindex-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,45,106,.15);
  border-color: #ab1e56;
  text-decoration: none;
  color: inherit;
}
.pvindex-thumb {
  aspect-ratio: 7 / 10;
  background: #e9e9e9 center / cover no-repeat;
  position: relative;
}
.pvindex-thumb::after { content: ""; position: absolute; inset: 0; box-shadow: inset 12px 0 20px -12px rgba(0,0,0,.45); }
.pvindex-meta { padding: 10px 12px 12px; }
.pvindex-meta b { display: block; font-size: 14px; color: #002d6a; margin-bottom: 4px; line-height: 1.5; }
.pvindex-meta span { color: #888; font-size: 12px; direction: ltr; unicode-bidi: embed; display: inline-block; }
.pvindex-meta span.pvindex-vauthor { display: block; direction: rtl; color: #757575; margin-bottom: 2px; }
.pvindex-meta em { font-style: normal; }

/* book-level author / note lines (from books.json) */
.pvindex-author { color: #ab1e56; font-size: 14px; margin: -6px 0 10px; }
.pvindex-note   { color: #757575; font-size: 13px; margin: -4px 0 12px; }
.pvindex-empty  { color: #757575; padding: 20px 0; }

/* "whole book in one file" card */
.pvindex-card-full { border-style: dashed; }
.pvindex-card-full .pvindex-meta b { color: #ab1e56; }

/* ---- books view: one card per book (landing page) – "bookshelf" look ---- */
.pvindex-grid-books {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 40px 34px;
  padding: 14px 4px 26px;
}
.pvindex-card-book {
  display: flex;
  flex-direction: column;
  padding: 22px 22px 20px;
  border-radius: 14px;
  border-color: #e9e9e9;
  background: linear-gradient(180deg, #fff 0%, #fff 62%, #f7f8fa 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.pvindex-card-book:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 34px rgba(0,45,106,.16);
}
/* the cover: a framed "book" with a spine on the right (Arabic books open from the right) */
.pvindex-card-book .pvindex-thumb {
  width: 78%;
  margin: 0 auto 18px;
  border-radius: 3px 6px 6px 3px;
  background-color: #eee;
  box-shadow: 0 14px 22px -10px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.08);
  transition: transform .2s, box-shadow .2s;
}
.pvindex-card-book .pvindex-thumb::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 91%, rgba(0,0,0,.18) 96%, rgba(255,255,255,.35) 98%, rgba(0,0,0,.25) 100%),
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 30%);
}
.pvindex-card-book:hover .pvindex-thumb {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 22px 30px -12px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.08);
}
.pvindex-card-book .pvindex-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 0;
}
.pvindex-card-book .pvindex-meta b {
  font-size: 16px;
  line-height: 1.55;
  margin-bottom: 6px;
  min-height: 2.6em;                     /* keeps the buttons of a row aligned */
}
.pvindex-card-book .pvindex-meta span.pvindex-vauthor {
  font-size: 13px;
  color: #757575;
  margin-bottom: 10px;
}
/* action pill, always at the bottom of the card */
.pvindex-card-book .pvindex-meta span.pvindex-count {
  display: inline-block;
  direction: rtl;
  margin: auto auto 0;
  padding: 7px 18px;
  border: 1px solid #ab1e56;
  border-radius: 20px;
  color: #ab1e56;
  font-size: 13px;
  font-weight: bold;
  line-height: 1.4;
  transition: background .15s, color .15s;
}
.pvindex-card-book:hover .pvindex-meta span.pvindex-count { background: #ab1e56; color: #fff; }
/* volume count badge on the cover */
.pvindex-badge {
  position: absolute;
  right: -8px;
  top: 12px;
  z-index: 1;
  background: #002d6a;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 6px 10px 6px 12px;
  border-radius: 12px 0 0 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
@media (max-width: 640px) {
  .pvindex-grid-books { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 14px; padding: 8px 0 16px; }
  .pvindex-card-book { padding: 14px 12px 14px; border-radius: 10px; }
  .pvindex-card-book .pvindex-thumb { width: 86%; margin-bottom: 12px; }
  .pvindex-card-book .pvindex-meta b { font-size: 14px; }
  .pvindex-card-book .pvindex-meta span.pvindex-count { padding: 6px 14px; font-size: 12px; }
}
/* volumes view header ("← جميع كتب PDF" link + title) */
.pvindex-intro a { color: #ab1e56; }

/* ---- volumes view: same bookshelf look, slightly smaller (a book may have 30 volumes) ---- */
.pvindex-grid-shelf {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 32px 26px;
  padding: 12px 4px 26px;
}
.pvindex-card-vol {
  display: flex;
  flex-direction: column;
  padding: 18px 16px 16px;
  border-radius: 12px;
  border-color: #e9e9e9;
  background: linear-gradient(180deg, #fff 0%, #fff 62%, #f7f8fa 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.pvindex-card-vol:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 30px rgba(0,45,106,.15);
}
.pvindex-card-vol .pvindex-thumb {
  width: 80%;
  margin: 0 auto 14px;
  border-radius: 3px 6px 6px 3px;
  background-color: #eee;
  box-shadow: 0 12px 20px -10px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.08);
  transition: transform .2s, box-shadow .2s;
}
.pvindex-card-vol .pvindex-thumb::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 91%, rgba(0,0,0,.18) 96%, rgba(255,255,255,.35) 98%, rgba(0,0,0,.25) 100%),
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 30%);
}
.pvindex-card-vol:hover .pvindex-thumb {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 20px 28px -12px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.08);
}
.pvindex-card-vol .pvindex-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0;
}
.pvindex-card-vol .pvindex-meta b { font-size: 15px; margin-bottom: 4px; }
.pvindex-card-vol .pvindex-meta span.pvindex-vauthor { font-size: 12px; margin-bottom: 4px; }
/* file size as a small grey chip */
.pvindex-card-vol .pvindex-meta span:not(.pvindex-vauthor):not([id^="md-"]) {
  margin-top: auto;
  padding: 3px 10px;
  border-radius: 12px;
  background: #f2f3f5;
  color: #757575;
  font-size: 11px;
  min-height: 1.6em;
}
.pvindex-card-vol .pvindex-meta span:not(.pvindex-vauthor):not([id^="md-"]):empty,
.pvindex-card-vol .pvindex-meta span em:empty { display: none; }
.pvindex-card-vol.pvindex-card-full { border: 1px dashed #ab1e56; }
@media (max-width: 640px) {
  .pvindex-grid-shelf { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 12px; padding: 8px 0 16px; }
  .pvindex-card-vol { padding: 12px 10px 12px; border-radius: 10px; }
  .pvindex-card-vol .pvindex-thumb { width: 88%; margin-bottom: 10px; }
  .pvindex-card-vol .pvindex-meta b { font-size: 13px; }
}


.pvindex-status {
  margin-top: 20px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 8px;
  font-size: 13px;
  color: #757575;
  line-height: 1.9;
}
.pvindex-status code { color: #ab1e56; direction: ltr; unicode-bidi: embed; background: #f7f7f7; padding: 0 4px; border-radius: 3px; }
.pvindex-status a { color: #ab1e56; }
.pvindex .ok  { color: #1d8a3b; }
.pvindex .bad { color: #c0392b; }
.pvindex kbd {
  display: inline-block;
  background: #fff;
  border: 1px solid #ddd;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 12px;
  font-family: inherit;
  color: #002d6a;
  line-height: 1.6;
}

/* standalone page (test.html) */
body.pvindex-standalone {
  margin: 0;
  background: #f9f9f9;
  font-family: 'GESSTwo', "Segoe UI", Tahoma, Arial, sans-serif;
}
body.pvindex-standalone .pvindex-head {
  background: #002d6a;
  color: #fff;
  padding: 18px 28px;
}
body.pvindex-standalone .pvindex-head h1 { margin: 0 0 4px; font-size: 20px; color: #ffd479; }
body.pvindex-standalone .pvindex-head p { margin: 0; font-size: 13px; opacity: .85; }
body.pvindex-standalone .pvindex { max-width: 1300px; margin: 0 auto; padding: 20px 28px 30px; }
