/* wiki/wiki.css */

/* 1. 기본 설정 및 변수 */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
  --primary: #006D77;
  --primary-dark: #054a51;
  --primary-light: #f0fdfa;
  --secondary: #FF9F1C;
  --accent: #006D77;
  --radius: 12px;
  --radius-lg: 18px; /* 곡률을 살짝 높여 더 부드러운 인상 부여 */
  --text-main: #1e293b;
  --text-sub: #64748b;
  --bg-body: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --line: #e2e8f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.7; /* 기본 행간 최적화 */
  -webkit-font-smoothing: antialiased;
  word-break: keep-all; /* 한글 가독성 핵심 */
}

a { 
  text-decoration: none; 
  color: inherit; 
  transition: all 0.25s ease; 
}

/* 2. 레이아웃 및 헤더 */
.wikiWrap {
  max-width: 1080px; /* 약간 넓혀서 여유로운 느낌 부여 */
  margin: 0 auto;
  padding: 60px 24px 100px;
}

.wikiHeader {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 50px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 30px;
}

@media(min-width: 768px) {
  .wikiHeader {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.wikiBrand { display: flex; flex-direction: column; }
.wikiBrandTitle {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: 26px;
  color: var(--primary-dark);
  letter-spacing: -0.8px;
  animation: frailtySolid 6s ease-in-out infinite;
}
.wikiBrandSub {
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 600;
  margin-top: 2px;
}

@keyframes frailtySolid {
  0%, 100% { color: var(--primary); }
  50% { color: var(--secondary); }
}

/* 3. 네비게이션 */
.wikiNav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.wikiNav::-webkit-scrollbar { display: none; }

.wikiNavLink {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-sub);
  white-space: nowrap;
}
.wikiNavLink:hover {
  background-color: var(--border);
  color: var(--text-main);
}
.wikiNavLink.active {
  background-color: var(--primary);
  color: #fff; /* 활성화 시 대비를 확실하게 변경 */
}

/* 4. 타이틀 및 히로 섹션 */
.heroSection, .wikiHero {
  text-align: left;
  margin-bottom: 3.5rem;
}

.wikiH1, .wikiTitle {
  margin-bottom: 1.2rem;
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -0.04em; /* 제목의 응집력 강화 */
  line-height: 1.2;
  color: #0f172a;
}

@media (max-width: 640px) {
  .wikiH1, .wikiTitle { font-size: 36px; }
}

.wikiDesc, .wikiLead {
  max-width: 740px;
  margin: 0;
  font-size: 18px;
  line-height: 1.75;
  color: var(--text-sub);
}

.sectionTitle {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 40px 0 20px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sectionTitle::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
}

/* 5. 본문 가독성 및 아티클 */
.wikiArticle, .contentWrap {
  font-size: 17px; /* 가독성을 위한 확대 */
  max-width: 800px; /* 한 줄 읽기 편한 너비로 제한 */
  margin: 0 auto;
}

.wikiArticle p, .contentWrap p {
  line-height: 1.85;
  margin: 1.6rem 0; /* 단락 간격 확대 */
  letter-spacing: -0.015em;
  color: #334155;
}

.wikiArticle h2 { 
  margin-top: 50px; 
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-light);
  font-weight: 800; 
  font-size: 28px;
  letter-spacing: -0.03em;
}
.wikiArticle strong, .contentWrap strong { 
  font-weight: 800; 
  color: var(--primary-dark);
}

.contentWrap ul, .contentWrap ol {
  margin: 1.4rem 0;
  padding-left: 1.6rem;
}

.contentWrap li {
  margin-bottom: 12px;
  line-height: 1.75;
}

/* 6. 박스 모델 (요약/노트) */
.wikiSummary, .noteBox {
  margin: 32px 0 40px;
  padding: 28px 32px;
  background-color: var(--primary-light);
  border: 1px solid #ccfbf1;
  border-left: 6px solid var(--primary); /* 정보 성격 강조 */
  border-radius: var(--radius-lg);
  font-size: 16px;
  line-height: 1.75;
  color: #0f3d41;
}

.wikiSummary ul, .noteBox ul {
  margin: 14px 0 0;
  padding-left: 20px;
}

.wikiSummary li, .noteBox li { margin: 8px 0; }

/* 7. 이미지 및 피규어 */
.wikiFigure, .post-figure {
  margin: 3.5rem auto;
  text-align: center;
}

.wikiFigure img, .post-figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.wikiFigure.is-context img, .post-figure img {
  border: 1px solid var(--border);
}

.wikiFigure figcaption, .post-figure figcaption {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-sub);
}

/* 성동구 전용 갤러리 */
.sdGallery { margin: 32px 0; }
.sdGalleryGrid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 720px) {
  .sdGalleryGrid { grid-template-columns: repeat(2, 1fr); }
}
.sdGalleryItem {
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  transition: transform 0.3s ease;
}
.sdGalleryItem:hover { transform: scale(1.02); }

.sdGalleryThumb {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  padding: 12px;
}
.sdGalleryThumb img { width: 100%; height: 100%; object-fit: contain; }

/* 8. 그리드 및 카드 (Index/Policy) */
.wikiGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.wikiCard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: 100%;
}

