/* ==========================================================================
   bw-dlite.css — 상세 3종(관광지·맛집·숙소) 간결 화면 'dl1' (2026-11-19)
   html.bw-dl1 일 때만(includes/_detail_lite.php bw_dl_assets, 토글 feature_detail_lite).
   본문 시작(_shared_header 다음)에서 읽혀 헤더의 bw-ui4.css 보다 뒤 → 같은 구체성이면 이긴다.
   페이지 안 인라인 style 을 이겨야 하는 곳만 !important.
   ① 머리 아래 행동 단추 한 줄  ② 휴대폰 사진 16:9 + 출처는 사진 위  ③ 머리·요약 칸 촘촘히
   ④ 빠른 길찾기 한 줄 + '더 보기'  ⑤ 리뷰 안내 한 칸  ⑥ 아래 고정 바는 행동 단추가 지나간 뒤에만
   ========================================================================== */

/* ---------- ① 행동 단추 (전화 · 길찾기 · 저장 · 공유) ---------- */
html.bw-dl1 .dl-actions { display: flex; gap: 8px; align-self: start; flex-wrap: wrap; }
html.bw-dl1 .dl-act {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; box-sizing: border-box;
  border: 1px solid var(--bw-line, #E5E2DC); border-radius: 12px; background: #fff;
  color: var(--bw-ink-900, #14171C); font: inherit; font-size: 14px; font-weight: 700; line-height: 1.2;
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color .15s ease, background-color .15s ease;
}
html.bw-dl1 .dl-act .bw-icon { width: 18px; height: 18px; flex: 0 0 auto; color: #C2410C; }
/* bw-ui4.css(ux3·rd1)는 아래 고정 바에 공유가 있다며 머리의 공유 단추를 숨긴다(body:has(#dxShareBtn) — ID 구체성) — dl1 에선 고정 바가 늦게 나오므로 머리 한 줄에 둔다 */
html.bw-dl1 #bw-main :is(.sd-head, .fd-head, .stayd-head) .dl-actions button.dl-act[onclick*="navigator.share"] { display: inline-flex !important; }
html.bw-dl1 .dl-act:first-child { background: #C2410C; border-color: #C2410C; color: #fff; }
html.bw-dl1 .dl-act:first-child .bw-icon { color: #fff; }
html.bw-dl1 .dl-act[data-bw-save][aria-pressed="true"] { background: #FFF4EE; border-color: #C2410C; color: #C2410C; }
html.bw-dl1 .dl-act[data-bw-save][aria-pressed="true"]:first-child .bw-icon { color: #C2410C; }
@media (hover: hover) { html.bw-dl1 .dl-act:hover { border-color: #C2410C; } html.bw-dl1 .dl-act:first-child:hover { background: #9A3412; } }
html.bw-dl1 .dl-act:focus-visible { outline: 3px solid #FF5A1F; outline-offset: 2px; }
html.bw-dl1 .dl-act:active { transform: scale(.98); }

/* 관광지 '다녀왔어요'는 행동 단추 아래 작은 알약 하나 */
html.bw-dl1 .sd-actions.dl-sub { display: flex !important; gap: 8px; margin: 10px 0 0 !important; padding: 0 !important; }
html.bw-dl1 .sd-actions.dl-sub #bwCheckinBtn { flex: 0 0 auto !important; width: auto !important; height: auto !important; min-height: 36px; padding: 0 14px !important; font-size: 13px !important; border-radius: 999px; }
html.bw-dl1 .dl-sum > .sd-ai-summary { margin: 12px 0 0 !important; }

@media (max-width: 720px) {
  /* 머리(이름·상태·주소) 바로 아래 꽉 찬 한 줄 — 칸 수만큼 같은 폭, 아이콘 위·글자 아래 */
  html.bw-dl1 .dl-actions { display: grid; grid-template-columns: repeat(var(--dl-n, 4), minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
  html.bw-dl1 .dl-actions--n5 { --dl-n: 5; gap: 6px; }
  html.bw-dl1 .dl-actions--n5 .dl-act { font-size: 12.5px; padding: 8px 2px; }
  html.bw-dl1 .dl-actions--n3 { --dl-n: 3; }
  html.bw-dl1 .dl-actions--n2 { --dl-n: 2; }
  html.bw-dl1 .dl-actions--n1 { --dl-n: 1; }
  html.bw-dl1 .dl-act { flex-direction: column; gap: 4px; min-height: 58px; padding: 8px 4px; font-size: 13px; border-radius: 12px; }
  html.bw-dl1 .dl-act .bw-icon { width: 20px; height: 20px; }
  html.bw-dl1 .dl-act > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- ② 휴대폰 사진: 4:3 → 16:9(약 193px), 출처는 사진 바로 아래 작은 한 줄 ----------
   출처 글(공공누리·CC 라이선스 링크)은 사용 조건이라 잘라 숨기지 않는다 — 글자만 작게, 줄바꿈 허용 */
@media (max-width: 720px) {
  html.bw-dl1 .fd-gallery, html.bw-dl1 .sd-gallery, html.bw-dl1 .stayd-gallery { aspect-ratio: 16 / 9 !important; height: auto !important; max-height: 220px; }
  html.bw-dl1 .fd-gallery > div:first-child, html.bw-dl1 .sd-gallery > :first-child, html.bw-dl1 .stayd-gallery > :first-child { aspect-ratio: auto !important; height: 100% !important; }
  html.bw-dl1 .bw-photo-credit { margin: 4px 0 0 !important; font-size: 11px !important; line-height: 1.45 !important; color: var(--bw-ink-500, #5B6470) !important; }
}

/* ---------- ③ 머리·요약 칸을 촘촘하게 (휴대폰) ---------- */
@media (max-width: 720px) {
  html.bw-dl1 #bw-main > section.bw-container:has(.fd-head),
  html.bw-dl1 #bw-main > section.bw-container:has(.sd-head),
  html.bw-dl1 #bw-main > section.bw-container:has(.stayd-head) { padding-top: 6px !important; }
  html.bw-dl1 .fd-head, html.bw-dl1 .sd-head, html.bw-dl1 .stayd-head { padding-bottom: 14px !important; margin-bottom: 4px !important; }
  html.bw-dl1 .fd-cat-row, html.bw-dl1 .sd-cat-row, html.bw-dl1 .stayd-cat-row { gap: 6px !important; margin-bottom: 8px !important; }
  html.bw-dl1 .fd-cat-tag, html.bw-dl1 .sd-cat-tag, html.bw-dl1 .stayd-cat-tag { min-height: 0 !important; height: auto !important; padding: 3px 9px !important; font-size: 12.5px !important; }
  html.bw-dl1 .fd-cat-tag .bw-icon, html.bw-dl1 .sd-cat-tag .bw-icon, html.bw-dl1 .stayd-cat-tag .bw-icon { width: 13px; height: 13px; }
  html.bw-dl1 .fd-name, html.bw-dl1 .sd-name, html.bw-dl1 .stayd-name { font-size: 24px !important; line-height: 1.3 !important; margin: 0 0 6px !important; }
  html.bw-dl1 .fd-meta, html.bw-dl1 .sd-meta, html.bw-dl1 .stayd-meta { margin-top: 6px !important; row-gap: 6px !important; }

  /* 숙소: 사진 아래 작은 사진 줄은 휴대폰에서 생략(사진 넘김 화살표·'사진 전체 보기'가 있다), 평점 줄 끝의 남는 '·' 숨김 */
  html.bw-dl1 .stayd-thumbs { display: none !important; }
  html.bw-dl1 .stayd-meta .stayd-meta__dot { display: none; }

  /* 요약 칸(영업시간·전화 등): 큰 카드 → 얇은 칸 */
  html.bw-dl1 .fd-quick, html.bw-dl1 .sd-quick { gap: 8px !important; margin-bottom: 18px !important; }
  html.bw-dl1 .fd-quick-card, html.bw-dl1 .sd-quick-card { padding: 10px 12px !important; gap: 2px !important; border-radius: 12px !important; }
  html.bw-dl1 .fd-quick-card__label, html.bw-dl1 .sd-quick-card__label { font-size: 11.5px !important; }
  html.bw-dl1 .fd-quick-card__value, html.bw-dl1 .sd-quick-card__value { font-size: 15px !important; line-height: 1.35 !important; }
  html.bw-dl1 .fd-quick-card__sub, html.bw-dl1 .sd-quick-card__sub { font-size: 12.5px !important; line-height: 1.4 !important; }
}

/* ---------- ④ 빠른 길찾기: 단추 4개 한 줄 + 출발지·복사는 접기 ---------- */
html.bw-dl1 .dl-route { padding: 14px 16px !important; }
html.bw-dl1 .dl-route > h2 { font-size: 17px !important; margin: 0 0 10px !important; }
html.bw-dl1 .dl-route .dl-route__modes { gap: 6px !important; margin-bottom: 4px !important; }
html.bw-dl1 .dl-route .dl-route__m {
  min-height: 54px; padding: 8px 2px !important; gap: 3px !important; justify-content: center;
  background: #fff !important; border: 1px solid var(--bw-line, #E5E2DC) !important; border-radius: 10px !important;
}
html.bw-dl1 .dl-route .dl-route__m svg { width: 20px !important; height: 20px !important; color: #C2410C !important; }
html.bw-dl1 .dl-route .dl-route__m span { font-size: 12.5px !important; white-space: nowrap; }
@media (hover: hover) { html.bw-dl1 .dl-route .dl-route__m:hover { border-color: #C2410C !important; } }
html.bw-dl1 .dl-more { margin: 2px 0 0; }
html.bw-dl1 .dl-more > summary {
  display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 2px;
  list-style: none; cursor: pointer; font-size: 13px; font-weight: 700; color: #5B6470;
}
html.bw-dl1 .dl-more > summary::-webkit-details-marker { display: none; }
html.bw-dl1 .dl-more > summary .bw-icon { width: 14px; height: 14px; transition: transform .15s ease; }
html.bw-dl1 .dl-more[open] > summary .bw-icon { transform: rotate(180deg); }
html.bw-dl1 .dl-more > summary:focus-visible { outline: 3px solid #FF5A1F; outline-offset: 2px; border-radius: 6px; }
html.bw-dl1 .dl-more[open] { padding-bottom: 2px; }

/* ---------- ⑤ 리뷰: 안내 한 칸 + 단추 하나 ---------- */
html.bw-dl1 .dl-rv-cta {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  margin: 4px 0 12px; padding: 14px 16px; border: 1px solid #FFE0CC; border-radius: 12px; background: #FFF8F2;
}
html body.has-tabbar .dl-rv-cta p.dl-rv-cta__txt,
html.bw-dl1 .dl-rv-cta p.dl-rv-cta__txt { flex: 1 1 220px; margin: 0; font-size: 14px !important; line-height: 1.5 !important; color: var(--bw-ink-700, #374151); }
html.bw-dl1 .dl-rv-cta__txt strong { display: block; margin-bottom: 2px; font-size: 15.5px; color: var(--bw-ink-900, #14171C); }
html.bw-dl1 .dl-rv-cta__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 0 0 auto;
  min-height: 44px; padding: 0 18px; border-radius: 10px; background: #C2410C; color: #fff !important;
  font-size: 14px; font-weight: 800; text-decoration: none !important; white-space: nowrap;
}
html.bw-dl1 .dl-rv-cta__btn .bw-icon { width: 16px; height: 16px; color: #fff; }
@media (hover: hover) { html.bw-dl1 .dl-rv-cta__btn:hover { background: #9A3412; } }
html.bw-dl1 .dl-rv-cta__btn:focus-visible { outline: 3px solid #FF5A1F; outline-offset: 2px; }
@media (max-width: 480px) { html.bw-dl1 .dl-rv-cta__btn { flex: 1 1 100%; } }

/* ---------- ⑥ 아래 고정 바: 머리의 행동 단추가 화면 위로 지나간 뒤에만 ---------- */
@media (max-width: 920px) {
  html.bw-dl1 .dx-sticky-cta, html.bw-dl1 #stayd-stickybar { transition: transform .22s ease, visibility .22s; }
  html.bw-dl1:not(.dl-bar-on) .dx-sticky-cta,
  html.bw-dl1:not(.dl-bar-on) #stayd-stickybar { transform: translateY(calc(100% + 96px)) !important; visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  html.bw-dl1 .dx-sticky-cta, html.bw-dl1 #stayd-stickybar, html.bw-dl1 .dl-act, html.bw-dl1 .dl-more > summary .bw-icon { transition: none; }
}
