/*
 Theme Name: The Phage Jobs
 Theme URI: https://thephage.xyz/
 Author: Raphael Hans Lwesya
 Author URI: https://thephage.xyz/
 Description: High-performance, SEO-friendly jobs board theme inspired by FindAPhD, tailored for ThePhage.xyz job listings.
 Version: 1.1.1
 License: GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: phagejobs
*/

/* =========================
   Core variables & resets
   ========================= */

:root {
  --phage-primary: #111827;
  --phage-accent: #10b981;
  --phage-accent-soft: #d1fae5;
  --phage-bg: #f9fafb;
  --phage-text: #111827;
  --phage-muted: #6b7280;
  --phage-border: #e5e7eb;
  --phage-radius-lg: 0.85rem;
  --phage-radius-xl: 1.25rem;
  --phage-shadow-soft: 0 10px 30px rgba(15,23,42,0.08);
  --phage-max-width: 1160px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  color: var(--phage-text);
  background: var(--phage-bg);
  line-height: 1.6;
}

/* =========================
   Layout
   ========================= */

.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1 0 auto;
}

.container {
  width: 100%;
  max-width: var(--phage-max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

@media (min-width: 992px) {
  .container {
    padding: 2.5rem 1.5rem;
  }
}

/* =========================
   Header & Navigation
   ========================= */

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--phage-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.7rem 1.25rem;
  max-width: var(--phage-max-width);
  margin: 0 auto;
}

/* Logo */

.site-title a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--phage-primary);
}

.site-logo-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--phage-accent);
  flex-shrink: 0;
}

.site-logo-text {
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 1rem;
}

.site-title span.accent {
  color: var(--phage-accent);
}

/* Main nav: horizontal ribbon */

.main-nav {
  flex: 1 1 auto;
}

.site-header .main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.site-header .main-nav li {
  margin: 0;
}

.site-header .main-nav a {
  text-decoration: none;
  color: var(--phage-muted);
  font-size: 0.9rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

.site-header .main-nav a:hover,
.site-header .main-nav a:focus {
  color: var(--phage-primary);
  background: #f3f4f6;
}

/* Search block (right side) */

.header-search {
  flex: 0 0 auto;
}

.header-search .search-form {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.header-search .search-field {
  border-radius: 999px;
  border: 1px solid var(--phage-border);
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
  background: #f9fafb;
  min-width: 140px;
}

.header-search .search-field:focus {
  outline: none;
  border-color: var(--phage-accent);
  box-shadow: 0 0 0 1px rgba(16,185,129,0.3);
}

.header-search .search-submit {
  border-radius: 999px;
  border: none;
  background: var(--phage-accent);
  color: #fff;
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
}

.header-search .search-submit:hover,
.header-search .search-submit:focus {
  background: #059669;
}

/* Hamburger button */

.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  padding: 0.3rem;
  border-radius: 999px;
  cursor: pointer;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-toggle-bar {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--phage-primary);
}

/* =========================
   Hero
   ========================= */

.hero {
  background: radial-gradient(circle at top left, #ecfeff 0, #ffffff 45%, #f9fafb 100%);
  border-bottom: 1px solid var(--phage-border);
}

.hero-inner {
  max-width: var(--phage-max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--phage-accent-soft);
  color: #047857;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: 2.1rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  color: var(--phage-primary);
}

.hero-subtitle {
  max-width: 34rem;
  font-size: 0.97rem;
  color: var(--phage-muted);
  margin-bottom: 1.5rem;
}

/* Hero search bar */

.hero-search {
  background: #ffffff;
  border-radius: var(--phage-radius-xl);
  box-shadow: var(--phage-shadow-soft);
  padding: 0.85rem;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) auto;
  gap: 0.55rem;
  align-items: center;
}

.hero-search input[type="search"],
.hero-search input[type="text"],
.hero-search select {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--phage-border);
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  outline: none;
  background: #f9fafb;
}

.hero-search input:focus,
.hero-search select:focus {
  border-color: var(--phage-accent);
  box-shadow: 0 0 0 1px rgba(16,185,129,0.3);
}

/* Primary buttons */

.button-primary {
  border-radius: 999px;
  background: var(--phage-accent);
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
}

.button-primary:hover,
.button-primary:focus {
  background: #059669;
}

/* Filter pills */

.filter-bar {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-pill {
  border-radius: 999px;
  border: 1px solid var(--phage-border);
  background: #ffffff;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  color: var(--phage-muted);
  text-decoration: none;
}

.filter-pill.is-active,
.filter-pill:hover {
  border-color: var(--phage-accent);
  color: #047857;
  background: var(--phage-accent-soft);
}

/* =========================
   Jobs layout & cards
   ========================= */

.jobs-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: flex-start;
}

@media (max-width: 960px) {
  .jobs-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.job-card {
  background: #ffffff;
  border-radius: var(--phage-radius-lg);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.8rem;
  border: 1px solid var(--phage-border);
  box-shadow: 0 12px 30px rgba(15,23,42,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(15,23,42,0.06);
  border-color: rgba(16,185,129,0.5);
}

.job-card-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: flex-start;
}

.job-card-thumb {
  width: 60px;
  height: 60px;
  border-radius: 0.9rem;
  overflow: hidden;
  background: #f3f4f6;
  flex-shrink: 0;
}

.job-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.job-card-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 650;
}

.job-card-title a {
  color: var(--phage-primary);
  text-decoration: none;
}

.job-card-title a:hover {
  text-decoration: underline;
}

.job-card-meta {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: var(--phage-muted);
}

.job-tag {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  background: #f3f4f6;
}

