/* 공장매칭 매거진 공통 스타일 */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
  color: #111827;
  background: #f8fafc;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* 헤더 */
.mg-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}
.mg-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mg-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #1d4ed8;
}
.mg-logo-img { width: 36px; height: 36px; }
.mg-nav { display: flex; gap: 24px; }
.mg-nav a {
  font-size: 14px;
  color: #6b7280;
  padding: 6px 0;
  transition: color 0.15s;
}
.mg-nav a:hover { color: #1d4ed8; }
.mg-nav a.active { color: #1d4ed8; font-weight: 600; }
.mg-cta {
  padding: 8px 16px;
  background: #1d4ed8;
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

/* 컨테이너 */
.mg-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 인덱스 — 제목 영역 */
.mg-title-section {
  padding: 60px 24px 40px;
  text-align: center;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.mg-title {
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 12px;
  color: #0f172a;
  letter-spacing: -0.5px;
}
.mg-subtitle {
  font-size: 16px;
  color: #6b7280;
  margin: 0;
}

/* 필터 칩 */
.mg-filters {
  display: flex;
  gap: 8px;
  padding: 24px;
  overflow-x: auto;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.mg-chip {
  padding: 8px 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.mg-chip:hover { border-color: #1d4ed8; color: #1d4ed8; }
.mg-chip.active { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }

/* 카드 그리드 */
.mg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 40px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 1024px) {
  .mg-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .mg-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 24px 16px 60px; }
}
@media (max-width: 480px) {
  .mg-grid { grid-template-columns: 1fr; }
}
.mg-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}
.mg-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}
.mg-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  background-size: cover;
  background-position: center;
  background-color: #dbeafe;
  position: relative;
}
.mg-thumb-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.mg-card-body {
  padding: 16px 18px 20px;
}
.mg-card-tag {
  display: inline-block;
  padding: 3px 10px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}
.mg-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.2px;
}
.mg-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #94a3b8;
}

/* 개별 글 페이지 */
.mg-article {
  background: #fff;
  max-width: 800px;
  margin: 0 auto;
}
.mg-breadcrumb {
  padding: 16px 24px;
  font-size: 13px;
  color: #94a3b8;
  background: #f8fafc;
}
.mg-breadcrumb a { color: #1d4ed8; }
.mg-article-hero {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 500px;
  background-size: cover;
  background-position: center;
  background-color: #1d4ed8;
}
.mg-article-header {
  padding: 40px 24px 30px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}
.mg-article-cat {
  display: inline-block;
  padding: 4px 14px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}
.mg-article-title {
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 16px;
  line-height: 1.35;
  letter-spacing: -0.5px;
}
.mg-article-subtitle {
  font-size: 16px;
  color: #6b7280;
  margin: 0 0 20px;
  line-height: 1.6;
}
.mg-article-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 13px;
  color: #94a3b8;
}
.mg-article-meta span { display: inline-flex; align-items: center; gap: 4px; }
.mg-article-body {
  padding: 40px 24px;
  font-size: 16px;
  line-height: 1.85;
  color: #1f2937;
}
.mg-article-body h2 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 40px 0 16px;
  padding-left: 14px;
  border-left: 4px solid #1d4ed8;
  letter-spacing: -0.3px;
}
.mg-article-body h3 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 28px 0 12px;
}
.mg-article-body p { margin: 0 0 16px; }
.mg-article-body strong { color: #0f172a; font-weight: 700; }
.mg-article-body ul, .mg-article-body ol {
  margin: 0 0 16px;
  padding-left: 24px;
}
.mg-article-body li { margin-bottom: 8px; }
.mg-article-body img {
  width: 100%;
  border-radius: 12px;
  margin: 24px 0;
}
.mg-info-box {
  background: #eff6ff;
  border-left: 4px solid #1d4ed8;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 14px;
  color: #1e3a8a;
  line-height: 1.7;
}
.mg-info-box-title {
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 8px;
}
.mg-faq-item {
  padding: 16px 20px;
  background: #f8fafc;
  border-radius: 12px;
  margin-bottom: 10px;
}
.mg-faq-q { font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 6px; }
.mg-faq-a { font-size: 14px; color: #4b5563; line-height: 1.7; }

/* 추천 업체 카드 */
.mg-rec-section { margin: 32px 0; }
.mg-rec-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.mg-rec-card:hover { border-color: #1d4ed8; }
.mg-rec-photo {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: #dbeafe;
  flex-shrink: 0;
}
.mg-rec-info { flex: 1; min-width: 0; }
.mg-rec-name { font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.mg-rec-meta { font-size: 12px; color: #6b7280; margin-bottom: 6px; }
.mg-rec-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.mg-rec-tag { padding: 2px 8px; background: #f3f4f6; color: #4b5563; border-radius: 999px; font-size: 11px; }
.mg-rec-num {
  width: 32px;
  height: 32px;
  background: #1d4ed8;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* 해시태그 */
.mg-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 24px;
  border-top: 1px solid #e5e7eb;
}
.mg-tag {
  padding: 6px 12px;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 999px;
  font-size: 12px;
}

/* 관련 글 */
.mg-related {
  padding: 32px 24px;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
}
.mg-related-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}
.mg-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 768px) {
  .mg-related-grid { grid-template-columns: 1fr; }
}

/* 푸터 */
.mg-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 40px 24px;
  text-align: center;
  font-size: 13px;
}
.mg-footer a { color: #cbd5e1; margin: 0 8px; }
.mg-credit { font-size: 11px; color: #6b7280; margin-top: 8px; }

/* 빈 상태 */
.mg-empty {
  text-align: center;
  padding: 80px 24px;
  color: #94a3b8;
}
