/* splus.kr 추천 큐레이션 사이트 — 공통 스타일
   외부 폰트·CDN 의존 없음(시스템 폰트 스택). 색상·간격은 이 파일의
   CSS 변수로만 관리한다 — data/sites.json 은 내용만, 디자인은 여기서. */

:root {
  --bg: #F7F8FA;
  --bg-alt: #EEF1F5;
  --card-bg: #FFFFFF;
  --border: #E2E5EA;
  --text: #16181D;
  --text-muted: #5B6270;
  --text-faint: #8A909C;
  --accent: #2F5EDB;
  --accent-soft: #EAEFFC;
  --tag-bg: #F0F1F4;
  --tag-text: #4A505C;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,18,22,.04), 0 6px 20px rgba(16,18,22,.05);
  --max-width: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Malgun Gothic", "Apple SD Gothic Neo",
    "Noto Sans KR", "Noto Sans CJK KR", sans-serif;
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  word-break: keep-all;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== 헤더 ===== */
#site-header {
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}
#site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand .brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.brand .brand-sub {
  font-size: 0.78rem;
  color: var(--text-faint);
}
#site-header nav {
  display: flex;
  gap: 4px;
}
#site-header nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
}
#site-header nav a:hover,
#site-header nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ===== 히어로 ===== */
#hero {
  padding: 56px 0 40px;
}
#hero h1 {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: 14px;
}
#hero p {
  color: var(--text-muted);
  max-width: 640px;
  font-size: 1rem;
  margin-bottom: 8px;
}
.measure-note {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 14px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.measure-note strong { color: var(--text); }

/* ===== 필터/정렬 바 ===== */
#controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
#controls label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 6px;
}
#controls select {
  font: inherit;
  font-size: 0.88rem;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
}
#result-count {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* ===== 카드 그리드 ===== */
#card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding-bottom: 64px;
}
.site-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
}
.site-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(16,18,22,.06), 0 12px 28px rgba(16,18,22,.08);
}
.card-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  object-position: top center;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
/* 스크린샷을 못 찍은 사이트 자리 -- 비워서 고장난 것처럼 보이지 않게,
   같은 높이의 중립 박스로 "갈무리 없음"을 명시한다(TASK:T1934 ②,
   이미지 아님·가짜 스크린샷 아님) */
.card-thumb-placeholder {
  width: 100%;
  height: 150px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 16px;
}
.card-thumb-placeholder span {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-weight: 600;
}
.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card-top h3 {
  font-size: 1.05rem;
  font-weight: 800;
}
.tag {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 20px;
  background: var(--tag-bg);
  color: var(--tag-text);
  white-space: nowrap;
}
.card-reason {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}
.card-stats {
  display: flex;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .stat-label { font-size: 0.68rem; color: var(--text-faint); font-weight: 600; }
.stat .stat-value { font-size: 0.98rem; font-weight: 800; color: var(--text); }
.card-link {
  margin-top: 4px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent);
}
.card-link::after { content: " →"; }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
  font-size: 0.92rem;
}

/* ===== 소개 페이지 ===== */
.about-container { padding: 48px 0 72px; }
.prose { max-width: 720px; }
.prose h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 36px 0 14px;
}
.prose h2:first-child { margin-top: 0; }
.prose p {
  color: var(--text-muted);
  margin-bottom: 14px;
}
.criteria-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.criteria-list li {
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* ===== 상세 페이지 ===== */
#detail-wrap { padding: 48px 0 72px; }
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted);
}
.back-link::before { content: "← "; }
.detail-hero-img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  background: var(--bg-alt);
}
.detail-hero-placeholder {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-hero-placeholder span {
  font-size: 0.86rem;
  color: var(--text-faint);
  font-weight: 600;
}
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.detail-head h1 { font-size: 1.7rem; font-weight: 800; }
.detail-reason {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.75;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.metric-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.metric-box .metric-label { font-size: 0.72rem; color: var(--text-faint); font-weight: 700; margin-bottom: 6px; }
.metric-box .metric-value { font-size: 1.35rem; font-weight: 800; }
.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.feature-pill {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
}
.feature-pill.on { background: var(--accent-soft); color: var(--accent); }
.feature-pill.off { background: var(--tag-bg); color: var(--text-faint); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.btn-primary, .btn-secondary {
  display: inline-block;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--card-bg); border: 1px solid var(--border); color: var(--text); }
.detail-measure-note {
  margin-top: 28px;
  font-size: 0.82rem;
  color: var(--text-faint);
  line-height: 1.6;
  word-break: break-all;
}

/* ===== 푸터 ===== */
#site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  font-size: 0.8rem;
  color: var(--text-faint);
}
#site-footer .container { display: flex; flex-direction: column; gap: 4px; }

/* ===== 반응형: 900px 이하 2열, 600px 이하 1열 ===== */
@media (max-width: 900px) {
  #card-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  #hero { padding: 36px 0 28px; }
  #hero h1 { font-size: 1.5rem; }
  #card-grid { grid-template-columns: 1fr; gap: 14px; }
  #controls { flex-direction: column; align-items: stretch; }
  #controls label { margin-right: 0; }
  #result-count { margin-left: 0; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-head { flex-direction: column; }
  #site-header .container { flex-direction: column; align-items: flex-start; }
}
