/* Scientific Research — category & book pages */
.gate-sr-books-page {
  padding-top: 0;
}

.gate-sr-cat-top {
  position: relative;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.gate-sr-cat-hero {
  position: relative;
  min-height: clamp(480px, 58vw, 620px);
  background-color: #1a2332;
  background-image:
    linear-gradient(to left, rgba(11, 18, 32, 0.22) 0%, rgba(11, 18, 32, 0.48) 38%, rgba(11, 18, 32, 0.82) 62%, rgba(11, 18, 32, 0.94) 100%),
    var(--gate-sr-cat-hero-bg, none);
  background-size: cover, cover;
  background-position: center, 72% center;
  background-repeat: no-repeat;
  border-radius: 0 0 32px 32px;
  overflow: hidden;
  padding-top: var(--gate-hero-header-offset, 148px);
}

.gate-sr-cat-hero__grid {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  min-height: clamp(380px, 46vw, 500px);
  padding-block: clamp(2.25rem, 4vw, 3.25rem);
  direction: ltr;
}

.gate-sr-cat-hero__slider {
  height: clamp(380px, 46vw, 480px);
  width: min(100%, 420px);
  justify-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero — fan / cascade book covers */
.gate-sr-cat-fan {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 380px;
  margin-inline: auto;
}

.gate-sr-cat-fan__item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46%;
  aspect-ratio: 3 / 4;
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.42);
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.45s ease, z-index 0s;
  will-change: transform;
}

.gate-sr-cat-fan__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gate-sr-cat-fan__item--prev {
  transform: translate(-138%, -50%) rotate(-14deg) scale(0.86);
  z-index: 1;
  opacity: 0.78;
}

.gate-sr-cat-fan__item--active {
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
  z-index: 3;
  width: 56%;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.48);
}

.gate-sr-cat-fan__item--next {
  transform: translate(38%, -50%) rotate(14deg) scale(0.86);
  z-index: 2;
  opacity: 0.78;
}

.gate-sr-cat-fan.is-changing .gate-sr-cat-fan__item {
  transition-duration: 0.35s;
}

.gate-sr-cat-hero__copy {
  color: #fff;
  text-align: start;
  padding-inline-end: clamp(0.5rem, 3vw, 2rem);
}

[dir="rtl"] .gate-sr-cat-hero__copy {
  direction: rtl;
}

[dir="ltr"] .gate-sr-cat-hero__copy {
  direction: ltr;
}

.gate-sr-cat-hero__title {
  font-size: clamp(2.15rem, 5vw, 3.5rem);
  font-weight: 800;
  margin: 0 0 1.25rem;
  line-height: 1.12;
  max-width: 780px;
  color: #fff !important;
}

.gate-sr-cat-hero__desc {
  max-width: 720px;
  line-height: 2;
  opacity: 0.96;
  margin: 0;
  font-size: clamp(1rem, 1.7vw, 1.1rem);
  color: #fff !important;
}

.gate-sr-books-back {
  display: inline-block;
  color: inherit;
  opacity: 0.85;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.gate-sr-books-back:hover {
  opacity: 1;
}

/* Quick links — bento diagonal cards */
.gate-sr-quick-links {
  position: relative;
  z-index: 2;
  margin-top: clamp(-3.25rem, -5.5vw, -2.25rem);
  padding-bottom: 0.25rem;
}

.gate-sr-quick-links__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.8vw, 20px);
}

.gate-sr-quick-link {
  position: relative;
  display: block;
  min-height: 156px;
  border-radius: 24px;
  overflow: hidden;
  background: var(--gate-sr-ql-bg, #0d9488);
  color: #fff !important;
  text-decoration: none;
  box-shadow: 0 16px 40px rgba(11, 18, 32, 0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  direction: ltr;
}

.gate-sr-quick-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(11, 18, 32, 0.2);
  color: #fff !important;
}

.gate-sr-quick-link__img {
  position: absolute;
  inset: 0 auto 0 0;
  width: 52%;
  height: 100%;
  object-fit: cover;
  clip-path: polygon(0 0, 100% 0, 68% 100%, 0 100%);
}

.gate-sr-quick-link__body {
  position: relative;
  min-height: 156px;
  margin-left: 38%;
  padding: 1.35rem 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 1;
}

[dir="rtl"] .gate-sr-quick-link__body {
  direction: rtl;
  text-align: right;
}

[dir="ltr"] .gate-sr-quick-link__body {
  direction: ltr;
  text-align: left;
}

.gate-sr-quick-link__body h3 {
  margin: 0;
  font-size: clamp(1.12rem, 2vw, 1.35rem);
  font-weight: 800;
  line-height: 1.35;
  color: #fff !important;
}

.gate-sr-quick-link__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 1rem;
  font-weight: 700;
  font-size: 0.84rem;
  padding-inline: 0;
  border: 0;
  background: transparent;
  width: fit-content;
  opacity: 0.95;
  color: #fff !important;
}

