/* ============================================================
   BTBB — Balochistan Textbook Board
   Modern government portal theme (green / gold)
   ============================================================ */

:root {
  --green-900: #0b3d2c;
  --green-800: #0e4d36;
  --green-700: #146c43;
  --green-600: #17804e;
  --green-500: #1d9a5f;
  --green-050: #e9f6ef;
  --gold-500: #d4a017;
  --gold-400: #eab938;
  --ink-900: #14201b;
  --ink-700: #33413a;
  --ink-500: #5c6b63;
  --line: #dfe7e2;
  --bg: #f6f9f7;
  --card: #ffffff;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(11, 61, 44, .08);
  --shadow-md: 0 8px 28px rgba(11, 61, 44, .12);
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Merriweather', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink-700);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-500); }
ul { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink-900); line-height: 1.25; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: 50px;
  font-weight: 600; font-size: 15px; font-family: var(--font-body);
  border: 2px solid transparent; cursor: pointer; transition: all .25s ease;
}
.btn-primary { background: var(--gold-500); color: #fff; }
.btn-primary:hover { background: var(--gold-400); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline { border-color: #fff; color: #fff; background: transparent; }
.btn-outline:hover { background: #fff; color: var(--green-800); }
.btn-green { background: var(--green-700); color: #fff; }
.btn-green:hover { background: var(--green-600); color: #fff; transform: translateY(-2px); }
.btn-sm { padding: 8px 18px; font-size: 14px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--green-900); color: #cfe5da; font-size: 13px; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 38px; flex-wrap: wrap; }
.topbar a { color: #cfe5da; display: inline-flex; align-items: center; gap: 6px; }
.topbar a:hover { color: var(--gold-400); }
.topbar-contact { display: flex; gap: 20px; }
.topbar-links { display: flex; gap: 14px; align-items: center; }
.topbar .sep { width: 1px; height: 14px; background: rgba(255,255,255,.25); }

/* ---------- Header ---------- */
.site-header {
  background: #fff; position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm); transition: box-shadow .3s;
}
.site-header.scrolled { box-shadow: var(--shadow-md); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img, .footer-brand img { border-radius: 50%; background: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--font-head); font-size: 19px; color: var(--green-900); }
.brand-ur { font-size: 12px; color: var(--ink-500); margin-top: 3px; }

.nav-toggle { display: none; background: none; border: 0; color: var(--green-900); cursor: pointer; }

.main-nav > ul { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 10px 11px; font-weight: 600; font-size: 14px; color: var(--ink-700);
  border-radius: 8px; transition: all .2s;
}
.main-nav a:hover, .main-nav a.active { color: var(--green-700); background: var(--green-050); }

.has-dropdown { position: relative; }
.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-md);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all .25s ease; z-index: 50; border: 1px solid var(--line);
}
.has-dropdown:hover .dropdown, .has-dropdown.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: block; padding: 9px 14px; font-weight: 500; border-radius: 8px; }

.nav-search form {
  display: flex; align-items: center; background: var(--bg);
  border: 1px solid var(--line); border-radius: 50px; padding: 2px 4px 2px 14px; margin-left: 6px;
}
.nav-search input { border: 0; background: none; outline: none; width: 74px; font-family: inherit; font-size: 14px; transition: width .3s; }
.nav-search input:focus { width: 140px; }
.nav-search button {
  border: 0; background: var(--green-700); color: #fff; width: 30px; height: 30px;
  border-radius: 50%; display: grid; place-items: center; cursor: pointer;
}
.nav-search button:hover { background: var(--green-500); }

/* ---------- Ticker ---------- */
.ticker { background: var(--gold-500); overflow: hidden; }
.ticker-inner { display: flex; align-items: center; gap: 14px; min-height: 40px; }
.ticker-label {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: var(--green-900); color: #fff; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; padding: 5px 14px; border-radius: 50px;
}
.ticker-track-wrap { overflow: hidden; flex: 1; }
.ticker-track { display: inline-flex; gap: 48px; white-space: nowrap; animation: tickerScroll 30s linear infinite; }
.ticker-track:hover { animation-play-state: paused; }
.ticker-track a { color: #3a2c05; font-size: 14px; font-weight: 600; }
.ticker-track a:hover { color: #fff; }
.ticker-date { background: rgba(255,255,255,.35); border-radius: 4px; padding: 1px 8px; font-size: 12px; margin-right: 6px; }
@keyframes tickerScroll { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

/* ---------- Hero slider ---------- */
.hero { position: relative; overflow: hidden; background: var(--green-900); }
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; z-index: 1;
  display: flex; align-items: center;
  background-size: cover; background-position: center;
}
.hero-slide.active { opacity: 1; position: relative; z-index: 2; }
.hero-slide::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(8, 45, 32, .93) 25%, rgba(8, 45, 32, .55) 60%, rgba(8, 45, 32, .25));
}
.hero-content { position: relative; z-index: 3; max-width: 720px; padding: 110px 20px 130px; color: #fff; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: var(--gold-400); margin-bottom: 18px;
}
.hero-kicker::before { content: ''; width: 34px; height: 2px; background: var(--gold-400); }
.hero-content h1 { color: #fff; font-size: clamp(22px, 3vw, 36px); margin-bottom: 18px; font-weight: 900; min-height: 2.5em; }
.type-caret {
  display: inline-block; width: 4px; height: .95em; margin-left: 7px;
  background: var(--gold-400); border-radius: 2px; vertical-align: -0.08em;
  animation: caretBlink .75s step-end infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }
.hero-content p { font-size: clamp(15px, 1.6vw, 19px); color: #d9e9e1; margin-bottom: 32px; max-width: 560px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-dots { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 5; }
.hero-dots button {
  width: 11px; height: 11px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.4); transition: all .3s;
}
.hero-dots button.active { background: var(--gold-400); width: 30px; border-radius: 6px; }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center;
  transition: background .3s; backdrop-filter: blur(4px);
}
.hero-arrow:hover { background: var(--gold-500); }
.hero-arrow.prev { left: 22px; } .hero-arrow.next { right: 22px; }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-alt { background: #fff; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-kicker {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--green-600); background: var(--green-050);
  padding: 6px 16px; border-radius: 50px; margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 12px; }
.section-head p { color: var(--ink-500); }

/* ---------- Service cards ---------- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.service-card {
  background: var(--card); border-radius: var(--radius); padding: 34px 28px;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: all .3s ease; position: relative; overflow: hidden;
}
.service-card::after {
  content: ''; position: absolute; left: 0; top: 0; height: 4px; width: 0;
  background: linear-gradient(90deg, var(--green-600), var(--gold-400)); transition: width .35s ease;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.service-card:hover::after { width: 100%; }
.service-icon {
  width: 58px; height: 58px; border-radius: 14px; display: grid; place-items: center;
  background: var(--green-050); color: var(--green-700); margin-bottom: 20px;
}
.service-card h3 { font-size: 18px; margin-bottom: 10px; font-family: var(--font-body); font-weight: 700; }
.service-card p { font-size: 14.5px; color: var(--ink-500); margin-bottom: 16px; }
.link-more { font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.link-more svg { transition: transform .25s; }
.link-more:hover svg { transform: translateX(4px); }

/* ---------- About / Chairman ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center; }
.about-media { position: relative; }
.about-media img { border-radius: var(--radius); box-shadow: var(--shadow-md); width: 100%; }
.about-badge {
  position: absolute; bottom: -22px; right: -14px; background: var(--green-800); color: #fff;
  border-radius: var(--radius); padding: 20px 26px; text-align: center; box-shadow: var(--shadow-md);
}
.about-badge strong { display: block; font-size: 32px; font-family: var(--font-head); color: var(--gold-400); }
.about-badge span { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; }
.about-text h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 18px; }
.about-text p { margin-bottom: 14px; color: var(--ink-500); }
.about-text blockquote {
  border-left: 4px solid var(--gold-500); background: var(--green-050);
  padding: 18px 22px; border-radius: 0 12px 12px 0; margin: 20px 0; font-style: italic; color: var(--ink-700);
}
.chairman-sign { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.chairman-sign img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 3px solid var(--green-050); }
.chairman-sign strong { display: block; color: var(--ink-900); }
.chairman-sign span { font-size: 13.5px; color: var(--ink-500); }

/* ---------- Stats ---------- */
.stats {
  background: linear-gradient(120deg, var(--green-900), var(--green-700));
  border-radius: 20px; padding: 54px 40px; color: #fff;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 30px;
  position: relative; overflow: hidden;
}
.stats::before {
  content: ''; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px;
  border-radius: 50%; background: rgba(255,255,255,.06);
}
.stat { text-align: center; position: relative; }
.stat strong { display: block; font-size: clamp(30px, 3.4vw, 44px); font-family: var(--font-head); color: var(--gold-400); }
.stat span { font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: #cfe5da; }

/* ---------- Latest columns (news / tenders / downloads) ---------- */
.latest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.latest-col { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow-sm); }
.latest-col-head {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--green-800); color: #fff; padding: 16px 22px;
}
.latest-col-head h3 { color: #fff; font-size: 17px; display: flex; align-items: center; gap: 10px; font-family: var(--font-body); font-weight: 700; }
.latest-col-head a { color: var(--gold-400); font-size: 13px; font-weight: 600; }
.latest-list { padding: 10px 0; }
.latest-list li { border-bottom: 1px dashed var(--line); }
.latest-list li:last-child { border-bottom: 0; }
.latest-list a { display: block; padding: 14px 22px; transition: background .2s; }
.latest-list a:hover { background: var(--green-050); }
.latest-list .item-title { display: block; font-weight: 600; color: var(--ink-900); font-size: 14.5px; line-height: 1.45; }
.latest-list .item-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-500); margin-top: 5px; }
.latest-empty { padding: 22px; color: var(--ink-500); font-size: 14px; }

/* ---------- Why choose us ---------- */
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.why-item {
  display: flex; gap: 18px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; transition: all .3s;
}
.why-item:hover { border-color: var(--green-500); box-shadow: var(--shadow-md); }
.why-icon {
  flex-shrink: 0; width: 50px; height: 50px; border-radius: 50%;
  background: var(--green-050); color: var(--green-700); display: grid; place-items: center;
}
.why-item h3 { font-size: 16.5px; font-family: var(--font-body); font-weight: 700; margin-bottom: 6px; }
.why-item p { font-size: 14px; color: var(--ink-500); }

/* ---------- CTA strip ---------- */
.cta {
  background: linear-gradient(110deg, var(--green-800), var(--green-600));
  border-radius: 20px; padding: 48px; display: flex; align-items: center;
  justify-content: space-between; gap: 26px; flex-wrap: wrap; color: #fff;
}
.cta h2 { color: #fff; font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 6px; }
.cta p { color: #d9e9e1; }
.cta-phone { display: flex; align-items: center; gap: 14px; }
.cta-phone .icon-circle {
  width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.15);
  display: grid; place-items: center; color: var(--gold-400);
}
.cta-phone strong { font-size: 22px; }
.cta-phone span { display: block; font-size: 13px; color: #cfe5da; }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.gallery-card { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); aspect-ratio: 4/3; background: var(--green-050); }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gallery-card:hover img { transform: scale(1.07); }
.gallery-card .gallery-cap {
  position: absolute; inset: auto 0 0 0; padding: 30px 18px 14px;
  background: linear-gradient(transparent, rgba(8,45,32,.9)); color: #fff; font-weight: 600; font-size: 15px;
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  background: linear-gradient(110deg, var(--green-900) 30%, var(--green-700));
  color: #fff; padding: 62px 0 54px; position: relative; overflow: hidden;
}
.page-hero::after {
  content: ''; position: absolute; right: -60px; bottom: -120px; width: 320px; height: 320px;
  border-radius: 50%; background: rgba(255,255,255,.05);
}
.page-hero h1 { color: #fff; font-size: clamp(28px, 3.4vw, 40px); }
.breadcrumb { display: flex; gap: 8px; font-size: 13.5px; color: #b9d6c8; margin-bottom: 12px; flex-wrap: wrap; }
.breadcrumb a { color: var(--gold-400); }

/* ---------- Content / cards ---------- */
.content-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
.content-body { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow-sm); }
.content-body h2, .content-body h3 { margin: 22px 0 12px; }
.content-body p { margin-bottom: 14px; }
.content-body ul, .content-body ol { margin: 0 0 16px 22px; }
.content-body ul { list-style: disc; }
.content-body ol { list-style: decimal; }
.content-body img { border-radius: 10px; margin: 14px 0; }

/* Framed portrait inside CMS pages (e.g. Chairman's Message) */
.page-portrait {
  float: right; width: min(400px, 100%); margin: 6px 0 20px 30px;
  padding: 7px; border-radius: 18px;
  background: linear-gradient(140deg, var(--gold-400), var(--green-600) 60%, var(--green-900));
  box-shadow: var(--shadow-md);
}
.page-portrait img {
  width: 100%; display: block; border-radius: 12px 12px 0 0; margin: 0 !important;
}
.page-portrait:not(:has(figcaption)) img { border-radius: 12px; }
.page-portrait figcaption {
  background: var(--green-900); border-radius: 0 0 12px 12px;
  text-align: center; padding: 14px 12px;
}
.page-portrait figcaption strong {
  display: block; color: #fff; font-family: var(--font-head); font-size: 17px;
}
.page-portrait figcaption span {
  display: block; color: var(--gold-400); font-size: 13px; margin-top: 3px;
  letter-spacing: .03em;
}
@media (max-width: 700px) {
  .page-portrait { float: none; margin: 0 auto 22px; }
}

.sidebar-widget { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.sidebar-widget h3 { font-size: 17px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--green-050); font-family: var(--font-body); font-weight: 700; }
.sidebar-widget ul li { border-bottom: 1px dashed var(--line); }
.sidebar-widget ul li:last-child { border: 0; }
.sidebar-widget ul a { display: block; padding: 10px 2px; font-size: 14.5px; font-weight: 500; }

/* ---------- News cards ---------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px; }
.news-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: all .3s; display: flex; flex-direction: column;
}
.news-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.news-card-img { aspect-ratio: 16/9; overflow: hidden; background: var(--green-050); }
.news-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.news-card:hover .news-card-img img { transform: scale(1.06); }
.news-card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.news-tag {
  align-self: flex-start; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--green-700); background: var(--green-050);
  border-radius: 5px; padding: 3px 10px; margin-bottom: 12px;
}
.news-card h3 { font-size: 17px; font-family: var(--font-body); font-weight: 700; margin-bottom: 8px; }
.news-card h3 a { color: var(--ink-900); }
.news-card h3 a:hover { color: var(--green-700); }
.news-card p { font-size: 14px; color: var(--ink-500); flex: 1; }
.news-card-meta { display: flex; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-500); }
.news-card-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; min-width: 640px; }
table.data th {
  background: var(--green-800); color: #fff; text-align: left; padding: 14px 18px;
  font-size: 13px; text-transform: uppercase; letter-spacing: .05em;
}
table.data td { padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--green-050); }
.badge { display: inline-block; padding: 3px 12px; border-radius: 50px; font-size: 12px; font-weight: 700; }
.badge-green { background: var(--green-050); color: var(--green-700); }
.badge-gold { background: #faf3dd; color: #94700a; }
.badge-red { background: #fdecec; color: #b42323; }

/* ---------- Forms ---------- */
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow-sm); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 18px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; color: var(--ink-900); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 15px; border: 1.5px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 15px; background: #fff; transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(29,154,95,.13);
}
.form-group textarea { min-height: 140px; resize: vertical; }

.flash { padding: 15px 20px; border-radius: 10px; margin: 18px 0; font-weight: 500; font-size: 14.5px; }
.flash-success { background: #e5f6ec; color: #14663b; border: 1px solid #b7e4c9; }
.flash-error { background: #fdecec; color: #b42323; border: 1px solid #f5c6c6; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 36px; align-items: start; }
.contact-info-card {
  background: linear-gradient(150deg, var(--green-900), var(--green-700));
  border-radius: var(--radius); padding: 36px; color: #fff;
}
.contact-info-card h3 { color: #fff; margin-bottom: 22px; }
.contact-info-item { display: flex; gap: 16px; margin-bottom: 22px; }
.contact-info-item .icon-circle {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px;
  background: rgba(255,255,255,.12); display: grid; place-items: center; color: var(--gold-400);
}
.contact-info-item strong { display: block; font-size: 14px; margin-bottom: 3px; }
.contact-info-item span, .contact-info-item a { color: #d9e9e1; font-size: 14px; }

/* ---------- Books filter ---------- */
.filter-bar {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: end;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 28px; box-shadow: var(--shadow-sm);
}
.filter-bar .form-group { margin: 0; flex: 1; min-width: 150px; }

/* ---------- Distribution plan: stats, phases, charts ---------- */
.plan-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.plan-stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 14px; text-align: center; box-shadow: var(--shadow-sm);
}
.plan-stat strong { display: block; font-family: var(--font-head); font-size: 26px; color: var(--green-700); }
.plan-stat span { font-size: 12.5px; color: var(--ink-500); text-transform: uppercase; letter-spacing: .04em; }

.phase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 22px; }
.phase-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); position: relative;
}
.phase-num {
  width: 44px; height: 44px; border-radius: 50%; background: var(--gold-500); color: #fff;
  display: grid; place-items: center; font-family: var(--font-head); font-size: 20px;
  font-weight: 900; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.phase-card h3 { font-size: 17px; font-family: var(--font-body); font-weight: 700; margin-bottom: 12px; }
.phase-card h3 small { display: block; font-size: 12px; color: var(--ink-500); font-weight: 600; margin-top: 3px; text-transform: uppercase; letter-spacing: .05em; }
.phase-card ul { margin: 0; }
.phase-card ul li {
  font-size: 14px; color: var(--ink-500); padding: 7px 0 7px 22px; position: relative;
  border-bottom: 1px dashed var(--line);
}
.phase-card ul li:last-child { border-bottom: 0; }
.phase-card ul li::before {
  content: ''; position: absolute; left: 2px; top: 13px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--green-500);
}

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr)); gap: 22px; align-items: stretch; }
.chart-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm);
}
.chart-card h3 { font-size: 16px; font-family: var(--font-body); font-weight: 700; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--green-050); }
.pie-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.pie {
  width: 190px; height: 190px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), var(--shadow-sm); position: relative;
}
.pie.donut::after {
  content: ''; position: absolute; inset: 22%; background: var(--card); border-radius: 50%;
  box-shadow: inset 0 1px 4px rgba(0,0,0,.08);
}
.donut-center {
  position: absolute; inset: 22%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; z-index: 1; line-height: 1.15;
  font-family: var(--font-head); font-size: 24px; color: var(--green-800); font-weight: 900; text-align: center;
}
.donut-center small { display: block; font-family: var(--font-body); font-size: 11px; color: var(--ink-500); font-weight: 600; }
.chart-legend { width: 100%; }
.chart-legend li {
  display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 7px 2px;
  border-bottom: 1px dashed var(--line);
}
.chart-legend li:last-child { border-bottom: 0; }
.chart-legend i { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.chart-legend b { margin-left: auto; color: var(--ink-900); }
.chart-note { font-size: 12.5px; color: var(--ink-500); margin-top: 14px; line-height: 1.5; }

.hbars { display: flex; flex-direction: column; gap: 16px; margin-top: 6px; }
.hbar { display: grid; grid-template-columns: 1fr; gap: 5px; }
.hbar-label { font-size: 13.5px; font-weight: 600; color: var(--ink-900); }
.hbar-label small { color: var(--ink-500); font-weight: 500; }
.hbar-track { display: block; background: var(--green-050); border-radius: 50px; height: 18px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 50px; transition: width 1s ease; }
.hbar b { font-size: 14px; color: var(--ink-900); }
.hbar { grid-template-columns: 1fr 44px; align-items: center; }
.hbar .hbar-label { grid-column: 1 / -1; }

.gantt { margin-top: 6px; }
.gantt-row { display: grid; grid-template-columns: 160px 1fr; align-items: center; gap: 10px; margin-bottom: 12px; }
.gantt-row > span { font-size: 13px; font-weight: 600; color: var(--ink-900); }
.gantt-track { position: relative; background: var(--green-050); border-radius: 8px; height: 30px; overflow: hidden; }
.gantt-track i {
  position: absolute; top: 3px; bottom: 3px; border-radius: 6px; font-style: normal;
  color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; white-space: nowrap; overflow: hidden; box-shadow: var(--shadow-sm);
}
.gantt-axis { display: flex; justify-content: space-between; margin-left: 170px; font-size: 11px; color: var(--ink-500); }
@media (max-width: 640px) {
  .gantt-row { grid-template-columns: 1fr; gap: 4px; }
  .gantt-axis { margin-left: 0; }
  .pie { width: 160px; height: 160px; }
}

/* ---------- Book catalogue flow ---------- */
.flow-step { margin-bottom: 48px; }
.flow-step-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.flow-step-num {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%;
  background: var(--gold-500); color: #fff; display: grid; place-items: center;
  font-family: var(--font-head); font-size: 21px; font-weight: 900; box-shadow: var(--shadow-sm);
}
.flow-step-head h2 { font-size: 22px; }
.flow-step-head p { font-size: 13.5px; color: var(--ink-500); }
.flow-search { margin-left: auto; }
.flow-search input {
  padding: 11px 18px; border: 1.5px solid var(--line); border-radius: 50px;
  font-family: inherit; font-size: 14px; width: 250px; max-width: 100%; background: #fff;
}
.flow-search input:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(29,154,95,.13); }