.job-card-body {
  margin-top: 0.7rem;
  font-size: 0.88rem;
  color: #4b5563;
}

.job-card-footer {
  margin-top: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--phage-muted);
}

.job-deadline {
  font-weight: 600;
  color: #b91c1c;
}

.job-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
}

/* Sidebar */

.sidebar-card {
  background: #ffffff;
  border-radius: var(--phage-radius-lg);
  padding: 1.15rem 1.1rem;
  border: 1px solid var(--phage-border);
  box-shadow: var(--phage-shadow-soft);
  margin-bottom: 1rem;
}

.sidebar-card h2 {
  font-size: 1rem;
  margin-top: 0;
}

.sidebar-highlight {
  font-size: 0.86rem;
  color: var(--phage-muted);
}

/* =========================
   Global links & footer
   ========================= */

a {
  color: var(--phage-accent);
}

a:hover {
  color: #059669;
}

.site-footer {
  background: #020617;
  color: #9ca3af;
  padding: 1.75rem 1.25rem;
  margin-top: 2rem;
}

.site-footer-inner {
  max-width: var(--phage-max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
}

/* Breadcrumbs */

.breadcrumbs {
  font-size: 0.78rem;
  margin-bottom: 0.9rem;
  color: var(--phage-muted);
}

.breadcrumbs a {
  color: var(--phage-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--phage-primary);
  text-decoration: underline;
}

/* =========================
   Single job page
   ========================= */

.single-job-header {
  background: #ffffff;
  border-radius: var(--phage-radius-xl);
  padding: 1.5rem 1.4rem;
  border: 1px solid var(--phage-border);
  box-shadow: var(--phage-shadow-soft);
  margin-bottom: 1.5rem;
}

.single-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.86rem;
  color: var(--phage-muted);
  margin-top: 0.5rem;
}

.single-job-tags {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.single-job-thumb {
  margin-top: 1rem;
  border-radius: 1.1rem;
  overflow: hidden;
  max-height: 350px;
}

.single-job-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.single-job-body {
  background: #ffffff;
  border-radius: var(--phage-radius-xl);
  padding: 1.5rem 1.4rem;
  border: 1px solid var(--phage-border);
}

/* Deadline status badges */

.job-deadline-soon {
  background: #fef2f2;
  color: #b91c1c;
}

.job-deadline-closed {
  background: #e5e7eb;
  color: #4b5563;
}

/* Share section */

.job-share-title {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.job-share-buttons {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.job-share-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--phage-muted);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0;
  overflow: hidden;
  transition: 0.15s ease;
}

.job-share-icon svg {
  display: block;
  width: 22px !important;
  height: 22px !important;
  max-width: 100%;
  max-height: 100%;
  fill: #fff !important;
}

.job-share-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
}

/* Individual platform colours */

.job-share-x        { background: #1D9BF0; }
.job-share-bluesky  { background: #0285FF; }
.job-share-linkedin { background: #0A66C2; }
.job-share-facebook { background: #1877F2; }
.job-share-whatsapp { background: #25D366; }
.job-share-email    { background: #6b7280; }

/* Similar jobs */

.similar-jobs {
  margin-top: 2.5rem;
}

.similar-jobs-title {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* Forms & utilities */

input,
select,
textarea {
  font-family: inherit;
}

.text-sm {
  font-size: 0.86rem;
}

.text-xs {
  font-size: 0.78rem;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 0.75rem;
}

/* =========================
   Responsive tweaks
   ========================= */

/* Slightly narrower screens */
@media (max-width: 900px) {
  .header-search .search-field {
    min-width: 110px;
  }
}

/* Header + nav behaviour on tablets/phones */
@media (max-width: 768px) {

  .site-header-inner {
    flex-wrap: wrap;
    align-items: center;
    padding-inline: 1rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    order: 3;
    width: 100%;
    display: none;
    border-top: 1px solid var(--phage-border);
    background: #ffffff;
  }

  .main-nav.is-open {
    display: block;
  }

  .site-header .main-nav ul {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 0 0.75rem;
  }

  .site-header .main-nav li {
    width: 100%;
  }

  .site-header .main-nav a {
    display: block;
    width: 100%;
    padding: 0.55rem 0.4rem;
    border-radius: 0.6rem;
  }

  .header-search {
    order: 2;
    width: 100%;
    margin-top: 0.4rem;
  }

  .header-search .search-form {
    width: 100%;
  }

  .header-search .search-field {
    flex: 1 1 auto;
  }
}

/* Phone refinements */
@media (max-width: 640px) {

  .container {
    padding: 1.25rem 1rem;
  }

  .hero-inner {
    padding: 1.75rem 1rem 1.5rem;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .hero-search {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.6rem;
    padding: 0.75rem;
  }

  .jobs-grid {
    gap: 1.25rem;
  }

  .single-job-header,
  .single-job-body {
    padding: 1.25rem 1rem;
    border-radius: 1rem;
  }

  .job-card-title {
    font-size: 0.98rem;
  }

  .job-card-header {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.6rem;
  }

  .job-card-thumb {
    width: 50px;
    height: 50px;
  }

  .single-job-meta {
    font-size: 0.8rem;
  }

  .badge-pill {
    font-size: 0.72rem;
  }

  .single-job-thumb {
    max-height: 260px;
  }

  .job-share-buttons {
    gap: 0.5rem;
  }

  .job-share-icon {
    width: 36px;
    height: 36px;
  }

  .job-share-icon svg {
    width: 20px !important;
    height: 20px !important;
  }

  .sidebar-card {
    margin-top: 1rem;
  }

  .site-footer {
    padding: 1.35rem 1rem;
  }
}
