/* 블로그 (목록·글). site.css, pages.css 위에 얹는다. */
.blog-hero { padding-bottom: 56px; }
.blog-page main { min-height: 40vh; }

/* 분류 탭 */
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.cats a { padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--body); font-size: 15px; font-weight: 600; text-decoration: none; }
.cats a:hover { border-color: var(--blue-400); color: var(--blue-600); }
.cats a[aria-current="true"] { background: var(--blue-500); border-color: var(--blue-500); color: var(--white); }

/* 글 카드 */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pcard { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--white); border: 1px solid var(--line); text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s, border-color .2s; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c9dcf0; }
.pthumb { aspect-ratio: 16 / 10; background: var(--soft); overflow: hidden; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; }
.pbody { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.pbody h2, .pbody h3 { margin: 0; font-size: 18px; line-height: 1.4; color: var(--ink); letter-spacing: -.02em; }
.pbody p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); flex: 1; }
.pbody time { font-size: 13px; color: var(--muted); }
.pmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--muted); }
.pcat { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #eaf3fc; color: var(--blue-600); font-weight: 600; }
.post-empty { padding: 80px 20px; text-align: center; border-radius: var(--radius); background: var(--soft); color: var(--muted); }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 36px; }
.pager a { min-width: 40px; padding: 8px 12px; text-align: center; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; color: var(--body); font-weight: 600; }
.pager a[aria-current="page"] { background: var(--blue-500); border-color: var(--blue-500); color: var(--white); }

