/* =====================================================================
   Inner pages follow the home page: cream page header, navy titles with
   the red/yellow accent, left-aligned section heads with a hairline rule,
   white / light grey section rhythm. Loaded last, so it wins over the
   older layers in site.css and theme.css.
   ===================================================================== */
:root {
  --u-cream: #FBF3D9; --u-cream-line: #F0E4BC;
  --u-red: #D42A2F; --u-red-2: #B51D21; --u-navy: #1F2A6B; --u-yellow: #FFC83D;
  --u-ink: #111827; --u-text: #4b5563; --u-muted: #6b7280; --u-line: #E8EAEE; --u-grey: #F5F6F8;
}

/* ---------- Page header (every inner page) ---------- */
.page-hero, .pub-banner, .tl-head, .tr-hero, .qb-paper-hero {
  background: var(--u-cream); color: var(--u-text); text-align: left;
  padding: 40px 0 36px; border-bottom: 1px solid var(--u-cream-line); position: relative; overflow: hidden;
}
.page-hero::before, .page-hero::after { display: none; }
.page-hero .hero-mosaic, .tx-hero .hero-mosaic { display: none; }
.page-hero h1, .pub-banner h1, .tl-head h1, .tr-hero h1, .qb-paper-hero h1 {
  color: var(--u-navy); font-size: clamp(1.6rem, 3.4vw, 2.5rem); line-height: 1.25; font-weight: 800;
  margin: 8px 0 8px; max-width: 900px; text-shadow: none; overflow-wrap: anywhere;
}
.page-hero h1 { margin-left: 0; margin-right: 0; }
.page-hero p, .pub-banner p, .tl-head p, .tr-hero p, .qb-paper-hero p {
  color: var(--u-text); max-width: 720px; margin: 0; font-size: 1.02rem; line-height: 1.7;
}
.page-hero p { margin-left: 0; margin-right: 0; }
.page-hero h1 .accent-word, .pub-banner h1 .accent-word, .tl-head h1 .accent-word {
  color: var(--u-red); position: relative; z-index: 0; white-space: normal; background: none;
}
.page-hero h1 .accent-word::after, .pub-banner h1 .accent-word::after, .tl-head h1 .accent-word::after {
  content: ""; display: block; position: absolute; left: -1%; right: -1%; bottom: .06em; height: .26em; z-index: -1;
  background: var(--u-yellow); background-image: none; border-radius: 3px; transform: skewX(-8deg); opacity: .9;
}

/* Breadcrumbs: dark on cream */
.crumbs, .tl-crumbs, .tl-crumbs.light { justify-content: flex-start; color: var(--u-muted); font-size: .84rem; margin-bottom: 4px; }
.crumbs a, .crumbs span, .tl-crumbs a, .tl-crumbs span,
.tl-crumbs.light a, .tl-crumbs.light span,
.pub-banner .tl-crumbs.light a, .pub-banner .tl-crumbs.light span { color: var(--u-muted); }
.crumbs a:hover, .tl-crumbs a:hover, .tl-crumbs.light a:hover, .pub-banner .tl-crumbs.light a:hover { color: var(--u-red); }
.page-hero .crumbs { justify-content: flex-start; }

/* Stats and meta inside headers */
.qb-hub-stats div, .qb-paper-stats div { color: var(--u-navy); }
.qb-hub-stats small, .qb-paper-stats small { color: var(--u-muted); }
.qb-paper-meta { color: var(--u-text); }

