/**
 * ==============================================================================
 * FILE: /assets/css/style.css
 * PROJECT: bestjobs.bg — Master Design Engine (Mobikom Network Unified)
 * LICENSE: MIT (https://opensource.org/licenses/MIT)
 * AUTHOR: Stoyan Stoyanov / Mobikom Bulgaria (mobikom.bg)
 * STANDARDS: CSS Grid Level 2 (Subgrid) • CSS Color Module 4 (light-dark)
 * COMPLIANCE: Strict CSP Level 3 • Zero !important • Zero Cookies
 * PERFORMANCE: Sub-14KB Single-Pass Engine • Native System Typography
 * ==============================================================================
 */

:root {
  color-scheme: light dark;

  /* light-dark() Dynamic Color Tokens */
  --bg: light-dark(#ffffff, #0b0f19);
  --bg-alt: light-dark(#f8fafc, #131b2e);
  --border: light-dark(#dbe2ea, #1e293b);
  --text: light-dark(#0f172a, #f1f5f9);
  --muted: light-dark(#475569, #94a3b8);
  --primary: light-dark(#0052cc, #38bdf8);
  --primary-hover: light-dark(#0747a6, #7dd3fc);
  --primary-fg: light-dark(#ffffff, #0b0f19);
  --accent-success: light-dark(#059669, #34d399);

  /* Geometry & Typography Tokens */
  --max-w: 1100px;
  --max-w-prose: 760px;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding-block: 2.5rem;
}

/* Unified 1100px Shell */
.shell,
.shell-prose {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Typography */
h1, h2, h3, h4 {
  color: var(--text);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); margin-bottom: 0.5rem; }
h2 { font-size: 1.35rem; margin-block: 1.5rem 0.5rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }

p {
  color: var(--muted);
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible, input:focus-visible, .nav-toggle-label:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Universal Header */
header.site-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 0.75rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
}

.brand-logo-svg {
  width: 190px;
  height: 42px;
  display: block;
}

.nav-toggle, .nav-toggle-label {
  display: none;
}

nav ul {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
}

.nav-link {
  color: var(--text);
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
}

.nav-link:hover, .nav-link[aria-current="page"] {
  color: var(--primary);
}

.nav-btn {
  background: var(--primary);
  color: var(--primary-fg);
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
}

.nav-btn:hover {
  background: var(--primary-hover);
  color: var(--primary-fg);
  text-decoration: none;
}

.lang-toggle {
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  color: var(--text);
}

@media (max-width: 768px) {
  .nav-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.3rem;
  }

  nav ul {
    display: none;
  }

  .nav-toggle:checked ~ ul {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 1px);
    left: 1.25rem;
    right: 1.25rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }

  .nav-toggle:checked ~ ul li,
  .nav-toggle:checked ~ ul a {
    width: 100%;
    text-align: left;
  }
}

/* Hero */
.hero {
  margin-bottom: 2.5rem;
}

.hero-tag {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  display: block;
  margin-bottom: 0.4rem;
}

.hero-lead {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* PATTERN 1: Native CSS Subgrid Engine (Jobs Directory) */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  /* Track 1: Meta/Salary | Track 2: Title | Track 3: Details | Track 4: Action */
  grid-auto-rows: auto auto 1fr auto;
  gap: 1.25rem;
  margin-top: 1rem;
}

.feature-card {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  row-gap: 0.5rem;
  transition: border-color 0.15s ease;
  content-visibility: auto;
}

.feature-card:hover {
  border-color: var(--primary);
}

.card-meta {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-success);
  font-family: var(--font-mono);
  align-self: start;
}

.feature-card h3 {
  font-size: 1.2rem;
  margin: 0;
  align-self: start;
}

.feature-card p {
  font-size: 0.95rem;
  margin: 0;
  align-self: start;
}

.feature-card a.card-link {
  font-weight: 600;
  align-self: end;
  margin-top: 0.5rem;
}

/* Search Container & Filter Pills */
.search-container {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 2.5rem;
}

.search-title-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.search-field {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.filter-pills-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-pill {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
}

.filter-pill.active, .filter-pill:hover {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
  text-decoration: none;
}

/* Conversion Banner */
.conversion-banner {
  margin-top: 3rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Footer */
footer.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding-block: 2.5rem 1.5rem;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-col a {
  color: var(--muted);
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feature-card[hidden] {
  display: none !important;
}
