/* Notion 에서 옮겨온 블록을 위한 스타일 */

/* 단 나누기 (Notion column_list) */
.notion-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.notion-column {
  /* 220px 보다 좁아질 상황이면 다음 줄로 넘긴다.
     단이 많아도 글자가 세로로 눕는 일이 없도록 하기 위함. */
  flex: 1 1 220px;
  min-width: 0; /* 긴 코드블록이 칸을 밀어내지 않도록 */
}

.notion-column > :first-child {
  margin-top: 0;
}

.notion-column > :last-child {
  margin-bottom: 0;
}

/* 좁은 화면에서는 세로로 쌓는다 */
@media (max-width: 768px) {
  .notion-columns {
    display: block;
  }

  .notion-column + .notion-column {
    margin-top: 1.5rem;
  }
}

/* 토글 (Notion toggle → <details>) */
details {
  margin-bottom: 1rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--notion-box-border);
  border-radius: 6px;
}

details > summary {
  cursor: pointer;
  font-weight: 600;
  /* 열림 상태에서만 아래 여백을 준다 */
  margin: 0;
}

details[open] > summary {
  margin-bottom: 0.6rem;
}

details > :last-child {
  margin-bottom: 0;
}

/* 탭 (Notion tab) — 라디오 + 라벨로 자바스크립트 없이 전환한다.
   kramdown 이 라디오와 라벨을 <p> 로 감싸므로 형제 선택자 대신 :has() 를 쓴다. */
.notion-tabs {
  margin-bottom: 1rem;
  border: 1px solid var(--notion-box-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--main-bg);
}

.notion-tabs input[type='radio'] {
  display: none;
}

/* 라디오와 라벨이 모인 첫 문단이 탭 막대가 된다.
   옅은 배경 띠로 얹어 본문 영역과 구분한다. */
.notion-tabs > p:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0; /* 문단 기본 여백이 탭 위에 빈 공간을 만든다 */
  padding: 0.55rem 0.8rem 0;
  background: var(--notion-tab-bar-bg);
  border-bottom: 1px solid var(--notion-box-border);
}

.notion-tabs label {
  padding: 0.5rem 0.75rem 0.6rem;
  margin-bottom: -1px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted-color);
  border-bottom: 2px solid transparent;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.notion-tabs label:hover {
  color: var(--text-color);
}

.notion-tabs > .notion-tab-panel {
  display: none;
  padding: 1rem 1.1rem 1.1rem;
}

.notion-tabs > .notion-tab-panel > :first-child {
  margin-top: 0;
}

.notion-tabs > .notion-tab-panel > :last-child {
  margin-bottom: 0;
}

/* 선택된 탭은 강조색 밑줄로 표시한다 (최대 8개) */
.notion-tabs:has(> p > input:nth-of-type(1):checked) > p > label:nth-of-type(1),
.notion-tabs:has(> p > input:nth-of-type(2):checked) > p > label:nth-of-type(2),
.notion-tabs:has(> p > input:nth-of-type(3):checked) > p > label:nth-of-type(3),
.notion-tabs:has(> p > input:nth-of-type(4):checked) > p > label:nth-of-type(4),
.notion-tabs:has(> p > input:nth-of-type(5):checked) > p > label:nth-of-type(5),
.notion-tabs:has(> p > input:nth-of-type(6):checked) > p > label:nth-of-type(6),
.notion-tabs:has(> p > input:nth-of-type(7):checked) > p > label:nth-of-type(7),
.notion-tabs:has(> p > input:nth-of-type(8):checked) > p > label:nth-of-type(8) {
  color: var(--link-color);
  border-bottom-color: var(--link-color);
  font-weight: 600;
}

/* 선택된 탭의 패널만 보여준다 */
.notion-tabs:has(> p > input:nth-of-type(1):checked) > .notion-tab-panel:nth-of-type(1),
.notion-tabs:has(> p > input:nth-of-type(2):checked) > .notion-tab-panel:nth-of-type(2),
.notion-tabs:has(> p > input:nth-of-type(3):checked) > .notion-tab-panel:nth-of-type(3),
.notion-tabs:has(> p > input:nth-of-type(4):checked) > .notion-tab-panel:nth-of-type(4),
.notion-tabs:has(> p > input:nth-of-type(5):checked) > .notion-tab-panel:nth-of-type(5),
.notion-tabs:has(> p > input:nth-of-type(6):checked) > .notion-tab-panel:nth-of-type(6),
.notion-tabs:has(> p > input:nth-of-type(7):checked) > .notion-tab-panel:nth-of-type(7),
.notion-tabs:has(> p > input:nth-of-type(8):checked) > .notion-tab-panel:nth-of-type(8) {
  display: block;
}

.notion-tabs input:focus-visible + label {
  outline: 2px solid var(--link-color);
  outline-offset: -2px;
}

/* 북마크 카드 (Notion bookmark) */
.notion-bookmark {
  display: flex;
  align-items: stretch;
  margin-bottom: 1rem;
  border: 1px solid var(--notion-box-border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none !important;
  color: inherit;
  background: var(--main-bg);
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.notion-bookmark:hover {
  border-color: var(--link-color);
  box-shadow: 0 4px 14px rgb(0 0 0 / 10%);
  transform: translateY(-1px);
}

.notion-bookmark-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1.05rem;
  min-width: 0;
  flex: 1 1 auto;
}

.notion-bookmark-title {
  font-weight: 600;
  font-size: 0.97rem;
  line-height: 1.4;
  color: var(--text-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notion-bookmark-desc {
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--text-muted-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 파비콘 + 도메인 줄 */
.notion-bookmark-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.35rem;
  min-width: 0;
}

.notion-bookmark-favicon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex: none;
  object-fit: contain;
}

.notion-bookmark-site {
  font-size: 0.78rem;
  color: var(--text-muted-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notion-bookmark-thumb {
  flex: 0 0 34%;
  max-width: 220px;
  display: block;
  overflow: hidden;
}

.notion-bookmark-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  border-radius: 0;
}

@media (max-width: 576px) {
  .notion-bookmark-thumb {
    display: none;
  }
}

/* 들여쓴 블록 (Notion 에서 Tab 으로 밀어 넣은 내용) */
.notion-indent {
  margin-left: 1.5rem;
}

.notion-indent > :first-child {
  margin-top: 0;
}

.notion-indent > :last-child {
  margin-bottom: 0;
}

/* 표 — 넓은 화면에서 폭이 남을 때 왼쪽으로 치우치지 않게 가운데로 */
.content .table-wrapper > table {
  margin-left: auto;
  margin-right: auto;
}
