/*
Theme Name: JobPortal Pro
Theme URI: https://example.com/jobportal-pro
Author: JobPortal Pro
Author URI: https://example.com
Description: A lightweight, SEO-optimized job portal WordPress theme with custom post types, auto schema generation, AdSense-ready ad zones, ads.txt verification, and smart meta boxes.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jobportal
Tags: jobs, job-portal, adsense, schema, seo
*/

/* ============================================================
   CSS RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #1a56db;
  --primary-dark:  #1343b0;
  --accent:        #f59e0b;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --surface:       #f8fafc;
  --white:         #ffffff;
  --radius:        8px;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --font-sans:     'Inter', system-ui, -apple-system, sans-serif;
  --max-w:         1140px;
  --sidebar-w:     320px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

p { margin-bottom: 1rem; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-main    { flex: 1; padding: 2rem 0; }

.content-sidebar-wrap {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .content-sidebar-wrap { grid-template-columns: 1fr; }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.02em;
}
.site-logo span { color: var(--accent); }

/* Nav */
.site-nav ul { list-style: none; display: flex; gap: 1.5rem; padding: 0; margin: 0; }
.site-nav a { font-size: .9rem; font-weight: 500; color: var(--text); }
.site-nav a:hover { color: var(--primary); }

/* Search bar */
.header-search { display: flex; gap: .5rem; }
.header-search input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .45rem .9rem;
  font-size: .875rem;
  width: 220px;
  outline: none;
  transition: border-color .2s;
}
.header-search input:focus { border-color: var(--primary); }
.header-search button {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: .45rem 1rem;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.header-search button:hover { background: var(--primary-dark); }

/* Mobile toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: .5rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; transition: .3s; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--border); padding: 1rem; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: .75rem; }
  .header-search { display: none; }
}

/* ============================================================
   HERO / BANNER
   ============================================================ */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #1343b0 100%);
  color: var(--white);
  padding: 4rem 0 3rem;
  text-align: center;
}
.hero-banner h1 { font-size: 2.5rem; margin-bottom: .75rem; color: var(--white); }
.hero-banner p  { font-size: 1.1rem; opacity: .9; margin-bottom: 2rem; }

