/* =====================================================
   ARTIFEX Components — shared UI (order 2)
   Buttons, cards, tabs, badges, arrows, modal, quickBar, forms.
   ===================================================== */

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1;
  padding: 14px 28px;
  border-radius: var(--r-sm);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
  white-space: nowrap;
}

.btn--primary {
  background: var(--brand-600);
  color: #fff;
}
.btn--primary:hover { background: var(--brand-700); color: #fff; }

.btn--secondary {
  background: var(--bg-0);
  border: 1px solid var(--line-200);
  color: var(--ink-900);
}
.btn--secondary:hover { border-color: var(--brand-600); color: var(--brand-600); }

.btn--ghost-inverse {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .4);
  color: #fff;
}
.btn--ghost-inverse:hover { background: rgba(255, 255, 255, .1); }

.btn--white {
  background: #fff;
  color: var(--brand-700);
}
.btn--white:hover { background: var(--brand-50); }

.btn--lg { height: 52px; padding: 0 32px; font-size: var(--text-body-lg); }
.btn--sm { padding: 10px 20px; font-size: var(--text-sm); }

/* ---- Text link with arrow ---- */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--brand-600);
}
.text-link::after { content: "\2192"; transition: transform var(--dur) var(--ease); }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.text-link:hover::after { transform: translateX(3px); }

/* ---- Card (default interactive card) ---- */
.card {
  background: var(--bg-0);
  border: 1px solid var(--line-200);
  border-radius: var(--r-md);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
a.card:hover, .card--hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-100);
}

/* ---- Icon chip (services etc.) ---- */
.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--brand-50);
  color: var(--brand-600);
  flex: none;
}
.icon-chip svg { width: 24px; height: 24px; }

/* ---- Tabs (text + underline on a rail) ---- */
.tabs {
  display: flex;
  gap: var(--sp-8);
  border-bottom: 1px solid var(--line-200);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tabs button, .tabs a {
  position: relative;
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink-500);
  padding: 0 2px 14px;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.tabs button::after, .tabs a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--brand-600);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.tabs button:hover, .tabs a:hover { color: var(--ink-900); }
.tabs button.show, .tabs button.is-active,
.tabs a.show, .tabs a.is-active { color: var(--ink-900); }
.tabs button.show::after, .tabs button.is-active::after,
.tabs a.show::after, .tabs a.is-active::after { opacity: 1; }

/* ---- Badge pill ---- */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--brand-600);
  background: var(--brand-50);
  padding: 5px 10px;
  border-radius: var(--r-full);
}

/* ---- Circular arrow buttons (sliders) ---- */
.arrow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-0);
  border: 1px solid var(--line-200);
  color: var(--ink-700);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.arrow-btn:hover { border-color: var(--brand-600); color: var(--brand-600); }
.arrow-btn svg { width: 18px; height: 18px; }

/* ---- Media card (rounded media container) ---- */
.media-card {
  border-radius: var(--r-lg);
  overflow: hidden;
}
.media-card img, .media-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Thumb zoom hover (portfolio/notice images) ---- */
.thumb {
  overflow: hidden;
  border-radius: var(--r-md);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}
a:hover .thumb img, .thumb:hover img { transform: scale(1.03); }

/* ---- Modal (#layerPopup contract kept) ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 19, 34, .5);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
}
.modal-overlay.is-open { display: flex; }

.modal-content {
  position: relative;
  background: var(--bg-0);
  border-radius: var(--r-lg);
  padding: var(--sp-12);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-content .close-btn {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-200);
  font-size: 20px;
  line-height: 1;
  color: var(--ink-700);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.modal-content .close-btn:hover { border-color: var(--brand-600); color: var(--brand-600); }
.modal-content h3 { font-size: var(--text-h2); letter-spacing: -0.01em; }
.modal-content p { color: var(--ink-500); margin-top: var(--sp-3); }
.modal-content .imgBox { margin-top: var(--sp-6); border-radius: var(--r-md); overflow: hidden; }
.modal-content .imgBox img { width: 100%; }

/* ---- Quick bar (floating) ---- */
.quickBar {
  position: fixed;
  right: var(--sp-6);
  bottom: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  z-index: var(--z-header);
}
.quickBar .kakaoBtn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fee500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.quickBar .kakaoBtn img { width: 28px; height: auto; }
.quickBar .topBtn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-0);
  border: 1px solid var(--line-200);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  align-self: center;
  color: var(--ink-700);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
}
.quickBar .topBtn.is-visible { opacity: 1; visibility: visible; }
.quickBar .topBtn svg { width: 18px; height: 18px; }

/* ---- Form kit (Phase 2 pages + board write/comment) ---- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field > label { font-size: var(--text-sm); font-weight: 600; color: var(--ink-700); }
.field .req { color: var(--brand-600); }

.input, .field input[type="text"], .field input[type="email"], .field input[type="tel"],
.field input[type="url"], .field input[type="password"] {
  height: 48px;
  border: 1px solid var(--line-200);
  border-radius: var(--r-sm);
  padding: 0 var(--sp-4);
  background: var(--bg-0);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field textarea {
  min-height: 160px;
  border: 1px solid var(--line-200);
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-4);
  resize: vertical;
}
.field input:focus, .field textarea:focus, .input:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.field ::placeholder { color: var(--ink-300); }

.chip-group { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-200);
  border-radius: var(--r-full);
  padding: 10px 18px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-700);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip.is-checked, .chip:has(input:checked) {
  background: var(--brand-50);
  border-color: var(--brand-600);
  color: var(--brand-600);
}

/* ---- 허니팟 필드 (스팸 가드 — 시각·포커스·스크린리더 숨김) ---- */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Sub-nav (서브페이지 스티키 탭 — subhead 아래 공용) ---- */
.sub-nav {
  position: sticky;
  top: var(--header-h);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-200);
  z-index: calc(var(--z-header) - 10);
}
.sub-nav ul {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-pad);
  display: flex;
  gap: var(--sp-8);
  overflow-x: auto;
  scrollbar-width: none;
}
.sub-nav ul::-webkit-scrollbar { display: none; }
.sub-nav ul li a {
  position: relative;
  display: block;
  padding: 16px 2px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-500);
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
  cursor: pointer;
}
.sub-nav ul li a:hover { color: var(--ink-900); }
.sub-nav ul li.is-active a, .sub-nav ul li.active a { color: var(--brand-600); }
.sub-nav ul li.is-active a::after, .sub-nav ul li.active a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--brand-600);
}
