/*
Theme Name: UNJoble
Theme URI: https://unjoble.org
Author: John Leon
Description: A fast, accessible, SEO-optimized WordPress theme for international and UN jobs.
Version: 2.3.0
License: GPL-2.0+
*/

/* ===== RESET & BASE ===== */
html { 
  box-sizing: border-box; 
  scroll-behavior: smooth;
}

*, *:before, *:after { 
  box-sizing: inherit; 
}

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: #23384e;
  background: #f5f7fa;
  margin: 0;
  padding: 0;
  font-size: 17px;
  line-height: 1.62;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mobile-first font sizing */
@media (max-width: 768px) {
  body {
    font-size: 16px;
    line-height: 1.5;
  }
}

a { 
  color: #1a73e8; 
  text-decoration: none; 
  transition: color .15s ease;
}

a:hover, a:focus { 
  color: #1557b0; 
}

h1, h2, h3, h4, h5 {
  font-family: inherit;
  color: #202124;
  font-weight: 600;
  margin: 0 0 .45em 0;
  line-height: 1.3;
}

/* ===== ACCESSIBILITY ===== */
.skip-link,
.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  left: -9999px;
  z-index: 999999;
  padding: 8px 16px;
  background: #000;
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  left: 6px;
  top: 7px;
  position: absolute;
  width: auto;
  height: auto;
  clip: auto;
}

/* ===== CONTAINER ===== */
.unjoble-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 15px 32px 15px;
}

@media (max-width: 768px) {
  .unjoble-container {
    padding: 16px 12px;
  }
}

/* ===== HEADER STYLES ===== */
.site-header {
  background: #316ae4;
  padding-bottom: 0;
  position: relative;
  z-index: 100;
}

.unjoble-header-wrapper {
  max-width: 100vw;
  margin: 0 auto;
}

.site-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 0 16px 0;
}

.custom-logo-link {
  display: inline-block;
  transition: transform 0.2s ease;
}

.custom-logo-link:hover,
.custom-logo-link:focus {
  transform: scale(1.05);
}

.custom-logo-link img {
  height: 84px;
  width: 84px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 12px rgba(44,61,133,0.13);
  transition: box-shadow 0.2s ease;
}

.fallback-logo {
  height: 84px;
  width: 84px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 12px rgba(44,61,133,0.13);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #316ae4;
  font-size: 24px;
  transition: all 0.2s ease;
}

.fallback-logo:hover {
  box-shadow: 0 4px 16px rgba(44,61,133,0.2);
}

/* ===== NAVIGATION STYLES ===== */
.site-navigation {
  background: #ce2851;
  border-radius: 0;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  overflow: visible;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
  min-height: 62px;
}

.nav-menu li {
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-width: 120px;
  display: flex;
}

.nav-menu a {
  background: #ce2851;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px;
  font-weight: 500;
  color: #fff;
  font-size: 1.1em;
  border-radius: 0;
  transition: all 0.2s ease;
  text-align: center;
  text-decoration: none;
  width: 100%;
  min-height: 62px;
  position: relative;
  border-bottom: 2px solid transparent;
}

.nav-menu a:hover,
.nav-menu a:focus {
  background: #b91c3f;
  color: #fff;
  transform: translateY(-1px);
  border-bottom-color: rgba(255,255,255,0.3);
}

.nav-menu a:active {
  transform: translateY(0);
}

.nav-menu .current-menu-item a,
.nav-menu .current_page_item a {
  background: #b91c3f;
  border-bottom-color: #fff;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  padding: 15px;
  cursor: pointer;
  position: absolute;
  right: 80px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
  background: rgba(255,255,255,0.1);
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}

.mobile-menu-toggle svg {
  transition: transform 0.3s ease;
}

