/* edulabhaey 공통 스타일 (정적 매뉴얼 MVP)
   - 톤: 공공성 + 실무감 + 과장 없는 UI
   - 2026-01: 라이트(흰 배경) 테마 적용
   - 정리본: 라이트박스 중복 제거(lb- 방식만 유지)
*/

/* =============================
   Theme
   ============================= */
:root{
  --bg:#ffffff;
  --panel:#ffffff;
  --card:#ffffff;

  --text:#111111;
  --muted:#555555;

  --line:rgba(0,0,0,.10);

  --accent:#2f6fff;
  --accent2:#0ea5a4;

  --warn:#b45309;
  --bad:#dc2626;
  --good:#059669;

  --radius:18px;
  --shadow: 0 14px 40px rgba(0,0,0,.10);
  --shadow2: 0 8px 20px rgba(0,0,0,.08);
  --max: 1120px;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  background: var(--bg);
  color:var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR", "맑은 고딕", sans-serif;
  line-height:1.55;
  word-break: keep-all;
  overflow-x:hidden; /* ✅ 큰 이미지/요소로 인한 가로 스크롤 방지 */
}

a{color:inherit; text-decoration:none;}
.small{font-size:.92rem; color:var(--muted);}

.kbd{
  display:inline-block; padding:.15rem .45rem;
  border:1px solid var(--line);
  border-bottom-color:rgba(0,0,0,.20);
  border-radius:10px;
  background:rgba(0,0,0,.03);
  font-size:.85rem;
  color:var(--text);
}

.wrap{max-width:var(--max); margin:0 auto; padding: 0 18px;}

/* =============================
   Topbar
   ============================= */
.topbar{
  position:sticky; top:0; z-index:50;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,.86);
  border-bottom:1px solid var(--line);
}

.topbar-inner{
  display:flex; align-items:center; gap:14px;
  padding:12px 0;
}

.brand{
  display:flex; align-items:baseline; gap:10px;
  min-width: 210px;
}
.brand .logo{
  width:34px; height:34px; border-radius:12px;
  background: linear-gradient(135deg, rgba(47,111,255,.95), rgba(14,165,164,.85));
  box-shadow: 0 10px 24px rgba(47,111,255,.18);
}
.brand .title{
  font-weight:800;
  letter-spacing:.2px;
}
.brand .tag{
  font-weight:600;
  font-size:.9rem;
  color:var(--muted);
}

.nav{
  display:flex; flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.nav a{
  padding:8px 10px;
  border-radius:12px;
  color:var(--muted);
  border:1px solid transparent;
}
.nav a:hover{
  color:var(--text);
  border-color: var(--line);
  background: rgba(0,0,0,.03);
}
.nav a.active{
  color:var(--text);
  border-color: rgba(47,111,255,.40);
  background: rgba(47,111,255,.08);
}

/* =============================
   Search (메뉴 아래 한 줄 배치용)
   - HTML에서 topbar-inner 밖으로 .topbar-search를 둔 구조 전제
   ============================= */
.topbar-search{
  padding: 0 0 12px;
}
.search{
  position:relative;
  min-width: 280px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.search input{
  width:100%;
  padding:10px 12px 10px 40px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.02);
  color: var(--text);
  outline:none;
}
.search input:focus{
  border-color: rgba(47,111,255,.55);
  box-shadow: 0 0 0 4px rgba(47,111,255,.15);
}
.search .icon{
  position:absolute; left:12px; top:50%;
  transform:translateY(-50%);
  opacity:.7;
}
.search-results{
  position:absolute; left:0; right:0; top:46px;
  background: rgba(255,255,255,.98);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow: var(--shadow2);
  overflow:hidden;
  display:none;
}
.search-results .item{
  display:block;
  padding:10px 12px;
  border-top:1px solid var(--line);
}
.search-results .item:first-child{border-top:none;}
.search-results .item:hover{background: rgba(0,0,0,.03);}
.search-results .item .t{font-weight:750;}
.search-results .item .d{font-size:.88rem; color:var(--muted); margin-top:2px;}

/* =============================
   Hero / Layout
   ============================= */
.hero{
  padding: 28px 0 18px;
}
.hero h1{
  margin:0;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  letter-spacing:-.2px;
}
.hero .sub{
  margin:10px 0 0;
  color:var(--muted);
  max-width: 900px;
}

.grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:18px;
  padding: 14px 0 56px;
}
@media (max-width: 980px){
  .grid{grid-template-columns:1fr;}
  .search{max-width:none;}
  .brand{min-width:auto;}
}

