/*
Theme Name: Scholarship Portal
Description: Custom theme replicating the original PHP scholarship/jobs panel front-end.
Version: 1.0
*/

/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #212121;
  background: #f5f5f5;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

:root {
  --primary: #7c1d3f;
  --primary-dark: #5c1530;
  --orange: #ff6200;
  --text: #212121;
  --text-light: #717171;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --border: #e0e0e0;
  --header-height: 56px;
  --cream-bg: #f6efe3;
  --cream-border: #ead9c4;
  --scroll-blue: #2979ff;
}

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

/* ─── Header ─────────────────────────────────────────────────── */
.site-topbar { height: 4px; width: 100%; background: linear-gradient(90deg, var(--primary), var(--orange)); }
.site-header { position: static; background: #fff; height: var(--header-height); box-shadow: 0 1px 4px rgba(0,0,0,.1); border-bottom: 1px solid #eee; }
.header-container { max-width: 1200px; margin: 0 auto; padding: 0 16px; height: 100%; display: flex; align-items: center; gap: 12px; }
.site-logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.logo-text { font-size: 22px; font-weight: 800; color: #222; letter-spacing: -0.5px; }
.header-search { flex: 1; min-width: 0; max-width: 560px; display: flex; align-items: center; background: #f5f5f5; border: 1px solid #e8e8e8; border-radius: 6px; overflow: hidden; margin-left: auto; transition: border-color .15s; }
.header-search:focus-within { border-color: var(--primary); }
.header-search input { flex: 1; min-width: 0; border: none; outline: none; padding: 9px 14px; font-size: 14px; background: transparent; }
.header-search button { flex-shrink: 0; background: var(--primary); border: none; color: #fff; padding: 9px 16px; font-size: 13px; font-weight: 600; transition: background .15s; }
.header-search button:hover { background: var(--primary-dark); }

.header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.menu-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 4px; }
.menu-toggle span { width: 24px; height: 2px; background: #333; border-radius: 2px; display: block; }
.search-toggle { display: none; padding: 8px; border: none; background: none; color: #333; border-radius: 6px; transition: background .2s; align-items: center; }
.search-toggle:hover { background: rgba(0,0,0,.06); }

.site-nav { background: #fff; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; overflow-x: auto; scrollbar-width: none; }
.nav-inner::-webkit-scrollbar { display: none; }
.nav-link { padding: 12px 16px; font-size: 13px; font-weight: 600; color: #444; white-space: nowrap; transition: color .2s, border-color .2s; display: block; border-bottom: 2.5px solid transparent; }
.nav-link:hover, .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Mobile dropdown nav (hamburger) */
.mobile-nav { display: none; background: var(--card-bg); border-bottom: 1px solid var(--border); }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 13px 20px; color: var(--text); font-size: 15px; border-bottom: 1px solid var(--border); transition: background .15s; }
.mobile-nav a:hover { background: #eef2ff; color: var(--primary); }

/* Search overlay bar (mobile) */
.search-bar { background: #fff; border-bottom: 1px solid var(--border); padding: 12px 20px; display: none; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.search-bar.open { display: block; }
.search-bar-inner { max-width: 1200px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.search-input-wrap { flex: 1; display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 16px; }
.search-input-wrap input { flex: 1; border: none; background: none; outline: none; font-size: 15px; }
.search-input-wrap button { background: var(--primary); color: #fff; border: none; padding: 6px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.search-close { background: none; border: none; font-size: 18px; color: var(--text-light); padding: 6px; }

@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .search-toggle { display: flex; }
  .site-nav { display: none; }
  .header-search { display: none; }
}

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer { background: #172337; color: #90a4b7; padding: 26px 0 0; margin-top: 30px; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.footer-grid-compact { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid #2a3f55; }
.footer-logo { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.footer-about p { font-size: 12.5px; line-height: 1.6; }
.footer-col h4 { font-size: 12px; font-weight: 700; color: #fff; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .5px; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul li a { font-size: 12.5px; color: #7f97ab; transition: color .2s; }
.footer-col ul li a:hover { color: #fff; }
.footer-bottom { padding: 12px 0; text-align: center; font-size: 11.5px; color: #5c7284; }
@media (max-width: 700px) { .footer-grid-compact { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

/* ─── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb { padding: 12px 0; font-size: 13px; color: var(--text-light); }
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { opacity: .6; margin: 0 4px; }

/* ─── Category/tag listing header (kb-*) ────────────────────────── */
.kb-breadcrumb { font-size:12px; color:#757575; margin-bottom:8px; }
.kb-breadcrumb a { color:#757575; text-decoration:none; }
.kb-breadcrumb a:hover { color:var(--primary); }
.kb-breadcrumb span { margin:0 4px; }
.kb-cat-title { font-family:'Merriweather', Georgia, serif; font-size:30px; font-weight:700; color:var(--primary); margin:0 0 14px; }
.kb-toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; padding-bottom:12px; border-bottom:1px solid #ddd; flex-wrap:wrap; gap:8px; }
.kb-showing { font-size:13px; color:#757575; }
.kb-sort-sel { border:1px solid #ddd; border-radius:4px; padding:6px 10px; font-size:13px; cursor:pointer; outline:none; }
.kb-sb-search { display:flex; border:1px solid #ddd; border-radius:4px; overflow:hidden; margin-bottom:20px; }
.kb-sb-search input { flex:1; min-width:0; border:none; outline:none; padding:8px 8px; font-size:12px; }
.kb-sb-search button { flex-shrink:0; background:var(--primary); border:none; padding:0 10px; cursor:pointer; color:#fff; display:flex; align-items:center; justify-content:center; }

/* ─── Category/tag long-form description (cream box, after posts) ── */
.cat-description { background:var(--cream-bg); border:1px solid var(--cream-border); border-radius:12px; padding:24px 28px; margin:28px 0 8px; color:#3f3428; font-size:15px; line-height:1.85; }
.cat-description h2, .cat-description h3 { font-family:'Merriweather', Georgia, serif; color:var(--primary); margin:18px 0 10px; }
.cat-description h2:first-child, .cat-description h3:first-child { margin-top:0; }
.cat-description h2 { font-size:21px; }
.cat-description h3 { font-size:17px; }
.cat-description p { margin:0 0 14px; }
.cat-description ul { margin:0 0 14px 20px; }
.cat-description li { margin-bottom:6px; list-style:disc; }
@media (max-width:600px) { .cat-description { padding:18px 18px; } }

/* ─── Scroll to top button ──────────────────────────────────────── */
.scroll-top-btn {
  position: fixed; right: 20px; bottom: 22px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--scroll-blue); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.scroll-top-btn.show { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top-btn:hover { background: #1c64e0; }
@media (max-width:768px) { .kb-cat-title { font-size:22px; } }

/* ─── Job cards (archive/category/tag listing) ─────────────────── */
.job-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:18px; margin: 20px 0; }
.job-cards-lg { grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:22px; }
.job-cards-lg .job-card-thumb { aspect-ratio:4/3; }
.job-cards-lg .job-card-title { font-size:16.5px; }
@media(max-width:600px){ .job-cards-lg { grid-template-columns:1fr; gap:16px; } }
.job-card { display:flex; flex-direction:column; background:#fff; border:1px solid var(--border); border-radius:12px; overflow:hidden; transition:box-shadow .15s,transform .15s,border-color .15s; }
.job-card:hover { box-shadow:0 8px 24px rgba(0,0,0,.10); transform:translateY(-3px); border-color:var(--primary); }
.job-card-thumb { position:relative; display:block; aspect-ratio:16/10; overflow:hidden; background:#f1f5f9; }
.job-card-thumb img { width:100%; height:100%; object-fit:contain; display:block; }
.job-card-ph { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#fff; font-size:18px; font-weight:800; letter-spacing:1px; text-transform:uppercase; }
.job-card-label { display:block; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.5px; margin-bottom:2px; }
.job-card-body { display:flex; flex-direction:column; gap:6px; padding:14px 15px 15px; flex:1; }
.job-card-title { font-size:15px; font-weight:700; line-height:1.4; margin:0; }
.job-card-title a { color:#1e293b; text-decoration:none; }
.job-card-title a:hover { color:var(--primary); }
.job-card-meta { font-size:12px; color:#64748b; line-height:1.5; }
.job-card-btn { margin-top:auto; font-size:13px; font-weight:700; color:var(--primary); }
.job-card:hover .job-card-btn { text-decoration:underline; }
@media(max-width:600px){ .job-cards:not(.job-cards-lg) { grid-template-columns:repeat(2,1fr); gap:12px; } .job-card-title { font-size:13.5px; } .job-card-body { padding:11px 11px 12px; } }

.job-badge { display:inline-block; padding:4px 10px; border-radius:6px; font-size:10.5px; font-weight:700; color:#fff; text-transform:uppercase; letter-spacing:.5px; box-shadow:0 2px 6px rgba(0,0,0,.15); }
.job-badge-lg { font-size:12px; padding:6px 14px; }

/* ─── Single post ────────────────────────────────────────────── */
.job-single-section { background:#f5f6f8; padding:14px 0 50px; }
.job-header { margin-bottom:14px; }
.job-title { font-size:24px; font-weight:800; color:#111827; line-height:1.3; margin:8px 0 8px; }
.job-submeta { display:flex; flex-wrap:wrap; gap:14px; font-size:13px; color:#64748b; }
.job-feature-img { margin:0 0 20px; border-radius:8px; overflow:hidden; }
.job-feature-img img { width:100%; height:auto; display:block; }

.info-box { border:1px solid var(--border); border-radius:10px; overflow:hidden; margin-bottom:18px; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.info-box-title { background:var(--primary); color:#fff; font-size:14px; font-weight:700; padding:10px 16px; }
.info-table { width:100%; border-collapse:collapse; }
.info-table th, .info-table td { text-align:left; padding:10px 16px; font-size:13.5px; border-bottom:1px solid #f1f5f9; vertical-align:top; }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom:none; }
.info-table th { width:42%; color:#475569; font-weight:600; background:#fafbfc; }
.info-table td { color:#1e293b; }

.job-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:12px; margin:20px 0; }
.job-action-btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-width:200px; padding:13px 24px; border-radius:8px; color:#fff; font-size:15px; font-weight:700; text-decoration:none; box-shadow:0 3px 10px rgba(0,0,0,.18); transition:filter .15s, transform .15s; text-align:center; }
.job-action-btn:hover { filter:brightness(.93); transform:translateY(-2px); }
@media(max-width:600px){ .job-action-btn { min-width:0; width:100%; } }

.article-content { font-size:16px; line-height:1.85; color:#2b2b2b; }
.article-content h2 { font-size: 21px; font-weight: 800; margin: 32px 0 14px; color:#111827; padding-bottom:8px; border-bottom:2px solid #eef2f7; }
.article-content h3 { font-size: 18px; font-weight: 700; margin: 24px 0 10px; color:#111827; }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin: 14px 0 16px 26px; }
.article-content li { margin-bottom: 8px; }
.article-content ul li { list-style: disc; }
.article-content ol li { list-style: decimal; }
.article-content strong { font-weight: 700; color:#111827; }
.article-content img { border-radius: 10px; margin: 20px auto; max-width: 100%; box-shadow:0 2px 10px rgba(0,0,0,.08); }
.article-content a { color: var(--primary); text-decoration: none; border-bottom: 1.5px solid rgba(36,116,245,.3); font-weight:600; transition: border-color .15s; }
.article-content a:hover { border-bottom-color: var(--primary); }
.article-content table { width:100%; border-collapse:collapse; margin:20px 0; border-radius:8px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.article-content table th, .article-content table td { border:1px solid var(--border); padding:10px 14px; font-size:14.5px; text-align:left; }
.article-content table th { background:#eef4ff; color:#1d4ed8; font-weight:700; }
.article-content table tr:nth-child(even) td { background:#fafbfc; }

.article-footer-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border); margin-top: 24px; }
.article-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.tag-link { display: inline-block; white-space: nowrap; padding: 5px 12px; background: #eef2f7; border: 1px solid #e2e8f0; border-radius: 20px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.tag-link:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.article-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.share-btn { padding: 5px 12px; border-radius: 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: #fff; }
.share-twitter { background: #1da1f2; }
.share-fb { background: #1877f2; }
.share-wa { background: #25d366; }
.share-btn:hover { opacity: .85; }

/* ─── Related posts (order-preserving) ──────────────────────────── */
.related-posts { margin:26px 0; }
.related-heading { font-size:17px; font-weight:700; color:#111827; margin-bottom:12px; border-left:4px solid var(--primary); padding-left:10px; }
.related-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:18px; }
.related-list { display:grid; grid-template-columns:1fr; gap:14px; }
.related-grid .related-card, .related-list .related-card { display:block; text-decoration:none; background:#fff; border:1px solid var(--border); border-radius:12px; overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,.06); transition:box-shadow .15s,transform .15s,border-color .15s; }
.related-grid .related-card:hover, .related-list .related-card:hover { box-shadow:0 10px 26px rgba(0,0,0,.13); transform:translateY(-3px); border-color:var(--primary); }
.related-thumb { width:100%; aspect-ratio:4/3; overflow:hidden; background:#eef2f7; line-height:0; }
.related-thumb img { width:100%; height:100%; object-fit:contain; background:#eef2f7; display:block; }
.related-title { padding:12px 14px 16px; font-size:15px; font-weight:700; color:#1e293b; line-height:1.45; }
.related-card:hover .related-title { color:var(--primary); }
.related-list .related-thumb { aspect-ratio:16/9; }
.related-list .related-title { font-size:17px; }
@media (max-width:768px){ .related-grid { grid-template-columns:repeat(2,1fr); } }
@media (max-width:600px){ .related-grid { grid-template-columns:1fr; } .related-title { font-size:16px; padding:12px 14px 15px; } }

/* ─── Sidebar ────────────────────────────────────────────────── */
.article-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; padding: 16px 0 40px; }
.article-main { min-width: 0; }
.article-sidebar { position: sticky; top: 76px; height: fit-content; }
.sidebar-widget { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.widget-title { font-size: 13.5px; font-weight: 800; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--primary); text-transform: uppercase; letter-spacing: .5px; color:#111827; }
.widget-categories li a, .widget-latest li a { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 13px; color: var(--text); border-bottom: 1px solid var(--border); }
.widget-categories li:last-child a, .widget-latest li:last-child a { border-bottom: none; }
.widget-categories li a:hover, .widget-latest li a:hover { color: var(--primary); }
.cat-count { background: #f5f5f5; color: var(--text-light); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } .article-sidebar { position: static; } }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 28px 0; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 6px; border-radius: 50%; font-size: 13.5px; font-weight: 600; color: var(--primary); background: var(--card-bg); border: 1.5px solid var(--primary); transition: background .15s, color .15s; }
.pagination .page-numbers.dots { border-color: transparent; background: none; }
.pagination .page-numbers.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .page-numbers:hover:not(.current):not(.dots) { background: #fbeef2; }
.pagination .page-numbers.next, .pagination .page-numbers.prev { border-radius: 50%; border-color: var(--cream-border); background: var(--cream-bg); color: var(--primary); }
.pagination .page-numbers.next:hover, .pagination .page-numbers.prev:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.no-posts { text-align: center; padding: 60px 20px; color: var(--text-light); }

/* ─── Ad zones (Ad Inserter shortcode targets) ──────────────────
   Centered, clearly labelled, generously spaced from surrounding
   content/links — matches Google AdSense placement guidance. */
.ad-zone { text-align: center; margin: 32px 0; overflow: hidden; }
.ad-zone:empty { display: none; }
.job-single-section > .container > .ad-zone { margin-top: 4px; margin-bottom: 20px; }
.ad-zone > * { display: block; margin-left: auto; margin-right: auto; }
.ad-zone::before {
  content: 'Advertisement'; display: block; font-size: 11px; font-weight: 500;
  letter-spacing: 1.5px; color: #9e9e9e; text-align: center; margin-bottom: 8px;
  text-transform: uppercase;
}
ins.adsbygoogle { max-width: 100% !important; }
.ad-placeholder-box {
  max-width: 728px; margin: 0 auto; padding: 22px 16px;
  border: 2px dashed #c9b8a8; border-radius: 8px;
  background: repeating-linear-gradient(45deg, #faf6ef, #faf6ef 10px, #f3ece1 10px, #f3ece1 20px);
  color: #9a8368; font-size: 13px; font-weight: 700; letter-spacing: .5px;
}

/* ─── Homepage ───────────────────────────────────────────────── */
.home-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; padding: 48px 0 56px; text-align: center;
  position: relative; overflow: hidden;
}
.home-hero::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.08), transparent 55%);
}
.home-hero .container { position: relative; }
.home-hero h1 { font-family:'Merriweather', Georgia, serif; font-size: 34px; font-weight: 700; margin-bottom: 10px; }
.home-hero p { font-size: 15px; color: #f3d9e2; margin-bottom: 26px; }
.home-hero-search { max-width: 560px; margin: 0 auto; display: flex; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.home-hero-search input { flex: 1; min-width: 0; border: none; outline: none; padding: 14px 18px; font-size: 15px; }
.home-hero-search button { flex-shrink: 0; background: var(--orange); border: none; color: #fff; padding: 0 26px; font-size: 14px; font-weight: 700; }
.home-hero-search button:hover { background: #e05700; }
@media (max-width: 600px) { .home-hero { padding: 36px 0 44px; } .home-hero h1 { font-size: 24px; } }

.home-section-title { font-family:'Merriweather', Georgia, serif; font-size: 20px; font-weight: 700; color: #111827; margin: 36px 0 16px; padding-left: 12px; border-left: 4px solid var(--primary); }

.home-cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.home-cat-tile { background: var(--cream-bg); border: 1px solid var(--cream-border); border-radius: 12px; padding: 20px 14px; text-align: center; transition: transform .15s, box-shadow .15s, border-color .15s; }
.home-cat-tile:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(124,29,63,.12); border-color: var(--primary); }
.home-cat-tile-icon { display: block; font-size: 30px; margin-bottom: 10px; }
.home-cat-tile-name { display: block; font-size: 14px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.home-cat-tile-count { display: block; font-size: 11.5px; color: var(--text-light); }
@media (max-width: 600px) { .home-cat-tiles { grid-template-columns: repeat(3, 1fr); gap: 10px; } .home-cat-tile { padding: 14px 8px; } .home-cat-tile-icon { font-size: 24px; } .home-cat-tile-name { font-size: 12px; } }