.mobile-menu-toggle[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

/* Header search button */
.header-search-btn {
  background: transparent;
  border: none;
  margin-left: 10px;
  padding: 0 18px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
  color: #fff;
  border-radius: 4px;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
}

.header-search-btn:hover,
.header-search-btn:focus {
  background: rgba(255, 255, 255, 0.1);
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}

/* ==========================================================================
   UPDATED SEARCH BAR — GRID + PROGRESSIVE STACKING
   ========================================================================== */

/* Container */
.unjoble-search-bar {
  margin-top: 20px;
  margin-bottom: 30px;
  width: 100%;
}

/* 1) Base: Mobile (below 480px) */
.unjoble-search-bar form {
  display: grid;
  grid-gap: 0.75rem;
  align-items: center;
  grid-template-columns: 1fr;
  grid-template-areas:
    "search"
    "cat"
    "country"
    "button";

  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(60,60,60,0.08);
  max-width: 1200px;
  margin: 0 auto;
  border: 1px solid rgba(0,0,0,0.04);
  transition: all 0.3s ease;
}

.unjoble-search-bar form input[type="search"],
.unjoble-search-bar form select,
.unjoble-search-bar form button[type="submit"] {
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 1rem;
  font-size: 16px;
}

.unjoble-search-bar form input[type="search"]   { grid-area: search; }
.unjoble-search-bar form select[name="cat"]      { grid-area: cat; }
.unjoble-search-bar form select[name="country"]  { grid-area: country; }
.unjoble-search-bar form button[type="submit"]   { grid-area: button; }

/* 2) Small Tablet (481px – 650px) */
@media (min-width: 481px) and (max-width: 650px) {
  .unjoble-search-bar form {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "search  search"
      "cat     country"
      "button  button";
  }
}

/* 3) Medium Tablet (651px – 900px) */
@media (min-width: 651px) and (max-width: 900px) {
  .unjoble-search-bar form {
    grid-template-columns: 2fr 1fr;
    grid-template-areas:
      "search    cat"
      "country   button";
  }
}

/* 4) Large Tablet (901px – 1200px) */
@media (min-width: 901px) and (max-width: 1200px) {
  .unjoble-search-bar form {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-areas:
      "search    cat      country"
      ".         button   .";
    gap: 12px;
  }
  .unjoble-search-bar form button[type="submit"] {
    justify-self: center;
    width: auto;
    min-width: 120px;
  }
}

/* 5) Desktop (Above 1200px) */
@media (min-width: 1201px) {
  .unjoble-search-bar form {
    grid-template-columns: 2fr 1fr 1fr auto;
    grid-template-areas:
      "search    cat      country  button";
  }
  .unjoble-search-bar form button[type="submit"] {
    justify-self: start;
    width: auto;
  }
}

/* ===== JOB LISTINGS ===== */
.job-listings {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
}

/* ===== JOB CARD STYLES ===== */
.job-card {
  background: #fff;
  border: 1px solid #e1e5e9;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.job-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1a73e8, #4285f4);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.job-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: #dadce0;
  transform: translateY(-2px);
}

.job-card:hover::before {
  transform: scaleX(1);
}

.job-card.featured,
.job-card[style*="border-color:#4285f4"] {
  border-color: #4285f4 !important;
  box-shadow: 0 4px 16px rgba(66,133,244,0.15) !important;
}

.job-card.featured::before {
  transform: scaleX(1);
}

/* Job card layout */
.job-card-layout {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.job-logo {
  flex-shrink: 0;
}

.job-logo img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: contain;
  background: #f8f9fa;
  display: block;
  border: 1px solid #e8eaed;
  transition: transform 0.2s ease;
}

.job-logo img:hover {
  transform: scale(1.05);
}

.job-content {
  flex: 1;
  min-width: 0;
}

.job-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a73e8;
  margin: 0 0 6px 0;
  line-height: 1.4;
}

.job-title a {
  color: #1a73e8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.job-title a:hover,
.job-title a:focus {
  color: #1557b0;
  text-decoration: underline;
}

.job-org {
  color: #d93a4a;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.3;
}

/* Job meta tags */
.job-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-bottom: 8px;
}

.job-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e8f0fe;
  color: #1967d2;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.job-category-tag:hover {
  background: #d2e3fc;
  border-color: #1967d2;
}

.job-category-tag svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

.job-location-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #137333;
  font-size: 13px;
  font-weight: 600;
}

.job-location-tag svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.job-date-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #5f6368;
  font-size: 12px;
}

.job-date-tag svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.job-deadline-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #5f6368;
  font-size: 13px;
}

.job-deadline-tag svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Apply button */
.job-apply-wrapper {
  flex-shrink: 0;
}

