/* ============================================================
   JOB BLOG — Main Stylesheet
   Mobile-first, system font stack, zero external dependencies
   ============================================================ */

/* ── CSS Variables ──────────────────────────────────────── */
:root {
  --ink:        #0f1923;
  --ink-mid:    #3a4a58;
  --ink-light:  #6b7f8f;
  --page:       #f4f6f9;
  --surface:    #ffffff;
  --border:     #e2e8ed;
  --border-hi:  #cdd5de;

  --blue:       #1a6fd4;
  --blue-bg:    #e8f1fc;
  --blue-dark:  #1458a8;
  --green:      #15803d;
  --green-bg:   #dcfce7;
  --amber:      #b45309;
  --amber-bg:   #fef3c7;
  --red:        #b91c1c;
  --red-bg:     #fee2e2;
  --purple:     #6d28d9;
  --purple-bg:  #ede9fe;
  --teal:       #0d6e6e;
  --teal-bg:    #ccfbf1;

  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.05);
  --shadow-lg:  0 4px 20px rgba(0,0,0,.1);

  --font:       'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:  'Courier New', Courier, monospace;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.4em; }
button { cursor: pointer; font-family: inherit; }

/* ── Layout ─────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.layout-main {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  padding: 28px 0;
}
.content-area { min-width: 0; }

/* ── HEADER ─────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 2px solid var(--blue);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}
.site-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 800;
  color: var(--ink); text-decoration: none;
  letter-spacing: -.02em; flex-shrink: 0;
}
.site-logo span { color: var(--blue); }
.logo-img { width: 36px; height: 36px; border-radius: 8px; }

/* Search bar in header */
.header-search { flex: 1; max-width: 400px; position: relative; }
.header-search input {
  width: 100%;
  padding: 8px 36px 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  background: var(--page);
  outline: none;
  transition: border-color .2s;
}
.header-search input:focus { border-color: var(--blue); background: #fff; }
.header-search .search-icon {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-light); pointer-events: none; font-size: 15px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none; border: none;
  font-size: 22px; color: var(--ink);
  padding: 4px; line-height: 1;
}

/* Main navigation */
.site-nav { background: var(--ink); }
.site-nav ul {
  display: flex; list-style: none; padding: 0;
  overflow-x: auto; scrollbar-width: none;
}
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav li a {
  display: block; padding: 10px 16px;
  color: rgba(255,255,255,.85); font-size: 13px; font-weight: 600;
  white-space: nowrap; text-decoration: none;
  transition: background .15s, color .15s;
}
.site-nav li a:hover,
.site-nav li a.active { background: var(--blue); color: #fff; text-decoration: none; }

/* Telegram CTA in nav */
.nav-telegram { background: #229ed9 !important; color: #fff !important; }

/* ── CATEGORY BAR ───────────────────────────────────────── */
.cat-bar {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 12px 0;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 14px; border-radius: 999px; border: 1.5px solid var(--border);
  font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--surface); color: var(--ink-mid);
  text-decoration: none; transition: all .15s;
}
.cat-pill:hover, .cat-pill.active {
  background: var(--blue); border-color: var(--blue); color: #fff; text-decoration: none;
}
.cat-pill .count {
  background: rgba(0,0,0,.12); padding: 1px 6px; border-radius: 999px; font-size: 10px;
}

/* ── POST CARDS ─────────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.post-card-img { width: 100%; height: 160px; object-fit: cover; }
.post-card-img-placeholder {
  width: 100%; height: 160px;
  background: linear-gradient(135deg, var(--blue-bg) 0%, var(--border) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}
.post-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.post-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; flex-wrap: wrap; gap: 6px;
}
.post-card-cat {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--blue); text-decoration: none;
}
.post-card-cat:hover { text-decoration: underline; }
.post-card-title {
  font-size: 15px; font-weight: 700; color: var(--ink);
  line-height: 1.4; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-title a { color: inherit; text-decoration: none; }
.post-card-title a:hover { color: var(--blue); }
.post-card-info {
  display: flex; gap: 14px; font-size: 12px; color: var(--ink-light);
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border);
}
.post-card-info span { display: flex; align-items: center; gap: 4px; }

/* ── BADGE / STATUS ─────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.badge-active  { background: var(--green-bg); color: var(--green); }
.badge-closed  { background: var(--red-bg);   color: var(--red); }
.badge-warning { background: var(--amber-bg); color: var(--amber); }
.badge-draft   { background: var(--border);   color: var(--ink-light); }
.badge-new     { background: var(--blue);     color: #fff; }
.badge-result  { background: var(--purple-bg);color: var(--purple); }

/* ── SINGLE POST PAGE ───────────────────────────────────── */
.post-header { margin-bottom: 24px; }
.post-breadcrumb {
  font-size: 12px; color: var(--ink-light);
  margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.post-breadcrumb a { color: var(--ink-light); }
.post-breadcrumb a:hover { color: var(--blue); }
.post-breadcrumb .sep { color: var(--border-hi); }
.post-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800; line-height: 1.3;
  letter-spacing: -.02em; margin-bottom: 14px;
}
.post-meta {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-light); margin-bottom: 20px;
}
.post-meta .author { color: var(--ink-mid); font-weight: 600; }

