/* ============================================
   액션본부 조직도 — 스타일
   디자인 결: Airtable 시안 3 기반, 풀스크린 확장
   ============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --ink: #181d26;
  --ink-sub: #41454d;
  --hairline: #dddddd;
  --surface-dark: #181d26;
  --surface-dark-hover: #232830;
  --max-w: 1400px;
  --radius: 12px;
  --gap: 16px;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 32px 80px;
}

/* ─── 헤더 ─── */
.header {
  margin-bottom: 48px;
}
.header h1 {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.header__sub {
  font-size: 15px;
  color: var(--ink-sub);
}

/* ─── 섹션 ─── */
.section {
  margin-bottom: 48px;
}
.section__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-sub);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

/* ─── voltage 카드 (액션이 · 샘) ─── */
.voltage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.voltage {
  background: var(--accent, var(--ink));
  color: #ffffff;
  border-radius: var(--radius);
  padding: 28px 32px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  position: relative;
  overflow: hidden;
}
.voltage:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}
.voltage__name {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.voltage__subtitle {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.5;
}

/* ─── 일반 카드 (사업체) ─── */
.business-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.card {
  background: #ffffff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.card:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}
.card__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 8px;
}
.card__body {
  flex: 1;
  min-width: 0;
}
.card__name {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.card__subtitle {
  font-size: 13px;
  color: var(--ink-sub);
  line-height: 1.4;
}

/* ─── 부서 카드 (dark surface) ─── */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}
.card--dept {
  background: var(--surface-dark);
  border-color: var(--surface-dark);
  color: #ffffff;
}
.card--dept:hover {
  background: var(--surface-dark-hover);
  border-color: var(--surface-dark-hover);
}
.card--dept .card__name {
  color: #ffffff;
}
.card--dept .card__subtitle {
  color: rgba(255, 255, 255, 0.7);
}

/* ─── 모달 ─── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 29, 38, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 32px;
}
.modal-backdrop.is-open {
  display: flex;
}
.modal {
  background: #ffffff;
  border-radius: var(--radius);
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
}
.modal__header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.modal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 10px;
}
.modal__header-text {
  flex: 1;
  min-width: 0;
}
.modal__name {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.modal__subtitle {
  font-size: 14px;
  color: var(--ink-sub);
}
.modal__close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--ink-sub);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.modal__close:hover { color: var(--ink); }

.modal__body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
}
.modal__body h1, .modal__body h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 10px;
  letter-spacing: -0.01em;
}
.modal__body h1:first-child, .modal__body h2:first-child { margin-top: 0; }
.modal__body h3 { font-size: 15px; font-weight: 600; margin: 16px 0 8px; }
.modal__body p { margin: 8px 0; color: var(--ink-sub); }
.modal__body ul, .modal__body ol { padding-left: 22px; margin: 8px 0; color: var(--ink-sub); }
.modal__body li { margin: 4px 0; }
.modal__body strong { color: var(--ink); font-weight: 600; }
.modal__body code {
  background: #f4f5f7;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.modal__body pre {
  background: #f4f5f7;
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
  font-size: 13px;
}
.modal__body pre code { background: transparent; padding: 0; }
.modal__body table {
  border-collapse: collapse;
  margin: 12px 0;
  width: 100%;
  font-size: 13px;
}
.modal__body th, .modal__body td {
  border: 1px solid var(--hairline);
  padding: 6px 10px;
  text-align: left;
}
.modal__body th { background: #f4f5f7; font-weight: 500; }
.modal__body a { color: #1b61c9; text-decoration: none; }
.modal__body a:hover { text-decoration: underline; }
.modal__body .placeholder {
  color: var(--ink-sub);
  font-style: italic;
}

/* ─── 모달 푸터 — 칩 ─── */
.modal__footer {
  padding: 16px 28px 24px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.chip-group__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-sub);
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 12px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--ink);
}
.chip:hover { border-color: var(--ink); background: #f4f5f7; }
.chip--dept { background: var(--surface-dark); color: #ffffff; border-color: var(--surface-dark); }
.chip--dept:hover { background: var(--surface-dark-hover); border-color: var(--surface-dark-hover); }

/* ─── 반응형 ─── */
@media (max-width: 900px) {
  .business-grid { grid-template-columns: repeat(2, 1fr); }
  .dept-grid { grid-template-columns: repeat(2, 1fr); }
  .voltage-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .container { padding: 32px 16px 48px; }
  .header h1 { font-size: 28px; }
  .business-grid, .dept-grid { grid-template-columns: 1fr; }
}
