/* ===============================
   SINGLE LIBRARY PAGE STYLES
================================ */
/* === GLOBAL SECTION SPACING === */

.single-library,
.library-pdf,
.related-libraries,
.library-back {
  margin-top: 80px;
  margin-bottom: 80px;
}

@media (max-width: 768px) {
  .single-library,
  .library-pdf,
  .related-libraries,
  .library-back {
    margin-top: 50px;
    margin-bottom: 50px;
  }
}

/* === HERO BANNER === */
.library-hero {
  position: relative;
  width: 100%;
  height: 520px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.library-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.library-hero-content {
  position: relative;
  z-index: 2;
  padding: 0 20px;
}

.library-hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #fff;
}

.library-hero-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.library-tag {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
}

/* === CONTAINER === */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
  box-sizing: border-box;
}

/* === MAIN CONTENT === */
.single-library {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  color: #222;
}

.library-content {
  margin-bottom: 2rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* === PDF SECTION === */
.library-pdf {
  text-align: center;
  width: 100%;
}

.library-pdf h3 {
  font-size: 1.4rem;
  color: #333;
  margin-bottom: 1rem;
}

.library-pdf-viewer {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
}

.library-pdf-viewer iframe {
  width: 100%;
  height: 900px;
  border: 1px solid #ddd;
  border-radius: 8px;
  display: block;
  max-width: 100%;
  box-sizing: border-box;
}

/* === PDF BLOCK (clean layout) === */
.library-pdf-block {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.pdf-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 10px;
}

.pdf-title {
  font-size: 1rem;
  font-weight: 500;
  color: #111827;
}

.pdf-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f3f4f6;
  color: #111827;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid #d1d5db;
  transition: background 0.3s ease;
  white-space: nowrap;
}

.pdf-view-btn:hover {
  background: #e5e7eb;
}

/* === BACK BUTTON === */
.library-back.left {
  text-align: left;
}

.library-back {
  text-align: center;
}

.back-to-library {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f3f4f6;
  color: #111827;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid #d1d5db;
  transition: background 0.3s ease;
}

.back-to-library:hover {
  background: #e5e7eb;
}

/* === RELATED POSTS === */
.related-libraries {
  background: #f9f9f9;
  padding: 80px 20px;
  border-top: 1px solid #eee;
}

.related-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.8rem;
  color: #333;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.related-item {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.related-item:hover {
  transform: translateY(-5px);
}

.related-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.related-name {
  padding: 1rem;
  font-size: 1.1rem;
  color: #222;
  text-align: center;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
  .library-hero {
    height: 440px;
  }
  .library-hero-title {
    font-size: 2.5rem;
  }
  .library-pdf-viewer iframe {
    height: 750px;
  }
}

@media (max-width: 768px) {
  .library-hero {
    height: 380px;
    padding: 40px 10px;
  }
  .library-hero-title {
    font-size: 2rem;
  }
  .single-library {
    padding: 1.5rem 1rem;
  }
  .library-pdf-viewer iframe {
    height: 550px;
  }
  .library-pdf-block {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .pdf-view-btn,
  .back-to-library {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .library-hero {
    height: 300px;
  }
  .library-hero-title {
    font-size: 1.7rem;
  }
  .library-pdf-viewer iframe {
    height: 420px;
  }
  .back-to-library {
    width: 100%;
    justify-content: center;
  }
}

/* ===============================
   Library Filter Bar
   =============================== */
#library-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px 20px;
  justify-content: center;
  align-items: center;
  background: #f7f7f7;
  border-radius: 12px;
  padding: 25px 30px;
  max-width: 1140px;
  margin: 0 auto;
}

#library-filters input[type="text"],
#library-filters select {
  padding: 5px 16px;
  font-size: 18px;
  font-weight: 600;
  border: 1px solid #ccc;
  border-radius: 100px;
  background: #fff;
  width: 100%;
  height: 46px;
  transition: border-color 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10'%3E%3Cpath fill='none' stroke='%23222' stroke-width='2' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
  padding-right: 35px;
}

#library-filters input[type="text"]:focus,
#library-filters select:focus {
  border-color: #0073aa;
  outline: none;
}

