.book-library .book-categories{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.book-library .book-category{display:block;padding:26px;border:1px solid #e9d9c7;border-radius:16px;background:#fff4e6}
.book-library .book-category:nth-child(n+3){background:#f5f8fc;border-color:#dde4ed}
.book-library .book-category h2{font-size:25px;margin-bottom:18px}
.book-library .book-category span{font-size:14px}
.book-library .book-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.book-library .book-card{display:block;min-width:0;background:white;border:1px solid var(--line);border-radius:16px;overflow:hidden}
.book-library .book-cover{aspect-ratio:4/3;background:#feea9e;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px;color:#192d49}
.book-library .book-cover strong{font-size:56px;line-height:1}
.book-library .book-cover span,.book-library .book-cover small{font:13px Arial,sans-serif}
.book-library .book-card h2{font-size:20px;padding:18px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.book-library .book-card:focus-visible,.book-library .book-category:focus-visible{outline:3px solid #587bae;outline-offset:4px}
@media(max-width:850px){.book-library .book-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.book-library .book-grid,.book-library .book-categories{grid-template-columns:1fr}}


.category-page{padding-block:clamp(28px,5vw,58px)}
.category-page h1{margin:0 0 20px}
.category-page .breadcrumb{margin-bottom:12px}
.book-library .book-categories{gap:16px}
.book-library .book-category{
  display:flex;align-items:end;justify-content:space-between;gap:12px;min-height:150px;
  padding:24px;border-radius:22px;background-color:#fff1df;background-position:center;background-size:cover;
  color:#192d49;
}
.book-library .book-category h2{margin:0;font-size:clamp(19px,2.5vw,29px)}
.book-library .book-category span{font-size:24px}
.book-library .category-ltr-en,.book-library .category-ltr-hi{background-image:url("assets/images/learn-to-read-bg.png")}
.book-library .category-books{list-style:none;margin:0;padding:0;grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr))}
.book-library .category-books .book-card{height:100%;padding:12px;border-radius:16px;background:#fffaf2}
.book-library .category-books img{display:block;width:100%;aspect-ratio:4/5;object-fit:contain}
.book-library .category-books h2{margin:8px 0 0;padding:0;font-size:17px}
@media(max-width:540px){
  .book-library .book-categories{grid-template-columns:1fr}
  .book-library .book-category{min-height:98px;padding:16px}
  .book-library .category-books{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
}
.book-library .book-category.category-rtl-en,.book-library .book-category.category-rtl-hi{background-image:url("assets/images/read-to-learn-bg.png")}

.catalogue-filters { display:flex; flex-wrap:wrap; gap:12px; margin:0 0 16px; }
.catalogue-filters label { display:grid; gap:5px; flex:1 1 180px; }
.catalogue-filters input,.catalogue-filters select { min-height:44px; width:100%; border:1px solid #a9c4d7; border-radius:12px; padding:8px 12px; background:#fff; color:#192d49; }
.book-library .catalogue-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 110px), 132px));
  gap: 12px;
}
.book-library .catalogue-grid .book-card { padding: 8px; border-radius: 12px; }
.book-library .catalogue-grid h2 { font-size: 15px; line-height: 1.3; }
.catalogue-viewer video { display: block; width: 100%; max-height: 380px; }
.catalogue-grid .book-card h2 { white-space:normal; }
.catalogue-grid .book-card small { display:block; margin-top:4px; color:#425b70; }
.catalogue-grid .book-cover { aspect-ratio:4/5; border-radius:10px; background:#e5eef6; }
#more-books,.catalogue-steps { margin-top:20px; }
.catalogue-steps { display:flex; gap:12px; flex-wrap:wrap; }
.catalogue-steps a { display:inline-block; padding:10px 16px; }
.catalogue-viewer { max-width:620px; padding:20px; background:#f5f9fc; border:1px solid #dce8ef; border-radius:18px; text-align:center; }
.catalogue-viewer img { display:block; max-width:min(100%,240px); max-height:280px; object-fit:contain; margin:0 auto 12px; }
@media (max-width: 540px) {
  .book-library .catalogue-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 84px), 106px));
    gap: 8px;
  }
}

.books-section { scroll-margin-top: 120px; padding-block: 20px 32px; }
.books-section[tabindex="-1"]:focus { outline: none; }
.books-section + .books-section { border-top: 1px solid #dbcdbb; }
.books-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.books-intro figure { margin: 0; }
.books-intro img { width: 100%; height: clamp(120px, 22vw, 245px); object-fit: cover; border-radius: 16px; }
.books-draft { padding: 10px 14px; border-radius: 8px; background: #fff0c6; color: #503818; }
.books-draft p { margin: 6px 0 0; }
.books-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0; }
.books-section-heading h3 { margin: 0; }
.books-catalogue-layout { display: grid; gap: 20px; }
.books-catalogue-layout:has(.books-levels) { grid-template-columns: 160px minmax(0,1fr); }
.books-levels { display: grid; gap: 6px; align-content: start; }
.books-levels select { width: 100%; min-height: 44px; padding: 8px; border-radius: 10px; border: 1px solid #a9c4d7; }
@media (max-width: 620px) {
  .books-intro, .books-catalogue-layout:has(.books-levels) { grid-template-columns: 1fr; }
  .books-section { scroll-margin-top: 165px; }
}

.books-ribbon { margin: 18px 0 26px; }
.books-ribbon-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.books-ribbon-heading h4 { margin: 0 auto 0 0; font-size: 1.1rem; }
.books-ribbon-heading button { width: 44px; min-height: 44px; padding: 0; }
.books-ribbon-heading [aria-disabled="true"] { opacity: .45; }
.books-ribbon ul {
  --visible-books: 5;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--visible-books) - 1) * 12px) / var(--visible-books));
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 4px 0 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.books-ribbon li { min-width: 0; scroll-snap-align: start; }
.books-ribbon .book-card { height: 100%; padding: 8px; background: #fffaf2; }
.books-ribbon .book-card:focus-visible { outline-offset: -3px; }
.books-ribbon img, .ribbon-letter { width: 100%; aspect-ratio: 4 / 3; border-radius: 9px; }
.books-ribbon img { display: block; object-fit: contain; }
.ribbon-letter { display: grid; place-items: center; background: #e0eff8; font-size: clamp(2rem, 5vw, 4.5rem); }
.books-ribbon li:nth-child(even) .ribbon-letter { background: #ffe8cc; }
.ribbon-title { display: block; padding: 8px 4px 2px; overflow-wrap: anywhere; }
@media (max-width: 720px) { .books-ribbon ul { --visible-books: 3; } }
@media (max-width: 420px) { .books-ribbon ul { --visible-books: 2; } }

.books-section-heading { flex-wrap: wrap; }
.books-section-heading h3 { margin-right: auto; }

.books-section-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.books-section-actions > a, .books-level-picker > summary {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  font-size: 0.875rem;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.books-level-picker { position: relative; background: transparent; border: 0; padding: 0; }
.books-level-picker > summary { cursor: pointer; list-style: none; }
.books-level-picker > summary::-webkit-details-marker { display: none; }
.books-level-options {
  position: absolute;
  z-index: 5;
  inset: calc(100% + 4px) auto auto 0;
  min-width: 100%;
  display: grid;
  gap: 4px;
  padding: 5px;
  border: 1px solid #88b4d0;
  border-radius: 12px;
  background: #e8f2f9;
}
.books-level-options button { min-height: 36px; padding: 4px 10px; font-size: 0.875rem; white-space: nowrap; }

.books-level-picker > summary::marker { content: ""; }
.books-level-picker > summary .nav-chevron { background: transparent; }
.books-level-picker[open] > summary .nav-chevron { transform: rotate(225deg); }
body > header.digilearning-header { position: sticky; top: 0; z-index: 30; }

.ltr-book-showcase {
  margin-top: clamp(16px, 3vw, 28px);
  padding: clamp(16px, 3vw, 32px);
  background: #fff;
  border: 1px solid #dcebf4;
  border-radius: 24px;
}
#books-ltr + .books-section {
  margin-top: clamp(20px, 4vw, 40px);
}
#books-ltr .books-ribbon .book-card {
  background: #eaf6fd;
  border: 1px solid #c4e1f2;
  border-radius: 16px;
}
#books-ltr .books-ribbon .book-card:hover,
#books-ltr .books-ribbon .book-card:focus-visible {
  background: #dff0fb;
  border-color: #8cbfdb;
}

#app .books-landing .books-intro h2 { font-size: clamp(25px, 2.6vw, 34px); line-height: 1.2; margin: 0 0 16px; }

:is(#books-ltr, #books-rtl) .books-intro { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
:is(#books-ltr, #books-rtl) .books-intro img {
  display: block;
  width: min(100%, clamp(240px, 30vw, 350px));
  height: auto;
  margin-inline: auto;
  border-radius: 0;
}
@media (max-width: 620px) {
  :is(#books-ltr, #books-rtl) .books-intro { grid-template-columns: 1fr; gap: 12px; }
  :is(#books-ltr, #books-rtl) .books-intro img { width: min(72%, 265px); }
}

#books-ltr { padding-block-start: 4px; }
#books-ltr .books-intro {
  grid-template-columns: minmax(0, 1fr) clamp(115px, 20vw, 210px);
  gap: clamp(12px, 3vw, 32px);
}
#books-ltr .books-intro h1 { margin-bottom: 8px; }
#books-ltr .books-intro p { margin: 0; max-width: 62ch; }
#books-ltr .books-intro img { width: 100%; }
#books-ltr .ltr-book-showcase {
  margin-top: 14px;
  padding: clamp(12px, 2vw, 22px);
}
#books-ltr .books-section-heading { margin: 0 0 10px; }
#books-ltr .books-ribbon { margin: 12px 0 16px; }
@media (min-width: 721px) {
  #books-ltr .books-ribbon ul { --visible-books: 4; }
  #books-ltr .books-ribbon img { max-height: 120px; }
}
@media (max-width: 420px) {
  #books-ltr .books-intro { grid-template-columns: minmax(0, 1fr) 82px; }
}

@media (min-width: 621px) {
  :is(#books-ltr, #books-rtl) .books-intro figure {
    transform: translateX(clamp(-36px, -2.8vw, -14px));
  }
  #books-ltr .books-intro { grid-template-columns: minmax(0, 1fr) clamp(150px, 27vw, 280px); }
  #books-ltr .books-intro img { width: min(100%, 210px); }
}
.book-library .books-section-actions > a,
.book-library .books-level-picker > summary,
.book-library .catalogue-steps a,
.book-library .page-back a {
  min-height: 36px;
  height: auto;
  padding: 6px 12px;
  font-size: 0.8125rem;
}
.book-library .books-ribbon-heading {
  flex-wrap: wrap;
  column-gap: 6px;
  row-gap: 4px;
}
.book-library .books-ribbon-heading a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 3px 6px;
  font-size: 0.8rem;
  white-space: nowrap;
}
.book-library .books-ribbon-heading button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1;
}
.books-landing.category-page { padding-block: clamp(16px, 3vw, 36px); }
.books-landing .books-section { padding-block-end: clamp(16px, 2vw, 24px); }
.books-landing .books-ribbon:last-child { margin-bottom: 0; }

#books-ltr .books-intro .books-section-actions {
  justify-content: flex-start;
  margin-top: 10px;
}
#books-ltr .books-level-picker[open] { z-index: 6; }
#books-ltr .books-level-options { width: max-content; white-space: nowrap; }
#books-ltr .books-level-options button { width: 100%; }

:is(#books-ltr, #books-rtl) .books-ribbon ul { grid-auto-columns: 132px; }
:is(#books-ltr, #books-rtl) .books-ribbon .book-card { border-radius: 12px; }
:is(#books-ltr, #books-rtl) .books-ribbon img { aspect-ratio: 4 / 5; max-height: none; }
:is(#books-ltr, #books-rtl) .books-ribbon h2 { font-size: 15px; line-height: 1.3; margin: 8px 0 0; padding: 0; white-space: normal; }
.catalogue-topic + .catalogue-topic { margin-top: 24px; }
.catalogue-topic > h2 { margin: 0 0 10px; }
@media (max-width: 540px) {
  :is(#books-ltr, #books-rtl) .books-ribbon ul { grid-auto-columns: 106px; gap: 8px; }
}

#books-rtl .books-intro {
  grid-template-columns: minmax(0, 1fr) clamp(115px, 24vw, 250px);
}
#books-rtl .books-intro p { margin: 0; max-width: 62ch; }
#books-rtl .books-intro img { width: min(100%, 210px); }
@media (max-width: 420px) {
  #books-rtl .books-intro { grid-template-columns: minmax(0, 1fr) 82px; }
}
