/*
 * Jobdex UI Fixes — assets/css/ui-fixes.css
 * Mobile responsive patches + misc fixes
 */

/* ── MOBILE NAV ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-right .btn-post { display: none; }

  /* Hero */
  .hero-inner { padding: 2rem 0 1.5rem; }
  .hero-title  { font-size: clamp(1.6rem, 6vw, 2.4rem); }
  .hero-search { flex-direction: column; gap: 8px; }
  .hs-cat      { width: 100%; }
  .hs-cat select { width: 100%; }
  .hs-wrap     { width: 100%; }
  .hs-btn      { width: 100%; padding: .75rem; }
  .hero-chips  { flex-wrap: wrap; gap: 6px; }

  /* Stats strip */
  .stats-inner { flex-wrap: wrap; gap: 0; }
  .stat-item   { flex: 1 1 calc(33.333% - 1px); min-width: 90px; padding: .75rem .5rem; }
  .stat-num    { font-size: 1.3rem; }
  .stat-label  { font-size: .65rem; }

  /* Ticker */
  .ticker-label { font-size: .7rem; padding: 0 8px; white-space: nowrap; }

  /* Section headings */
  .sec-head    { flex-direction: column; align-items: flex-start; gap: 10px; }
  .sec-title   { font-size: clamp(1.3rem, 5vw, 1.8rem); }

  /* Job cards grid */
  .jobs-grid   { grid-template-columns: 1fr !important; }
  .pvt-jobs-grid { grid-template-columns: 1fr !important; }
  .scheme-grid { grid-template-columns: 1fr !important; }
  .dir-grid    { grid-template-columns: 1fr 1fr !important; }
  .edu-grid    { grid-template-columns: 1fr 1fr !important; }
  .results-grid { grid-template-columns: 1fr 1fr !important; }

  /* Single job page */
  .job-post-layout { grid-template-columns: 1fr !important; }
  .post-sidebar { display: none; } /* sidebar hidden on mobile */
  .jhc-top     { flex-direction: column; gap: 12px; }
  .jhc-facts   { flex-wrap: wrap; gap: 8px; }
  .jhc-actions { flex-wrap: wrap; gap: 8px; }
  .jhc-actions .btn-apply-big { width: 100%; justify-content: center; }
  .share-row   { flex-wrap: wrap; gap: 6px; }
  .share-btn-sm { flex: 1; min-width: 100px; text-align: center; }

  /* Archive jobs */
  .archive-layout { grid-template-columns: 1fr !important; }
  .jobs-sidebar   { display: none; } /* use filter bar instead */
  .jlc-right      { display: none; } /* hide date on far right */
  .jlc-top        { flex-wrap: wrap; gap: 8px; }
  .filter-bar-strip .fbs-inner { flex-wrap: wrap; gap: 6px; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 1.5rem; }

  /* AI tools */
  .ai-grid { grid-template-columns: 1fr !important; }

  /* Newsletter */
  .nl-strip  { flex-direction: column; gap: 1.25rem; text-align: center; }
  .nl-form   { flex-direction: column; gap: 8px; width: 100%; }
  .nl-input  { width: 100%; }
  .nl-btn    { width: 100%; }

  /* CTA banner */
  .cta-banner { flex-direction: column; gap: 1.25rem; text-align: center; }
  .cta-btns   { flex-direction: column; gap: 8px; width: 100%; }
  .cta-btns button { width: 100%; }

  /* Breadcrumb */
  .breadcrumb-inner { flex-wrap: wrap; gap: 4px; font-size: .8rem; }

  /* Modals */
  .auth-modal, .pvt-job-modal, .post-job-modal { width: 96vw !important; max-height: 90vh; overflow-y: auto; }
}

@media (max-width: 480px) {
  .hero-title  { font-size: 1.45rem; }
  .stat-item   { flex: 1 1 calc(50% - 1px); }
  .edu-grid    { grid-template-columns: 1fr !important; }
  .results-grid { grid-template-columns: 1fr !important; }
  .dir-grid    { grid-template-columns: 1fr !important; }
  .footer-grid { grid-template-columns: 1fr !important; }
  .container   { padding: 0 14px !important; }

  /* Single job card */
  .jc, .pjc   { padding: 14px !important; }
  .jc-title, .pjc-title { font-size: .88rem; }
  .jc-ft       { flex-direction: column; gap: 8px; align-items: stretch; }
  .btn-apply   { text-align: center; }
}

/* ── Ticker label bleed fix ── */
.ticker-label {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.ticker-overflow { overflow: hidden; flex: 1; position: relative; }

/* ── Archive: hide private filter on govt-only pages ── */
body.govt-only .sidebar-box:first-child .check-row:nth-child(n+3) { display: none; }
body.govt-only .ftab[href*="private"] { display: none; }

/* ── Stat counter — prevent flash of zero ── */
.stat-num { min-width: 2ch; display: inline-block; }

/* ── Job list card mobile ── */
@media (max-width: 640px) {
  .job-list-card { padding: 14px !important; }
  .jlc-facts     { flex-wrap: wrap; gap: 6px; }
  .jlc-ft        { flex-direction: column; gap: 8px; }
  .jlc-actions   { justify-content: flex-end; }
  .btn-view      { font-size: .78rem; padding: .4rem .85rem; }
  .ov-grid       { grid-template-columns: 1fr 1fr !important; }
}

/* Select dropdown fix */
select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23E8500A' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;padding-right:28px}
/* Modal center on mobile */
@media(max-width:768px){
  .modal-overlay{align-items:center !important;padding:1rem !important}
  .modal,.modal.modal-auth{width:calc(100% - 2rem) !important;max-width:100% !important;border-radius:16px !important;max-height:88vh !important;margin:auto !important}
  body.modal-open{overflow:hidden !important;position:fixed !important;width:100%}
  /* Font size 16px prevents iOS zoom */
  input,select,textarea{font-size:16px !important}
}
