/* ============================================================
   pikaworks blog — clean & minimal
   brand: #6526d9 / contrast(ink): #1c1c1e
   selectors: class/id 우선, 마크다운 본문만 .post-content 하위 스코프
   ============================================================ */

:root {
  --brand: #6526d9;
  --brand-strong: #5018c0;
  --ink: #1c1c1e;
  --bg: #ffffff;
  --bg-soft: #f6f5fb;
  --text: #23232a;
  --muted: #74747f;
  --border: #e8e7f0;
  --maxw: 44rem;
  --radius: 12px;
}

* { box-sizing: border-box; }

.site {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* 접근성: 키보드 스킵 링크 */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ── 헤더 ───────────────────────────────── */
.site-header {
  background: var(--ink);
  color: #fff;
  border-bottom: 3px solid var(--brand);
}
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.site-brand {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  margin-right: auto;
}
.site-brand:hover { color: #fff; opacity: 0.9; }

.site-nav { display: flex; gap: 1.1rem; }
.site-nav__link {
  color: #d7d6e4;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.site-nav__link:hover { color: #fff; }

.lang-switch { display: flex; align-items: center; gap: 0.4rem; }
.lang-switch__label { font-size: 1rem; line-height: 1; cursor: pointer; }
.lang-switch__select {
  appearance: none;
  -webkit-appearance: none;
  background-color: #2a2a30;
  color: #fff;
  border: 1px solid #45454d;
  border-radius: 8px;
  padding: 0.32rem 1.9rem 0.32rem 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b9b8c8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
}
.lang-switch__select:hover { border-color: var(--brand); }
.lang-switch__select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.lang-switch__select option { color: #1c1c1e; background: #fff; }

/* ── 본문 영역 ──────────────────────────── */
.site-main {
  padding-top: 3rem;
  padding-bottom: 4rem;
  min-height: 60vh;
}

/* 홈 글 목록 */
.home__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin: 0 0 1.5rem;
}
.home__empty { color: var(--muted); }

.post-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
}
.post-card { display: flex; }
.post-card__link {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-decoration: none;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.post-card__link:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 24px rgba(101, 38, 217, 0.12);
  transform: translateY(-2px);
}
.post-card__thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  display: block;
  background: var(--bg-soft);
}
.post-card__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1c1c1e, #3e3e46);
  color: #6b6b76;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.post-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.1rem 1.2rem;
}
.post-card__date { font-size: 0.78rem; color: var(--muted); }
.post-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: -0.01em;
}
.post-card__link:hover .post-card__title { color: var(--brand); }
.post-card__summary {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__cat {
  align-self: flex-start;
  font-size: 0.72rem;
  color: var(--brand);
  background: var(--bg-soft);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

/* 글 / 페이지 */
.post__header { margin-bottom: 2rem; }
.post__title, .page__title {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}
.post__meta { color: var(--muted); font-size: 0.88rem; margin: 0; }
.post__cat { margin-left: 0.5rem; color: var(--brand); }

.post__footer { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.tag-list__item {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* ── 마크다운 본문 (요소 선택자는 이 스코프 안에서만) ── */
.post-content { font-size: 1.04rem; }
.post-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.post-content h3 { font-size: 1.15rem; font-weight: 700; margin: 1.8rem 0 0.7rem; }
.post-content p { margin: 0 0 1.15rem; }
.post-content a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.post-content a:hover { color: var(--brand-strong); }
.post-content ul, .post-content ol { margin: 0 0 1.15rem; padding-left: 1.4rem; }
.post-content li { margin: 0.3rem 0; }
.post-content strong { font-weight: 700; color: var(--ink); }
.post-content blockquote {
  margin: 1.4rem 0;
  padding: 0.6rem 1.1rem;
  border-left: 3px solid var(--brand);
  background: var(--bg-soft);
  color: #4a4a55;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.post-content code {
  background: var(--bg-soft);
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  font-size: 0.9em;
}
.post-content pre {
  background: var(--ink);
  color: #f2f1f8;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  overflow-x: auto;
}
.post-content pre code { background: none; padding: 0; }
.post-content img { max-width: 100%; height: auto; border-radius: var(--radius); }
.post-content table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: 0.95rem; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 0.5rem 0.7rem; text-align: left; }
.post-content th { background: var(--bg-soft); }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ── 푸터 ───────────────────────────────── */
.site-footer {
  background: var(--ink);
  color: #c9c8d6;
  margin-top: auto;
}
.site-footer__inner { padding-top: 2.25rem; padding-bottom: 2.25rem; }
.site-footer__brand { font-weight: 700; color: #fff; margin: 0 0 0.35rem; }
.site-footer__desc { font-size: 0.9rem; margin: 0 0 0.75rem; color: #a9a8ba; }
.site-footer__copy { font-size: 0.8rem; margin: 0; color: #7d7c8f; }

/* ── 반응형 ─────────────────────────────── */
@media (max-width: 600px) {
  .site { font-size: 16px; }
  .site-header__inner { gap: 0.6rem 1rem; }
  .site-brand { font-size: 1.1rem; width: 100%; margin-right: 0; }
  .post__title, .page__title { font-size: 1.55rem; }
  .site-main { padding-top: 2rem; }

  /* 모바일: 가로형 컴팩트 카드 (썸네일 좌 + 텍스트 우) */
  .post-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .post-card__link {
    flex-direction: row;
    align-items: center;
    padding: 0.7rem 0.8rem;
    gap: 0.85rem;
  }
  .post-card__thumb {
    width: 40%;
    max-width: 150px;
    flex-shrink: 0;
    aspect-ratio: 1200 / 630;   /* 비율 유지 → 이미지 잘림 없이 전체 노출 */
    height: auto;
    object-fit: cover;
    border-radius: 8px;
  }
  .post-card__thumb--placeholder { font-size: 0.8rem; border-radius: 8px; }
  .post-card__body {
    padding: 0;
    gap: 0.3rem;
    justify-content: center;
    min-width: 0;
  }
  .post-card__title { font-size: 1rem; line-height: 1.4; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .post-card__date { font-size: 0.72rem; }
  .post-card__summary { font-size: 0.82rem; line-height: 1.45; -webkit-line-clamp: 2; }
  .post-card__cat { font-size: 0.68rem; }
}

/* 포커스 가시성 (접근성) */
.site a:focus-visible,
.lang-switch__link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
