/* assets/common/companies.css
   Companies (list / view) — Ultimate v1 (Stable)

   목표
   - 가독성/유지보수성: 섹션화 + 중복 제거 + 최종값 기준으로 통합
   - 브레이크포인트: 1040 / 640
   - 기존 UI/동작 최대 유지 (값/톤은 유지, 충돌/중복만 정리)
*/

/* =========================================================
   C0. SCOPE TOKENS (companies page only)
========================================================= */

.nx-company-wrap {
  /* container */
  --nx-container: var(--container, 1040px);

  /* colors (fallbacks) */
  --nx-primary: var(--color-primary, #1f2b5b);
  --nx-accent: var(--color-accent, #0f6b5b);
  --nx-ink: var(--c-ink, #111);
  --nx-muted: rgba(0, 0, 0, 0.6);
  --nx-border: #e9edf3;
  --nx-border-soft: #eee;
  --nx-bg: #fff;
  --nx-bg-soft: #f7f9fc;

  max-width: var(--nx-container);
  margin: 0 auto;
  padding: 28px 16px 60px;
  box-sizing: border-box;
}

/* =========================================================
   C1. LIST HEAD (title + tools)
========================================================= */

.nx-company-head {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.nx-company-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--nx-ink);
}

.nx-company-sub {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.6);
  margin-top: 6px;
}

.nx-company-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.nx-company-input {
  height: 40px;
  min-width: 240px;
  padding: 0 12px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  box-sizing: border-box;
}

.nx-company-btn {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--nx-primary);
  border-radius: 10px;
  background: var(--nx-primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* =========================================================
   C2. LIST GRID (cards)
========================================================= */

.nx-company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.nx-company-card {
  display: block;
  border: 1px solid var(--nx-border-soft);
  border-radius: 16px;
  background: var(--nx-bg);
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  text-decoration: none;
}

.nx-company-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
}

/* Logo area + hover overlay (+) */
.nx-company-logo {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: #fff;
  position: relative;
}

.nx-company-logo img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  display: block;
}

.nx-company-logo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.08);
  opacity: 0;
  transition: 0.18s ease;
  pointer-events: none;
}

.nx-company-logo::after {
  content: "+";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px;
  border-radius: 999px;
  background: #fff;
  color: var(--nx-accent);
  font-weight: 900;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.86);
  transition: 0.18s ease;
  pointer-events: none;
}

.nx-company-card:hover .nx-company-logo::before {
  opacity: 1;
}
.nx-company-card:hover .nx-company-logo::after {
  opacity: 1;
  transform: scale(1);
}

.nx-company-body {
  padding: 12px 14px 14px;
  border-top: 1px solid #f2f2f2;
}

.nx-company-name {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--nx-ink);
  line-height: 1.3;
}

.nx-company-name-en {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nx-company-meta {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.72);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Pager */
.nx-company-pager {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 26px;
}

.nx-company-page {
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  color: #222;
  text-decoration: none;
  font-weight: 700;
  box-sizing: border-box;
}

.nx-company-page.is-active {
  border-color: var(--nx-primary);
  background: var(--nx-primary);
  color: #fff;
}

/* =========================================================
   C3. VIEW TOP (logo + info card)
========================================================= */

.nx-view-top {
  position: relative;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  align-items: start;
  margin-bottom: 18px;
}

.nx-view-logo {
  min-height: 220px;
  border: 1px solid var(--nx-border);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.nx-view-logo img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
}

.nx-view-card {
  border: 1px solid var(--nx-border);
  border-radius: 16px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.nx-view-h1 {
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  color: var(--nx-ink);
}

.nx-view-h2 {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.6);
  margin: 0 0 12px;
}

/* View actions (top-right) */
.nx-view-actions {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
}

.nx-view-card-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nx-view-bottom {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.nx-view-bottom .nx-company-btn {
  min-width: 200px;
}

/* =========================================================
   C4. VIEW CONTENT COMPONENTS (chip / kv / sec / box)
========================================================= */

.nx-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--nx-border-soft);
  border-radius: 999px;
  background: #fafafa;
  color: #333;
}

.nx-kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 14px;
  font-size: 13px;

  border: 1px solid var(--nx-border);
  border-radius: 12px;
  background: var(--nx-bg-soft);
  padding: 12px 14px;
  margin-top: 14px;
  box-sizing: border-box;
}

.nx-sec {
  margin-top: 16px;
}

.nx-sec h3 {
  font-size: 15px;
  font-weight: 900;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--nx-ink);
}

.nx-sec h3::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--nx-accent);
  display: inline-block;
}

.nx-box {
  border: 1px solid var(--nx-border);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: #222;
  white-space: pre-line;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

/* =========================================================
   C5. GALLERY (inside view)
========================================================= */

.nx-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.nx-gallery a {
  display: block;
  border: 1px solid var(--nx-border-soft);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.nx-gallery img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

/* =========================================================
   C6. BUTTON VARIANTS
========================================================= */

/* 목록 버튼: 고스트 스타일 */
.nx-btn-ghost {
  background: #fff !important;
  color: var(--nx-primary) !important;
  border: 1px solid #d8dee6 !important;
}

/* 홈페이지 동그라미 홈 버튼 */
.nx-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #d8dee6;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--nx-primary);
  box-sizing: border-box;
}

.nx-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.nx-icon-btn:hover {
  filter: brightness(0.98);
}

/* =========================================================
   C9. RESPONSIVE (1040 / 640)
========================================================= */

@media (max-width: 1040px) {
  .nx-view-top {
    grid-template-columns: 1fr;
  }

  /* view actions가 겹치지 않게 '정적' 전환 */
  .nx-view-actions {
    position: static;
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-end;
  }

  .nx-company-input {
    min-width: 180px;
  }
}

@media (max-width: 640px) {
  .nx-company-wrap {
    padding: 22px 14px 54px;
  }

  .nx-company-title {
    font-size: 24px;
  }

  .nx-company-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .nx-company-input {
    min-width: 0;
    width: 100%;
  }

  .nx-company-btn {
    width: 100%;
  }

  .nx-kv {
    grid-template-columns: 92px 1fr;
  }

  .nx-company-logo {
    height: 150px;
  }
  .nx-gallery img {
    height: 170px;
  }
}