/* Exam result header */
.tr-hero { padding: 32px 0 36px; }
.tr-ring { background: conic-gradient(var(--t-green) calc(var(--p) * 1%), rgba(31, 42, 107, .1) 0); }
.tr-ring > div { background: #fff; }
.tr-ring strong { color: var(--u-navy); }
.tr-ring span { color: var(--u-muted); }
.tr-main > small { color: var(--u-muted); }
.tr-who { color: var(--u-text); }
.tr-stats div { background: #fff; border-color: var(--u-cream-line); }
.tr-stats b { color: var(--u-navy); }
.tr-stats span, .tr-stats small { color: var(--u-muted); }

/* Leaderboard header */
.lb-hero { text-align: left; padding-bottom: 0; }
.lb-hero .tl-crumbs { justify-content: flex-start; }
.lb-chips { justify-content: flex-start; }
.lb-chips span { background: #fff; border-color: var(--u-cream-line); color: var(--u-text); }
.lb-step strong { color: var(--u-navy); }
.lb-step .block { color: var(--u-navy); background: linear-gradient(180deg, rgba(31, 42, 107, .1), rgba(31, 42, 107, .03)); }

/* Model test hub banner keeps its card shape, on cream */
.tx-hero-wrap { padding: 0; background: var(--u-cream); border-bottom: 1px solid var(--u-cream-line); }
.tx-hero { background: transparent; border-radius: 0; padding: 44px 0 34px; color: var(--u-text); }
.tx-hero::before { display: none; }
.tx-hero h1 { color: var(--u-navy); font-size: clamp(1.7rem, 3.6vw, 2.7rem); }
.tx-hero h1 span { color: var(--u-red); }
.tx-hero h1::after { width: 120px; height: 4px; background: var(--u-yellow); }
.tx-hero p { color: var(--u-text); }
.tx-hero .ml-btn-white { background: var(--u-red); color: #fff; }
.tx-hero .ml-btn-white:hover { background: var(--u-red-2); color: #fff; }
.tx-chips { justify-content: flex-start; }
.tx-chips a { color: var(--u-navy); background: #fff; border-color: var(--u-cream-line); }
.tx-chips a:hover { background: var(--u-navy); color: #fff; border-color: var(--u-navy); }

/* ---------- Section rhythm ---------- */
.section-soft, .ml-grey { background: var(--u-grey); }
.ml-dark { background: var(--u-grey); color: var(--u-text); }
.ml-dark .ml-head h2 { color: var(--u-ink); }
.ml-dark .ml-head p { color: var(--u-text); }
.ml-dark .ml-chips a { background: #fff; border-color: var(--u-line); color: var(--u-ink); }
.ml-dark .ml-chips a:hover { border-color: var(--u-red); color: var(--u-red); }
.ml-sec { padding: 56px 0; }
.section { padding: 64px 0; }

/* Section heads read like the home page: left, compact, hairline rule */
.ml-head, .section-head, .section-head.center, .thead, .thead-c {
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px;
  text-align: left; max-width: none; margin: 0 0 22px; padding-bottom: 10px; border-bottom: 1px solid var(--u-line);
}
.ml-head > *, .section-head > *, .thead > * { margin-left: 0; margin-right: 0; }
.ml-head h2, .section-head h2, .thead h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.65rem); font-weight: 700; margin: 0; color: var(--u-ink); line-height: 1.3;
}
.ml-head p, .section-head p, .thead p { flex-basis: 100%; margin: 0; color: var(--u-muted); font-size: .95rem; }
.section-head h2::after, .ml-head h2::after { display: none; }

/* Plain h2 used as a section title in inner pages */
.tr-section-title, .sv-block h2, .qb-group h2 { color: var(--u-ink); }

/* ---------- Surfaces ---------- */
/* Tinted lavender / teal panels become neutral, like home cards */
:root { --lav: #F5F6F8; --lav-2: #E8EAEE; --tint-a: #F5F6F8; --teal-soft: #F5F6F8; }
.tp-filters details { background: var(--u-grey); border-color: var(--u-line); }
.tp-filters summary { color: var(--u-ink); }
@media (max-width: 860px) {
  /* Stacked layout: two filters per row so the book list starts sooner */
  .tp-filter-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
  .tp-filter-form .tp-stock, .tp-filter-form .tp-clear { grid-column: 1 / -1; }
}
.hm-head { flex-wrap: wrap; }
@media (max-width: 575px) {
  .tr-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-filters .input { grid-column: 1 / -1; }
}
.qb-cat { background: #fff; border-color: var(--u-line); color: var(--u-ink); transition: border-color .15s, color .15s; }
.qb-cat:hover { border-color: var(--u-red); color: var(--u-red); }
.qb-group h2 { border-bottom-color: var(--u-line); }

/* Training cards: fixed media ratio keeps rows even */
.tr-card { height: 100%; }
.tr-card .ph { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--u-grey); }
.tr-card .ph img { display: block; }
.tr-card .sv-ph { min-height: 0; height: 100%; background: var(--u-grey); color: var(--u-navy); }
.sv-ph { background: var(--u-grey); }

/* ---------- Pagination (Bootstrap 5 markup without Bootstrap) ---------- */
nav > .d-flex.d-sm-none { display: flex; justify-content: space-between; gap: 8px; }
nav > .d-none.d-sm-flex { display: none; }
nav > .d-flex.d-sm-none .pagination { margin: 1.5rem 0 0; }
nav > .d-none.d-sm-flex p.small { margin: 0; color: var(--u-muted); font-size: .85rem; }
nav > .d-none.d-sm-flex .fw-semibold { font-weight: 700; color: var(--u-ink); }
@media (min-width: 576px) {
  nav > .d-flex.d-sm-none { display: none; }
  nav > .d-none.d-sm-flex { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 1.5rem; }
  nav > .d-none.d-sm-flex > div:first-child { order: 2; }
  nav > .d-none.d-sm-flex .pagination { margin: 0; }
}
.pagination .active .page-link, .pagination .active span { background: var(--u-navy); border-color: var(--u-navy); }
.pagination .page-link:hover { border-color: var(--u-navy); color: var(--u-navy); }

/* ---------- Responsive safety net ---------- */
html, body { overflow-x: clip; }
img, video, iframe { max-width: 100%; }
h1, h2, h3, p, li, td, dd, a { overflow-wrap: break-word; }

@media (max-width: 991px) {
  .page-hero, .pub-banner, .tl-head, .tr-hero, .qb-paper-hero { padding: 30px 0 28px; }
  .tx-hero { padding: 32px 0 26px; }
  .ml-sec, .section { padding: 44px 0; }
}
@media (max-width: 575px) {
  .page-hero h1, .pub-banner h1, .tl-head h1, .tr-hero h1, .qb-paper-hero h1, .tx-hero h1 { font-size: 1.55rem; }
  .page-hero p, .pub-banner p, .tl-head p, .tx-hero p { font-size: .95rem; }
  .ml-sec, .section { padding: 36px 0; }
  .tx-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tx-chips a { justify-content: center; }
  .tx-hero .ml-btn { width: 100%; justify-content: center; }
  /* iOS zooms into inputs under 16px */
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; }
}

/* 320px phones: language switch lives in the drawer, keep header actions on screen */
@media (max-width: 400px) {
  .tn-actions .tn-lang { display: none; }
  .tn-login { padding: 0 .8rem; font-size: .86rem; }
  .faculty { padding: 1.2rem .8rem; }
  .faculty-photo { width: 84px; height: 84px; }
}
@media (max-width: 360px) {
  .tn-inner { gap: 6px; }
  .tn-actions { gap: 0; }
  .tn-actions .icon-btn { width: 36px; height: 36px; }
  .tn .brand-logo-full { height: 34px; }
}

/* Course detail header: cream like the rest, photo fades in on the right */
.tc-hero { background: var(--u-cream); color: var(--u-text); border-bottom: 1px solid var(--u-cream-line); }
.tc-hero h1 { color: var(--u-navy); text-shadow: none; }
.tc-hero p, .tc-hero.has-photo p { color: var(--u-text); }
.tc-hero.has-photo { background: var(--u-cream) var(--hero-img) right 30% / 52% auto no-repeat; }
.tc-hero.has-photo h1 { text-shadow: none; }
.tc-hero.has-photo::before { background: linear-gradient(90deg, var(--u-cream) 0%, var(--u-cream) 48%, rgba(251, 243, 217, .55) 68%, rgba(251, 243, 217, 0) 100%); }
.tc-meta .rate { color: #B45309; }
.tc-meta .rate small { color: var(--u-muted); }
@media (max-width: 760px) {
  .tc-hero.has-photo { background-image: none; }
  .tc-hero.has-photo::before { display: none; }
}

/* Course fees banner */
.fees-banner { background: var(--u-cream); border: 1px solid var(--u-cream-line); border-radius: 12px; min-height: 0; padding: 36px 40px; }
.fees-banner img, .fees-banner::after { display: none; }
.fees-banner h1 { color: var(--u-navy); }
.fees-banner p { color: var(--u-text); }
@media (max-width: 575px) { .fees-banner { padding: 26px 20px; } }

/* ---------- Book card (bookstore style) ---------- */
.ml-item > .book-card, .book-card { min-width: 0; width: 100%; }
.book-card { position: relative; height: 100%; display: flex; flex-direction: column; text-align: center; padding: 12px 10px 14px; border-radius: 8px; transition: box-shadow .2s; }
.book-card { container-type: inline-size; }
.bk-media { position: relative; display: flex; justify-content: center; padding: 4px 0 2px; }
/* Cover width follows the card, so covers fill the column and line up with the text under them */
.bk-media .book-cover { width: 82%; height: auto; aspect-ratio: 3 / 4.1; border-radius: 2px 4px 4px 2px; box-shadow: 0 1px 2px rgba(17, 24, 39, .08), 0 12px 20px -14px rgba(17, 24, 39, .55); transition: transform .2s; }
.book-card:hover .bk-media .book-cover { transform: translateY(-3px); }
.bk-off { position: absolute; top: -4px; left: 4px; z-index: 2; width: 46px; height: 46px; border-radius: 50%; background: var(--u-red); color: #fff; display: grid; place-content: center; font-size: .62rem; font-weight: 700; line-height: 1.05; box-shadow: 0 0 0 3px #fff; }
.bk-off b { font-size: .86rem; font-weight: 800; }
.bk-out { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap; background: rgba(17, 24, 39, .85); color: #fff; font-size: .7rem; font-weight: 700; padding: .2rem .55rem; border-radius: 4px; }
.book-card.is-out .bk-media .book-cover { filter: grayscale(.6); opacity: .8; }
.book-card .book-info { padding-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; min-width: 0; width: 100%; }
.book-card .book-info h3 { font-size: .93rem; font-weight: 600; line-height: 1.4; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.book-card .book-info h3 a { color: var(--u-ink); }
.book-card .book-info h3 a:hover { color: var(--u-red); }
.book-card .book-info .by { font-size: .78rem; color: var(--u-muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-price { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 0 6px; margin-top: 4px; }
.bk-price strong { font-size: 1.05rem; font-weight: 800; color: var(--u-ink); }
.bk-price del { font-size: .8rem; color: var(--u-muted); }
.book-card .book-stock { font-size: .74rem; font-weight: 600; margin: 0; color: #B45309; }
.bk-cart { width: 100%; margin-top: auto; padding-top: 10px; }
.book-card .add-btn { width: 100%; height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 6px; border: 1px solid var(--u-navy); background: #fff; color: var(--u-navy); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; transition: background .15s, color .15s, opacity .15s; }
.book-card .add-btn .icon { width: 16px; height: 16px; }
.book-card .add-btn:hover { background: var(--u-navy); color: #fff; transform: none; }
.book-card .add-btn[disabled] { border-color: var(--u-line); background: var(--u-grey); color: var(--u-muted); cursor: not-allowed; }
.book-card a:focus-visible, .book-card .add-btn:focus-visible { outline: 2px solid var(--u-navy); outline-offset: 2px; }
/* Mouse users get the button on hover; touch screens always see it */
@media (hover: hover) {
  .book-card:hover { box-shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 14px 30px -18px rgba(17, 24, 39, .35); }
  /* Floats over the cover bottom, so no empty gap is reserved under the price */
  /* Sits on the lower edge of the cover: card padding 12 + media padding 4 + cover height (82% of the card width x 4.1/3) - button 38 - 10 */
  .book-card .bk-cart { position: absolute; left: 14%; right: 14%; width: auto; top: calc(16px + 112cqw - 48px); padding: 0; z-index: 3; opacity: 0; transition: opacity .15s; }
  .book-card .add-btn { box-shadow: 0 8px 18px -10px rgba(17, 24, 39, .6); }
  .book-card:hover .bk-cart, .book-card:focus-within .bk-cart { opacity: 1; }
}
.book-card .cover-art .ca-top { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(.5rem, 2.4vw, .68rem); }
@media (max-width: 575px) {
  .book-card { padding: 8px 4px 10px; }
  .bk-media .book-cover { width: 88%; }
  .bk-off { width: 40px; height: 40px; }
  .bk-off b { font-size: .76rem; }
  .book-card .add-btn span { font-size: .8rem; }
}

/* Book section panel, as on the home page and related books */
.bk-panel { background: #fff; border: 1px solid var(--u-line); border-radius: 10px; padding: 22px 22px 14px; }
.bk-panel .hm-head, .bk-panel .thead { align-items: center; border-bottom: 0; padding-bottom: 0; margin-bottom: 14px; }
.bk-all { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border: 1px solid var(--u-navy); border-radius: 6px; color: var(--u-navy); font-weight: 600; font-size: .9rem; background: #fff; white-space: nowrap; }
.bk-panel .hm-head a.bk-all:hover, .bk-all:hover { background: var(--u-navy); color: #fff; text-decoration: none; }
.bk-panel .ml-track { gap: 8px; padding-bottom: 6px; }
.bk-panel .is-books .ml-track { grid-auto-columns: calc((100% - 40px) / 6); }
.bk-panel .ml-arrow { top: 120px; width: 38px; height: 38px; background: #fff; color: var(--u-ink); border: 1px solid var(--u-line); box-shadow: 0 6px 14px -8px rgba(17, 24, 39, .4); }
.bk-panel .ml-arrow:hover { background: var(--u-navy); color: #fff; }
.bk-panel .ml-arrow.prev { left: -19px; }
.bk-panel .ml-arrow.next { right: -19px; }
.bk-panel .ts-grid { gap: 8px; margin-bottom: 8px; }
@media (max-width: 1100px) { .bk-panel .is-books .ml-track { grid-auto-columns: calc((100% - 24px) / 4); } }
@media (max-width: 767px) { .bk-panel .is-books .ml-track { grid-auto-columns: calc((100% - 16px) / 3); } }
@media (max-width: 575px) {
  .bk-panel { padding: 16px 10px 8px; border-radius: 8px; }
  .bk-panel .hm-head, .bk-panel .thead { padding: 0 6px; }
  .bk-panel .is-books .ml-track { grid-auto-columns: calc((100% - 8px) / 2); }
  .bk-panel .ml-arrow { display: none; }
  .bk-all { height: 34px; padding: 0 12px; font-size: .85rem; }
}
/* Bangla: tracking splits conjunct clusters visually, keep it at zero */
body.lang-bn h4, body.lang-bn h5, body.lang-bn h6, body.lang-bn .tbtn, body.lang-bn .btn, body.lang-bn .ml-btn { letter-spacing: 0; }

/* ---------- Navbar + page width ----------
   One container width for header and content so the logo lines up with
   page content. Main links: Home, Coaching, Publications, More (the rest
   live in More), which leaves room for the live search box. Below 1100px
   the drawer takes over and the search icon opens the same live search
   under the header. */
.container { max-width: 1320px; }
.tn-inner { gap: 14px; }
.tn .brand { flex-shrink: 0; }
.tn-nav { gap: 0; }
.tn-nav .nav-link { padding: .5rem .6rem; font-size: .92rem; }
.tn-actions { gap: 4px; flex-shrink: 0; }
.tn .tn-search { display: block; flex: 1 1 320px; max-width: 420px; min-width: 200px; position: relative; }
.tn-search-ic { display: none; }
.tn-search-pop { position: relative; }
.tn-results { width: 100%; min-width: 320px; }
.tn-nav .drop a.is-current { color: var(--u-red); background: var(--u-grey); }
.drop-sep { display: block; height: 1px; background: var(--u-line); margin: 6px 4px; }
/* Question Bank & Practice is a top-level link, so the search box gives up width before the nav wraps or the actions clip */
@media (max-width: 1440px) { .tn .tn-search { flex-basis: 220px; min-width: 120px; } }
/* Narrow desktops keep the full nav and fold search into its icon, the same drop-down search used on tablets */
@media (min-width: 1101px) and (max-width: 1240px) {
  .tn .tn-search { flex: 0 0 auto; min-width: 0; max-width: none; position: static; }
  .tn-nav { margin-left: auto; }
  .tn-nav .nav-link { padding-left: .42rem; padding-right: .42rem; }
  .tn-search-ic { display: inline-grid; }
  .tn-search-pop { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--u-line); box-shadow: 0 16px 30px -20px rgba(17, 24, 39, .45); padding: 12px 16px 14px; z-index: 75; }
  .tn-search.is-open .tn-search-pop { display: block; }
  .tn-search-pop .tn-search-box { height: 48px; }
  .tn-results { position: static; width: 100%; min-width: 0; margin-top: 8px; max-height: 60vh; box-shadow: none; }
}
@media (max-width: 1100px) {
  .tn-nav { display: none; }
  .tn .menu-btn { display: inline-grid; }
  .tn .tn-search { flex: 0 0 auto; min-width: 0; max-width: none; margin-left: auto; position: static; }
  .tn-actions { margin-left: 0; }
  .tn-search-ic { display: inline-grid; }
  /* The box drops in under the header and spans the screen */
  .tn-search-pop { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--u-line); box-shadow: 0 16px 30px -20px rgba(17, 24, 39, .45); padding: 12px 16px 14px; z-index: 75; }
  .tn-search.is-open .tn-search-pop { display: block; }
  .tn-search.is-open .tn-search-ic { background: var(--u-grey); color: var(--u-ink); }
  .tn-search-pop .tn-search-box { height: 48px; }
  .tn-search-pop .tn-search-box input { font-size: 16px; }
  .tn-results { position: static; width: 100%; min-width: 0; margin-top: 8px; max-height: 60vh; box-shadow: none; }
}
@media (max-width: 359px) {
  .tn .tn-search-ic, .tn-actions .icon-btn, .tn .menu-btn { width: 32px; height: 32px; }
  .tn-login { padding: 0 .6rem; font-size: .82rem; }
  .tn .brand-logo-full { height: 30px; }
}

/* Training card footer: when price and two buttons do not fit (longer Bangla labels), the buttons move to their own row */
.tr-foot { flex-wrap: wrap; }
.tr-foot .sv-actions { display: flex; gap: 6px; margin-left: auto; flex-wrap: nowrap; }
.tr-foot .sv-actions .btn { white-space: nowrap; }

/* AJAX cart: the update button is only a no-JS fallback; dim while saving */
.cart-ajax.is-live [data-update-btn] { display: none; }
.cart-ajax.is-busy .form-card, .cart-ajax.is-busy .summary-card { opacity: .6; transition: opacity .15s; }