.grade-flow { display: flex; gap: 12px; flex-wrap: wrap; }
.grade-tile {
  flex: 1 1 110px; max-width: 150px; min-width: 96px; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 16px 10px; text-align: center; font-family: var(--font-body); transition: all .25s;
}
.grade-tile strong {
  display: block; width: 42px; height: 42px; margin: 0 auto 8px; border-radius: 50%;
  background: var(--green-050); color: var(--green-700); font-family: var(--font-head);
  font-size: 19px; font-weight: 900; line-height: 42px; transition: all .25s;
}
.grade-tile span { display: block; font-weight: 700; font-size: 13.5px; color: var(--ink-900); }
.grade-tile small { color: var(--ink-500); font-size: 11.5px; }
.grade-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--green-500); }
.grade-tile.active { background: var(--green-800); border-color: var(--green-800); }
.grade-tile.active strong { background: var(--gold-500); color: #fff; }
.grade-tile.active span { color: #fff; }
.grade-tile.active small { color: #cfe5da; }

.book-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px;
}
.book-grid-empty { grid-column: 1/-1; color: var(--ink-500); padding: 20px; text-align: center; }
.book-cover {
  border: 0; padding: 0; background: none; cursor: pointer; text-align: left;
  border-radius: 10px; transition: transform .25s, box-shadow .25s;
  animation: bookIn .5s ease backwards;
}
@keyframes bookIn { from { opacity: 0; transform: translateY(18px); } }
.book-cover:hover { transform: translateY(-6px) scale(1.02); }
.book-cover-art {
  aspect-ratio: 3 / 4.1; border-radius: 8px 14px 14px 8px; position: relative;
  padding: 18px 16px 14px 20px; display: flex; flex-direction: column; color: #fff;
  box-shadow: var(--shadow-md); overflow: hidden;
}
.book-cover-art::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px;
  background: rgba(255,255,255,.35);
}
.book-cover-art::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px;
  border-radius: 50%; background: rgba(255,255,255,.08);
}
.book-cover-medium {
  position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.28);
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 9px; border-radius: 50px; backdrop-filter: blur(2px);
}
.book-cover-emblem { width: 30px; height: 30px; opacity: .85; margin-bottom: auto; }
.book-cover-emblem svg { width: 100%; height: 100%; }
.book-cover-title {
  font-family: var(--font-head); font-weight: 900; font-size: 15.5px; line-height: 1.3;
  margin: 10px 0 8px; word-break: break-word;
}
.book-cover-grade {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.9); border-top: 1px solid rgba(255,255,255,.25); padding-top: 8px;
}
.book-cover-brand { font-size: 9px; color: rgba(255,255,255,.55); margin-top: 3px; letter-spacing: .04em; }

