/* ==========================================================================
   KAHustle Employer Directory — Styles
   Brand colours: --kh-green (#2d8a45), white, light grey
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --kh-green:        #2d8a45;
  --kh-green-dark:   #1e6331;
  --kh-green-light:  #e8f5ec;
  --kh-green-mid:    #3ca354;
  --kh-white:        #ffffff;
  --kh-offwhite:     #f7f8fa;
  --kh-border:       #e2e8f0;
  --kh-text:         #1a202c;
  --kh-text-muted:   #64748b;
  --kh-shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --kh-shadow-md:    0 4px 16px rgba(0,0,0,.10);
  --kh-shadow-lg:    0 8px 32px rgba(0,0,0,.12);
  --kh-radius:       12px;
  --kh-radius-sm:    8px;
  --kh-transition:   .2s ease;
}

/* ── Reset / base ────────────────────────────────────────────────────────── */
.kh-employer-directory *,
.kh-employer-profile *,
.kh-no-results * {
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DIRECTORY PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.kh-employer-directory {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Directory header -------------------------------------------------------- */
.kh-directory-header {
  text-align: center;
  margin-bottom: 48px;
}

.kh-directory-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--kh-text);
  margin: 0 0 10px;
  line-height: 1.2;
}

.kh-directory-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--kh-green);
  border-radius: 2px;
  margin: 14px auto 0;
}

.kh-directory-subtitle {
  color: var(--kh-text-muted);
  font-size: 1rem;
  margin: 12px 0 0;
}

/* Grid ------------------------------------------------------------------- */
.kh-employer-grid {
  display: grid;
  gap: 24px;
}
.kh-cols-1 { grid-template-columns: 1fr; }
.kh-cols-2 { grid-template-columns: repeat(2, 1fr); }
.kh-cols-3 { grid-template-columns: repeat(3, 1fr); }
.kh-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .kh-cols-3, .kh-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .kh-cols-2, .kh-cols-3, .kh-cols-4 { grid-template-columns: 1fr; }
}

/* ── EMPLOYER CARD ──────────────────────────────────────────────────────── */
.kh-employer-card {
  background: var(--kh-white);
  border: 1px solid var(--kh-border);
  border-radius: var(--kh-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--kh-shadow-sm);
  transition: transform var(--kh-transition), box-shadow var(--kh-transition);
}

.kh-employer-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--kh-shadow-lg);
}

/* Card image area */
.kh-card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--kh-green-light);
}

.kh-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.kh-employer-card:hover .kh-card-image img {
  transform: scale(1.04);
}

/* Placeholder avatar when no image */
.kh-card-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--kh-green), var(--kh-green-dark));
}

.kh-card-avatar span {
  font-size: 3rem;
  font-weight: 800;
  color: rgba(255,255,255,.9);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Listing type badge on image */
.kh-listing-type-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--kh-green);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 4px 10px;
  border-radius: 20px;
}

/* Card body */
.kh-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

/* Category badges */
.kh-card-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kh-cat-badge {
  background: var(--kh-green-light);
  color: var(--kh-green-dark);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid rgba(45,138,69,.2);
}

/* Title */
.kh-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

.kh-card-title a {
  color: var(--kh-text);
  text-decoration: none;
  transition: color var(--kh-transition);
}

.kh-card-title a:hover { color: var(--kh-green); }

/* Excerpt */
.kh-card-excerpt {
  color: var(--kh-text-muted);
  font-size: .875rem;
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

/* Tags */
.kh-card-tags,
.kh-sidebar-tags,
.kh-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kh-tag {
  background: var(--kh-offwhite);
  color: var(--kh-text-muted);
  font-size: .72rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--kh-border);
}

.kh-tag--light {
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  border-color: rgba(255,255,255,.25);
}

/* Card footer */
.kh-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--kh-border);
}

.kh-card-date {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--kh-text-muted);
  font-size: .78rem;
}

/* View button */
.kh-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--kh-green);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: background var(--kh-transition), transform var(--kh-transition);
}

.kh-view-btn:hover {
  background: var(--kh-green-dark);
  transform: translateX(2px);
  color: #fff;
}

/* No results ------------------------------------------------------------- */
.kh-no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--kh-text-muted);
}

.kh-no-results-icon { font-size: 4rem; margin-bottom: 16px; }
.kh-no-results h3   { font-size: 1.4rem; color: var(--kh-text); margin: 0 0 8px; }

/* Pagination ------------------------------------------------------------- */
.kh-pagination {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}

.kh-pagination .page-numbers {
  display: inline-flex;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.kh-pagination .page-numbers li a,
.kh-pagination .page-numbers li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border-radius: var(--kh-radius-sm);
  border: 1px solid var(--kh-border);
  background: #fff;
  color: var(--kh-text);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--kh-transition);
}

.kh-pagination .page-numbers li a:hover {
  background: var(--kh-green-light);
  border-color: var(--kh-green);
  color: var(--kh-green-dark);
}