.job-apply-btn {
  background: linear-gradient(135deg, #d93a4a 0%, #c12d3a 100%);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(217, 58, 74, 0.3);
}

.job-apply-btn:hover,
.job-apply-btn:focus {
  background: linear-gradient(135deg, #c12d3a 0%, #a02632 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 58, 74, 0.4);
}

.job-apply-btn:active {
  transform: translateY(0);
}

/* ===== PAGINATION ===== */
.pagination {
  margin: 40px 0 0 0;
  display: flex;
  justify-content: center;
}

.pagination ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 8px;
}

.pagination .page-numbers {
  display: inline-block;
  background: #f8f9fa;
  color: #3c4043;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid #dadce0;
  min-width: 44px;
  text-align: center;
}

.pagination .current,
.pagination .page-numbers.current {
  background: #1a73e8;
  color: #fff;
  border-color: #1a73e8;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.pagination .page-numbers:hover:not(.current) {
  background: #f1f3f4;
  border-color: #c4c7c5;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ===== NO JOBS MESSAGE ===== */
.no-jobs-found {
  background: linear-gradient(135deg, #fef7e0 0%, #fdf4d7 100%);
  border: 1px solid #fbcc02;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  color: #8d4e00;
  margin: 40px 0;
  box-shadow: 0 4px 16px rgba(251, 204, 2, 0.1);
}

.no-jobs-found h3 {
  margin: 0 0 10px 0;
  color: #8d4e00;
  font-size: 18px;
}

.no-jobs-found p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

/* ===== LATEST JOBS TICKER ===== */
.latest-jobs-ticker-bar {
  background: #fff;
  box-shadow: 0 2px 8px rgba(60,60,60,0.07);
  border-radius: 8px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 36px auto 20px auto;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.04);
}

/* ==========================================================================
   FORCE‑OVERRIDE: Responsive UNJoble Search Bar Grid
   ========================================================================== */

/* 0) Make sure we’re not still flexing anywhere */
.unjoble-search-bar > form {
  display: grid !important;
  gap: 16px !important;
  align-items: center !important;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(60,60,60,0.08);
  border: 1px solid rgba(0,0,0,0.04);
  max-width: 1200px;
  margin: 0 auto;
  transition: all 0.3s ease;
  /* Base: full‑stack on mobile */
  grid-template-columns: 1fr !important;
  grid-template-areas:
    "search"
    "cat"
    "country"
    "button";
}

/* 1) Mobile (<481px) */
@media (max-width: 480px) {
  .unjoble-search-bar > form {
    /* keeps the base single‑column layout */
    grid-template-areas:
      "search"
      "cat"
      "country"
      "button";
  }
}

/* 2) Small Tablet (481px – 650px) */
@media (min-width: 481px) and (max-width: 650px) {
  .unjoble-search-bar > form {
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "search  search"
      "cat     country"
      "button  button";
  }
}

/* 3) Medium Tablet (651px – 900px) */
@media (min-width: 651px) and (max-width: 900px) {
  .unjoble-search-bar > form {
    grid-template-columns: 2fr 1fr !important;
    grid-template-areas:
      "search    cat"
      "country   button";
  }
}

/* 4) Large Tablet (901px – 1200px) */
@media (min-width: 901px) and (max-width: 1200px) {
  .unjoble-search-bar > form {
    grid-template-columns: 2fr 1fr 1fr !important;
    grid-template-areas:
      "search    cat      country"
      ".         button   .";
  }
  .unjoble-search-bar > form button[type="submit"] {
    justify-self: center !important;
    min-width: 140px;
    width: auto;
  }
}

/* 5) Desktop (Above 1200px) */
@media (min-width: 1201px) {
  .unjoble-search-bar > form {
    grid-template-columns: 2fr 1fr 1fr auto !important;
    grid-template-areas:
      "search    cat      country  button";
  }
  .unjoble-search-bar > form button[type="submit"] {
    justify-self: start !important;
    width: auto;
  }
}

/* Assign each field to its grid‑area */
.unjoble-search-bar > form input[type="search"]   { grid-area: search; }
.unjoble-search-bar > form select[name="cat"]      { grid-area: cat; }
.unjoble-search-bar > form select[name="country"]  { grid-area: country; }
.unjoble-search-bar > form button[type="submit"]   { grid-area: button; }

/* Touch‑friendly defaults */
.unjoble-search-bar > form input[type="search"],
.unjoble-search-bar > form select,
.unjoble-search-bar > form button[type="submit"] {
  width: 100%;
  min-height: 48px;
  font-size: 16px;   /* prevents iOS zoom */
  padding: 0.5rem 1rem;
}


/* … rest of your footer, responsive breakpoints, utilities, animations, print styles … */