/* ── TL;DR BOX ──────────────────────────────────────────── */
.tldr-box {
  background: linear-gradient(135deg, #e8f1fc 0%, #f0f7ff 100%);
  border: 1.5px solid var(--blue);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.tldr-box .tldr-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--blue); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.tldr-box ul { list-style: none; padding: 0; }
.tldr-box li {
  display: flex; gap: 8px; font-size: 13px; color: var(--ink-mid);
  padding: 4px 0; border-bottom: 1px dashed var(--border);
}
.tldr-box li:last-child { border: none; }
.tldr-box li strong { color: var(--ink); min-width: 130px; flex-shrink: 0; }

/* ── INFO HIGHLIGHT BOX ─────────────────────────────────── */
.info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}
.info-box-header {
  background: var(--ink);
  color: #fff; padding: 10px 18px;
  font-size: 13px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.info-box-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0;
}
.info-box-item {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.info-box-item:nth-child(even) { background: #fafbfc; }
.info-box-label { font-size: 11px; color: var(--ink-light); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.info-box-value { font-size: 14px; font-weight: 700; color: var(--ink); }

/* ── DATES TABLE ────────────────────────────────────────── */
.dates-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.dates-table caption {
  background: var(--ink); color: #fff;
  padding: 10px 16px; text-align: left;
  font-size: 13px; font-weight: 700;
}
.dates-table td {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 14px; vertical-align: top;
}
.dates-table tr:last-child td { border: none; }
.dates-table td:first-child { color: var(--ink-mid); width: 55%; }
.dates-table td:last-child { font-weight: 700; color: var(--ink); }
.dates-table .deadline td:last-child { color: var(--red); }
.dates-table tr:hover td { background: var(--page); }

/* ── VACANCY TABLE ──────────────────────────────────────── */
.vacancy-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.vacancy-table th {
  background: var(--ink); color: #fff;
  padding: 9px 12px; font-size: 12px; font-weight: 700; text-align: center;
}
.vacancy-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  text-align: center; font-size: 14px;
}
.vacancy-table .total-row td { font-weight: 800; background: var(--blue-bg); color: var(--blue); }

/* ── IMPORTANT LINKS BUTTONS ────────────────────────────── */
.links-grid {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px;
}
.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; border: none;
  text-decoration: none; transition: all .15s; white-space: nowrap;
}
.link-btn:hover { transform: translateY(-1px); text-decoration: none; }
.link-btn-pdf    { background: var(--red-bg);    color: var(--red);    border: 1.5px solid var(--red); }
.link-btn-apply  { background: var(--blue);      color: #fff; }
.link-btn-apply:hover { background: var(--blue-dark); }
.link-btn-admit  { background: var(--purple-bg); color: var(--purple); border: 1.5px solid var(--purple); }
.link-btn-result { background: var(--green-bg);  color: var(--green);  border: 1.5px solid var(--green); }
.link-btn-other  { background: var(--page);      color: var(--ink-mid);border: 1.5px solid var(--border); }

/* ── FAQ SECTION ────────────────────────────────────────── */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--surface);
}
.faq-question {
  width: 100%; text-align: left; padding: 14px 18px;
  background: none; border: none; font-size: 14px; font-weight: 700;
  color: var(--ink); display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; gap: 10px;
}
.faq-question:hover { background: var(--page); }
.faq-icon { font-size: 18px; color: var(--blue); transition: transform .2s; flex-shrink: 0; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  display: none; padding: 0 18px 14px;
  font-size: 14px; color: var(--ink-mid); line-height: 1.7;
}
.faq-item.open .faq-answer { display: block; }

