/* PYU — Kệ Ấn phẩm & Sách lật trực tuyến cuối trang chủ pyu.edu.vn · v20261205
   Chỉ tác động bên trong #pyuPublications và hộp thoại #pyuPubModal (không ảnh hưởng CSS khác của cổng). */

.pyu-pub-wrap {
  clear: both;
  width: 100%;
  float: left;
  padding: 28px 0 32px;
  margin-bottom: 22px;
  background: linear-gradient(180deg, #f5f8fd 0%, #eaf1fb 100%);
  border-top: 1px solid #dbe5f3;
  border-bottom: 1px solid #dbe5f3;
  font-family: "Open Sans", Arial, sans-serif;
  color: #16253d;
}

.pyu-pub-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
}

.pyu-pub-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 700 11px/1.3 "Open Sans", Arial, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0047ba;
  background: rgba(0, 71, 186, 0.08);
  padding: 4px 10px;
  border-radius: 99px;
}

.pyu-pub-eyebrow i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c8102e;
}

.pyu-pub-heading {
  margin: 6px 0 0;
  font: 700 26px/1.2 "Open Sans Condensed", "Arial Narrow", Arial, sans-serif;
  text-transform: uppercase;
  color: #003a99;
  letter-spacing: 0.01em;
}

.pyu-pub-sub {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: #4b5d78;
}

.pyu-pub-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pyu-pub-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid rgba(0, 71, 186, 0.22);
  background: #fff;
  color: #0047ba;
  font: 600 13px/1.2 "Open Sans", Arial, sans-serif;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.18s ease;
}

.pyu-pub-btn:hover,
.pyu-pub-btn:focus {
  background: #f0f6ff;
  border-color: #0047ba;
  color: #003388;
  transform: translateY(-1px);
}

.pyu-pub-btn--primary {
  background: #0047ba;
  border-color: #0047ba;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(0, 71, 186, 0.22);
}

.pyu-pub-btn--primary:hover,
.pyu-pub-btn--primary:focus {
  background: #003691;
  border-color: #003691;
  color: #fff !important;
}

.pyu-pub-btn[hidden] {
  display: none !important;
}

/* Khung chính: Cột thông tin/Kệ sách bên trái + Sân khấu sách lật bên phải */
.pyu-pub-card {
  position: relative;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(8, 42, 108, 0.12);
  border: 1px solid rgba(0, 71, 186, 0.12);
}

.pyu-pub-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, #0047ba 0%, #f2b544 38%, #f8da85 50%, #f2b544 62%, #0047ba 100%);
  pointer-events: none;
}

/* Cột trái: Thông tin cuốn đang mở + Kệ chọn ấn phẩm (khi có từ 2 cuốn trở lên) */
.pyu-pub-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 20px 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  border-right: 1px solid #e4ecf7;
}

.pyu-pub-active-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pyu-pub-cover-Row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.pyu-pub-mini-cover {
  flex: none;
  width: 78px;
  aspect-ratio: 1 / 1.414;
  border-radius: 4px;
  background: #dfe7f3 center / cover no-repeat;
  box-shadow: -3px 0 0 #0b2545, 0 8px 18px rgba(11, 37, 69, 0.22);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.pyu-pub-book-tag {
  display: inline-block;
  font: 700 10.5px/1.2 "Open Sans", Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c8102e;
  margin-bottom: 4px;
}

.pyu-pub-book-title {
  margin: 0;
  font: 700 19px/1.25 "Open Sans Condensed", "Arial Narrow", Arial, sans-serif;
  color: #0b1d3a;
}

.pyu-pub-book-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #51627d;
}

.pyu-pub-book-note {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #3e506c;
  background: #f1f6fe;
  border-left: 3px solid #0047ba;
  padding: 8px 10px;
  border-radius: 0 6px 6px 0;
}

/* Kệ ấn phẩm (tự hiện khi có >= 2 tài liệu) */
.pyu-pub-shelf-box {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #d5e0f0;
}

.pyu-pub-shelf-box[hidden] {
  display: none !important;
}

.pyu-pub-shelf-label {
  font: 700 11px/1.2 "Open Sans", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5b6d88;
  margin-bottom: 10px;
}

.pyu-pub-shelf-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 2px;
}

