/* 기본 설정 */
:root {
  --color-primary: #1a73e8;
  --color-bg: #f8f9fa;
  --color-text: #333;
  --color-white: #fff;
  --radius: 16px;
  --space: 20px;
  --width: 1200px;
}

/* 공통 스타일 */
body {
  font-family: 'SUIT', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  padding: var(--space);
}

.container {
  max-width: var(--width);
  margin: 0 auto;
}

header {
  max-width: var(--width);
  margin: 0 auto 40px;
  padding: var(--space);
}

/* 홈 페이지 */
#tt-body-index .container,
#tt-body-category .container,
#tt-body-archive .container {
  display: flex;
  gap: 40px;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: var(--space);
  background: var(--color-white);
  border-radius: var(--radius);
  padding: var(--space);
}

.content {
  flex: 1;
}

.card {
  background: var(--color-white);
  padding: var(--space);
  border-radius: var(--radius);
  margin-bottom: var(--space);
}

.card p {
  display: -webkit-box;
  /* autoprefixer: ignore next */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 10px 0;
  line-height: 1.5;
  max-height: 3em;
  word-break: break-word;
  
  /* Safari 지원을 위한 추가 속성 */
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 20px;
  text-decoration: none;
}

/* 포스트 페이지 */
#tt-body-page .container {
  display: flex;
  gap: 40px;
}

#tt-body-page .post-wrap {
  flex: 1;
  max-width: 800px;
}

/* 포스트 페이지 사이드바 */
.post-sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: var(--space);
  height: fit-content;
}

.post {
  max-width: 800px;
  margin: 0 auto;
  background: var(--color-white);
  padding: 30px;
  border-radius: var(--radius);
}

.post-content {
  line-height: 1.8;
  word-break: keep-all;
}

/* 이미지 컨테이너 스타일 */
.post-content figure {
  margin: 20px 0;
  position: relative;
  cursor: pointer;
}

/* 이미지 위 돋보기 이모지 스타일 */
.post-content figure::before {
  content: '🔍';
  position: absolute;
  left: 10px;
  top: 10px;
  font-size: 24px;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  pointer-events: none;
  transition: all 0.3s ease;
  opacity: 0.8;
  transform: scale(1); /* 기본 크기 설정 */
}

/* 이미지 호버 시 돋보기 이모지 효과 */
.post-content figure:hover::before {
  opacity: 1;
  transform: scale(1.5); /* 50% 크기 증가로 수정 */
}

