/**
 * Single job page — head + sections + sidebar.
 */

.apm-job-detail-page {
  background: #f3f5f8;
  padding: 20px 0 64px;
}

.apm-job-detail__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 0.875rem;
  color: #64748b;
}

.apm-job-detail__breadcrumb a {
  color: #64748b;
  text-decoration: none;
}

.apm-job-detail__breadcrumb a:hover {
  color: #1e4ed8;
}

.apm-job-single .apm-job-detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  padding: 0;
  align-items: start;
}

.apm-job-detail__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Fixed share rail — TopCV style, outside content */
.apm-job-share {
  display: none;
}

@media (min-width: 1280px) {
  .apm-job-share {
    position: fixed;
    z-index: 40;
    top: 42%;
    left: max(8px, calc(50% - (min(100vw - 48px, var(--apm-container, 1320px)) / 2) - 64px));
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
    border: 1px solid #eef2f6;
  }

  .apm-job-share__btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease, background 0.15s ease;
  }

  .apm-job-share__btn:hover,
  .apm-job-share__btn.is-copied {
    color: #00b14f;
    background: #ecfdf3;
  }
}

/* Job head card */
.apm-job-head {
  margin: 0;
  padding: 28px;
  background: #fff;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  min-width: 0;
}

.apm-job-head__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #121212;
  line-height: 1.35;
}

.apm-job-head__verified {
  display: inline-flex;
  color: #1e4ed8;
  flex-shrink: 0;
}

.apm-job-head__salary {
  margin: 0 0 20px;
  color: #00b14f;
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1.3;
}

.apm-job-head__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 0 0 24px;
}

.apm-job-head__meta-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.apm-job-head__meta-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8f8ef;
  color: #00b14f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.apm-job-head__meta-label {
  display: block;
  font-size: 0.8125rem;
  color: #7a7a7a;
  margin-bottom: 2px;
}

.apm-job-head__meta-item strong {
  display: block;
  font-size: 0.975rem;
  color: #121212;
  font-weight: 700;
  line-height: 1.35;
}

.apm-job-head__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.apm-job-head__apply {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 8px;
  background: #0d5bdb;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.apm-job-head__apply:hover,
.apm-job-head__apply:focus,
.apm-job-head__apply:visited {
  background: #0a4bb8;
  color: #fff;
  box-shadow: 0 8px 18px rgba(13, 91, 219, 0.28);
}

.apm-job-head__apply.apm-job-head__apply--primary {
  background: #0d5bdb;
}

.apm-job-head__apply.apm-job-head__apply--primary:hover,
.apm-job-head__apply.apm-job-head__apply--primary:focus,
.apm-job-head__apply.apm-job-head__apply--primary:visited {
  background: #0a4bb8;
  color: #fff;
  box-shadow: 0 8px 18px rgba(13, 91, 219, 0.28);
}

.apm-job-head__save {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid #d5d8dd;
  background: #fff;
  color: #00b14f;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.apm-job-head__save:hover,
.apm-job-head__save.is-saved {
  border-color: #00b14f;
  background: #f0fdf4;
}

.apm-job-head__save.is-saved svg {
  fill: currentColor;
}

.apm-job-detail__content {
  background: #fff;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.apm-job-section {
  margin: 0 0 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid #eef2f6;
}

.apm-job-section:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.apm-job-detail__apply-bottom {
  margin-top: 28px;
  padding-top: 4px;
}

.apm-job-detail__apply-bottom .apm-job-head__apply {
  width: 100%;
  min-height: 56px;
  padding: 0 28px;
  font-size: 1.125rem;
  border-radius: 10px;
}

.apm-job-detail__apply-bottom .apm-job-head__apply svg {
  width: 20px;
  height: 20px;
}

.apm-job-section__title {
  position: relative;
  margin: 0 0 14px;
  padding-left: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #121212;
}

.apm-job-section__title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 3px;
  border-radius: 2px;
  background: #00b14f;
}

.apm-job-section__body {
  color: #333;
  line-height: 1.7;
  font-size: 0.975rem;
}

.apm-job-section__body ul {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.apm-job-section__body li {
  margin: 0 0 0.45em;
}

/* Sidebar */
.apm-job-detail__sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--apm-header-h, 80px) + 16px);
  align-self: start;
  max-height: calc(100vh - var(--apm-header-h, 80px) - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.apm-job-company-card,
.apm-job-info-card,
.apm-job-side-block {
  background: #fff;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.apm-job-company-card__top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.apm-job-company-card__logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 800;
  font-size: 1.25rem;
  color: #1e4ed8;
}

.apm-job-company-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.apm-job-company-card__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.apm-job-company-card__name {
  font-size: 0.975rem;
  color: #121212;
  line-height: 1.35;
}

.apm-job-company-card__meta {
  font-size: 0.8125rem;
  color: #7a7a7a;
}

.apm-job-company-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid #cfe0fb;
  background: #f3f7ff;
  color: #1e4ed8;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.apm-job-company-card__link:hover {
  background: #e8f1fd;
  border-color: #93b4f5;
  color: #1639a8;
}

