/* 달곰 카드뉴스 1.1.0 — 맨 위 넘김 슬라이드, 끝 펼침 바둑판, 크게 보는 창 */

/* 자바스크립트가 없을 때 보이는 대표 이미지 크기(1.0.1과 같음) */
.entry-thumbnail img { max-height:420px; width:auto; max-width:100%; margin-inline:auto; }
/* 슬라이드가 생기면 대표 이미지는 화면에서만 숨긴다(HTML에는 남아 검색·공유에 영향 없음) */
.entry-thumbnail.dg-thumb-hidden { display:none !important; }

/* ---------- 맨 위 넘김 슬라이드 ---------- */
.dg-top { --dg-h:420px; --dg-gap:12px; --dg-w:calc(var(--dg-h) * 0.8); margin:24px 0 0; }
.dg-top__stage { position:relative; }
.dg-top__track { position:relative; display:flex; gap:var(--dg-gap); overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; scroll-snap-type:x mandatory; scrollbar-width:none; -webkit-overflow-scrolling:touch; margin:0; padding:0; border-radius:14px; background:#f0f7f3; }
.dg-top__track::-webkit-scrollbar { display:none; }
.dg-top__track::before,.dg-top__track::after { content:''; flex:0 0 max(0px, calc(50% - var(--dg-w) / 2 - var(--dg-gap))); }
.dg-top__slide { flex:0 0 auto; height:var(--dg-h); aspect-ratio:4 / 5; margin:0; scroll-snap-align:center; scroll-snap-stop:always; opacity:.55; transition:opacity .2s; }
.dg-top__slide.is-current { opacity:1; }
.dg-top__open { display:block; width:100%; height:100%; margin:0; padding:0; border:0; border-radius:12px; background:none; cursor:zoom-in; }
.dg-top__open img { display:block; width:100%; height:100%; max-width:none; max-height:none; object-fit:contain; border-radius:12px; }
.dg-top__nav { position:absolute; top:50%; z-index:1; display:grid; place-items:center; width:44px; height:44px; margin:0; padding:0; transform:translateY(-50%); border:1px solid #9ab9ad; border-radius:50%; background:rgb(255 255 255 / 94%); color:#173f36; box-shadow:0 2px 8px rgb(0 0 0 / 16%); cursor:pointer; font:inherit; font-size:28px; line-height:1; }
.dg-top__nav span { margin-top:-3px; }
.dg-top__nav--prev { left:8px; }
.dg-top__nav--next { right:8px; }
.dg-top__nav:disabled { opacity:0; pointer-events:none; }
.dg-top__count { position:absolute; top:10px; right:10px; z-index:1; padding:3px 10px; border-radius:999px; background:rgb(23 63 54 / 85%); color:#fff; font-size:13px; font-weight:600; line-height:1.5; pointer-events:none; }
.dg-top__dots { display:flex; justify-content:center; gap:2px; margin-top:6px; }
.dg-top__dot { display:grid; place-items:center; width:24px; height:24px; margin:0; padding:0; border:0; background:none; cursor:pointer; }
.dg-top__dot::before { content:''; width:8px; height:8px; border-radius:999px; background:#b9cfc6; transition:width .2s, background .2s; }
.dg-top__dot[aria-current="true"]::before { width:18px; background:#15735b; }
.dg-top__track:focus-visible,.dg-top__open:focus-visible,.dg-top__nav:focus-visible,.dg-top__dot:focus-visible { outline:3px solid #15735b; outline-offset:3px; }
.dg-top__open:focus-visible { outline-offset:-3px; }

/* ---------- 글 끝 펼침 바둑판 ---------- */
.entry-content .dg-grid__hint { margin:0 0 10px; color:#3d635a; font-size:15px; line-height:1.5; }
.entry-content .dalgom-gallery.dg-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; margin:0 0 1.4em; padding:0; list-style:none; }
.entry-content .dalgom-gallery.dg-grid > * { margin:0; min-width:0; }
.entry-content .dg-grid__open { display:block; width:100%; margin:0; padding:0; border:0; border-radius:12px; background:none; cursor:zoom-in; transition:transform .15s; }
.entry-content .dg-grid__open:hover { transform:translateY(-2px); }
.entry-content .dg-grid__open img { display:block; width:100%; height:auto; }
.entry-content .dg-grid__open:focus-visible { outline:3px solid #15735b; outline-offset:3px; }

@media (max-width:720px) {
  .dg-top { --dg-h:260px; }
  .entry-content .dalgom-gallery.dg-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
}
@media (prefers-reduced-motion:reduce) {
  .dg-top__slide,.dg-top__dot::before,.entry-content .dg-grid__open { transition:none; }
}

/* ---------- 크게 보는 창 ---------- */
html.dg-lb-lock { overflow:hidden; }
.dg-lb { position:fixed; inset:0; width:100%; height:100%; max-width:none; max-height:none; margin:0; padding:0; border:0; background:transparent; color:#fff; overflow:hidden; }
.dg-lb[open] { display:flex; flex-direction:column; }
.dg-lb::backdrop { background:rgb(10 20 28 / 96%); }
.dg-lb__bar { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 12px; }
.dg-lb__count { padding-left:4px; font-size:15px; font-weight:600; }
.dg-lb__close { min-width:44px; min-height:44px; margin:0; padding:8px 16px; border:1px solid rgb(255 255 255 / 55%); border-radius:999px; background:rgb(0 0 0 / 35%); color:#fff; cursor:pointer; font:inherit; font-size:15px; line-height:1.4; }
.dg-lb__stage { position:relative; flex:1 1 auto; min-height:0; display:flex; align-items:center; justify-content:center; padding:0 12px; touch-action:pan-y pinch-zoom; }
.dg-lb__img { display:block; width:auto; height:auto; max-width:min(100%, 760px); max-height:calc(100vh - 150px); max-height:calc(100dvh - 150px); border-radius:12px; object-fit:contain; user-select:none; -webkit-user-drag:none; }
.dg-lb__nav { position:absolute; top:50%; display:grid; place-items:center; width:48px; height:48px; margin:0; padding:0; transform:translateY(-50%); border:1px solid rgb(255 255 255 / 60%); border-radius:50%; background:rgb(0 0 0 / 45%); color:#fff; cursor:pointer; font:inherit; font-size:32px; line-height:1; }
.dg-lb__nav span { margin-top:-4px; }
.dg-lb__nav--prev { left:12px; }
.dg-lb__nav--next { right:12px; }
.dg-lb__nav:disabled { opacity:0; pointer-events:none; }
.dg-lb__caption { margin:0; padding:10px 16px 18px; font-size:15px; line-height:1.5; text-align:center; }
.dg-lb__close:focus-visible,.dg-lb__nav:focus-visible { outline:3px solid #8fe0c4; outline-offset:3px; }
@media (min-width:900px) {
  .dg-lb__nav--prev { left:calc(50% - 440px); }
  .dg-lb__nav--next { right:calc(50% - 440px); }
}

@media print {
  .dg-top,.dg-lb,.entry-content .dg-grid__hint { display:none !important; }
  .entry-thumbnail.dg-thumb-hidden { display:block !important; }
  .entry-content .dg-grid__open { transform:none; }
}