/* 기존 캡션 스타일 유지 */
.post-content figcaption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 플로팅 버튼 애니메이션 */
@keyframes ctaBlink {
  0% { background-color: #f95139; }
  50% { background-color: #0066FF; }
  100% { background-color: #f95139; }
}

@keyframes textBlink {
  0% { color: #f95139; }
  50% { color: #0066FF; }
  100% { color: #f95139; }
}

/* 플로팅 버튼 */
.floating-btn {
  display: none;
  position: fixed;
  bottom: var(--space);
  right: var(--space);
  width: 276px;
  z-index: 9999;
}

/* 포스트 페이지에서만 표시 */
body[id*="tt-body-page"] .floating-btn,
body[data-page-type="post"] .floating-btn {
  display: block !important;
}

.floating-btn a {
  text-decoration: none;
  display: block;
}

.floating-btn__top {
  background-color: #f95139;
  color: var(--color-white);
  padding: 15px;
  border-radius: var(--radius) var(--radius) 0 0;
  text-align: center;
  animation: ctaBlink 1s ease-in-out infinite;
  font-size: 18px;
  font-weight: 700;
  position: relative;
}

.floating-btn__top::before {
  content: "🚨";
  margin-right: 6px;
}

.floating-btn__bottom {
  background: #f8f7f3;
  padding: 15px;
  border-radius: 0 0 var(--radius) var(--radius);
  text-align: center;
  color: #f95139;
  animation: textBlink 1s ease-in-out infinite;
  font-size: 16px;
  font-weight: 600;
}

/* 모바일 플로팅 버튼 */
.mobile-floating {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 300px;
  z-index: 999;
}

.mobile-floating__content {
  background: #f95139;
  color: white;
  padding: 15px;
  border-radius: var(--radius);
  text-align: center;
  animation: ctaBlink 1s ease-in-out infinite;
  font-size: 16px;
  font-weight: 700;
}

.mobile-floating__icon {
  margin-right: 8px;
}

.mobile-floating a {
  text-decoration: none;
  color: white;
  display: block;
}

/* 반응형 처리 */
@media (max-width: 768px) {
  #tt-body-index .container,
  #tt-body-category .container,
  #tt-body-archive .container {
    flex-direction: column;
  }
  
  .sidebar {
    display: none;
  }

  .floating-btn {
    width: 90%;
    max-width: 276px;
    right: 50% !important;
    transform: translateX(50%) !important;
    bottom: 80px !important;
    top: auto !important;
  }

  #tt-body-page .container {
    flex-direction: column;
  }
  
  .post-sidebar {
    display: none;
  }

  #tt-body-page .post-wrap {
    width: 100%;
  }

  .pc-floating {
    display: none !important;
  }
  
  .mobile-floating {
    display: block;
  }
}

@media (max-width: 480px) {
  .floating-btn {
    bottom: 70px !important;
    height: 80px;
  }
}

/* 홈/목록 페이지에서는 포스트 숨김 */
#tt-body-index .post-wrap,
#tt-body-category .post-wrap,
#tt-body-archive .post-wrap {
  display: none !important;
}

/* 포스트 페이지에서는 목록 숨김 */
#tt-body-page .content {
  display: none !important;
}

/* 헤더 스타일 */
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* 구독 버튼 */
.subscribe-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: linear-gradient(45deg, #1a73e8, #4285f4);
  color: var(--color-white);
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(26,115,232,0.2);
}

.subscribe-btn:hover {
  background: linear-gradient(45deg, #1557b0, #1a73e8);
  box-shadow: 0 4px 12px rgba(26,115,232,0.3);
  transform: translateY(-1px);
}

/* 목차 스타일 */
.table-of-contents {
  background: #f8f9fa;
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 30px;
}

.toc-title {
  cursor: pointer;
  margin: 0;
  font-size: 1.17em;  /* h3 크기 */
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-content {
  display: none;  /* 초기에는 숨김 상태 */
  margin-top: 15px;
  padding-left: 24px;
}

.toc-content.show {
  display: block;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin: 8px 0;
}

.toc-list a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s;
  padding: 5px 0;
  display: block;
}

.toc-list a:hover {
  color: #f95139;
}

/* h2 태그 스타일 */
.post-content h2 {
  background: #f95139;
  color: var(--color-white);
  padding: 15px 20px;
  border-radius: var(--radius);
  margin: 40px 0 20px;
  font-size: 1.5em;
  position: relative;
  transition: all 0.3s ease;
  transform-origin: left center;
}

.post-content h2::after {
  content: '⬇️';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  opacity: 1;
  transition: all 0.3s ease;
}

.post-content h2:hover {
  background: #0066FF;
  padding-left: 25px;
  transform: scale(1.02);
  font-size: 1.6em;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.2);
}

.post-content h2:hover::after {
  content: '👆';
  opacity: 1;
  transform: translateY(-50%) rotate(-15deg) scale(1.5);
  right: 30px;
  text-shadow: 3px 3px 6px rgba(0,0,0,0.2);
}

/* 모바일에서는 터치 시 효과 표시 */
@media (max-width: 768px) {
  .post-content h2.touch-active {
    background: #0066FF;
    padding-left: 25px;
    transform: scale(1.02);
    font-size: 1.6em;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.2);
  }
  
  .post-content h2.touch-active::after {
    content: '👆';
    transform: translateY(-50%) rotate(-15deg) scale(1.5);
    right: 30px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.2);
  }
}

.google-ads {
  margin-bottom: var(--space);
  text-align: center;
}

/* 사이드바 광고 스타일 */
.sidebar .adsbygoogle {
  width: 100% !important;
  max-width: 300px;
  margin: 0 auto var(--space);
  display: block;
  background: var(--color-white);
  border-radius: var(--radius);
}

/* 포스트 페이지 사이드바 광고 */
.post-sidebar .adsbygoogle {
  position: sticky;
  top: var(--space);
  height: 600px;  /* 세로형 광고 크기 */
}

/* 반응형에서 광고 처리 */
@media (max-width: 768px) {
  .sidebar .adsbygoogle,
  .post-sidebar .adsbygoogle {
    display: none !important;  /* 모바일에서는 광고 숨김 */
  }
} 