/* =====================
   서울 무료급식 지도 - CSS
   ===================== */

:root {
  --primary: #B54A1A;
  --primary-light: #D4621F;
  --accent: #F59E0B;
  --bg: #fdf8f4;
  --white: #ffffff;
  --text: #222;
  --text-muted: #666;
  --border: #e8ddd5;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 12px;
}

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

body {
  font-family: 'Apple SD Gothic Neo', '맑은 고딕', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ===== 헤더 ===== */
.site-header {
  background: var(--primary);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon { font-size: 28px; }

.logo h1 {
  font-size: 18px;
  font-weight: 700;
  color: white;
}

.logo-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin-top: 1px;
}

.main-nav { display: flex; gap: 4px; }

.nav-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.2);
  color: white;
}

/* ===== 히어로 ===== */
.hero {
  background: linear-gradient(135deg, #8B3210 0%, #B54A1A 55%, #D4621F 100%);
  color: white;
  padding: 60px 20px;
  text-align: center;
}

.hero-inner { max-width: 700px; margin: 0 auto; }

.hero-title {
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
}

.hero-title .highlight {
  color: #ffd166;
}

.hero-desc {
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 32px;
  line-height: 1.7;
}

/* 검색박스 */
.search-box {
  display: flex;
  max-width: 540px;
  margin: 0 auto 24px;
  background: white;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 22px;
  font-size: 15px;
  color: var(--text);
}

.search-box button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.search-box button:hover { background: #c73d20; }

/* 통계바 */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 8px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255,255,255,0.9);
}

.stat strong {
  font-size: 26px;
  font-weight: 800;
  color: #ffd166;
}

.stat span { font-size: 12px; }

/* ===== 광고 ===== */
.ad-container {
  background: white;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  text-align: center;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-placeholder {
  color: #aaa;
  font-size: 13px;
  border: 2px dashed #ddd;
  padding: 20px 60px;
  border-radius: 8px;
}

/* ===== 섹션 공통 ===== */
section { padding: 48px 0; }

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
  position: relative;
  padding-left: 14px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-header .section-title { margin-bottom: 0; }

.see-all {
  color: var(--primary-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

/* ===== 카테고리 탭 ===== */
.filter-section { background: white; border-bottom: 1px solid var(--border); padding: 32px 0; }

.category-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cat-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
}

.cat-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.cat-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.cat-icon { font-size: 16px; }

/* ===== 호선 그리드 ===== */
.line-section { background: var(--bg); }

.line-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.line-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--card-shadow);
  color: var(--text);
}

.line-btn:hover {
  border-color: var(--line-color);
  transform: translateY(-2px);
}

.line-btn.active {
  background: var(--line-color);
  color: white;
  border-color: var(--line-color);
}

.line-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== 구 그리드 ===== */
.district-section { background: white; }

.district-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.district-btn {
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  color: var(--text);
}

.district-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.district-count {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 2px;
}

.district-btn:hover .district-count { color: #ffd166; }

/* ===== 검색 결과 ===== */
.results-section {
  background: var(--bg);
  border-top: 3px solid var(--primary);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.results-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.close-results {
  background: none;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== 카드 ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.meal-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--primary-light);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.meal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 8px;
}

.card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.4;
}

.card-badge {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-어르신 { background: #e8f4fd; color: #1a6fa0; }
.badge-노숙인 { background: #fdf0e8; color: #c06030; }
.badge-장애인 { background: #f0e8fd; color: #7040a0; }
.badge-저소득층 { background: #e8fdf0; color: #207040; }
.badge-누구나 { background: #fdfde8; color: #806020; }

.card-station {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.station-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.station-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.card-info {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 5px;
  display: flex;
  gap: 6px;
}

.card-info-icon { flex-shrink: 0; }

.card-days {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.card-days .days-label { font-weight: 600; margin-right: 4px; }

/* 카드 테두리 색상 - 호선별 */
.card-1호선 { border-left-color: #0052A4; }
.card-2호선 { border-left-color: #00A650; }
.card-3호선 { border-left-color: #EF7C1C; }
.card-4호선 { border-left-color: #00A4E3; }
.card-5호선 { border-left-color: #8B50A4; }
.card-6호선 { border-left-color: #C55C1D; }
.card-7호선 { border-left-color: #747F00; }
.card-8호선 { border-left-color: #EA0029; }
.card-9호선 { border-left-color: #BDB427; }
.card-경의중앙선 { border-left-color: #77C4A3; }
.card-분당선 { border-left-color: #F5A200; }
.card-우이신설선 { border-left-color: #B7C452; }

/* ===== TOP 10 ===== */
.top-section { background: var(--bg); }

.top-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: all 0.2s;
}

.top-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.top-rank {
  font-size: 20px;
  font-weight: 800;
  width: 28px;
  text-align: center;
  color: var(--text-muted);
}

.top-rank.gold { color: #f5a623; }
.top-rank.silver { color: #9e9e9e; }
.top-rank.bronze { color: #cd7f32; }

.top-station {
  flex: 1;
  font-weight: 700;
  font-size: 15px;
}

.top-line {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.top-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.top-bar {
  height: 6px;
  background: var(--primary-light);
  border-radius: 3px;
  width: 80px;
}

.top-station-info { flex: 1; }
.top-bar-wrap { width: 80px; }

/* ===== 블로그 미리보기 ===== */
.blog-preview { background: white; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.blog-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  display: block;
}

.blog-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--card-shadow);
  transform: translateY(-2px);
}

.blog-tag {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.blog-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
  line-height: 1.4;
}

.blog-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.blog-date {
  font-size: 12px;
  color: #aaa;
}

/* ===== 이용 안내 ===== */
.guide-section { background: var(--bg); }

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.guide-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--card-shadow);
}

.guide-icon { font-size: 32px; display: block; margin-bottom: 12px; }

.guide-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.guide-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== 푸터 ===== */
.site-footer {
  background: #1a1a2e;
  color: rgba(255,255,255,0.7);
  padding: 40px 20px;
  text-align: center;
}

.footer-inner { max-width: 700px; margin: 0 auto; }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
}

.footer-links a:hover { color: white; }

.footer-note {
  font-size: 12px;
  line-height: 1.8;
  margin-bottom: 12px;
}

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

/* ===== 반응형 ===== */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 8px; }
  .main-nav { font-size: 13px; }
  .hero { padding: 40px 16px; }
  .stats-bar { gap: 20px; }
  .line-grid { grid-template-columns: repeat(3, 1fr); }
  .district-grid { grid-template-columns: repeat(4, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .category-tabs { gap: 6px; }
  .cat-btn { padding: 8px 12px; font-size: 13px; }
  .line-grid { grid-template-columns: repeat(2, 1fr); }
  .district-grid { grid-template-columns: repeat(3, 1fr); }
  .guide-grid { grid-template-columns: 1fr; }
}
