/*
Theme Name: NCTB Book 2
Theme URI: https://nctbbook.com/
Description: আধুনিক, দ্রুতগতির ও এসইও-বান্ধব ওয়ার্ডপ্রেস থিম — NCTB পাঠ্যবই ডাউনলোড ওয়েবসাইটের জন্য। মোবাইল ও ডেস্কটপ উভয়ের জন্য উপযোগী।
Author: nctbbook.com
Author URI: https://nctbbook.com/
Version: 2.0.3
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nctbbooks
Tags: education, custom-colors, custom-menu, featured-images, translation-ready, right-sidebar
*/

/* ==========================================================================
   1.0  DESIGN TOKENS
   ========================================================================== */
:root {
  --bg:        #FBFAF6;
  --surface:   #ffffff;
  --ink:       #16241d;
  --ink-soft:  #3a4a41;
  --muted:     #7a877e;
  --muted-2:   #9aa69d;
  --line:      #ece7db;
  --line-2:    #e6e0d2;

  --green:     #15805A;
  --green-d:   #0f6b4a;
  --green-l:   #1b9c6b;
  --green-xl:  #22a874;
  --green-50:  #e6f3ec;
  --green-100: #dcefe2;
  --green-200: #bfe4d0;

  --shadow-sm: 0 5px 16px rgba(20,60,44,.06);
  --shadow-md: 0 10px 24px rgba(8,50,36,.14);
  --shadow-lg: 0 14px 30px rgba(20,60,44,.12);

  --radius-lg: 26px;
  --radius-md: 20px;
  --radius-sm: 13px;

  --maxw: 1140px;
  --font-head: 'Baloo Da 2', 'Noto Sans Bengali', system-ui, sans-serif;
  --font-body: 'Noto Sans Bengali', system-ui, -apple-system, sans-serif;
}

/* ==========================================================================
   2.0  RESET / BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; line-height: 1.2; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }

.nctb-container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: 18px;
  padding-right: 18px;
}
.nctb-visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.nctb-skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--green); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.nctb-skip-link:focus { left: 0; }

/* ==========================================================================
   3.0  HEADER
   ========================================================================== */
.nctb-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,250,246,.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nctb-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 13px; padding-bottom: 13px;
}
.nctb-logo { display: flex; align-items: center; gap: 10px; max-height: 44px; }
.nctb-logo__mark {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 38px;
  background: linear-gradient(140deg, var(--green-l), var(--green-d));
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  box-shadow: 0 4px 12px rgba(15,107,74,.28);
}
/* Image logo (nctb.png, 225×225) capped to header size */
.nctb-logo__img {
  height: 42px !important;
  width: 42px !important;
  border-radius: 10px;
  object-fit: contain;
  display: block;
  flex: 0 0 42px;
}
.nctb-logo__text { font: 800 19px/1 var(--font-head); color: #14231c; }
.nctb-logo__text .yr { color: var(--green); }

.nctb-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nctb-nav__link {
  padding: 7px 12px; border-radius: 999px;
  font: 600 13px var(--font-body); color: var(--ink-soft);
  transition: background .16s, color .16s;
}
.nctb-nav__link:hover,
.nctb-nav__link.is-active { background: var(--green-50); color: var(--green-d); }

.nctb-menu-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line-2);
  border-radius: 12px; background: var(--surface); color: var(--ink);
  font-size: 22px; line-height: 1; align-items: center; justify-content: center;
}
.nctb-mobile-menu { display: none; }

/* ==========================================================================
   4.0  MAIN / HERO
   ========================================================================== */
.nctb-main { max-width: var(--maxw); margin: 0 auto; padding: 20px 18px 0; }

.nctb-hero {
  margin-top: 6px;
  padding: clamp(26px,5vw,44px) clamp(22px,4vw,40px);
  border-radius: var(--radius-lg);
  background: radial-gradient(130% 120% at 0% 0%, var(--green-xl), var(--green-d));
  color: #fff; position: relative; overflow: hidden;
}
.nctb-hero__inner { position: relative; max-width: 640px; }
.nctb-hero__title { font-size: clamp(26px,4.4vw,40px); font-weight: 800; margin: 0 0 8px; }
.nctb-hero__desc { margin: 0; font-size: clamp(14px,1.8vw,17px); opacity: .92; line-height: 1.55; max-width: 520px; }

