/* =============================================================
   tag.css  —  Tag listing page  |  hiring4jobs.com
   Theme  : Astra-inspired, matches global design system
   CLS    : All ad slots use min-height reservations + contain:layout
   Mobile : Full breakpoints 320 → 1200px
   ============================================================= */

/* ─────────────────────────────────────────────────────────────
   1. HERO BANNER
─────────────────────────────────────────────────────────────── */
.tag-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  padding: 44px 0 52px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

/* subtle geometric accent (pure CSS, no image) */
.tag-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(245,197,24,.12) 0%, transparent 55%),
    radial-gradient(circle at 10% 90%, rgba(255,255,255,.06) 0%, transparent 45%);
  pointer-events: none;
}

.tag-hero__inner {
  position: relative;
  z-index: 1;
}

.tag-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: .8rem;
  color: rgba(255,255,255,.6);
  margin-bottom: 14px;
  list-style: none;
  padding: 0;
  margin-top: 0;
}
.tag-breadcrumb a {
  color: rgba(255,255,255,.75);
  transition: color .15s;
}
.tag-breadcrumb a:hover { color: #fff; }
.tag-breadcrumb li:not(:last-child)::after {
  content: '›';
  margin-left: 6px;
  opacity: .5;
}

.tag-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245,197,24,.18);
  border: 1px solid rgba(245,197,24,.35);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 14px;
}

.tag-hero h1 {
  color: #fff;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 10px;
  line-height: 1.2;
}

.tag-hero h1 .tag-hero__keyword {
  color: var(--accent);
  font-style: italic;
}

.tag-hero__desc {
  color: rgba(255,255,255,.72);
  font-size: .9375rem;
  max-width: 580px;
  line-height: 1.65;
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────
   2. SEARCH / REFINE BAR  (floats below hero, overlaps content)
─────────────────────────────────────────────────────────────── */
.tag-search-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  margin-top: -26px;
  position: relative;
  z-index: 10;
  margin-bottom: 28px;
}

.tag-search-bar svg { color: var(--text-muted); flex-shrink: 0; }

.tag-search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: .9375rem;
  color: var(--text);
  background: transparent;
  min-width: 0;
}
.tag-search-bar input::placeholder { color: var(--text-light); }

.tag-search-bar button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: .875rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
  flex-shrink: 0;
}
.tag-search-bar button:hover { background: var(--primary-light); }

/* ─────────────────────────────────────────────────────────────
   3. LAYOUT  — 2-col (main + sidebar) on desktop
─────────────────────────────────────────────────────────────── */
.tag-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
  padding-bottom: 72px;
}

.tag-main { min-width: 0; }
.tag-sidebar { min-width: 0; }

/* ─────────────────────────────────────────────────────────────
   4. RESULTS META ROW
─────────────────────────────────────────────────────────────── */
.tag-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tag-count {
  font-size: .875rem;
  color: var(--text-muted);
  margin: 0;
}
.tag-count strong { color: var(--primary-dark); font-weight: 700; }

.tag-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8125rem;
  color: var(--text-muted);
}
.tag-sort select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: .8125rem;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  outline: none;
}
.tag-sort select:focus { border-color: var(--primary); }

/* ─────────────────────────────────────────────────────────────
   5. JOB CARD GRID
─────────────────────────────────────────────────────────────── */
.tag-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tag-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, box-shadow .2s, transform .18s;
  position: relative;
  contain: layout style;          /* CLS-safe, avoids paint blowout */
}

.tag-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Accent left border on hover */
.tag-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  background: var(--primary);
  border-radius: 3px;
  opacity: 0;
  transition: opacity .2s;
}
.tag-card:hover::before { opacity: 1; }

/* NEW badge (≤3 days) */
.tag-card__new-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 99px;
  line-height: 1.6;
}

/* Logo wrapper */
.tag-card__logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tag-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Card body */
.tag-card__body { flex: 1; min-width: 0; }

