/* Internal links, SEO phase 2 batch 2 (2026-12-02). Figma file RSNUgeLUIyRoJwdDH0SSF3.
   1. «كتب مجانية أخرى / More free books» on the free-library book pages (front/partials/more-books.blade.php),
      page 473:2. Card look copied from the library's .resource-card; arrows, dots and the outline pill copied from
      «Latest articles» (latest-articles.css), because neither home.css nor latest-articles.css loads on these pages.
   2. «واصل التعلّم مع بنان / Keep learning with Bnan» under the blog articles (front/partials/keep-learning.blade.php),
      page 475:2.
   style.css styles every h2/h3 (capitalised, Playfair Display, margins, padding): the headings here reset that. */

/* ============================ 1. More free books ============================ */
.bnan-books {
  background: #fdf8ee;
  color: #071e36;
  padding: 48px 20px;
}

.bnan-books,
.bnan-books p,
.bnan-books a,
.bnan-books span,
.bnan-books button {
  font-family: "Poppins", sans-serif !important;
  font-style: normal;
}

.bnan-books[dir="rtl"],
.bnan-books[dir="rtl"] p,
.bnan-books[dir="rtl"] a,
.bnan-books[dir="rtl"] span,
.bnan-books[dir="rtl"] button {
  font-family: "El Messiri", sans-serif !important;
}

.bnan-books__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.bnan-books__head {
  text-align: center;
}

.bnan-books__title {
  margin: 0 !important;
  padding: 0 !important;
  color: #071e36 !important;
  font-family: "Playfair Display", serif !important;
  font-size: 28px !important;
  font-weight: 700 !important;
  line-height: 36px !important;
  letter-spacing: 0;
  text-align: center;
  text-transform: none !important;
}

.bnan-books[dir="rtl"] .bnan-books__title {
  font-family: "Fustat", sans-serif !important;
  font-size: 28px !important;
  line-height: 42px !important;
}

.bnan-books__sub {
  max-width: 760px;
  margin: 12px auto 0 !important;
  color: #5e7380 !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 24px !important;
  text-align: center;
}

.bnan-books[dir="rtl"] .bnan-books__sub {
  font-size: 16px !important;
  line-height: 26px !important;
}

/* the extra padding (cancelled by the negative margin) keeps card shadows from being cut off */
.bnan-books__viewport {
  margin: -12px -16px -40px;
  padding: 12px 16px 40px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.bnan-books__viewport::-webkit-scrollbar {
  display: none;
}

.bnan-books__track {
  display: flex;
  align-items: stretch;
  gap: 20px;
}

.bnan-book {
  box-sizing: border-box;
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scroll-snap-align: start;
  background: #fffcf7;
  border: 2px solid #e4ebe6;
  border-radius: 24px;
  box-shadow: 0 8px 22px rgba(7, 30, 54, 0.07);
  color: inherit !important;
  text-decoration: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bnan-book:hover,
.bnan-book:focus-visible {
  border-color: #b9cac8;
  box-shadow: 0 12px 28px rgba(7, 30, 54, 0.12);
}

.bnan-book:focus-visible {
  outline: 2px solid #006d7c;
  outline-offset: -2px;
}

.bnan-book__cover {
  flex: none;
  height: 210px;
  overflow: hidden;
  background: #edf1e5;
}

.bnan-book__cover img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center top; /* the covers are portrait: keep the title at the top in view */
}

.bnan-book__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 22px 24px;
}

.bnan-book__title {
  margin: 0 !important;
  padding: 0 !important;
  color: #071e36 !important;
  font-family: "Playfair Display", serif !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 26px !important;
  text-transform: none !important;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.bnan-books[dir="rtl"] .bnan-book__title {
  font-family: "Fustat", sans-serif !important;
  line-height: 31px !important;
}

.bnan-book__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bnan-book__badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 20px;
  font-family: inherit !important;
  font-size: 13px !important;
  line-height: 20px !important;
}

.bnan-book__badge--category {
  background: #edf1e5;
  color: #006d7c !important;
  font-weight: 700 !important;
}

.bnan-book__badge--age {
  background: #fcf2e2;
  color: #5e7380 !important;
  font-weight: 600 !important;
}

.bnan-book__foot {
  margin-top: auto;
  padding-top: 13px;
}

.bnan-book__more {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #dde2e3;
  color: #006d7c !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 22px !important;
}

.bnan-books[dir="rtl"] .bnan-book__more {
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 24px !important;
}