/* ── DISCLAIMER BOX ─────────────────────────────────────── */
.disclaimer-box {
  background: var(--amber-bg);
  border: 1px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px; color: var(--amber); line-height: 1.5;
  margin-bottom: 20px;
}
.disclaimer-box strong { display: block; margin-bottom: 3px; }

/* ── AD UNIT WRAPPER ────────────────────────────────────── */
/* CRITICAL: Always reserve space BEFORE ads load — prevents CLS */
.ad-unit-wrap {
  margin: 16px 0;
  background: #f0f2f5;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.ad-unit-wrap.ad-banner  { min-height: 90px; }
.ad-unit-wrap.ad-square  { min-height: 250px; }
.ad-unit-wrap.ad-large   { min-height: 280px; }
.ad-placeholder {
  font-size: 11px; color: var(--ink-light);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 20px; text-align: center;
}

/* ── SHARE BUTTONS ──────────────────────────────────────── */
.share-wrap { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; text-decoration: none;
  transition: opacity .15s;
}
.share-btn:hover { opacity: .9; text-decoration: none; }
.share-wa  { background: #25D366; color: #fff; }
.share-tg  { background: #229ED9; color: #fff; }
.share-tw  { background: #1DA1F2; color: #fff; }
.share-copy{ background: var(--page); color: var(--ink-mid); border: 1.5px solid var(--border); }

/* ── RELATED POSTS ──────────────────────────────────────── */
.related-posts h3 {
  font-size: 17px; font-weight: 800; margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 2px solid var(--border);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.related-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex; gap: 12px; align-items: flex-start;
  text-decoration: none; color: inherit;
  transition: border-color .15s;
}
.related-card:hover { border-color: var(--blue); text-decoration: none; }
.related-card .r-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.related-card .r-title { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.4; margin-bottom: 4px; }
.related-card .r-meta  { font-size: 11px; color: var(--ink-light); }

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar { position: relative; }
.sidebar-widget {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 20px; overflow: hidden;
}
.sidebar-widget-title {
  background: var(--ink); color: #fff;
  padding: 10px 16px; font-size: 13px; font-weight: 700;
}
.sidebar-widget-body { padding: 14px 16px; }
.sidebar-post { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sidebar-post:last-child { border: none; }
.sidebar-post-num { font-size: 18px; font-weight: 900; color: var(--border-hi); min-width: 24px; }
.sidebar-post-title { font-size: 13px; font-weight: 600; color: var(--ink-mid); line-height: 1.4; }
.sidebar-post-title a { color: inherit; }
.sidebar-post-title a:hover { color: var(--blue); }
.sidebar-cat-list { list-style: none; padding: 0; }
.sidebar-cat-list li { padding: 6px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.sidebar-cat-list li:last-child { border: none; }
.sidebar-cat-list a { font-size: 13px; color: var(--ink-mid); text-decoration: none; }
.sidebar-cat-list a:hover { color: var(--blue); }
.sidebar-cat-list .count { background: var(--page); padding: 1px 8px; border-radius: 999px; font-size: 11px; color: var(--ink-light); }

/* ── PAGINATION ─────────────────────────────────────────── */
.pagination-wrap { display: flex; justify-content: center; margin: 24px 0; }
.pagination { display: flex; list-style: none; gap: 4px; padding: 0; }
.page-item .page-link {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); font-size: 14px; font-weight: 600;
  color: var(--ink-mid); text-decoration: none; background: var(--surface);
  transition: all .15s;
}
.page-item .page-link:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-bg); text-decoration: none; }
.page-item.active .page-link { background: var(--blue); border-color: var(--blue); color: #fff; }
.page-item.disabled .page-link { opacity: .4; pointer-events: none; }

/* ── SECTION HEADINGS ───────────────────────────────────── */
.post-content h2 { font-size: 19px; font-weight: 800; margin: 24px 0 12px; color: var(--ink); padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.post-content h3 { font-size: 16px; font-weight: 700; margin: 20px 0 10px; color: var(--ink); }
.post-content h4 { font-size: 14px; font-weight: 700; margin: 16px 0 8px; color: var(--ink-mid); }
.post-content p  { margin-bottom: 14px; color: var(--ink-mid); font-size: 14px; line-height: 1.8; }
.post-content ul, .post-content ol { margin-bottom: 14px; padding-left: 20px; }
.post-content li { color: var(--ink-mid); font-size: 14px; padding: 3px 0; }
.post-content table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.post-content table th { background: var(--ink); color: #fff; padding: 9px 12px; font-size: 13px; text-align: left; }
.post-content table td { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.post-content table tr:nth-child(even) td { background: #f9fafb; }

/* ── ALERTS ─────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; display: flex; gap: 10px; }
.alert-blue   { background: var(--blue-bg);   border-left: 3px solid var(--blue); }
.alert-green  { background: var(--green-bg);  border-left: 3px solid var(--green); }
.alert-amber  { background: var(--amber-bg);  border-left: 3px solid var(--amber); }
.alert-red    { background: var(--red-bg);    border-left: 3px solid var(--red); }

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,.7);
  margin-top: 40px; padding: 40px 0 20px;
  font-size: 13px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px; margin-bottom: 28px;
}
.footer-brand { }
.footer-brand .logo { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.footer-brand p { font-size: 13px; opacity: .6; line-height: 1.6; }
.footer-col h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.5); margin-bottom: 12px; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 7px; }
.footer-col a { color: rgba(255,255,255,.65); text-decoration: none; font-size: 13px; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 18px; margin-top: 18px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; font-size: 12px; opacity: .5;
}
.social-icons { display: flex; gap: 10px; }
.social-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  color: #fff; text-decoration: none; font-size: 14px;
  transition: background .15s;
}
.social-icon:hover { background: var(--blue); }

/* ── UTILITY ─────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--ink-light); }
.fw-bold     { font-weight: 700; }
.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }.mb-2 { margin-bottom: 16px; }.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; } .align-center { align-items: center; } .gap-2 { gap: 8px; }
.hidden { display: none !important; }

/* ── LOADING SKELETON ───────────────────────────────────── */
@keyframes shimmer { 0%{background-position:-200% 0} 100%{background-position:200% 0} }
.skeleton {
  background: linear-gradient(90deg, #e8ecf0 25%, #f5f7f9 50%, #e8ecf0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .layout-main { grid-template-columns: 1fr; }
  .sidebar { display: none; }  /* Show via JS toggle on mobile */
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .header-search { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .info-box-grid { grid-template-columns: 1fr 1fr; }
  .links-grid { flex-direction: column; }
  .link-btn { width: 100%; justify-content: center; }
  .tldr-box li strong { min-width: 110px; }
}