/* Book sections */
.gate-sr-books-section {
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.gate-sr-books-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.65rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(11, 18, 32, 0.12);
}

[dir="rtl"] .gate-sr-books-section__head {
  direction: rtl;
}

[dir="ltr"] .gate-sr-books-section__head {
  direction: ltr;
}

.gate-sr-books-section__head h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3.2vw, 2rem);
  font-weight: 800;
  color: var(--gate-sr-section-accent, #ff6400);
}

.gate-sr-books-search {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(11, 18, 32, 0.08);
  min-width: min(320px, 100%);
  border: 1px solid rgba(11, 18, 32, 0.08);
}

.gate-sr-books-search__icon {
  padding-inline: 0.85rem 0.35rem;
  color: #9ca3af;
  font-size: 1.05rem;
  line-height: 1;
}

.gate-sr-books-search input {
  border: 0;
  padding: 0.75rem 1rem 0.75rem 0.25rem;
  flex: 1;
  min-width: 0;
  outline: none;
  background: transparent;
}

[dir="rtl"] .gate-sr-books-search input {
  padding: 0.75rem 0.25rem 0.75rem 1rem;
}

.gate-sr-books-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.2vw, 22px);
}

[dir="rtl"] .gate-sr-books-grid {
  direction: rtl;
}

[dir="ltr"] .gate-sr-books-grid {
  direction: ltr;
}

.gate-sr-book-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(128px, 148px);
  gap: 1rem;
  background: #fff;
  border-radius: 20px;
  padding: 1.1rem 1.15rem;
  box-shadow: 0 12px 32px rgba(11, 18, 32, 0.09);
  align-items: stretch;
  min-height: 228px;
  direction: ltr;
}

.gate-sr-book-card__cover-wrap {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(11, 18, 32, 0.16);
  align-self: stretch;
  min-height: 100%;
}

.gate-sr-book-card__cover {
  width: 100%;
  height: 100%;
  min-height: 200px;
  object-fit: cover;
  display: block;
}

.gate-sr-book-card__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  text-align: start;
}

[dir="rtl"] .gate-sr-book-card__body {
  direction: rtl;
}

.gate-sr-book-card__title {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.45;
}

.gate-sr-book-card__title a {
  color: inherit;
  text-decoration: none;
}

.gate-sr-book-card__title a:hover {
  color: #ff6400;
}

.gate-sr-book-card__excerpt {
  margin: 0 0 0.85rem;
  color: #5b667a;
  font-size: 0.83rem;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.gate-sr-book-card__author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.gate-sr-book-card__author-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.gate-sr-book-card__author-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex-wrap: wrap;
}

.gate-sr-book-card__author-meta strong {
  font-size: 0.78rem;
  color: #0b1220;
  line-height: 1.3;
  font-weight: 700;
}

.gate-sr-book-card__flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(11, 18, 32, 0.15);
  flex-shrink: 0;
}

.gate-sr-book-card__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin-top: auto;
  padding: 0 1rem;
  border-radius: 999px;
  background: var(--gate-sr-btn, #ff6400);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(255, 100, 0, 0.28);
}

.gate-sr-books-section--master .gate-sr-book-card__btn {
  box-shadow: 0 6px 16px rgba(11, 18, 32, 0.18);
}

