/* 6개 사이트 공통 — 초기화 · 배너 칸 · 모바일 하단 바 · PC 고정 문의 버튼 · 접근성.
   색은 각 사이트 style.css 의 변수(--bar-*, --float-*, --focus)로 바꾼다. */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; overflow-x: hidden; word-break: keep-all; overflow-wrap: break-word; line-break: strict; }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 12px 16px; border-radius: 8px; background: #111; color: #fff; text-decoration: none; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--focus, #2563eb); outline-offset: 3px; }

/* 사진: 자리를 먼저 잡고(aspect-ratio 는 각 사이트가 준다), 중심점은 모바일/PC 따로 */
.ph { position: relative; overflow: hidden; background: var(--ph-bg, rgba(0, 0, 0, .06)); }
.ph img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos-m, 50% 30%); }
@media (min-width: 900px) { .ph img { object-position: var(--pos-d, 50% 30%); } }

/* 배너 칸 — 비율은 config/banners.json 의 ratio 가 style 로 들어온다. 문구가 잘리지 않게 contain */
.banner { display: block; width: 100%; max-width: var(--banner-max, 1000px); margin-inline: auto; }
.banner a { display: block; border-radius: var(--banner-radius, 14px); overflow: hidden; text-decoration: none; }
.banner img { width: 100%; height: 100%; object-fit: contain; }
.banner .banner-slot { display: block; width: 100%; }
.banner-wrap { padding: var(--banner-pad, 28px 20px); }

/* 텔레그램 버튼 공통 구조 (색·크기는 사이트가 덮어쓴다) */
.tg-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 22px; border-radius: 999px; text-decoration: none; font-weight: 700; line-height: 1.25; }
.tg-btn svg { flex: none; width: 26px; height: 26px; }
.tg-btn .tg-text { display: flex; flex-direction: column; text-align: left; }
.tg-btn .tg-handle { font-size: .82em; font-weight: 500; opacity: .85; }

/* PC 고정 문의 버튼 */
.float-tg { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  background: var(--float-bg, #229ED9); color: var(--float-fg, #fff); }
@media (min-width: 900px) { .float-tg { display: inline-flex; } }

/* 모바일 하단 바 — 본문이 가려지지 않게 body 아래 여백을 같이 준다 */
.mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--bar-bg, rgba(255, 255, 255, .96));
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .12); backdrop-filter: blur(8px); }
.mbar a { flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; padding: 6px 8px; border-radius: 12px;
  text-decoration: none; font-weight: 700; font-size: 16px; text-align: center; line-height: 1.2; }
.mbar a svg { width: 20px; height: 20px; flex: none; }
.mbar .mbar-visit { background: var(--bar-visit-bg, #111); color: var(--bar-visit-fg, #fff); }
.mbar .mbar-tg { background: var(--bar-tg-bg, #229ED9); color: var(--bar-tg-fg, #fff); }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .mbar { display: none; }
  body { padding-bottom: 0; }
  /* PC 고정 버튼이 마지막 글·버튼을 가리지 않게 — 사이트 CSS 가 덮어써도 이 여백은 남긴다 */
  .page-end { padding-bottom: 104px !important; }
}

/* 등장 효과 — 모션 줄이기 설정이면 끔 */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