/* Reset Button */
#library-filters #filter-reset {
  background-color: #f88f89;
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 5px 22px;
  border-radius: 100px;
  cursor: pointer;
  height: 46px;
  transition: background-color 0.3s ease;
  font-size: 18px;
  width: 100%;
}

#library-filters #filter-reset:hover {
  background-color: #e5736d;
}

@media (max-width: 768px) {
  #library-filters {
    grid-template-columns: 1fr;
  }
}

/* ===============================
   Section / Library boxes
   =============================== */
.library-sections-grid,
.library-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 50px;
}

/* Card box */
.library-section,
.library-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 15px;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  height: 350px;
  transition: transform 0.2s, box-shadow 0.2s;
}

/* Image wrapper */
.library-section-image,
.library-item-image {
  width: 100%;
  height: 180px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 15px;
}

.library-section-image img,
.library-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Title */
.library-section h3,
.library-item h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 15px 0;
  line-height: 1.2;
}

/* ===============================
   Read More Button (Restored)
   =============================== */
.read-more-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 20px;
  font-size: 16px;
  background-color: #ffe680;
  color: #000;
  font-weight: 600;
  border-radius: 25px;
  text-decoration: none;
  margin-top: auto;
  transition: background 0.2s, transform 0.2s;
  box-sizing: border-box;
}

.read-more-btn:hover {
  background-color: #ffd24d;
}

.read-more-btn::after {
  content: "→";
  font-weight: 700;
  margin-left: 10px;
  font-size: 18px;
}

/* Hover effect */
.library-section:hover,
.library-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* ===============================
   Library Results Styling
   =============================== */
.library-results-list {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.library-result-item {
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  transition: background 0.2s;
}

.library-result-item a {
  text-decoration: none;
  color: #000;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding-right: 30px;
}

.library-result-item:hover {
  background: #f0f0f0;
}

.library-item-icon {
  opacity: 0;
  transform: translateX(0);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-size: 16px;
  transition: all 0.3s ease;
  position: absolute;
  right: 0;
}

.library-result-item a:hover .library-item-icon {
  opacity: 1;
  transform: translateX(5px);
}

/* ===============================
   Pagination Styling
   =============================== */
.pagination-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 50px 0;
}

.pagination-btn {
  background-color: #f3f4f6;
  color: #111827;
  border: 1px solid #d1d5db;
  padding: 10px 18px;
  border-radius: 100px; /* Fully rounded curvature */
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
}

.pagination-btn:hover {
  background-color: #0073aa;
  color: #fff;
  border-color: #0073aa;
}

.pagination-btn.active {
  background-color: #0073aa;
  color: #fff;
  border-color: #0073aa;
}

.pagination-btn.next,
.pagination-btn.prev {
  font-weight: 700;
}


/* Responsive adjustments */
@media (max-width: 992px) {
  .library-sections-grid,
  .library-results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .library-sections-grid,
  .library-results-grid {
    grid-template-columns: 1fr;
  }

  .pagination-btn {
    padding: 8px 14px;
    font-size: 15px;
  }
}

/* ===============================
   Library Page Read More Button Colors (Pastel Final)
   =============================== */
.library-section:nth-child(3n+1) .read-more-btn,
.library-item:nth-child(3n+1) .read-more-btn {
  background-color: #FDE79E; /* soft yellow */
}

.library-section:nth-child(3n+2) .read-more-btn,
.library-item:nth-child(3n+2) .read-more-btn {
  background-color: #F9D7C1; /* soft peach */
}

.library-section:nth-child(3n+3) .read-more-btn,
.library-item:nth-child(3n+3) .read-more-btn {
  background-color: #C2E0E0; /* soft blue */
}

/* Hover effects (slightly darker for feedback) */
.library-section:nth-child(3n+1) .read-more-btn:hover,
.library-item:nth-child(3n+1) .read-more-btn:hover {
  background-color: #FCD96B;
}

.library-section:nth-child(3n+2) .read-more-btn:hover,
.library-item:nth-child(3n+2) .read-more-btn:hover {
  background-color: #F4C3A4;
}

.library-section:nth-child(3n+3) .read-more-btn:hover,
.library-item:nth-child(3n+3) .read-more-btn:hover {
  background-color: #A9D4D4;
}
