/* ============================================================
   SocialLogicLab – Stitch Design System  v2.2
   학술지 레이아웃 + Insights 숏코드 스타일
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  --bg:        #f2f2f0;   /* 오프왔이트 연회색 배경 */
  --accent:    #4A654E;
  --accent-lt: #6b8f6f;
  --white:     #ffffff;
  --text:      #1a1a1a;
  --text-muted:#888888;
  --border:    #e8e8e8;
  --radius:    16px;
  --shadow:    0 2px 20px rgba(0,0,0,.07);
  --trans:     .28s ease;
  --h-font:    'Playfair Display', Georgia, serif;
  --b-font:    'Arimo', 'Apple SD Gothic Neo', sans-serif;
}

/* ── Reset / Global ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body, button, input, textarea {
  font-family: var(--b-font);
  color: var(--text);
  line-height: 1.72;
}
h1,h2,h3,h4,h5,h6,
.entry-title,.page-title {
  font-family: var(--h-font);
  line-height: 1.28;
  letter-spacing: .02em;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

body.page, body.home, body.blog { background: var(--bg); }

/* ── Elementor 호환 ───────────────────────────────────── */
.elementor-section,
.elementor-container,
.elementor-widget-container { background-color: var(--bg); }
.elementor-button { background: var(--accent) !important; color: var(--white) !important; }

/* ── Section Title ──────────────────────────────────────── */
.stitch-section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: var(--accent);
  text-align: center;
  margin: 0 0 2rem;
  position: relative;
  padding-bottom: 1rem;
}
.stitch-section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 48px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ── Insights Section Wrapper ───────────────────────────── */
.stitch-insights-section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* ── Hero Search Block ──────────────────────────────────── */
.stitch-search-hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  margin-bottom: 2.5rem;
}

/* 수퍼타이틀 레이블 */
.stitch-hero-label {
  font-family: var(--b-font);
  font-size: .68rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: rgba(74,101,78,.5);
  margin: 0 0 2.5rem;
  font-weight: 400;
}

/* 대형 검색창 래퍼 */
.stitch-giant-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

/* 대형 이탤릭 입력상자: 테마 override 보장 */
.stitch-search-giant {
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  padding: 0 3rem 0 0 !important;
  margin: 0 !important;
  font-family: var(--h-font) !important;
  font-style: italic !important;
  font-size: clamp(2.4rem, 7vw, 4.8rem) !important;
  font-weight: 400 !important;
  color: rgba(74,101,78,.22) !important;  /* 틀 톤 */
  text-align: center !important;
  line-height: 1.2 !important;
  letter-spacing: -.01em !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  caret-color: var(--accent);
}
.stitch-search-giant::placeholder {
  color: rgba(74,101,78,.22);
  font-style: italic;
}
/* 타이핑 시 색상 강조 */
.stitch-search-giant:not(:placeholder-shown) {
  color: rgba(74,101,78,.7) !important;
}
.stitch-search-giant::-webkit-search-cancel-button { display: none; }

/* 클리어(X) 버튼 — 우측 */
.stitch-search-clear {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none !important;
  border: none !important;
  padding: .3rem !important;
  color: rgba(74,101,78,.4);
  cursor: pointer;
  transition: color var(--trans);
  flex-shrink: 0;
}
.stitch-search-clear:hover { color: var(--accent); }
.stitch-search-clear.hidden { display: none; }

/* hairline 구분선 */
.stitch-hero-divider {
  width: 100%;
  max-width: 900px;
  height: 1px;
  background: rgba(74,101,78,.18);
  margin: 0 auto 1.4rem;
}

/* 검색 결과 레이블 */
.stitch-search-label {
  font-family: var(--b-font);
  font-size: .75rem;
  letter-spacing: .1em;
  color: rgba(74,101,78,.55);
  margin: 0 0 1rem;
}
.stitch-search-label strong { color: var(--accent); }

/* 카테고리 — 불릿(•) 구분 인라인 텍스트 */
.insights-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .6rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.insights-tabs button {
  display: inline !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  font-family: var(--b-font) !important;
  font-size: .7rem !important;
  letter-spacing: .22em !important;
  text-transform: uppercase !important;
  color: rgba(74,101,78,.5) !important;
  cursor: pointer;
  transition: color var(--trans);
  box-shadow: none !important;
  border-radius: 0 !important;
}
.insights-tabs button:hover {
  color: var(--accent) !important;
  background: none !important;
}
.insights-tabs button.active {
  color: var(--accent) !important;
  font-weight: 700 !important;
  background: none !important;
  border: none !important;
}
.cat-dot {
  color: rgba(74,101,78,.3);
  font-size: .5rem;
  line-height: 1;
  vertical-align: middle;
  user-select: none;
}

/* ── Card Grid ──────────────────────────────────────────── */
.insights-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  min-height: 200px;
}

