/* post.css: 포스트 카드 및 포스트 상세 관련 스타일 */
.post {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  background: #fff;
}
.post-list {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 40px;
}
.post-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 200px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  text-decoration: none;
  color: #222;
  padding: 24px 18px;
  transition: box-shadow 0.2s;
}
.post-card:hover {
  box-shadow: 0 2px 20px rgba(0,0,0,0.16);
}
.post-img {
  width: 100%;
  /* 썸네일은 2:1(1320x660 등)로 만들고 있다. 박스도 2:1로 맞춰야
     object-fit:cover가 좌우를 깎지 않는다. 고정 height를 쓰면 카드 폭이
     바뀔 때마다 비율이 틀어져 아이콘 끝이 잘린다. */
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 18px;
}
.post-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.post-date {
  font-size: 0.85rem;
  color: #888;
}
.post-content {
  margin-top: 32px;
  font-size: 1rem;
  line-height: 1.75;
}

/* 글 본문은 전역 p/li(0.9rem)보다 한 단계 크게 — 긴 글 가독성 확보 */
.post-content p,
.post-content li {
  font-size: 1rem;
  line-height: 1.75;
}

.post-content a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 0.14em;
  text-decoration-thickness: 0.08em;
  word-break: break-word;
}

.post-content a:hover,
.post-content a:focus-visible {
  color: #1d4ed8;
}

.post-content .fake-link {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 0.14em;
  text-decoration-thickness: 0.08em;
  word-break: break-word;
}

.post-content .help {
  margin: 20px 0;
  padding: 8px 10px;
  border-left: 4px solid #b6b6b6;
  border-radius: 8px;
  /* background: #f1f1f1; */
  color: #aeaeae;
}

.post-content .help p {
  margin: 0;
}

.post-content .help p + p {
  margin-top: 8px;
}

.post-content code {
  font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.95em;
  background: #f2f4f8;
  color: #1f2937;
  padding: 0.15em 0.45em;
  border-radius: 6px;
  word-break: break-word;
}

.post-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px 20px;
  border-radius: 12px;
  overflow-x: auto;
  line-height: 1.55;
  margin: 20px 0;
  -webkit-overflow-scrolling: touch;
}

.post-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 0.93rem;
  white-space: pre;
  word-break: normal;
}

.post-content .highlighter-rouge,
.post-content .highlight {
  margin: 20px 0;
}

.post-content .highlighter-rouge pre,
.post-content .highlight pre {
  margin: 0;
}

.post-content .highlighter-rouge {
  position: relative;
}

.post-content .highlighter-rouge pre {
  padding-top: 34px;
}

.post-content .highlighter-rouge::before {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #93c5fd;
  background: rgba(147, 197, 253, 0.14);
  border: 1px solid rgba(147, 197, 253, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
}

.post-content .language-bash.highlighter-rouge::before,
.post-content .language-shell.highlighter-rouge::before,
.post-content .language-sh.highlighter-rouge::before,
.post-content .language-zsh.highlighter-rouge::before {
  content: 'BASH';
}

.post-content .language-bat.highlighter-rouge::before,
.post-content .language-batch.highlighter-rouge::before,
.post-content .language-batchfile.highlighter-rouge::before,
.post-content .language-cmd.highlighter-rouge::before {
  content: 'CMD';
}

.post-content .language-javascript.highlighter-rouge::before,
.post-content .language-js.highlighter-rouge::before {
  content: 'JS';
}

.post-content .language-typescript.highlighter-rouge::before,
.post-content .language-ts.highlighter-rouge::before {
  content: 'TS';
}

.post-content .language-python.highlighter-rouge::before,
.post-content .language-py.highlighter-rouge::before {
  content: 'PYTHON';
}

.post-content .language-java.highlighter-rouge::before {
  content: 'JAVA';
}

.post-content .language-c.highlighter-rouge::before {
  content: 'C';
}

.post-content .language-cpp.highlighter-rouge::before,
.post-content .language-cxx.highlighter-rouge::before {
  content: 'C++';
}

.post-content .language-csharp.highlighter-rouge::before,
.post-content .language-cs.highlighter-rouge::before {
  content: 'C#';
}

.post-content .language-go.highlighter-rouge::before {
  content: 'GO';
}

.post-content .language-rust.highlighter-rouge::before,
.post-content .language-rs.highlighter-rouge::before {
  content: 'RUST';
}

.post-content .language-json.highlighter-rouge::before {
  content: 'JSON';
}

.post-content .language-yaml.highlighter-rouge::before,
.post-content .language-yml.highlighter-rouge::before {
  content: 'YAML';
}

.post-content .language-html.highlighter-rouge::before {
  content: 'HTML';
}

.post-content .language-css.highlighter-rouge::before {
  content: 'CSS';
}

.post-content .language-sql.highlighter-rouge::before {
  content: 'SQL';
}

.post-content .language-markdown.highlighter-rouge::before,
.post-content .language-md.highlighter-rouge::before {
  content: 'MARKDOWN';
}

.post-content .language-plaintext.highlighter-rouge::before,
.post-content .language-text.highlighter-rouge::before {
  display: none;
}

.post-content .highlight .k,
.post-content .highlight .kd,
.post-content .highlight .kn,
.post-content .highlight .kp,
.post-content .highlight .kr,
.post-content .highlight .kt,
.post-content .highlight .nt {
  color: #c4b5fd;
}

.post-content .highlight .s,
.post-content .highlight .s1,
.post-content .highlight .s2,
.post-content .highlight .sb,
.post-content .highlight .sh,
.post-content .highlight .sr,
.post-content .highlight .sx,
.post-content .highlight .se,
.post-content .highlight .si {
  color: #86efac;
}

.post-content .highlight .nb,
.post-content .highlight .nc,
.post-content .highlight .nf,
.post-content .highlight .fm {
  color: #93c5fd;
}

.post-content .highlight .mi,
.post-content .highlight .mf,
.post-content .highlight .il,
.post-content .highlight .m {
  color: #f9a8d4;
}

.post-content .highlight .c,
.post-content .highlight .cm,
.post-content .highlight .c1,
.post-content .highlight .cs {
  color: #94a3b8;
  font-style: italic;
}

.post-content .highlight .o,
.post-content .highlight .ow,
.post-content .highlight .p {
  color: #cbd5e1;
}

.post-content .highlight .err {
  color: #fda4af;
  background: transparent;
}

.post-category {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 12px;
}

.post-tags {
  margin-bottom: 20px;
}

.tag {
  display: inline-block;
  background: #16145b;
  color: #fff;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 12px;
  margin-right: 8px;
}

/* 클래스 없는 이미지 = VS Code 기본 붙여넣기(![](...))로 들어온 이미지.
   .post-image와 같은 크기·정렬을 준다. */
.post-image,
.post-content img:not([class]) {
  display: block;
  margin: 16px auto;
  max-width: 100%;
  height: 300px;
  object-fit: contain;
}

/* 사진 두 장을 나란히 놓는 줄. */
.post-image-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  margin: 16px auto;
}

