/* ============================================================
   FreeTools — 공통 스타일 (모든 카테고리 index.html 공유)
   사이트별로 :root { --ac, --ac-l } 만 override 하면 됩니다.
   ============================================================ */

/* ── 기본 변수 (변경 안 됨) ── */
:root {
  --gray:     #f5f6f7;
  --border:   #e0e0e0;
  --text:     #2d2d2d;
  --muted:    #888;
  --shadow:   0 2px 10px rgba(0,0,0,.07);
  --shadow-h: 0 6px 22px rgba(0,0,0,.13);
  /* --ac, --ac-l : 각 사이트 <style> 에서 정의 */
}

/* ── 리셋 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── 기본 바디 ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', Roboto, sans-serif;
  background: var(--gray);
  color: var(--text);
  line-height: 1.5;
}

/* ── 네비게이션 ── */
nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: .75rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* FreeTools 홈 링크 (허브로 돌아가기) */
.nav-hub {
  display: flex;
  align-items: center;
  gap: .35rem;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  padding: .25rem .55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.nav-hub:hover { color: var(--ac); border-color: var(--ac); }

.nav-sep {
  color: var(--border);
  font-size: 1.2rem;
  line-height: 1;
  user-select: none;
}

/* 현재 사이트 로고 */
.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
}
.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  /* background: 각 사이트에서 override */
}
.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}
.logo-text span { color: var(--ac); }

/* ── 히어로 ── */
.hero {
  text-align: center;
  padding: 3.5rem 1rem 2.5rem;
  /* background: 각 사이트에서 override 가능 */
}
.hero h1 {
  font-size: 2.3rem;
  font-weight: 800;
  margin-bottom: .6rem;
  letter-spacing: -.5px;
  line-height: 1.2;
}
.hero h1 span { color: var(--ac); }
.hero p {
  color: var(--muted);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.75;
}

/* ── 레이아웃 ── */
.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

/* ── 카테고리 섹션 ── */
.cat { margin-bottom: 2.5rem; }
.cat-title {
  font-size: .75rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .85rem;
  border-left: 3px solid var(--ac);
  padding-left: .6rem;
}

/* ── 카드 그리드 ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: .85rem;
}

/* ── 카드 ── */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 1.4rem 1.1rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: box-shadow .18s, transform .18s, border-color .18s;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .45rem;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-h);
  transform: translateY(-2px);
  border-color: var(--accent, var(--ac));
}
.card:hover .card-icon { transform: scale(1.12); }
.card-icon {
  font-size: 1.7rem;
  transition: transform .2s;
  line-height: 1;
}
.card h3 {
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.3;
}
.card p {
  font-size: .75rem;
  color: var(--muted);
  line-height: 1.5;
}
.card-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 20px;
  background: var(--badge-bg, var(--ac-l, #f0e0e0));
  color: var(--badge-color, var(--ac));
  margin-top: auto;
}
.sc-count {
  position: absolute;
  top: .85rem;
  right: .85rem;
  font-size: .68rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--gray);
  padding: .12rem .45rem;
  border-radius: 20px;
}

/* ── 푸터 ── */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: .78rem;
  border-top: 1px solid var(--border);
  background: #fff;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--ac); }

/* ── 반응형 ── */
@media (max-width: 600px) {
  nav { padding: 0 1rem; }
  .hero h1 { font-size: 1.8rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
  .nav-hub span { display: none; } /* 모바일: 아이콘만 표시 */
}