/* Book modal */
.book-modal {
  position: fixed; inset: 0; z-index: 220; background: rgba(8,25,18,.8);
  display: grid; place-items: center; padding: 22px; backdrop-filter: blur(3px);
}
.book-modal[hidden] { display: none; }
.book-modal-card {
  background: var(--card); border-radius: 18px; max-width: 720px; width: 100%;
  position: relative; box-shadow: 0 30px 80px rgba(0,0,0,.4);
  animation: bookIn .35s ease; max-height: 90vh; overflow-y: auto;
}
.book-modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px;
  border-radius: 50%; border: 0; cursor: pointer; background: var(--green-050);
  color: var(--green-800); display: grid; place-items: center;
}
.book-modal-close:hover { background: var(--gold-500); color: #fff; }
.book-modal-body { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding: 30px; }
.book-modal-cover { pointer-events: none; }
.book-modal-info h2 { font-size: 22px; margin: 10px 0 16px; }
.book-facts { margin-bottom: 22px; }
.book-facts li {
  display: flex; justify-content: space-between; gap: 14px; padding: 9px 2px;
  border-bottom: 1px dashed var(--line); font-size: 14px;
}
.book-facts li span { color: var(--ink-500); }
.book-facts li strong { color: var(--ink-900); text-align: right; }
.book-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
@media (max-width: 640px) {
  .book-modal-body { grid-template-columns: 1fr; padding: 22px; }
  .book-modal-cover { max-width: 190px; margin: 0 auto; }
  .flow-search { margin-left: 0; width: 100%; }
  .flow-search input { width: 100%; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
}

/* ---------- E-book reader ---------- */
.reader-shell {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.reader-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fafcfb; flex-wrap: wrap;
}
.reader-frame { width: 100%; height: min(78vh, 900px); display: block; border: 0; }
@media (max-width: 640px) { .reader-frame { height: 70vh; } }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.pagination a {
  min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 14px;
}
.pagination a.active, .pagination a:hover { background: var(--green-700); color: #fff; border-color: var(--green-700); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; right: 24px; bottom: 24px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--green-700); color: #fff; border: 0; cursor: pointer; display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(12px); transition: all .3s; z-index: 90; box-shadow: var(--shadow-md);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--gold-500); }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-900); color: #b9d6c8; margin-top: 80px; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 40px; padding: 64px 20px 48px;
}
.footer-col h4 { color: #fff; font-size: 16px; margin-bottom: 18px; font-family: var(--font-body); font-weight: 700; }
.footer-col ul li { margin-bottom: 9px; }
.footer-col a { color: #b9d6c8; font-size: 14px; }
.footer-col a:hover { color: var(--gold-400); }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-brand strong { color: #fff; font-family: var(--font-head); font-size: 17px; }
.footer-about p { font-size: 14px; margin-bottom: 18px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.09);
  display: grid; place-items: center; color: #fff; transition: all .3s;
}
.footer-social a:hover { background: var(--gold-500); transform: translateY(-3px); }
.footer-contact li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; font-size: 14px; }
.footer-contact svg { flex-shrink: 0; margin-top: 3px; color: var(--gold-400); }
.footer-dev { border-top: 1px solid rgba(255,255,255,.1); background: rgba(0,0,0,.18); }
.footer-dev-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 14px 20px; font-size: 13px; color: #9fc3b1; flex-wrap: wrap;
}
.footer-dev a { color: var(--gold-400); }
.footer-dev a:hover { color: #fff; }
.footer-dev-contact { font-size: 12.5px; }
.footer-dev-contact a { color: #cfe5da; }
@media (max-width: 700px) {
  .footer-dev-inner { flex-direction: column; text-align: center; gap: 6px; }
}

.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); }
.footer-bottom-inner { display: flex; justify-content: space-between; padding: 18px 20px; font-size: 13.5px; flex-wrap: wrap; gap: 8px; }
.footer-bottom a { color: var(--gold-400); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(8, 25, 18, .92); z-index: 200;
  display: none; place-items: center; padding: 30px;
}
.lightbox.open { display: grid; }
.lightbox img { max-height: 85vh; max-width: 100%; border-radius: 10px; }
.lightbox-close { position: absolute; top: 22px; right: 26px; background: none; border: 0; color: #fff; cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .content-wrap { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1200px) {
  /* Switch to the hamburger menu early enough that the nav never wraps */
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; top: 0; right: -320px; width: 300px; height: 100vh; background: #fff;
    box-shadow: var(--shadow-md); transition: right .35s ease; z-index: 150; overflow-y: auto; padding: 80px 18px 30px;
  }
  .main-nav.open { right: 0; }
  .main-nav > ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .main-nav a { padding: 12px 14px; white-space: normal; }
  .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; padding-left: 18px; display: none;
  }
  .has-dropdown.open .dropdown { display: block; }
  .nav-search form { margin: 12px 0 0; }
  .nav-search input { width: 100%; flex: 1; }
}