.apm-job-side-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: #121212;
}

.apm-job-info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.apm-job-info-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #e8eef5;
}

.apm-job-info-list li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.apm-job-info-list__label {
  font-size: 0.75rem;
  color: #7a7a7a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.apm-job-info-list strong {
  font-size: 0.9375rem;
  color: #121212;
  font-weight: 600;
}

.apm-job-side-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.apm-job-side-tags a {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #1e4ed8;
  font-size: 0.8125rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.apm-job-side-tags a:hover {
  background: #1e4ed8;
  color: #fff;
}

.apm-job-side-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.apm-job-side-links a {
  color: #333;
  text-decoration: none;
  font-size: 0.875rem;
}

.apm-job-side-links a:hover {
  color: #1e4ed8;
}

.apm-job-single .apm-job-apply {
  position: static;
  top: auto;
  border-radius: 8px;
  border: 1px solid #cfe0fb;
  background: linear-gradient(180deg, #f3f7ff 0%, #eaf1ff 100%);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  flex-shrink: 0;
  padding: 20px;
}

.apm-job-single .apm-job-apply h3 {
  margin: 0 0 16px;
  font-size: 1.125rem;
  font-weight: 700;
  color: #121212;
}

.apm-job-single .apm-job-apply .apm-form-group label {
  color: #334155;
  font-weight: 600;
}

.apm-job-single .apm-job-apply input[type="text"],
.apm-job-single .apm-job-apply input[type="email"],
.apm-job-single .apm-job-apply input[type="tel"],
.apm-job-single .apm-job-apply input[type="file"],
.apm-job-single .apm-job-apply textarea {
  background: #fff;
  border-color: #d7e3f7;
}

.apm-job-single .apm-job-apply .apm-btn--primary {
  margin-top: 4px;
  background: #0d5bdb;
  border-color: #0d5bdb;
  box-shadow: 0 8px 18px rgba(13, 91, 219, 0.22);
}

.apm-job-single .apm-job-apply .apm-btn--primary:hover {
  background: #0a4bb8;
  border-color: #0a4bb8;
}

.apm-job-apply .apm-form-static {
  margin: 0;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9375rem;
  color: #0f172a;
}

.apm-job-apply .apm-form-hint {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

@media (max-width: 1024px) {
  .apm-job-single .apm-job-detail__layout {
    grid-template-columns: 1fr;
  }

  .apm-job-detail__sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .apm-job-head {
    padding: 20px;
  }

  .apm-job-head__meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .apm-job-detail-page {
    padding: 16px 0 48px;
  }

  .apm-job-detail__content {
    padding: 20px 16px;
  }

  .apm-job-head__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .apm-job-head__apply,
  .apm-job-head__save {
    width: 100%;
  }
}

/* Related jobs */

.apm-job-suggest {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #eef2f6;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  padding: 24px;
}

.apm-job-suggest__title {
  margin: 0 0 20px;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.apm-job-suggest__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.apm-job-suggest-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
}

.apm-job-suggest-card:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.apm-job-suggest-card__logo {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--apm-primary);
  overflow: hidden;
}

.apm-job-suggest-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.apm-job-suggest-card__body {
  flex: 1;
  min-width: 0;
  padding-right: 28px;
}

.apm-job-suggest-card__title {
  margin: 0 0 4px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
}

.apm-job-suggest-card__title a {
  color: #0f172a;
}

.apm-job-suggest-card__title a:hover {
  color: var(--apm-primary);
}

.apm-job-suggest-card__company {
  margin: 0 0 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.apm-job-suggest-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.apm-job-suggest-card__tags span {
  padding: 3px 8px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #475569;
  background: #f1f5f9;
  border-radius: 6px;
}

.apm-job-suggest-card__save {
  position: absolute;
  top: 0;
  right: 0;
  background: transparent;
  border: none;
  padding: 4px;
  color: #94a3b8;
  cursor: pointer;
}

.apm-job-suggest-card__save:hover {
  color: #16A34A;
}

.apm-job-suggest__more {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #16A34A;
}

.apm-job-suggest__more:hover {
  color: #15803d;
}

/* Related section bottom */
.apm-job-related-section {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid #eef2f6;
}

.apm-job-related-section__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.apm-job-related-section__accent {
  width: 4px;
  height: 28px;
  background: #16A34A;
  border-radius: 4px;
  flex-shrink: 0;
}

.apm-job-related-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.apm-job-related-card {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid #d1fae5;
  border-radius: 14px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.apm-job-related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.apm-job-related-card__badge {
  position: absolute;
  top: -1px;
  left: 16px;
  width: 28px;
  height: 32px;
  background: #16A34A;
  color: #fff;
  border-radius: 0 0 8px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(22, 163, 74, 0.3);
}

.apm-job-related-card__logo {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  margin-top: 8px;
  border-radius: 12px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--apm-primary);
  overflow: hidden;
}

.apm-job-related-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.apm-job-related-card__main {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.apm-job-related-card__title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.apm-job-related-card__title a {
  color: #0f172a;
}

.apm-job-related-card__title a:hover {
  color: var(--apm-primary);
}

.apm-job-related-card__company {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.apm-job-related-card__loc {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.75rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
}

.apm-job-related-card__aside {
  flex-shrink: 0;
  text-align: right;
  min-width: 140px;
}

.apm-job-related-card__salary {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
  color: #16A34A;
  white-space: nowrap;
}

.apm-job-related-card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.apm-job-related-card__time {
  font-size: 0.75rem;
  color: #94a3b8;
}

.apm-job-related-card__save {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #d1fae5;
  background: #fff;
  color: #16A34A;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.apm-job-related-card__save:hover {
  background: #ecfdf3;
  border-color: #16A34A;
}

.apm-job-related-section__more {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #16A34A;
}

.apm-job-related-section__more:hover {
  color: #15803d;
}

@media (max-width: 1024px) {
  .apm-job-single .apm-job-detail__layout {
    grid-template-columns: 1fr;
  }

  .apm-job-detail__sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .apm-job-single .apm-job-apply {
    position: static;
  }

  .apm-job-detail__toolbar-inner {
    flex-wrap: wrap;
  }

  .apm-job-detail__apply-top {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .apm-job-related-card {
    flex-direction: column;
    gap: 12px;
  }

  .apm-job-related-card__aside {
    width: 100%;
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
  }

  .apm-job-related-card__salary {
    margin: 0;
  }

  .apm-job-detail__tabs {
    gap: 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
    width: 100%;
  }

  .apm-job-detail__tabs a {
    white-space: nowrap;
    font-size: 0.875rem;
  }
}

/* Apply success modal */
.apm-apply-success {
  border: none;
  padding: 0;
  max-width: min(440px, calc(100vw - 32px));
  background: transparent;
}

.apm-apply-success::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}

.apm-apply-success__panel {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px 28px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.apm-apply-success__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.apm-apply-success__close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.apm-apply-success__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8f1fd;
  color: #1e4ed8;
}

.apm-apply-success__title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0a2540;
}

.apm-apply-success__message {
  margin: 0 0 22px;
  font-size: 0.975rem;
  line-height: 1.65;
  color: #475569;
}

.apm-apply-success__ok {
  min-width: 140px;
}

body.apm-apply-success-open {
  overflow: hidden;
}
