/* 가로 구분선 스타일 */
.section-divider {
  border: 0;
  height: 1px;
  background: var(--border-color);
  margin: 40px 0;
  opacity: 0.5;
}

/* Notion 통합 섹션 스타일 */
.notion-integrated-section {
  margin: 30px auto 60px;
  max-width: 1200px;
  padding: 0 10px;
}

.notion-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.notion-tab-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px var(--card-shadow);
}

.notion-tab-btn:hover {
  background: var(--border-color);
  color: var(--text-color);
  border-color: var(--text-muted);
}

.notion-tab-btn.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
  border-radius: 12px;
  /* 탭 형태 강조를 위해 곡률 살짝 조정 */
}

/* 콘텐츠 영역: 다크/라이트 모드 자동 대응 */
.notion-content-area {
  min-height: 400px;
  background: var(--card-bg);
  /* 고정된 검은색 대신 변수 사용 */
  border-radius: 16px;
  padding: 25px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px var(--card-shadow);
  transition: opacity 0.3s ease;
}

/* 갤러리 그리드 (앨범용) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

.notion-gallery-item {
  margin: 0;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
}

.notion-gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--card-shadow);
}

.notion-gallery-item a {
  text-decoration: none;
  color: inherit;
}

.notion-gallery-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--aside-bg);
  display: block;
}

.notion-gallery-item figcaption {
  padding: 15px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.4;
  text-align: center;
}

/* 리스트 스타일 (News, 공지사항 등) */
.notion-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notion-list-item {
  border-bottom: 1px solid var(--border-color);
}

.notion-list-item:last-child {
  border-bottom: none;
}

.notion-list-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 10px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.2s ease;
}

.notion-list-item a:hover {
  background: var(--aside-bg);
  padding-left: 15px;
}

.list-title {
  flex: 1;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 20px;
}

.list-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 일정 스타일 */
.notion-schedule {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.notion-schedule-item {
  background: var(--aside-bg);
  border-left: 4px solid var(--accent-blue);
  border-radius: 8px;
  transition: transform 0.2s ease;
}

.notion-schedule-item:hover {
  transform: translateX(5px);
}

.notion-schedule-item a {
  display: flex;
  flex-direction: column;
  padding: 15px 20px;
  text-decoration: none;
}

.schedule-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 5px;
}

.schedule-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-color);
}

/* 로딩/에러 */
.notion-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.notion-error {
  text-align: center;
  padding: 60px 20px;
  color: #ef4444;
}

/* 모바일 대응 */
@media (max-width: 768px) {
  .notion-tab-btn {
    padding: 8px 15px;
    font-size: 0.85rem;
  }

  .list-title {
    font-size: 0.9rem;
  }
}

/* 포스트 상세 보기 스타일 */
.post-detail {
  padding: 10px;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-header {
  margin-bottom: 40px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 20px;
}

.back-button {
  background: var(--aside-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 20px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-button:hover {
  background: var(--border-color);
}

.detail-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 15px;
  line-height: 1.3;
  color: var(--headline-color);
}

.detail-meta {
  display: flex;
  gap: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* 본문 블록 렌더링 */
.post-body {
  line-height: 1.8;
  font-size: 1.1rem;
  color: var(--text-color);
}

.post-body h1,
.post-body h2,
.post-body h3 {
  margin-top: 40px;
  margin-bottom: 20px;
  color: var(--headline-color);
}

.post-body p {
  margin-bottom: 15px;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 20px 0;
  box-shadow: 0 4px 20px var(--card-shadow);
}

.post-body ul,
.post-body ol {
  margin-bottom: 20px;
  padding-left: 20px;
}

.post-body blockquote {
  border-left: 4px solid var(--accent-blue);
  background: var(--aside-bg);
  padding: 15px 25px;
  margin: 30px 0;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

.post-body code {
  background: var(--aside-bg);
  padding: 3px 6px;
  border-radius: 4px;
  font-family: monospace;
}

@media (max-width: 768px) {
  .detail-title {
    font-size: 1.5rem;
  }

  .post-body {
    font-size: 1rem;
  }
}

/* 임베드 및 동영상 반응형 래퍼 */
.aspect-ratio-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  /* 16:9 비율 */
  height: 0;
  margin: 30px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--card-shadow);
}

.aspect-ratio-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 첨부파일 스타일 */
.file-attachment {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: var(--aside-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin: 15px 0;
  transition: background 0.2s ease;
}

.file-attachment:hover {
  background: var(--border-color);
}

.file-icon {
  font-size: 1.4rem;
}

.file-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
  word-break: break-all;
}

.file-link:hover {
  text-decoration: underline;
}

.empty-message-small {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 10px;
  background: var(--aside-bg);
  border-radius: 6px;
}


/* 북마크 및 링크 프리뷰 스타일 */
.notion-bookmark {
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.notion-bookmark:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--card-shadow);
  border-color: var(--accent-blue);
}

.bookmark-link {
  display: flex;
  text-decoration: none !important;
  color: inherit !important;
}

.bookmark-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.bookmark-url {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookmark-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  font-style: italic;
}

/* 스케줄 타임라인 전용 스타일 */
.schedule-header {
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.schedule-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0;
  border: none;
  padding: 0;
}

.schedule-controls {
  display: flex;
  gap: 10px;
}

.view-tag {
  background: var(--aside-bg);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-color);
}

.schedule-timeline {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-bottom: 80px;
}

.schedule-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 30px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px var(--card-shadow);
  animation: fadeIn 0.5s ease both;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--headline-color);
}

.author-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 15px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.card-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-color);
}

.card-body p {
  margin-bottom: 12px;
}

.card-body a {
  color: var(--accent-blue);
  text-decoration: none;
  word-break: break-all;
}

.card-body a:hover {
  text-decoration: underline;
}

.spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px 0;
}

@media (max-width: 768px) {
  .schedule-card {
    padding: 20px;
  }

  .card-title {
    font-size: 1.25rem;
  }
}