.bnan-book__more span {
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
}

.bnan-book:hover .bnan-book__more span,
.bnan-book:focus-visible .bnan-book__more span {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* arrows inside links point the reading direction */
.bnan-il__arrow {
  flex: none;
}

[dir="rtl"] .bnan-il__arrow {
  transform: scaleX(-1);
}

/* carousel arrows and dots: the «Latest articles» controls */
.bnan-books .bnan-parents__nav {
  position: relative;
  z-index: 1;
  width: auto;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.bnan-books .bnan-parents__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.3px solid #c7cdd0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.bnan-books .bnan-parents__arrow img {
  display: block;
}

.bnan-books .bnan-parents__arrow:focus-visible {
  outline: 2px solid #0e7490 !important; /* style.css removes button outlines with !important */
  outline-offset: 3px;
}

.bnan-books[dir="rtl"] .bnan-parents__arrow img {
  transform: scaleX(-1);
}

.bnan-books .bnan-parents__dots {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bnan-books .bnan-parents__dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: #cecfce;
  cursor: pointer;
}

.bnan-books .bnan-parents__dots button.is-on {
  width: 32px;
  background: #0e7490;
}

.bnan-books .bnan-parents__dots button:focus-visible {
  outline: 2px solid #0e7490 !important;
  outline-offset: 3px;
}

/* "View all books": the «Latest articles» outline pill */
.bnan-il__pill-btn {
  align-self: center;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 26px;
  border: 1.5px solid #0e7490;
  border-radius: 999px;
  background: transparent;
  color: #0e7490 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 24px !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.bnan-il__pill-btn span {
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
}

.bnan-il__pill-btn:hover {
  color: #0e7490 !important;
  opacity: 0.8;
}

.bnan-il__pill-btn:focus-visible {
  outline: 2px solid #071e36;
  outline-offset: 3px;
  opacity: 1;
}

@media (max-width: 359px) {
  .bnan-books .bnan-books__title {
    font-size: 26px !important;
    line-height: 34px !important;
  }

  .bnan-books[dir="rtl"] .bnan-books__title {
    font-size: 26px !important;
    line-height: 40px !important;
  }

  .bnan-il__pill-btn {
    padding: 0 24px;
  }
}

@media (min-width: 768px) {
  .bnan-books {
    padding: 64px 40px;
  }

  .bnan-books__inner {
    gap: 32px;
  }

  .bnan-books .bnan-books__title {
    font-size: 32px !important;
    line-height: 42px !important;
  }

  .bnan-books[dir="rtl"] .bnan-books__title {
    font-size: 32px !important;
    line-height: 48px !important;
  }

  .bnan-books .bnan-books__sub {
    font-size: 16px !important;
    line-height: 26px !important;
  }

  .bnan-books[dir="rtl"] .bnan-books__sub {
    font-size: 18px !important;
    line-height: 29px !important;
  }

  .bnan-books__track {
    gap: 24px;
  }

  .bnan-book {
    flex-basis: calc((100% - 24px) / 2);
  }

  .bnan-il__pill-btn {
    height: 52px;
    padding: 0 30px;
    font-size: 18px !important;
    line-height: 27px !important;
  }
}

@media (min-width: 1101px) {
  .bnan-books {
    padding: 80px 40px;
  }

  .bnan-books__inner {
    gap: 40px;
  }

  .bnan-books .bnan-books__title {
    font-size: 40px !important;
    line-height: 52px !important;
  }

  .bnan-books[dir="rtl"] .bnan-books__title {
    font-size: 40px !important;
    line-height: 60px !important;
  }

  .bnan-books .bnan-books__sub {
    font-size: 18px !important;
    line-height: 28px !important;
  }

  .bnan-books[dir="rtl"] .bnan-books__sub {
    font-size: 20px !important;
    line-height: 32px !important;
  }

  .bnan-books__track {
    gap: 31.5px;
  }

  .bnan-book {
    flex-basis: calc((100% - 63px) / 3);
  }

  .bnan-book__cover {
    height: 260px;
  }

  .bnan-book__body {
    gap: 14px;
    padding: 26px 28px 28px;
  }

  .bnan-book__title {
    font-size: 22px !important;
    line-height: 29px !important;
  }

  .bnan-books[dir="rtl"] .bnan-book__title {
    font-size: 22px !important;
    line-height: 34px !important;
  }

  .bnan-book__badge {
    padding: 8px 18px;
    font-size: 14px !important;
    line-height: 21px !important;
  }

  .bnan-book__foot {
    padding-top: 17px;
  }

  .bnan-book__more {
    padding-top: 14px;
  }

  .bnan-il__pill-btn {
    height: 60px;
    padding: 0 36px;
    font-size: 20px !important;
    line-height: 30px !important;
  }
}

/* ============================ 2. Keep learning with Bnan ============================ */
.bnan-learn {
  box-sizing: border-box;
  margin: 28px 0 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #fdf8ee;
  border-radius: 24px;
  color: #071e36;
  text-align: start;
}

.bnan-learn,
.bnan-learn a,
.bnan-learn span {
  font-family: "Poppins", sans-serif !important;
  font-style: normal;
}

.bnan-learn[dir="rtl"],
.bnan-learn[dir="rtl"] a,
.bnan-learn[dir="rtl"] span {
  font-family: "El Messiri", sans-serif !important;
}

.bnan-learn__title {
  margin: 0 !important;
  padding: 0 !important;
  color: #071e36 !important;
  font-family: "Playfair Display", serif !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 28px !important;
  text-align: start;
  text-transform: none !important;
}

.bnan-learn[dir="rtl"] .bnan-learn__title {
  font-family: "Fustat", sans-serif !important;
  line-height: 31px !important;
}

.bnan-learn__items {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bnan-learn__item {
  box-sizing: border-box;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: #fffcf7;
  border: 2px solid #e4ebe6;
  border-radius: 20px;
  color: inherit !important;
  text-decoration: none !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.bnan-learn__item:hover,
.bnan-learn__item:focus-visible {
  background: #f2fafb;
  border-color: #0e7490;
  box-shadow: 0 8px 22px rgba(15, 41, 61, 0.1);
}

.bnan-learn__item:focus-visible {
  outline: 2px solid #0e7490;
  outline-offset: 2px;
}

.bnan-learn__thumb {
  flex: none;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 12px;
  background: #edf1e5;
}

.bnan-learn__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center top;
}

.bnan-learn__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.bnan-learn__pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 18px !important;
}

.bnan-learn[dir="rtl"] .bnan-learn__pill {
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 20px !important;
}

.bnan-learn__pill--course {
  background: #e3f1f5;
  color: #0e7490 !important;
}

.bnan-learn__pill--book {
  background: #edf1e5;
  color: #006d7c !important;
}

.bnan-learn__name {
  color: #071e36 !important;
  font-size: 17px !important;
  font-weight: 600 !important;
  line-height: 25px !important;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.bnan-learn[dir="rtl"] .bnan-learn__name {
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 28px !important;
}

.bnan-learn__meta {
  color: #5e7380 !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 21px !important;
}

.bnan-learn[dir="rtl"] .bnan-learn__meta {
  font-size: 15px !important;
  line-height: 24px !important;
}

.bnan-learn__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0e7490 !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 22px !important;
}

.bnan-learn[dir="rtl"] .bnan-learn__link {
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 24px !important;
}

.bnan-learn__link span {
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
}

.bnan-learn__item:hover .bnan-learn__link span,
.bnan-learn__item:focus-visible .bnan-learn__link span {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 359px) {
  .bnan-learn {
    padding: 16px;
  }
}

@media (min-width: 576px) {
  .bnan-learn {
    padding: 24px;
  }

  .bnan-learn__title {
    font-size: 22px !important;
    line-height: 30px !important;
  }

  .bnan-learn[dir="rtl"] .bnan-learn__title {
    font-size: 22px !important;
    line-height: 34px !important;
  }

  .bnan-learn__item {
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 20px;
  }

  .bnan-learn__thumb {
    width: 104px;
    height: 104px;
    border-radius: 16px;
  }

  .bnan-learn__name {
    font-size: 18px !important;
    line-height: 26px !important;
  }

  .bnan-learn[dir="rtl"] .bnan-learn__name {
    font-size: 19px !important;
    line-height: 30px !important;
  }
}

@media (min-width: 992px) {
  .bnan-learn {
    padding: 28px;
  }

  .bnan-learn__title {
    font-size: 24px !important;
    line-height: 32px !important;
  }

  .bnan-learn[dir="rtl"] .bnan-learn__title {
    font-size: 24px !important;
    line-height: 36px !important;
  }

  .bnan-learn__items {
    flex-direction: row;
  }

  .bnan-learn__item {
    flex: 1 1 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bnan-book,
  .bnan-learn__item,
  .bnan-il__pill-btn {
    transition: none;
  }
}
