/* Custom styles untuk PilihLoker.id - ringan */

/* Slot iklan — jaga layout tetap rapi, CLS rendah */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}

.ad-slot.ad-slot--native {
  display: block;
  overflow: visible;
}

.ad-slot-label {
  display: block;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 6px;
}

.ad-slot--box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.75rem;
}

.ad-slot--infeed {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.75rem 0.75rem 0.5rem;
}

.ad-slot--compact {
  padding: 0.35rem 0 0.15rem;
}

.ad-slot--300 {
  min-height: 292px;
}

.ad-slot--320 {
  min-height: 72px;
}

.ad-slot--native {
  display: block !important;
  overflow: visible !important;
  min-height: 140px;
  width: 100%;
  max-width: 100%;
  text-align: center;
  align-items: stretch;
  justify-content: flex-start;
}

.ad-slot--native .ad-slot-label {
  text-align: center;
}

.ad-native-host {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 120px;
  overflow: visible;
  position: relative;
}

.ad-native-container,
.ad-slot--native [id^="container-"] {
  display: block !important;
  visibility: visible !important;
  width: 100%;
  min-height: 120px;
  overflow: visible !important;
}

/* Jangan paksa ukuran iframe native — di iOS/WebKit max-width:100%
   sering membuat tinggi iframe jadi 0 sehingga iklan “hilang”. */
.ad-slot--native iframe,
.ad-slot--native ins,
.ad-native-host iframe,
.ad-native-container iframe,
.ad-slot--native [id^="container-"] iframe {
  max-width: none !important;
  max-height: none !important;
}

.ad-frame-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.ad-slot:not(.ad-slot--native) iframe,
.ad-slot:not(.ad-slot--native) ins,
.ad-frame-wrap iframe {
  max-width: 100%;
}

.job-side-ad {
  padding: 0.15rem 0 0.35rem;
  overflow: hidden;
}

.job-side-ad .ad-slot {
  min-height: 0;
}

.job-side-ad .ad-slot--320 {
  min-height: 64px;
}

@media (max-width: 360px) {
  .ad-slot--300 {
    min-height: 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .ad-slot--320 {
    min-height: 64px;
  }
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Logo perusahaan — ukuran kotak sama di semua kartu */
.job-logo {
  width: 3rem;
  height: 3rem;
  flex: 0 0 3rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.job-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0.25rem;
  display: block;
}

.job-logo--lg {
  width: 3.5rem;
  height: 3.5rem;
  flex-basis: 3.5rem;
}

.job-logo--sm {
  width: 2.25rem;
  height: 2.25rem;
  flex-basis: 2.25rem;
  border-radius: 0.5rem;
}

.job-logo--fallback {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
}

.job-side-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  min-width: 0;
}

.job-side-item__body {
  flex: 1 1 auto;
  min-width: 0;
}

.job-side-item__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-side-item:hover .job-side-item__title {
  color: #2563eb;
}

.job-side-item__meta {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 640px) {
  .job-logo {
    width: 3.5rem;
    height: 3.5rem;
    flex-basis: 3.5rem;
  }

  .job-logo--lg {
    width: 4rem;
    height: 4rem;
    flex-basis: 4rem;
  }
}

.job-card-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .job-card-row {
    gap: 1rem;
  }
}

.job-card-date {
  color: #9ca3af;
  font-size: 0.75rem;
  line-height: 1rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Focus visible improvement */
*:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Card hover subtle */
a.group:hover {
  transform: translateY(-1px);
}

/* Select multiple height fix */
select[multiple] {
  height: 48px;
}

/* Admin table responsive */
@media (max-width: 640px) {
  table {
    font-size: 0.8125rem;
  }
}

/* Mobile hamburger menu */
body.mobile-menu-lock {
  overflow: hidden;
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.mobile-menu-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  width: min(20rem, 86vw);
  height: 100%;
  background: #fff;
  box-shadow: -12px 0 30px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
}

.mobile-menu-panel.is-open {
  transform: translateX(0);
}

@media (min-width: 768px) {
  .mobile-menu-overlay,
  .mobile-menu-panel,
  #mobileMenuBtn {
    display: none !important;
  }
}

@media (max-width: 360px) {
  .ad-slot--320 {
    overflow-x: auto;
  }
}

#kategoriPanel,
#lokasiPanel,
#adminLokasiPanel {
  max-width: min(100vw - 2rem, 24rem);
}

.job-card-row .flex-1 {
  min-width: 0;
}

/* Sticky bottom ad — slide up tampil, slide down sembunyi */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sticky-ad-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  transform: translateY(0);
  transition: transform 0.28s ease;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.sticky-ad-bar.is-collapsed {
  transform: translateY(100%);
}

.sticky-ad-toggle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -100%);
  width: 44px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  padding: 0;
}

.sticky-ad-toggle:hover {
  color: #111827;
  background: #f9fafb;
}

.sticky-ad-chevron {
  display: block;
  transition: transform 0.22s ease;
}

.sticky-ad-bar.is-collapsed .sticky-ad-chevron {
  transform: rotate(180deg);
}

.sticky-ad-panel {
  width: 100%;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.08);
  padding: 8px 12px 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ad-slot--sticky {
  min-height: 50px;
  padding: 0;
}

body.has-sticky-ad {
  padding-bottom: 92px;
}

body.has-sticky-ad.sticky-ad-collapsed {
  padding-bottom: 28px;
}

/* Detail lowongan — teks panjang & iklan tidak merusak layout HP */
.job-detail-body,
.job-detail-body * {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.job-detail-body img,
.job-detail-body iframe,
.job-detail-body table {
  max-width: 100%;
}

.job-detail-body table {
  display: block;
  overflow-x: auto;
}

#shareJobPanel {
  max-width: 100%;
}

#shareQrBox canvas,
#shareQrBox img {
  max-width: 132px;
  height: auto;
}

@media print {
  .sticky-ad-bar {
    display: none !important;
  }
  body.has-sticky-ad,
  body.has-sticky-ad.sticky-ad-collapsed {
    padding-bottom: 0;
  }
}