/* ── Insight Card ──────────────────────────────────────────── */
.insight-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: visible;         /* 이미지는 card-thumb에서 클립 */
  box-shadow: var(--shadow);
  border: none;              /* 테두리 제거 */
  transition: transform var(--trans), box-shadow var(--trans);
  display: flex;
  flex-direction: column;
}
.insight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,.11);
}
.insight-card .card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  position: relative;
  z-index: 1;
  pointer-events: auto !important;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;         /* 카드 전체 클립 */
}
.insight-card .card-link:hover { text-decoration: none; }

/* 이미지: 내부 마진 + 라운드 */
.card-thumb {
  margin: 10px 10px 0;
  border-radius: 12px;
  overflow: hidden;
  height: 200px;
  flex-shrink: 0;
  position: relative;       /* 오버레이 기준 */
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.insight-card:hover .card-thumb img { transform: scale(1.04); }
.card-thumb-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #e8e8e6, #f5f5f3);
  display: flex; align-items: center; justify-content: center;
}
.card-thumb-placeholder::after {
  content: '📰';
  font-size: 2.5rem;
  opacity: .3;
}

/* 이미지 위 카테고리 오버레이 pill */
.card-cat-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: .18rem .7rem;
  font-family: var(--b-font);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #333;
  line-height: 1.8;
}

.insight-card-body {
  padding: 1rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
/* 날짜: 제목 위 소형 */
.card-date {
  font-size: .68rem;
  color: var(--text-muted);
  margin-bottom: .45rem;
  display: block;
  letter-spacing: .04em;
}
/* 제목: 이탤릭 세리프 */
.insight-card-body .card-title {
  font-family: var(--h-font);
  font-style: italic;
  font-size: 1.05rem;
  margin: 0 0 .55rem;
  color: var(--text);
  flex: 1;
  line-height: 1.4;
}
.insight-card-body p {
  font-size: .85rem;
  color: var(--text-muted);
  margin: 0 0 .8rem;
  line-height: 1.55;
}
/* READ → 링크 */
.card-read {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: var(--b-font);
  font-size: .75rem;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-top: auto;
  transition: color var(--trans), gap var(--trans);
}
.insight-card:hover .card-read {
  color: var(--accent);
  gap: .5rem;
}

/* ── Loading Spinner ────────────────────────────────────── */
.stitch-loader {
  display: flex;
  justify-content: center;
  gap: .5rem;
  padding: 2rem;
}
.stitch-loader.hidden { display: none; }
.stitch-loader span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: stitch-bounce .8s infinite alternate;
}
.stitch-loader span:nth-child(2) { animation-delay: .2s; }
.stitch-loader span:nth-child(3) { animation-delay: .4s; }
@keyframes stitch-bounce {
  from { opacity: .3; transform: translateY(0); }
  to   { opacity: 1;  transform: translateY(-8px); }
}

/* ── Pagination ─────────────────────────────────────────── */
.stitch-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 .7rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--h-font);
  font-size: .92rem;
  color: var(--accent);
  cursor: pointer;
  transition: all var(--trans);
}
.pg-btn:hover {
  background: #edf4ed;
  border-color: var(--accent);
}
.pg-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
  font-weight: 700;
}
.pg-btn.pg-prev,
.pg-btn.pg-next {
  font-size: 1.2rem;
  font-weight: 700;
}
.pg-ellipsis {
  color: var(--text-muted);
  font-size: .9rem;
  padding: 0 .2rem;
}

/* ── Empty state ─────────────────────────────────────────── */
.stitch-empty {
  grid-column: 1/-1;
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
  font-family: var(--h-font);
  font-size: 1.05rem;
}

/* ── Media Popup ────────────────────────────────────────── */
.media-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.media-modal.hidden { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  backdrop-filter: blur(8px);
  background: rgba(0,0,0,.45);
}
.modal-content {
  position: relative; z-index: 1;
  background: var(--white); padding: 2rem;
  border-radius: var(--radius);
  max-width: 90%; max-height: 80vh; overflow: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
}
.close-btn {
  position: absolute; top: .5rem; right: .8rem;
  background: none; border: none;
  font-size: 1.8rem; color: var(--accent);
  cursor: pointer; line-height: 1;
}

/* ── Blur Guard ─────────────────────────────────────────── */
body.stitch-blur-guard .post-content,
body.stitch-blur-guard .entry-content { position: relative; }
body.stitch-blur-guard .post-content::after,
body.stitch-blur-guard .entry-content::after {
  content: '';
  position: absolute; inset: 55% 0 0 0;
  backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, transparent, rgba(212,226,212,.88));
  pointer-events: none;
}
.unlock-btn {
  display: block; margin: 1.5rem auto;
  padding: .65rem 1.8rem;
  background: var(--accent); color: var(--white);
  border: none; border-radius: 999px;
  font-family: var(--h-font); font-size: 1rem;
  cursor: pointer; transition: background var(--trans);
}
.unlock-btn:hover { background: #3a5040; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .insights-grid { grid-template-columns: 1fr; }
  .stitch-insights-section { padding: 2rem 1rem 3rem; }
  .stitch-tabs-row { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .stitch-search-wrap { align-self: stretch; }
  .stitch-search-input { width: 100%; }
}