.gate-sr-books-pagination {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

.gate-sr-pagination__list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.gate-sr-pagination__item a,
.gate-sr-pagination__item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 0.5rem;
  border-radius: 999px;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.gate-sr-pagination__item a:hover {
  background: rgba(11, 18, 32, 0.06);
  color: #0b1220;
}

.gate-sr-pagination__item--active span {
  background: var(--gate-sr-section-accent, #ff6400);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 100, 0, 0.28);
}

.gate-sr-books-section--master .gate-sr-pagination__item--active span {
  box-shadow: 0 4px 14px rgba(11, 18, 32, 0.2);
}

.gate-sr-pagination__item--disabled span {
  opacity: 0.35;
  cursor: default;
}

.gate-sr-pagination__arrow {
  font-size: 1.1rem;
  line-height: 1;
}

/* Book detail */
.gate-sr-book-detail {
  padding-top: calc(var(--gate-hero-header-offset, 148px) + 1.5rem);
  padding-bottom: 4rem;
}

.gate-sr-book-detail__grid {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.gate-sr-book-detail__slider {
  background: linear-gradient(160deg, #1f2937 0%, #111827 100%);
  border-radius: 24px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  box-shadow: 0 20px 50px rgba(11, 18, 32, 0.18);
}

.gate-sr-book-detail__cover {
  width: min(100%, 240px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.gate-sr-book-btn.is-active {
  filter: brightness(0.95);
  box-shadow: 0 0 0 3px rgba(255, 100, 0, 0.25);
}

.gate-sr-book-detail__media {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.gate-sr-book-media {
  background: #fff;
  border-radius: 18px;
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: 0 10px 28px rgba(11, 18, 32, 0.08);
}

.gate-sr-book-media__label {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0b1220;
}

.gate-sr-book-media__pdf,
.gate-sr-book-media__video {
  width: 100%;
  min-height: 360px;
  border: 0;
  border-radius: 12px;
  background: #f3f4f6;
}

.gate-sr-book-media__video {
  display: block;
  max-height: 420px;
  object-fit: contain;
  background: #111827;
}

.gate-sr-book-media__audio {
  width: 100%;
}

.gate-sr-book-media__download {
  display: inline-flex;
  margin-top: 0.75rem;
  font-weight: 700;
  color: #ff6400;
  text-decoration: none;
}

.gate-sr-book-media__download:hover {
  text-decoration: underline;
}

.gate-sr-book-detail__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin: 0.5rem 0 1rem;
  line-height: 1.25;
}

.gate-sr-book-detail__desc {
  color: #4a5568;
  line-height: 1.9;
  margin-bottom: 1.5rem;
}

.gate-sr-book-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.gate-sr-book-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.35rem;
  border-radius: 999px;
  background: var(--gate-sr-btn, #ff6400);
  color: #fff !important;
  font-weight: 800;
  text-decoration: none;
  border: 2px solid var(--gate-sr-btn, #ff6400);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 100, 0, 0.28);
}

.gate-sr-book-btn--ghost {
  background: #fff;
  color: var(--gate-sr-btn, #ff6400) !important;
  border: 2px solid var(--gate-sr-btn, #ff6400);
  box-shadow: none;
}

.gate-sr-book-detail__author {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(11, 18, 32, 0.08);
}

.gate-sr-book-detail__author-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.gate-sr-book-detail__author strong {
  display: block;
  font-size: 1.05rem;
}

.gate-sr-book-detail__author span {
  color: #0d9488;
  font-weight: 600;
  font-size: 0.9rem;
}

[dir="rtl"] .gate-sr-book-detail__grid {
  direction: rtl;
}

/* Category hero — transparent header + white nav (no JS required) */
body.gate-sr-active:has(.gate-sr-cat-hero) .gate-site-header--overlap:not(.is-scrolled) .gate-site-header__logos-strip,
body.gate-sr-active:has(.gate-sr-cat-hero) .gate-site-header--overlap:not(.is-scrolled) .gate-site-header__bar,
body.gate-sr-cat-page.gate-sr-active .gate-site-header--overlap:not(.is-scrolled) .gate-site-header__logos-strip,
body.gate-sr-cat-page.gate-sr-active .gate-site-header--overlap:not(.is-scrolled) .gate-site-header__bar {
  background: transparent;
  box-shadow: none;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

body.gate-sr-active:has(.gate-sr-cat-hero) .gate-site-header--overlap:not(.is-scrolled) .gate-nav-primary .nav-link,
body.gate-sr-cat-page.gate-sr-active .gate-site-header--overlap:not(.is-scrolled) .gate-nav-primary .nav-link {
  color: #fff !important;
}

body.gate-sr-active:has(.gate-sr-cat-hero) .gate-site-header--overlap:not(.is-scrolled) .gate-nav-primary .nav-link:hover,
body.gate-sr-active:has(.gate-sr-cat-hero) .gate-site-header--overlap:not(.is-scrolled) .gate-nav-primary .nav-link.active,
body.gate-sr-cat-page.gate-sr-active .gate-site-header--overlap:not(.is-scrolled) .gate-nav-primary .nav-link:hover,
body.gate-sr-cat-page.gate-sr-active .gate-site-header--overlap:not(.is-scrolled) .gate-nav-primary .nav-link.active {
  color: #ffb380 !important;
}

body.gate-sr-active:has(.gate-sr-cat-hero) .gate-site-header--overlap:not(.is-scrolled) .gate-nav-primary .nav-link::after,
body.gate-sr-active:has(.gate-sr-cat-hero) .gate-site-header--overlap:not(.is-scrolled) .gate-nav-primary .nav-link.active::after,
body.gate-sr-cat-page.gate-sr-active .gate-site-header--overlap:not(.is-scrolled) .gate-nav-primary .nav-link::after,
body.gate-sr-cat-page.gate-sr-active .gate-site-header--overlap:not(.is-scrolled) .gate-nav-primary .nav-link.active::after {
  background: #ff6400;
}

body.gate-sr-active:has(.gate-sr-cat-hero) .gate-site-header--overlap:not(.is-scrolled) .gate-mega-trigger,
body.gate-sr-active:has(.gate-sr-cat-hero) .gate-site-header--overlap:not(.is-scrolled) .gate-site-header__toggler,
body.gate-sr-cat-page.gate-sr-active .gate-site-header--overlap:not(.is-scrolled) .gate-mega-trigger,
body.gate-sr-cat-page.gate-sr-active .gate-site-header--overlap:not(.is-scrolled) .gate-site-header__toggler {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

body.gate-sr-active:has(.gate-sr-cat-hero) .gate-site-header--overlap:not(.is-scrolled) .gate-btn--lang,
body.gate-sr-cat-page.gate-sr-active .gate-site-header--overlap:not(.is-scrolled) .gate-btn--lang {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

body.gate-sr-active:has(.gate-sr-cat-hero) .gate-site-header--overlap:not(.is-scrolled) .gate-site-header__logo img,
body.gate-sr-active:has(.gate-sr-cat-hero) .gate-site-header--overlap:not(.is-scrolled) .gate-site-header__logo-partner img,
body.gate-sr-cat-page.gate-sr-active .gate-site-header--overlap:not(.is-scrolled) .gate-site-header__logo img,
body.gate-sr-cat-page.gate-sr-active .gate-site-header--overlap:not(.is-scrolled) .gate-site-header__logo-partner img {
  filter: brightness(0) invert(1);
}

@media (max-width: 1199px) {
  .gate-sr-books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .gate-sr-cat-hero__grid {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  .gate-sr-cat-hero__slider {
    max-width: 320px;
    margin-inline: auto;
    justify-self: center;
    height: 340px;
  }

  .gate-sr-cat-hero__copy {
    text-align: center;
  }

  [dir="rtl"] .gate-sr-cat-hero__copy,
  [dir="ltr"] .gate-sr-cat-hero__copy {
    text-align: center;
  }

  .gate-sr-cat-hero__title,
  .gate-sr-cat-hero__desc {
    margin-inline: auto;
  }

  .gate-sr-quick-links {
    margin-top: -1.25rem;
  }

  .gate-sr-quick-links__grid {
    grid-template-columns: 1fr;
  }

  .gate-sr-books-grid {
    grid-template-columns: 1fr;
  }

  .gate-sr-book-detail__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .gate-sr-book-card {
    grid-template-columns: minmax(0, 1fr) 96px;
    min-height: 200px;
  }

  .gate-sr-book-card__cover {
    min-height: 160px;
  }
}