.post-image-row .post-image {
  margin: 0;
  max-width: calc(50% - 8px);
  height: 400px;
}

.post-biggest-image {
  display: block;
  margin: 16px auto;
  max-width: 100%;
  height: 800px;
  object-fit: contain;
}

.post-bigger-image {
  display: block;
  margin: 16px auto;
  max-width: 100%;
  height: 600px;
  object-fit: contain;
}

.post-big-image {
  display: block;
  margin: 16px auto;
  max-width: 100%;
  height: 400px;
  object-fit: contain;
}

.post-small-image {
  display: block;
  margin: 16px auto;
  max-width: 100%;
  height: 200px;
  object-fit: contain;
}
/* 표 — 본문에서 처음 쓰인 요소라 기본 스타일이 아예 없었다.
   테두리가 안 보여서 행 구분이 되지 않던 문제. */
.post-content table {
  width: 100%;
  margin: 22px 0;
  font-size: 0.88rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  /* collapse를 쓰면 모서리 radius가 먹지 않는다.
     separate + spacing 0으로 두고 모서리 셀에만 radius를 준다. */
  border-collapse: separate;
  border-spacing: 0;
}

.post-content th,
.post-content td {
  padding: 9px 14px;
  text-align: left;
  border-bottom: 1px solid #eef0f4;
}

.post-content thead th {
  background: #f2f4f8;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.post-content tbody tr:last-child td {
  border-bottom: none;
}

.post-content tbody tr:hover {
  background: #f9fafb;
}

.post-content thead tr:first-child th:first-child {
  border-top-left-radius: 10px;
}

.post-content thead tr:first-child th:last-child {
  border-top-right-radius: 10px;
}

.post-content tbody tr:last-child td:first-child {
  border-bottom-left-radius: 10px;
}

.post-content tbody tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

/* 앱 소개 글의 아이콘. 제목 옆에 붙여 항목을 알아보기 쉽게 한다. */
.post-content h3 .post-app-icon {
  width: 40px;
  height: 40px;
  vertical-align: -10px;
  margin-right: 10px;
}

/* 본문 동영상. 화면 녹화는 GIF보다 mp4가 훨씬 가벼워서
   autoplay/muted/loop로 GIF처럼 재생시킨다. */
.post-content video {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px auto;
  border-radius: 10px;
}

/* 폰 스크린샷처럼 세로로 긴 이미지를 2열로 나란히 놓는다.
   각 칸은 <figure><img><figcaption>설명</figcaption></figure>. */
.post-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 16px;
  max-width: 560px;
  margin: 24px auto;
}

.post-grid-2 figure {
  margin: 0;
}

/* .post-content img:not([class])보다 우선해야 하므로 .post-content를 붙인다 */
.post-content .post-grid-2 img {
  display: block;
  margin: 0;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.post-grid-2 figcaption {
  margin-top: 8px;
  font-size: 0.9em;
  line-height: 1.5;
  color: #555;
}