.card{
  background: rgba(255,255,255,.92);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding: 16px 16px;
}
.card h2{
  margin:0 0 10px;
  font-size:1.15rem;
}
.card h3{
  margin:18px 0 8px;
  font-size:1.05rem;
}
.card p{margin:8px 0; color: var(--text);}
.card ul{margin:8px 0 8px 18px; color: var(--text);}
.card li{margin:6px 0;}

.badge{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.02);
  color: var(--muted);
  font-size:.88rem;
}
.badge b{color:var(--text);}

.hr{
  height:1px;
  background: var(--line);
  margin: 14px 0;
}

.callout{
  border:1px solid var(--line);
  border-left: 4px solid rgba(47,111,255,.65);
  background: rgba(47,111,255,.06);
  border-radius: 16px;
  padding: 12px 12px;
  margin: 10px 0;
}
.callout.warn{
  border-left-color: rgba(180,83,9,.75);
  background: rgba(180,83,9,.06);
}
.callout.bad{
  border-left-color: rgba(220,38,38,.75);
  background: rgba(220,38,38,.06);
}
.callout.good{
  border-left-color: rgba(5,150,105,.75);
  background: rgba(5,150,105,.06);
}
.callout .t{font-weight:800; margin-bottom:6px;}

.kv{
  display:grid;
  grid-template-columns: 140px 1fr;
  gap:10px 12px;
  margin:10px 0;
}
@media (max-width: 560px){
  .kv{grid-template-columns:1fr;}
}
.kv .k{color:var(--muted);}
.kv .v{color:var(--text);}

.btnrow{
  display:flex; flex-wrap:wrap; gap:10px;
  margin-top: 10px;
}
.btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.02);
  color: var(--text);
  font-weight:700;
}
.btn:hover{
  border-color: rgba(47,111,255,.55);
  background: rgba(47,111,255,.08);
}

/* =============================
   TOC
   ============================= */
.toc{
  position: sticky;
  top: 74px;
  padding: 14px 14px;
}
.toc .tt{
  font-weight:850;
  margin-bottom:8px;
}
.toc a{
  display:block;
  padding:8px 10px;
  border-radius:12px;
  color:var(--muted);
  border:1px solid transparent;
}
.toc a:hover{
  color:var(--text);
  background: rgba(0,0,0,.03);
  border-color: var(--line);
}
.toc a.active{
  color:var(--text);
  background: rgba(47,111,255,.08);
  border-color: rgba(47,111,255,.40);
}

/* =============================
   Footer / Top Button
   ============================= */
.footer{
  border-top:1px solid var(--line);
  padding: 22px 0 34px;
  color: var(--muted);
  font-size:.92rem;
}
.footer .row{
  display:flex; gap:14px; flex-wrap:wrap;
  align-items:center; justify-content:space-between;
}
.footer a{
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset:3px;
}
.footer a:hover{color:var(--text);}

.topbtn{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display:none;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.92);
  color:var(--text);
  box-shadow: var(--shadow2);
  font-weight:800;
}
.topbtn:hover{
  border-color: rgba(47,111,255,.55);
  background: rgba(47,111,255,.08);
}

/* =============================
   Details / Codebox
   ============================= */
details{
  border:1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,.015);
  padding: 10px 12px;
  margin: 10px 0;
}
summary{cursor:pointer; font-weight:800;}
details[open]{background: rgba(0,0,0,.02);}

.codebox{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:.92rem;
  border:1px dashed rgba(0,0,0,.18);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(0,0,0,.03);
  overflow:auto;
}

/* =============================
   이미지 캡처 카드(에듀파인 팁용) - 기존 2열 카드
   ============================= */
.imggrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin: 10px 0;
}
@media (max-width: 980px){
  .imggrid{grid-template-columns:1fr;}
}

.imgcard{
  border:1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,.015);
  overflow:hidden;
}
.imgcard img{
  width:100%;
  display:block;
  background: rgba(0,0,0,.02);
}
.imgcap{
  padding:10px 12px;
}
.imgcap .t{
  font-weight:850;
  margin:0 0 6px;
}
.imgcap .d{
  margin:0;
  color: var(--muted);
  font-size: .92rem;
}

/* =============================
   이미지 오버레이(마커)
   - figure 안에 .imgwrap + .overlay + .marker 구조일 때 사용
   ============================= */
.imgwrap{ position: relative; }
.overlay{
  position:absolute;
  inset:0;
  pointer-events:none;
}
/* 번호/원 마커: 위치는 --x, --y(0~100) */
.marker{
  position:absolute;
  left: calc(var(--x) * 1%);
  top:  calc(var(--y) * 1%);
  transform: translate(-50%, -50%);

  width: 34px;
  height: 34px;
  border-radius: 999px;

  display:flex;
  align-items:center;
  justify-content:center;

  font-weight: 900;
  font-size: 14px;

  color: #111;
  background: rgba(255,255,255,.92);

  box-shadow: 0 10px 24px rgba(0,0,0,.20);
  outline: 4px solid rgba(255, 79, 79, .75);
  outline-offset: 0;
}

/* 썸네일에서 확대 커서 */
.img-zoomable{ cursor: zoom-in; }

/* =============================
   FAQ 이미지(글로서리 등) - ✅ 한 줄에 한 장
   - HTML: <div class="image-grid"><figure class="img-item">...</figure>...</div>
   ============================= */
.image-grid{
  display:block;
  margin-top:12px;
}

.img-item{
  margin: 16px 0 24px;
}

.img-item img{
  display:block;
  width:100%;
  max-width:100%;
  height:auto;
  border-radius:12px;
  border:1px solid var(--line);
}

.img-item figcaption{
  margin-top:6px;
  font-size:.9rem;
  color:var(--muted);
  text-align:left; /* 매뉴얼 느낌 */
}

/* =============================
   라이트박스 (튜토리얼 슬라이드 / 캡션 고정 / 키보드 이동)
   - main.js의 setupImageLightbox()와 짝
   ============================= */
.lightbox{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lb-inner{
  width: min(1100px, 96vw);
  height: min(92vh, 900px);
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.lb-stage{
  flex: 1;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 16px;
  overflow:hidden;
}

.lb-imgwrap{
  position: relative;
  width: 100%;
  height: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
}

.lb-img{
  max-width: 100%;
  max-height: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.lb-overlay{
  position:absolute;
  inset:0;
  pointer-events:none;
}

/* 확대 상태 캡션 고정 */
.lb-caption{
  background: rgba(255,255,255,.92);
  border-radius: 14px;
  padding: 10px 12px;
  color: #111;
  border: 1px solid rgba(255,255,255,.18);
}

.lb-title{
  font-weight: 900;
  margin-bottom: 4px;
}

.lb-desc{
  color: rgba(0,0,0,.70);
  font-size: .95rem;
}

.lb-hint{
  margin-top: 6px;
  font-size: .85rem;
  color: rgba(0,0,0,.55);
}

/* 버튼 */
.lb-btn{
  position: absolute;
  top: 16px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.35);
  color: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
}
.lb-btn:hover{ background: rgba(0,0,0,.5); }

.lb-close{ right: 16px; }
.lb-prev{ left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next{ right: 16px; top: 50%; transform: translateY(-50%); }

@media (max-width: 560px){
  .marker{ width: 30px; height: 30px; font-size: 13px; outline-width: 3px; }
  .lb-btn{ padding: 8px 10px; border-radius: 12px; }
}

/* =============================
   홈 하단 일러스트
   ============================= */
.home-illust{
  max-width:var(--max);
  margin:40px auto 20px;
  padding:0 18px;
  text-align:center;
}
.home-illust img{
  max-width:100%;
  width:100%;
  height:auto;
  display:block;
  margin:0 auto;
  opacity:.95;
}