.nctb-hero__search {
  display: flex; align-items: center; gap: 10px; margin-top: 22px;
  background: #fff; border-radius: 15px; padding: 8px 10px 8px 16px;
  max-width: 460px; box-shadow: 0 10px 24px rgba(8,50,36,.22);
}
.nctb-hero__search .ico { font-size: 17px; color: var(--muted); }
.nctb-hero__search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font: 500 15px var(--font-body); color: var(--ink); min-width: 0;
}
.nctb-hero__search input::placeholder { color: #96a29a; }
.nctb-hero__search button {
  border: 0; background: var(--green); color: #fff;
  padding: 9px 16px; border-radius: 11px; font: 700 14px var(--font-body);
  transition: filter .18s;
}
.nctb-hero__search button:hover { filter: brightness(.94); }

.nctb-levels {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px,1fr));
  gap: 10px; margin-top: 22px;
}
.nctb-level {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  border-radius: 16px; background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.24);
  transition: transform .16s, background .16s;
}
.nctb-level:hover { transform: translateY(-2px); background: rgba(255,255,255,.24); }
.nctb-level__emoji { font-size: 22px; }
.nctb-level__name { font: 700 14px var(--font-head); color: #fff; line-height: 1.2; }
.nctb-level__range { font-size: 11px; color: #dcf3e9; }

/* ==========================================================================
   5.0  SECTIONS + BOOK CARDS
   ========================================================================== */
.nctb-section { margin-top: 40px; scroll-margin-top: 80px; }
.nctb-section__head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--line-2);
}
.nctb-section__title { font-size: clamp(19px,2.6vw,25px); font-weight: 700; color: var(--ink); }
.nctb-section__more { font: 600 13px var(--font-body); color: var(--green); white-space: nowrap; }
.nctb-section__more:hover { text-decoration: underline; }

.nctb-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px;
}