.hero-search {
  display: flex;
  max-width: 640px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 50px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero-search input {
  flex: 1;
  border: none;
  padding: .9rem 1.5rem;
  font-size: 1rem;
  outline: none;
  color: var(--text);
}
.hero-search button {
  background: var(--accent);
  border: none;
  padding: .9rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  transition: background .2s;
}
.hero-search button:hover { background: #e08d00; }

/* ============================================================
   AD ZONES
   ============================================================ */
.ad-zone {
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  text-align: center;
  padding: .5rem;
  margin: 1.5rem 0;
  overflow: hidden;
}
.ad-zone-label {
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .25rem;
}
.ad-leaderboard  { min-height: 90px; }
.ad-rectangle    { min-height: 250px; }
.ad-large-rect   { min-height: 280px; }
.ad-sticky-side  { position: sticky; top: 80px; }

/* ============================================================
   JOB CARDS (Archive / Home)
   ============================================================ */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.job-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.job-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.job-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.job-card-logo   { width: 52px; height: 52px; border-radius: 8px; object-fit: contain; border: 1px solid var(--border); background: var(--surface); padding: 4px; flex-shrink: 0; }
.job-card-logo-placeholder { width: 52px; height: 52px; border-radius: 8px; background: var(--primary); display: flex; align-items: center; justify-content: center; color: var(--white); font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }

.job-card-title  { font-size: 1rem; font-weight: 700; color: var(--text); }
.job-card-title a { color: inherit; }
.job-card-title a:hover { color: var(--primary); }

.job-card-company { font-size: .875rem; color: var(--text-muted); font-weight: 500; }

.job-badges { display: flex; flex-wrap: wrap; gap: .4rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 20px;
}
.badge-type     { background: #dbeafe; color: #1d4ed8; }
.badge-location { background: #dcfce7; color: #15803d; }
.badge-salary   { background: #fef9c3; color: #854d0e; }
.badge-remote   { background: #ede9fe; color: #6d28d9; }
.badge-new      { background: var(--accent); color: var(--text); }
.badge-category { background: #f3f4f6; color: var(--text-muted); }

.job-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-muted);
}

.btn-apply {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--primary);
  color: var(--white) !important;
  padding: .45rem 1.1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  transition: background .2s;
}
.btn-apply:hover { background: var(--primary-dark) !important; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 1.5px solid var(--primary);
  color: var(--primary) !important;
  padding: .45rem 1.1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  background: transparent;
  transition: background .2s, color .2s;
}
.btn-outline:hover { background: var(--primary); color: var(--white) !important; }

/* ============================================================
   SINGLE JOB PAGE
   ============================================================ */
.single-job-wrap { display: flex; flex-direction: column; gap: 1.5rem; }

/* Apply Box — sticky CTA at top */
.job-apply-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.job-apply-box h2 { font-size: 1.5rem; margin: 0 0 .25rem; }
.job-apply-box .company { font-size: 1rem; color: var(--text-muted); }
.job-apply-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }

.apply-cta { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; text-align: right; }
.btn-apply-lg {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--primary);
  color: var(--white) !important;
  padding: .8rem 2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  transition: background .2s;
}
.btn-apply-lg:hover { background: var(--primary-dark) !important; }
.apply-deadline { font-size: .8rem; color: var(--text-muted); }

/* How-to-apply instructions box */
.job-how-to-apply {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.job-how-to-apply h3 {
  font-size: 1rem;
  color: var(--primary-dark);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.job-how-to-apply ol { margin: 0; color: var(--text); }
.job-how-to-apply ol li { margin-bottom: .4rem; }

/* Description */
.job-description-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.job-description-card h3 {
  font-size: 1.15rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: .5rem;
  margin-bottom: 1.1rem;
}
.job-description-card .entry-content h2 { font-size: 1.2rem; margin: 1.25rem 0 .5rem; }
.job-description-card .entry-content h3 { font-size: 1.05rem; margin: 1rem 0 .4rem; border: none; padding: 0; }
.job-description-card .entry-content ul  { margin-bottom: .75rem; }

/* Requirements block */
.job-requirements-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.job-requirements-card h3 {
  font-size: 1.15rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: .5rem;
  margin-bottom: 1.1rem;
}
.requirements-list { list-style: none; padding: 0; }
.requirements-list li {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
}
.requirements-list li:last-child { border-bottom: none; }
.requirements-list li::before {
  content: "✓";
  color: #16a34a;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: .05rem;
}

/* Job sidebar overview */
.job-overview-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.job-overview-card h4 { font-size: .95rem; margin-bottom: 1rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; }
.overview-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.overview-list li { display: flex; gap: .75rem; align-items: flex-start; font-size: .9rem; }
.overview-icon { font-size: 1.1rem; width: 20px; flex-shrink: 0; text-align: center; }
.overview-label { color: var(--text-muted); font-size: .78rem; display: block; }
.overview-value { font-weight: 600; }

/* Share buttons */
.share-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.share-box h4 { font-size: .85rem; font-weight: 700; margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.share-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .9rem;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: opacity .2s;
}
.share-btn:hover { opacity: .85; }
.share-btn svg   { width: 16px; height: 16px; fill: currentColor; }
.share-btn-twitter   { background: #000000; color: #fff !important; }
.share-btn-facebook  { background: #1877f2; color: #fff !important; }
.share-btn-linkedin  { background: #0a66c2; color: #fff !important; }
.share-btn-whatsapp  { background: #25d366; color: #fff !important; }
.share-btn-telegram  { background: #229ED9; color: #fff !important; }
.share-btn-copy      { background: var(--border); color: var(--text) !important; border: 1px solid #cbd5e1; }
.share-btn-copy:hover { background: #dde4ed; }

/* FAQ Accordion */
.faq-section { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.faq-section h3 { font-size: 1.15rem; margin-bottom: 1.25rem; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: .9rem 0;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.faq-question:hover { color: var(--primary); }
.faq-chevron { flex-shrink: 0; transition: transform .25s; font-size: .85rem; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-answer { display: none; padding: 0 0 1rem; font-size: .92rem; color: var(--text-muted); line-height: 1.7; }
.faq-item.open .faq-answer { display: block; }

/* Related jobs */
.related-jobs { margin-top: 2.5rem; }
.related-jobs h3 { font-size: 1.25rem; margin-bottom: 1.25rem; }

/* ============================================================
   ARCHIVE FILTERS
   ============================================================ */
.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin-bottom: 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.archive-filters select, .archive-filters input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .45rem .75rem;
  font-size: .875rem;
  color: var(--text);
  outline: none;
  background: var(--white);
}
.archive-filters select:focus, .archive-filters input:focus { border-color: var(--primary); }
.archive-filters .filter-label { font-size: .85rem; font-weight: 600; color: var(--text-muted); }

.archive-count { font-size: .875rem; color: var(--text-muted); margin-left: auto; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: .4rem; margin-top: 2rem; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  background: var(--white);
  color: var(--text);
  font-weight: 500;
}
.pagination a:hover      { border-color: var(--primary); color: var(--primary); }
.pagination .current     { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ============================================================
   WIDGETS & SIDEBAR
   ============================================================ */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.widget-title { font-size: .95rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--border); }
.widget ul { list-style: none; padding: 0; }
.widget ul li { padding: .35rem 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--text); }
.widget ul li a:hover { color: var(--primary); }

/* Category cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-cloud a {
  font-size: .8rem !important;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: .25rem .6rem;
  border-radius: 20px;
  color: var(--text) !important;
  font-weight: 500;
}
.tag-cloud a:hover { background: var(--primary); color: var(--white) !important; border-color: var(--primary); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 { font-size: .9rem; font-weight: 700; color: #f1f5f9; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: .05em; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: .5rem; }
.footer-col ul li a { color: #94a3b8; font-size: .875rem; }
.footer-col ul li a:hover { color: var(--white); }
.footer-col p { font-size: .875rem; line-height: 1.7; }

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .8rem;
}
.footer-bottom a { color: #94a3b8; }
.footer-bottom a:hover { color: var(--white); }

/* ============================================================
   NOTICES & ALERTS
   ============================================================ */
.notice {
  padding: .85rem 1.25rem;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.notice-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.notice-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.notice-warn    { background: #fefce8; border: 1px solid #fde68a; color: #854d0e; }
.notice-error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

/* ============================================================
   UTILITY
   ============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.text-center { text-align: center; }
.d-flex { display: flex; }
.gap-1 { gap: .5rem; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Copied toast */
#copy-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1e293b;
  color: #fff;
  padding: .65rem 1.25rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
#copy-toast.show { opacity: 1; transform: translateY(0); }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb { margin-bottom: 1.25rem; font-size: .85rem; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.breadcrumb li { display: flex; align-items: center; gap: .3rem; color: var(--text-muted); }
.breadcrumb li + li::before { content: '/'; color: var(--text-muted); }
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { color: var(--primary-dark); }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 500; }

/* Print */
@media print {
  .site-header, .sidebar, .ad-zone, .share-box, .site-footer { display: none !important; }
  .content-sidebar-wrap { grid-template-columns: 1fr; }
}