.wikiCard:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -12px rgba(0, 109, 119, 0.15);
  border-color: var(--primary);
}

.cardArrow {
  margin-top: auto;
  padding-top: 24px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.wikiCard:hover .cardArrow { opacity: 1; transform: translateX(0); }

/* 케이스 스터디 전용 카드 */
.caseGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 860px) { .caseGrid { grid-template-columns: 1fr; } }

.caseCard {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.04);
  transition: all 0.3s ease;
}

.caseCard:hover { 
  transform: translateY(-6px); 
  box-shadow: 0 20px 30px rgba(2, 6, 23, 0.1); 
  border-color: var(--primary);
}

.caseThumb { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: #f1f5f9; }

/* 9. 리스트 및 항목 */
.wikiItemLink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 4px;
  text-decoration: none;
  background: transparent;
  transition: background 0.2s ease, transform 0.2s ease;
}

.wikiItemLink:hover { 
  background: var(--primary-light);
  color: var(--primary-dark);
  transform: translateX(4px);
}

/* 10. 태그 및 뱃지 */
.badge, .caseTag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.badge { color: var(--primary-dark); background: #ccfbf1; border: 1px solid transparent; }

.useTag {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  font-size: 11px;
  border-radius: 6px;
  font-weight: 700;
}
.useTag.screening { background-color: #e6f4f1; color: #006d77; }
.useTag.assessment { background-color: #eef2ff; color: #1e40af; }
.useTag.outcome { background-color: #fff7ed; color: #9a3412; }

/* 11. 자료 출처 및 푸터 */
.wikiRef {
  margin-top: 60px;
  border-top: 1px solid var(--border);
  padding-top: 30px;
}

/* 기본 불릿 완전 제거 */
.wikiRef ul {
  list-style: none !important;
  padding: 0;
  margin: 0;
}

.wikiRef li {
  list-style: none !important;
  font-size: 14.5px;
  color: var(--text-sub);
  margin-bottom: 12px;
  padding-left: 18px;
  position: relative;
  line-height: 1.6;
}

/* 브라우저 기본 marker 강제 제거 */
.wikiRef li::marker {
  content: "";
}

/* 커스텀 불릿 */
.wikiRef li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.wikiRef a { 
  color: var(--primary); 
  text-decoration: underline; 
  text-underline-offset: 4px; 
  opacity: 0.8;
}
.wikiRef a:hover { 
  opacity: 1; 
}


.wikiFooter {
  margin-top: 100px;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-sub);
  font-size: 14px;
}

/* 12. 기타 컴포넌트 */
.downloadButton {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 109, 119, 0.2);
}
.downloadButton:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 109, 119, 0.3); }

.wikiMore {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  margin: 20px 0;
  overflow: hidden;
}

.wikiMoreSummary { 
  padding: 18px 24px; 
  cursor: pointer; 
  font-weight: 700; 
  background: var(--bg-body);
  transition: background 0.2s ease;
}
.wikiMoreSummary:hover { background: var(--primary-light); }

.keyPhrase { color: var(--primary); font-weight: 800; border-bottom: 2px solid var(--primary-light); }
.hl { background: rgba(0, 109, 119, 0.08); padding: 2px 6px; border-radius: 4px; color: var(--primary-dark); font-weight: 600; }

body {
  opacity: 0;
  transition: opacity 0.2s ease;
}

body.loaded {
  opacity: 1;
}

.doc-credit{
  margin-top: 32px;
  text-align: right;
  font-size: 12.5px;
  color: #d1d5db;
  font-style: italic;
}

.wikiMoreBody{
  padding: 18px 22px 20px;
}

.wikiMoreBody .wikiP{
  margin-bottom: 14px;
}

.wikiMoreBody .wikiH3{
  margin-top: 22px;
  margin-bottom: 10px;
}

.wikiMoreBody .wikiList{
  margin-left: 18px;
  margin-bottom: 16px;
}
/* Footer 세부 텍스트 */
.wikiFooter .footerNote{
  margin-top: 8px;
  opacity: 0.7;
}

.wikiFooter .footerOrg{
  margin-top: 16px;
  padding-top: 16px;
 
  font-size: 0.9em;
  line-height: 1.6;
  opacity: 0.8;
}

.wikiFooter .footerOrg a{
  color: inherit;
  text-decoration: underline;
}
/* 본문 링크 스타일 통일 (카드형 링크 제외) */
.content a:not(.wikiItemLink),
.contentWrap a:not(.wikiItemLink),
.wikiArticle a:not(.wikiItemLink) {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1.5px solid transparent;
  transition: all 0.2s ease;
}

.content a:not(.wikiItemLink):hover,
.contentWrap a:not(.wikiItemLink):hover,
.wikiArticle a:not(.wikiItemLink):hover {
  border-bottom: 1.5px solid var(--primary);
  opacity: 0.85;
}

.content a:not(.wikiItemLink):focus-visible,
.contentWrap a:not(.wikiItemLink):focus-visible,
.wikiArticle a:not(.wikiItemLink):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}
/* 다운로드 미리보기 축소 */
.wikiItemPreview {
  margin-top: 12px;
}

.wikiItemPreview img {
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

@media (min-width: 768px) {
  .wikiItemPreview img {
    max-width: 320px;
  }
}