.nctb-card {
  display: flex; gap: 16px; background: var(--surface); border-radius: var(--radius-md);
  padding: 15px; box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s;
}
.nctb-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.nctb-card__label {
  flex: 0 0 128px; height: 168px; border-radius: var(--radius-sm);
  background: linear-gradient(150deg, var(--green-100), var(--green-200));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: inset 3px 0 0 var(--green-l); overflow: hidden; position: relative;
}
.nctb-card__label img { width: 100%; height: 100%; object-fit: cover; }
.nctb-card__label-txt { font: 800 clamp(28px,3.4vw,38px) var(--font-head); color: var(--green-d); }
.nctb-card__label-sub { font-size: 10px; color: var(--green-d); opacity: .72; letter-spacing: .04em; }
.nctb-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nctb-card__meta { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted-2); }
.nctb-card__badge {
  font: 700 10px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--green);
}
.nctb-card__title {
  margin: 5px 0; font: 700 16px var(--font-body); color: var(--ink); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nctb-card:hover .nctb-card__title { color: var(--green-d); }
.nctb-card__desc {
  margin: 0 0 12px; font-size: 12px; color: var(--muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nctb-dlbtn {
  margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px; border-radius: 12px; background: var(--green); color: #fff;
  font: 700 13px var(--font-body); transition: filter .18s, background .18s, color .18s;
}
.nctb-dlbtn:hover { filter: brightness(.94); }
.nctb-dlbtn--outline { background: transparent; border: 1.5px solid var(--green); color: var(--green); }
.nctb-dlbtn--outline:hover { background: var(--green); color: #fff; }

.nctb-empty {
  grid-column: 1 / -1; color: var(--muted); font-size: 14px;
  background: var(--surface); border-radius: var(--radius-md); padding: 22px; text-align: center;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   6.0  IMPORTANT UPDATES
   ========================================================================== */
.nctb-updates {
  background: var(--surface); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm);
}
.nctb-update {
  display: flex; align-items: center; gap: 13px; padding: 15px 18px;
  border-bottom: 1px solid #f1ece1; transition: background .16s;
}
.nctb-update:last-child { border-bottom: 0; }
.nctb-update:hover { background: #f7fbf8; }
.nctb-update__emoji { font-size: 20px; }
.nctb-update__body { flex: 1; min-width: 0; }
.nctb-update__title { font: 600 15px var(--font-body); color: var(--ink); line-height: 1.35; }
.nctb-update__date { font-size: 11.5px; color: var(--muted-2); }
.nctb-update__chev { color: var(--green); font-size: 18px; }

/* ==========================================================================
   7.0  BREADCRUMB + CATEGORY HERO
   ========================================================================== */
.nctb-breadcrumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font: 500 13px var(--font-body); color: var(--muted-2); margin: 22px 0 16px;
}
.nctb-breadcrumb a { color: var(--green); }
.nctb-breadcrumb a:hover { text-decoration: underline; }
.nctb-breadcrumb .sep { color: var(--muted-2); }
.nctb-breadcrumb .current { color: #6f7d74; }

.nctb-cat-hero {
  padding: clamp(24px,4vw,38px) clamp(22px,4vw,38px); border-radius: 24px;
  background: radial-gradient(130% 120% at 0% 0%, var(--green-xl), var(--green-d));
  color: #fff; position: relative; overflow: hidden;
}
.nctb-cat-hero__bg {
  position: absolute; right: -30px; bottom: -40px; font-size: 170px; opacity: .10;
  line-height: 1; pointer-events: none;
}
.nctb-cat-hero__inner { position: relative; }
.nctb-cat-hero__pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.24);
  font: 600 12px var(--font-body); margin-bottom: 14px;
}
.nctb-cat-hero__title { font-size: clamp(24px,4vw,36px); font-weight: 800; }
.nctb-cat-hero__desc { margin: 8px 0 0; font-size: clamp(13px,1.8vw,16px); opacity: .92; line-height: 1.55; max-width: 560px; }
.nctb-cat-hero__count { margin-top: 16px; font: 600 13px var(--font-body); opacity: .85; }

/* ==========================================================================
   8.0  PAGINATION  (matches WP paginate_links markup)
   ========================================================================== */
.nctb-pagination {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 36px;
}
.nctb-pagination .page-numbers {
  padding: 9px 15px; border: 1px solid var(--line-2); border-radius: 11px;
  background: var(--surface); color: var(--ink); font: 600 13px var(--font-body);
  transition: background .16s, color .16s, border-color .16s;
}
.nctb-pagination a.page-numbers:hover { background: var(--green-50); color: var(--green-d); border-color: var(--green-200); }
.nctb-pagination .page-numbers.current { background: var(--green); color: #fff; border-color: var(--green); }
.nctb-pagination .page-numbers.dots { border-color: transparent; background: transparent; color: var(--muted-2); }

/* ==========================================================================
   9.0  SINGLE POST
   ========================================================================== */
.nctb-single { max-width: 800px; margin: 0 auto; padding: 8px 18px 0; }
.nctb-article {
  background: var(--surface); border-radius: var(--radius-md); padding: clamp(18px,4vw,40px);
  box-shadow: var(--shadow-sm); margin-top: 22px;
}
.nctb-article__head { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.nctb-article__meta { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 12.5px; color: var(--muted-2); margin-bottom: 10px; }
.nctb-article__title { text-align: center; font-size: clamp(23px,4vw,36px); font-weight: 800; color: var(--ink); line-height: 1.25; }
.nctb-article__thumb { width: 100%; margin-bottom: 24px; border-radius: 16px; overflow: hidden; background: var(--green-100); }
.nctb-article__thumb img { width: 100%; height: auto; max-height: 520px; object-fit: cover; }

.post-content { color: var(--ink-soft); font-size: 1.06rem; }
.post-content p { margin: 0 0 1.2em; line-height: 1.8; }
.post-content h1, .post-content h2, .post-content h3, .post-content h4 {
  font-family: var(--font-head); color: var(--ink); margin: 1.5em 0 .5em; line-height: 1.3;
}
.post-content h2 { font-size: 1.55rem; }
.post-content h3 { font-size: 1.28rem; }
.post-content h4 { font-size: 1.12rem; }
.post-content a { color: var(--green-d); text-decoration: underline; }
.post-content ul, .post-content ol { margin: 0 0 1.2em; padding-left: 1.5em; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: .4em; }
.post-content img { border-radius: 12px; margin: 1.2em 0; }
.post-content blockquote {
  margin: 1.2em 0; padding: 12px 18px; border-left: 4px solid var(--green);
  background: var(--green-50); border-radius: 0 12px 12px 0; color: var(--ink-soft);
}
.post-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; font-size: .96rem; }
.post-content th, .post-content td { border: 1px solid var(--line-2); padding: 10px 12px; text-align: left; }
.post-content th { background: var(--green-50); color: var(--ink); font-weight: 700; }
.post-content :is(h2,h3) { scroll-margin-top: 80px; }

.nctb-related { margin-top: 30px; padding-top: 22px; border-top: 2px solid var(--line-2); }
.nctb-related__title { font: 700 18px var(--font-head); color: var(--ink); border-left: 4px solid var(--green); padding-left: 12px; margin-bottom: 14px; }
.nctb-related__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.nctb-related__item a { display: flex; align-items: flex-start; gap: 8px; color: var(--ink-soft); font-size: 1rem; transition: color .16s; }
.nctb-related__item a:hover { color: var(--green-d); }
.nctb-related__item .arw { color: var(--green); margin-top: 2px; font-size: .85rem; }

/* ==========================================================================
   10.0  FOOTER
   ========================================================================== */
.nctb-footer { margin-top: 56px; padding: 40px 18px 44px; border-top: 1px solid #eae4d7; text-align: center; }
.nctb-footer__inner { max-width: var(--maxw); margin: 0 auto; }
.nctb-footer__brand { font: 800 20px var(--font-head); color: var(--ink); }
.nctb-footer__brand .yr { color: var(--green); }
.nctb-footer__desc { margin: 10px auto 0; max-width: 420px; font-size: 13px; color: #8a948c; line-height: 1.6; }
.nctb-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin: 20px 0 16px; font-size: 13.5px; }
.nctb-footer__links a { color: var(--ink-soft); }
.nctb-footer__links a:hover { color: var(--green-d); }
.nctb-footer__rule { height: 1px; background: #eae4d7; max-width: 520px; margin: 0 auto 16px; }
.nctb-footer__copy { font-size: 11.5px; color: #aab3ac; line-height: 1.6; }

/* ==========================================================================
   11.0  RESPONSIVE
   ========================================================================== */
@media (max-width: 860px) {
  .nctb-menu-toggle { display: inline-flex; }
  .nctb-nav { display: none; }
  .nctb-mobile-menu.is-open { display: block; }
  .nctb-mobile-menu {
    margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px;
  }
  .nctb-mobile-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
  .nctb-mobile-menu a {
    display: block; padding: 11px 12px; border-radius: 12px;
    font: 600 15px var(--font-body); color: var(--ink-soft);
  }
  .nctb-mobile-menu a:hover, .nctb-mobile-menu a.is-active { background: var(--green-50); color: var(--green-d); }
}
/* Tablet & phone: one card per row so the featured image stays large */
@media (max-width: 720px) {
  .nctb-grid { grid-template-columns: 1fr; gap: 14px; }
  .nctb-card__label { flex: 0 0 118px; height: 152px; }
  .nctb-update__title { font-size: 14px; }

  /* Single post: full-bleed article for maximum table width on mobile */
  .nctb-single { padding-left: 0; padding-right: 0; }
  .nctb-single > .nctb-breadcrumb { padding-left: 14px; padding-right: 14px; }
  .nctb-article { padding-left: 12px; padding-right: 12px; border-radius: 0; box-shadow: none; }
  .nctb-related { padding-left: 14px; padding-right: 14px; }
  .post-content table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 460px) {
  .nctb-card { gap: 12px; padding: 12px; }
  .nctb-card__label { flex: 0 0 96px; height: 128px; }
  .nctb-card__label-txt { font-size: 26px; }
  .nctb-card__title { font-size: 15px; }
}

/* WordPress core alignment / caption helpers */
.aligncenter { margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: .4em 1.2em .8em 0; }
.alignright { float: right; margin: .4em 0 .8em 1.2em; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 6px; }
.sticky, .gallery-caption, .bypostauthor { display: block; }