.tag-card__company {
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-card__title {
  font-size: .9875rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.3;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta chips row */
.tag-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .75rem;
  padding: 3px 9px;
  border-radius: 99px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.5;
}

.tag-chip--loc  { background: #e3f2fd; color: #1565c0; }
.tag-chip--exp  { background: #e8f5e9; color: #2e7d32; }
.tag-chip--date { background: var(--surface-alt); color: var(--text-muted); }
.tag-chip--sal  { background: #fff8e1; color: #e65100; }

/* Apply CTA (right side, desktop) */
.tag-card__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  font-size: .8125rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  transition: background .2s, transform .15s;
  align-self: center;
}
.tag-card__cta:hover { background: var(--primary-light); transform: translateY(-1px); }
.tag-card__cta svg { flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────────
   6. AD SLOTS  —  CLS-safe with reserved heights
─────────────────────────────────────────────────────────────── */

/* Inline ad (between cards) */
.tag-ad-inline {
  display: block;
  width: 100%;
  min-height: 100px;
  margin: 4px 0 12px;
  contain: layout;              /* prevents layout blowout */
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: center;
}

/* Sidebar ads */
.tag-sidebar-ad {
  display: block;
  width: 100%;
  min-height: 250px;
  margin-bottom: 18px;
  contain: layout;
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: center;
}

/* Sticky sidebar wrapper */
.tag-sidebar__sticky {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Sidebar info box */
.tag-sidebar__info {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 20px;
}
.tag-sidebar__info h3 {
  color: #fff;
  font-size: .9375rem;
  margin-bottom: 8px;
}
.tag-sidebar__info p {
  color: rgba(255,255,255,.72);
  font-size: .8125rem;
  line-height: 1.6;
  margin-bottom: 16px;
}
.tag-sidebar__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: .875rem;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background .2s;
}
.tag-sidebar__cta:hover { background: var(--accent-dark); }

/* Popular tags sidebar widget */
.tag-sidebar__widget {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.tag-sidebar__widget-title {
  font-size: .6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-light);
  margin-bottom: 14px;
}
.tag-sidebar__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.tag-sidebar__tags a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--primary);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 4px 10px;
  border-radius: 99px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.tag-sidebar__tags a:hover {
  background: #dbeafe;
  color: var(--primary-dark);
}

/* ─────────────────────────────────────────────────────────────
   7. EMPTY STATE
─────────────────────────────────────────────────────────────── */
.tag-empty {
  text-align: center;
  padding: 64px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.tag-empty__icon {
  width: 64px;
  height: 64px;
  background: var(--surface-alt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  color: var(--text-muted);
}
.tag-empty h2 {
  font-size: 1.125rem;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.tag-empty p {
  font-size: .9375rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.tag-empty__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  padding: 11px 24px;
  border-radius: var(--radius-md);
  font-size: .9375rem;
  transition: background .2s;
}
.tag-empty__link:hover { background: var(--primary-light); }

/* ─────────────────────────────────────────────────────────────
   8. JSON-LD PAGINATION  / LOAD-MORE BUTTON
─────────────────────────────────────────────────────────────── */
.tag-load-more {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}
.tag-load-more a,
.tag-load-more button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  font-weight: 700;
  font-size: .9375rem;
  padding: 11px 28px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background .2s, color .2s;
  text-decoration: none;
}
.tag-load-more a:hover,
.tag-load-more button:hover { background: var(--primary); color: #fff; }

/* ─────────────────────────────────────────────────────────────
   9. SEO SCHEMA SECTION  (visible human text for bots + users)
─────────────────────────────────────────────────────────────── */
.tag-seo-section {
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 8px;
}
.tag-seo-section h2 {
  font-size: 1rem;
  color: var(--primary-dark);
  margin-bottom: 10px;
}
.tag-seo-section p {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────
   10. RESPONSIVE  —  ≤ 960px  (tablet / large mobile)
─────────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .tag-layout {
    grid-template-columns: 1fr;
    padding-bottom: 48px;
    gap: 0;
  }

  /* Sidebar collapses to a horizontal strip on tablet */
  .tag-sidebar {
    order: -1;
    margin-bottom: 20px;
  }
  .tag-sidebar__sticky {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px;
  }
  .tag-sidebar__info { flex: 1 1 240px; }
  .tag-sidebar-ad    { flex: 1 1 280px; min-height: 120px; }

  /* Hide sidebar widget on tablet to save space */
  .tag-sidebar__widget { display: none; }

  .tag-card__cta { display: none; }

  .tag-hero { padding: 32px 0 42px; }
}

/* ─────────────────────────────────────────────────────────────
   11. RESPONSIVE  —  ≤ 640px  (mobile)
─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .tag-hero { padding: 24px 0 36px; }
  .tag-hero h1 { font-size: 1.375rem; }

  .tag-search-bar {
    flex-wrap: wrap;
    padding: 12px 14px;
    margin-top: -22px;
  }
  .tag-search-bar input { width: 100%; min-width: 0; }
  .tag-search-bar button { width: 100%; justify-content: center; }

  .tag-sidebar__sticky {
    flex-direction: column;
    gap: 12px;
  }
  .tag-sidebar-ad { min-height: 100px; }

  .tag-card {
    flex-wrap: wrap;
    padding: 14px 16px;
    gap: 12px;
  }
  .tag-card__logo {
    width: 48px;
    height: 48px;
  }
  .tag-card__title { font-size: .9375rem; }
  .tag-card__meta  { gap: 5px; }
  .tag-chip        { font-size: .72rem; padding: 3px 7px; }

  .tag-meta-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ─────────────────────────────────────────────────────────────
   12. RESPONSIVE  —  ≤ 380px  (small phones)
─────────────────────────────────────────────────────────────── */
@media (max-width: 380px) {
  .tag-hero h1 { font-size: 1.2rem; }
  .tag-hero__desc { font-size: .875rem; }
  .tag-card { padding: 12px 14px; gap: 10px; }
  .tag-card__logo { width: 42px; height: 42px; }
  .tag-card__title { font-size: .9rem; }

  .tag-search-bar { margin-top: -18px; }
  .tag-ad-inline  { min-height: 90px; }
}

/* ─────────────────────────────────────────────────────────────
   13. PRINT  —  strip ads, keep content
─────────────────────────────────────────────────────────────── */
@media print {
  .tag-hero { background: none; color: var(--text); padding: 20px 0; }
  .tag-hero h1 { color: var(--primary-dark); }
  .tag-search-bar,
  .tag-sidebar,
  .tag-ad-inline,
  .tag-sidebar-ad,
  .tag-card__cta,
  .tag-card__new-badge { display: none !important; }
  .tag-layout { display: block; }
  .tag-card   { break-inside: avoid; border: 1px solid #ccc; margin-bottom: 10px; }
}