.kh-pagination .page-numbers li .current {
  background: var(--kh-green);
  border-color: var(--kh-green);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.kh-employer-profile {
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Hero Header ──────────────────────────────────────────────────────────── */
.kh-profile-hero {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 0 0 var(--kh-radius) var(--kh-radius);
}

.kh-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(3px) brightness(.55);
  transform: scale(1.06); /* avoid blur edge */
}

.kh-hero-bg--default {
  background: linear-gradient(135deg, var(--kh-green-dark) 0%, var(--kh-green-mid) 100%);
  filter: none;
  transform: none;
}

.kh-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.65) 0%, rgba(0,0,0,.25) 60%, transparent 100%);
}

.kh-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 32px 40px 40px;
}

/* Breadcrumb */
.kh-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: rgba(255,255,255,.75);
  font-size: .82rem;
  margin-bottom: 28px;
}

.kh-breadcrumb a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  transition: color var(--kh-transition);
}

.kh-breadcrumb a:hover { color: #fff; }
.kh-breadcrumb span   { color: rgba(255,255,255,.6); }

/* Hero main row */
.kh-hero-main {
  display: flex;
  align-items: flex-end;
  gap: 28px;
  flex-wrap: wrap;
}

/* Logo circle */
.kh-hero-logo {
  width: 110px;
  height: 110px;
  border-radius: var(--kh-radius);
  overflow: hidden;
  border: 3px solid rgba(255,255,255,.5);
  background: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

.kh-hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kh-hero-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--kh-green);
}

.kh-hero-avatar span {
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
}

/* Hero info text */
.kh-hero-info { flex: 1; min-width: 220px; }

.kh-profile-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 14px;
  line-height: 1.25;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

/* Badges row */
.kh-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.kh-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .73rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: .3px;
}

.kh-badge--type {
  background: var(--kh-green);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .7px;
}

.kh-badge--cat {
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
}

.kh-badge--date {
  background: rgba(0,0,0,.25);
  color: rgba(255,255,255,.85);
}

@media (max-width: 640px) {
  .kh-hero-content  { padding: 20px 20px 28px; }
  .kh-hero-logo     { width: 80px; height: 80px; }
  .kh-profile-title { font-size: 1.4rem; }
}

/* ── Profile Body (2-col) ─────────────────────────────────────────────── */
.kh-profile-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  padding: 40px 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .kh-profile-body { grid-template-columns: 1fr; }
  .kh-profile-sidebar { order: -1; }
}

/* Sections (main) */
.kh-profile-section {
  background: #fff;
  border: 1px solid var(--kh-border);
  border-radius: var(--kh-radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--kh-shadow-sm);
}

.kh-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--kh-text);
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--kh-green-light);
}

.kh-section-title svg { color: var(--kh-green); flex-shrink: 0; }

/* Description content */
.kh-profile-content {
  color: var(--kh-text);
  font-size: .94rem;
  line-height: 1.75;
}

.kh-profile-content p { margin: 0 0 16px; }
.kh-profile-content p:last-child { margin-bottom: 0; }
.kh-profile-content ul, .kh-profile-content ol { padding-left: 20px; margin: 0 0 16px; }
.kh-profile-content li { margin-bottom: 6px; }

/* Gallery grid */
.kh-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.kh-gallery-item {
  position: relative;
  border-radius: var(--kh-radius-sm);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
}

.kh-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.kh-gallery-item:hover img { transform: scale(1.06); }

.kh-gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--kh-transition);
}

.kh-gallery-item:hover .kh-gallery-overlay { opacity: 1; }

/* ── SIDEBAR CARDS ─────────────────────────────────────────────────────── */
.kh-profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 80px;
}

.kh-sidebar-card {
  background: #fff;
  border: 1px solid var(--kh-border);
  border-radius: var(--kh-radius);
  padding: 22px;
  box-shadow: var(--kh-shadow-sm);
}

.kh-sidebar-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--kh-text);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--kh-green-light);
}

.kh-sidebar-title svg { color: var(--kh-green); }

/* Quick info list */
.kh-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kh-info-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .875rem;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--kh-border);
}

.kh-info-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.kh-info-label {
  color: var(--kh-text-muted);
  font-weight: 500;
}

.kh-info-val {
  color: var(--kh-text);
  font-weight: 600;
  text-align: right;
  max-width: 60%;
}

/* Features list */
.kh-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kh-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .875rem;
  color: var(--kh-text);
  line-height: 1.5;
}

.kh-feature-icon {
  width: 20px;
  height: 20px;
  background: var(--kh-green);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Back button */
.kh-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--kh-green-light);
  color: var(--kh-green-dark);
  font-size: .875rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--kh-radius-sm);
  text-decoration: none;
  border: 1px solid rgba(45,138,69,.2);
  transition: background var(--kh-transition), color var(--kh-transition);
  width: 100%;
  justify-content: center;
}

.kh-back-btn:hover {
  background: var(--kh-green);
  color: #fff;
}

/* Error box */
.kh-error-box {
  text-align: center;
  padding: 48px 20px;
  color: var(--kh-text-muted);
}

/* ── Mobile tweaks ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .kh-employer-directory { padding: 24px 16px; }
  .kh-profile-section    { padding: 20px; }
  .kh-sidebar-card       { padding: 18px; }
  .kh-gallery-grid       { grid-template-columns: repeat(2, 1fr); }
}
