/* --- 기본 설정 --- */
html{
  scroll-behavior: smooth;
}

:root {
    --primary: #4F46E5;       /* 인디고 (메인) */
    --primary-dark: #4338ca;
    --text-main: #111827;
    --text-sub: #6b7280;
    --bg-light: #f9fafb;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg-light); color: var(--text-main); }
a { text-decoration: none; }

/* --- 네비게이션 --- */
.navbar { background: white; height: 64px; display: flex; align-items: center; justify-content: center; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.nav-container { width: 100%; max-width: 1000px; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 22px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--text-sub); font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--primary); }

/* --- 버튼 스타일 --- */
.btn { display: inline-block; padding: 10px 20px; background: var(--primary); color: white; border-radius: 6px; font-weight: 600; transition: 0.2s; border: none; cursor: pointer; }
.btn:hover { background: var(--primary-dark); }
.btn-sm { padding: 6px 14px; font-size: 14px; border-radius: 20px; }
.btn-white { background: white; color: var(--primary); }
.btn-white:hover { background: #eee; }
.btn-outline { background: transparent; border: 1px solid #e5e7eb; color: var(--text-sub); width:auto; text-align: center; margin-top: auto; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn.btn-portfolio{
  background: #60A5FA !important;
  color: #fff !important;
  border: 1px solid rgba(96,165,250,.65) !important;
}
.btn.btn-portfolio:hover{
  background: #60A5FA !important;
}


/* --- 히어로 섹션 (배너) --- */
.hero {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}
.hero-content { max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: 36px; margin-bottom: 20px; line-height: 1.3; }
.hero p { font-size: 18px; margin-bottom: 30px; opacity: 0.9; }

/* --- 메인 컨테이너 --- */
.container { max-width: 1000px; margin: 60px auto; padding: 0 20px; }
.section-header { margin-bottom: 30px; }
.section-header h2 { font-size: 24px; margin-bottom: 8px; }
.section-header p { color: var(--text-sub); }

/* --- 카드 그리드 --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card { background: white; border-radius: 12px; padding: 24px; border: 1px solid #e5e7eb; display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s; height: 100%; }
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px -5px rgba(0,0,0,0.1); }
.card h3 { margin: 10px 0; font-size: 18px; color: var(--text-main); }
.card-desc { color: var(--text-sub); font-size: 14px; line-height: 1.5; margin-bottom: 20px; flex-grow: 1; }
.badge { display: inline-block; background: #EEF2FF; color: var(--primary); font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 4px; width: fit-content; }

/* --- 로딩/기타 --- */
.loading-box { grid-column: 1 / -1; text-align: center; padding: 40px; color: var(--text-sub); }
footer { text-align: center; padding: 40px; color: #9ca3af; font-size: 14px; border-top: 1px solid #e5e7eb; margin-top: 60px; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
}

.card:hover {
  border-color: #999;
}

.card-title {
  margin: 0 0 8px 0;
  font-size: 16px;
}

.meta {
  font-size: 13px;
  margin: 2px 0;
}

.meta.small {
  opacity: 0.7;
  font-size: 12px;
}

/* 화면이 좁을 때는 1~2열로 자동 감소 */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .grid-3 { grid-template-columns: 1fr; }
}


/* ============================================================
   Study detail page helpers
   ============================================================ */
.page { max-width: 980px; margin: 0 auto; padding: 20px; }
.page-head { margin-bottom: 14px; }
.muted { color: #666; }
.hint { color: #888; font-size: 13px; margin-top: 8px; }
.loading { color: #888; }

.card { background: #fff; border: 1px solid #e7e7e7; border-radius: 12px; padding: 16px; margin: 14px 0; }
.section-title { font-size: 18px; margin: 0 0 10px 0; }

.study-summary .title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.study-summary .meta { display:flex; flex-wrap:wrap; gap:10px; font-size: 14px; color:#555; }
.badge { display:inline-block; padding: 3px 8px; border-radius: 999px; border: 1px solid #ddd; font-size: 12px; background:#fafafa; }

.prewrap { white-space: pre-wrap; line-height: 1.6; }

.grid-2 { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px){ .grid-2 { grid-template-columns: 1fr; } }

.label { display:block; font-size: 13px; color:#444; margin: 10px 0 6px; }
.input, .textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 10px; font-size: 14px; }
.row { display:flex; align-items:center; gap: 10px; }

.btn { border: 0; padding: 10px 14px; border-radius: 10px; background: #1f5cff; color:#fff; cursor:pointer; font-weight: 700; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }


.action-row{
  display:flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.action-row .btn-outline{
  width: auto !important;
  margin-top: 0 !important;
}