.pyu-pub-shelf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.pyu-pub-shelf-item:hover {
  background: #eef4fc;
}

.pyu-pub-shelf-item.is-active {
  background: #e6f0ff;
  border-color: rgba(0, 71, 186, 0.32);
}

.pyu-pub-shelf-thumb {
  flex: none;
  width: 34px;
  aspect-ratio: 1 / 1.414;
  border-radius: 2px;
  background: #dbe4f0 center / cover no-repeat;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
}

.pyu-pub-shelf-info {
  min-width: 0;
  flex: 1;
}

.pyu-pub-shelf-info b {
  display: block;
  font-size: 12.5px;
  line-height: 1.3;
  color: #0f2342;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pyu-pub-shelf-info span {
  display: block;
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pyu-pub-side-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e8eef8;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pyu-pub-tip {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.45;
}

/* Cột phải: Sân khấu lật trang trực tiếp */
.pyu-pub-stage {
  position: relative;
  min-height: 470px;
  background: radial-gradient(circle at 50% 32%, #17458f 0%, #092047 68%, #05132b 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 54px 12px;
  overflow: hidden;
  user-select: none;
}

.pyu-pub-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 395px;
  position: relative;
}

.pyu-pub-fliphost {
  margin: 0 auto;
}

.pyu-pub-page {
  background: #fff;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.pyu-pub-page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.pyu-pub-page-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #8fa1b8;
  background: #f8fafc;
}

.pyu-pub-nav {
  position: absolute;
  top: 47%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(5, 20, 48, 0.68);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
  transition: background 0.15s, transform 0.15s;
}

.pyu-pub-nav:hover:not(:disabled) {
  background: #0047ba;
  border-color: #7ab0ff;
}

.pyu-pub-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.pyu-pub-nav--prev { left: 10px; }
.pyu-pub-nav--next { right: 10px; }

.pyu-pub-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 8px;
  color: #dbe7f8;
  font-size: 12.5px;
  z-index: 4;
}

.pyu-pub-bar input[type="range"] {
  width: min(320px, 46vw);
  accent-color: #f2b544;
  cursor: pointer;
}

.pyu-pub-zoom-btn {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pyu-pub-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Hộp thoại Đọc toàn màn hình (Lightbox sắc nét cho chữ nhỏ) */
.pyu-pub-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 50% 25%, #143f85 0%, #030d20 80%);
  display: flex;
  flex-direction: column;
  color: #fff;
  font-family: "Open Sans", Arial, sans-serif;
}

.pyu-pub-modal[hidden] {
  display: none !important;
}

.pyu-pub-modal-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.36);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.pyu-pub-modal-title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pyu-pub-modal-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff !important;
  padding: 6px 13px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
}

.pyu-pub-modal-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.pyu-pub-modal-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 60px;
}

.pyu-pub-modal-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 16px 14px;
  font-size: 13.5px;
  color: #cbd9ee;
}

.pyu-pub-modal-foot input[type="range"] {
  width: min(480px, 60vw);
  accent-color: #f2b544;
}

/* Đáp ứng màn hình Tablet & Điện thoại */
@media (max-width: 991px) {
  .pyu-pub-card {
    grid-template-columns: 1fr;
  }
  .pyu-pub-side {
    border-right: 0;
    border-bottom: 1px solid #e4ecf7;
    padding: 18px 16px;
  }
  .pyu-pub-shelf-list {
    flex-direction: row;
    overflow-x: auto;
    max-height: none;
    padding-bottom: 4px;
  }
  .pyu-pub-shelf-item {
    flex: 0 0 215px;
    background: #f6f9ff;
  }
  .pyu-pub-stage {
    min-height: 430px;
    padding: 14px 44px 12px;
  }
}

@media (max-width: 767px) {
  .pyu-pub-wrap {
    padding: 20px 0 26px;
  }
  .pyu-pub-heading {
    font-size: 21px;
  }
  .pyu-pub-stage {
    min-height: 390px;
    padding: 12px 36px 10px;
  }
  .pyu-pub-canvas {
    min-height: 320px;
  }
  .pyu-pub-nav {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }
  .pyu-pub-nav--prev { left: 4px; }
  .pyu-pub-nav--next { right: 4px; }
  .pyu-pub-modal-stage {
    padding: 10px 38px;
  }
}