@media (max-width: 860px) {
  .topbar-links { display: none; }
  .hero-arrow { display: none; }
  .hero-content { padding: 80px 20px 100px; }
}

@media (max-width: 860px) {
  /* 16px inputs stop iOS Safari from auto-zooming on focus */
  .form-group input, .form-group select, .form-group textarea, .nav-search input {
    font-size: 16px;
  }
  h1, h2, h3 { overflow-wrap: break-word; }
  .stats { padding: 36px 22px; gap: 22px; border-radius: 16px; }
  .about-badge { padding: 14px 18px; bottom: -16px; right: 0; }
  .about-badge strong { font-size: 24px; }
  .hero-content { padding: 64px 20px 90px; }
  .content-body { padding: 26px 20px; }
  .form-card { padding: 26px 20px; }
  .contact-info-card { padding: 26px 20px; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .form-grid { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
  .section-head { margin-bottom: 32px; }
  .cta { padding: 26px 20px; }
  .cta h2 { font-size: 20px; }
  .brand img { width: 46px; height: 46px; }
  .brand-text strong { font-size: 15px; }
  .brand-ur { font-size: 10.5px; }
  .topbar-contact { gap: 12px; font-size: 12px; }
  .hero-content { padding: 52px 16px 84px; }
  .hero-content h1 { min-height: auto; }
  .hero-actions .btn { padding: 11px 20px; font-size: 14px; }
  .latest-col-head { padding: 13px 16px; }
  .latest-list a { padding: 12px 16px; }
  .page-hero { padding: 40px 0 36px; }
  .news-grid, .gallery-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .pagination a { min-width: 36px; height: 36px; }
  .back-to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}

@media print {
  .topbar, .site-header, .ticker, .site-footer, .back-to-top { display: none; }
}