/* 글 한 편 */
.post { padding: calc(72px + 40px + env(safe-area-inset-top)) 0 20px; }
.post .narrow { max-width: 820px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue-500); }
.post-head { margin-bottom: 28px; }
.post-head h1 { margin: 14px 0 12px; font-size: clamp(26px, 4vw, 38px); line-height: 1.3; letter-spacing: -.03em; color: var(--ink); }
.post-head time { font-size: 14px; color: var(--muted); }
.post-intro, .post-outro { font-size: 17px; }
.post-intro p, .post-outro p, .ptext p { margin: 0 0 16px; font-size: 17px; line-height: 1.85; color: var(--body); word-break: keep-all; }
.pblock { margin: 34px 0; }
.pphotos { display: grid; gap: 10px; margin-bottom: 16px; }
.pphotos figure { margin: 0; border-radius: 14px; overflow: hidden; background: var(--soft); }
.pphotos img { width: 100%; height: auto; }
/* 나란히(2장 이상): 6칸을 줄마다 2장(3칸씩)·3장(2칸씩)으로 나눠 줄이 항상 꽉 찬다. 비율을 맞추려고 가장자리가 조금 잘릴 수 있음(누르면 전체) */
.pphotos.many { grid-template-columns: repeat(6, 1fr); }
.pphotos.many .s2 { grid-column: span 2; }
.pphotos.many .s3 { grid-column: span 3; }
.pphotos.many img { display: block; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pphotos.many.tall img { aspect-ratio: 3 / 4; }

/* 대표 사진＋작은 사진 줄 */
.pgal { margin-bottom: 16px; }
.pgal-main { display: grid; gap: 10px; }
.pgal-main figure { margin: 0; border-radius: 14px; overflow: hidden; background: var(--soft); }
.pgal-main img { display: block; width: 100%; height: auto; }
.pgal.on .pgal-main figure { display: none; aspect-ratio: 4 / 3; }
.pgal.on.tall .pgal-main figure { aspect-ratio: 3 / 4; max-height: 78vh; width: 100%; }
.pgal.on .pgal-main figure.on { display: block; }
.pgal.on .pgal-main img { height: 100%; object-fit: contain; }
.pgal-thumbs { display: none; gap: 8px; margin-top: 8px; padding: 3px 3px 8px; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.pgal.on .pgal-thumbs { display: flex; }
.pgal-thumbs button { flex: 0 0 112px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--soft); cursor: pointer; opacity: .62; }
.pgal-thumbs button[aria-current="true"] { opacity: 1; outline: 3px solid var(--blue-500); outline-offset: 0; }
.pgal-thumbs button:hover, .pgal-thumbs button:focus-visible { opacity: 1; }
.pgal-thumbs img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.tags li { padding: 5px 12px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 13.5px; }
.post-cta { margin: 44px 0 20px; padding: 32px 30px; border-radius: 20px; background: linear-gradient(135deg, #eef5fc, #e1eefb); }
.post-cta h2 { margin: 0 0 8px; font-size: 21px; color: var(--ink); }
.post-cta p { margin: 0 0 20px; font-size: 15.5px; color: var(--body); }
.post-cta .btn { padding: 13px 22px; font-size: 14.5px; }
.related { margin: 40px 0 0; }
.related h2 { margin: 0 0 18px; font-size: 22px; color: var(--ink); }

@media (max-width: 980px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; gap: 18px; }
  .post { padding-top: calc(72px + 24px + env(safe-area-inset-top)); }
  .pphotos.many { gap: 5px; }
  .pphotos.many figure { border-radius: 9px; }
  .pgal-thumbs button { flex-basis: 78px; }
  .post-intro p, .post-outro p, .ptext p { font-size: 16.5px; }
  .post-cta { padding: 26px 22px; }
}

/* 블록 소제목 */
.pheading { margin: 0 0 14px; font-size: clamp(20px, 2.6vw, 24px); line-height: 1.4; letter-spacing: -.02em; color: var(--ink); }
.pblock + .pblock { margin-top: 44px; }

/* 사진 슬라이드 (밀어서 넘김). 모든 사진이 HTML에 있고, 스크립트가 없어도 가로로 밀어 볼 수 있다 */
.pslider { position: relative; margin-bottom: 16px; border-radius: 14px; overflow: hidden; background: var(--soft); }
.pslides { position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; align-items: center; }
.pslides::-webkit-scrollbar { display: none; }
.pslide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; display: grid; place-items: center; }
.pslide img { width: 100%; height: auto; max-height: 78vh; object-fit: contain; }
.pnav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 56px; border: 0; border-radius: 10px; background: rgba(10,29,56,.5); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .2s; }
.pslider:hover .pnav, .pnav:focus-visible { opacity: 1; }
.pnav.prev { left: 8px; } .pnav.next { right: 8px; }
.pdots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 8px; pointer-events: none; }
.pdots button { pointer-events: auto; width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.65); box-shadow: 0 0 0 1px rgba(10,29,56,.25); cursor: pointer; }
.pdots button[aria-current="true"] { background: var(--blue-500); box-shadow: 0 0 0 2px #fff; }
@media (hover: none) { .pnav { opacity: .85; width: 34px; height: 48px; font-size: 24px; } }

/* 사진 누르면 크게 보기 */
.post img[data-zoom] { cursor: zoom-in; }
/* 길게 눌러 저장·끌어가기 막기 */
.post img, .lb img { -webkit-touch-callout: none; -webkit-user-drag: none; -webkit-user-select: none; user-select: none; }
body.lb-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; background: rgba(5,12,24,.94); }
.lb.on { display: flex; }
.lb > img { max-width: 94vw; max-height: 82vh; object-fit: contain; border-radius: 6px; }
.lbx { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.lbn { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 72px; border: 0; border-radius: 12px; background: rgba(255,255,255,.12); color: #fff; font-size: 34px; cursor: pointer; }
.lbn[hidden] { display: none; }
.lbp { left: 10px; } .lbq { right: 10px; }
.lbx:hover, .lbn:hover { background: rgba(255,255,255,.26); }
.lbi { position: absolute; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 2px; padding: 0 70px; text-align: center; color: #cfd8e3; font-size: 14px; }
.lbc { font-weight: 700; color: #fff; }
.lbt { opacity: .85; line-height: 1.4; }
@media (max-width: 640px) { .lbn { width: 38px; height: 56px; font-size: 26px; } .lbi { padding: 0 52px; font-size: 13px; } }

/* 목록 첫 화면 아래 여백: 분류 탭이 위 제목 영역에 붙지 않게 */
.blog-page main.block.tight { padding: 56px 0 24px; }
.cats { margin-bottom: 36px; }
@media (max-width: 640px) { .blog-page main.block.tight { padding: 40px 0 16px; } }

/* 목록 소개 아래 작은 안내 */
.blog-hero .lead { max-width: 640px; }
.lead-note { max-width: 640px; margin: 16px 0 0; font-size: 14px; line-height: 1.7; color: rgba(255,255,255,.62); }
.lead-note a { color: rgba(255,255,255,.85); text-underline-offset: 3px; }
.lead-note a:hover { color: #fff; }

/* 목록 카드: 마우스를 올리면 사진이 돌아가며 바뀜 (blog-list.js) */
.pthumb { position: relative; }
.pthumb.cy img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.pthumb.cy img.on { opacity: 1; }
.pdots-card { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2; display: flex; justify-content: center; gap: 6px; opacity: 0; transition: opacity .25s; pointer-events: none; }
.pdots-card.show { opacity: 1; }
.pdots-card i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55); box-shadow: 0 0 0 1px rgba(10,29,56,.35); }
.pdots-card i.on { background: #fff; box-shadow: 0 0 0 2px var(--blue-500); }
.pcount { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 3px 9px; border-radius: 999px; background: rgba(10,29,56,.62); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; }

/* 글 하단 문의하기 (버튼 하나) */
.post-cta { margin: 48px 0 24px; padding: 0; background: none; text-align: center; }
.post-cta .btn { min-width: 220px; justify-content: center; padding: 16px 34px; font-size: 17px; }

/* 관리자 전용 떠 있는 버튼 (새 글 쓰기 · 이 글 수정) */
.admin-fab { position: fixed; right: 18px; bottom: 22px; z-index: 70; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.admin-fab a { padding: 11px 18px; border-radius: 999px; background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(10,29,56,.18); font-size: 14.5px; font-weight: 700; text-decoration: none; }
.admin-fab a:hover { border-color: var(--blue-400); }
.admin-fab a.primary { background: var(--blue-500); border-color: var(--blue-500); color: #fff; }
@media (max-width: 760px) { .admin-fab { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); } }
