/* 법무법인 JS 홈페이지 - 모바일 공통 */
:root {
  --green: #182A23;
  --green-deep: #122B23;
  --beige: #E6E0D0;
  --beige-light: #F2F0EA;
  --beige-mid: #E7E4DE;
  --gold: #6B5A2E;
  --text: #26282A;
  --text-2: #414549;
  --text-3: #5A5F64;
  --line: #D8D3C6;
  --line-2: #CFC9BA;
  --line-3: #E2DED3;
  --on-dark: #D9DDDA;
  --en: 'Montserrat', sans-serif;
  --callbar: 68px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--beige-mid); }
body {
  margin: 0 auto;
  max-width: 640px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--callbar) + env(safe-area-inset-bottom, 0px));
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: #FFFFFF;
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: var(--green); text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
main { flex: 1 0 auto; }
.nowrap { white-space: nowrap; }
/* 담당 분야 이름: 이름 중간에서는 줄을 바꾸지 않되, 한 줄보다 긴 이름은 칸 안에서 줄을 바꿉니다. */
.field { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--green); color: #FFFFFF; padding: 12px 20px; z-index: 100; }
.skip:focus { left: 0; }

/* 상단 */
.m-header { position: sticky; top: 0; z-index: 40; height: 56px; background: #FFFFFF; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 20px; }
/* 로고 링크: 모양은 그대로 두고 누르는 범위의 높이만 44px 로 */
.m-header__logo { display: flex; align-items: center; min-height: 44px; }
.m-header__logo img { display: block; height: 28px; width: auto; }
.m-header__menu, .m-drawer__close { width: 44px; height: 44px; border: 0; padding: 0; background: none; color: var(--green); display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* 전체 메뉴 */
.m-drawer { display: none; position: fixed; inset: 0; z-index: 90; max-width: 640px; margin: 0 auto; background: var(--green); color: #FFFFFF; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* 열림: 자바스크립트가 있으면 is-open, 없으면 주소의 #m-drawer(:target)로 엽니다. 자바스크립트가 준비되면 data-js 가 붙어 :target 은 쓰지 않습니다. */
.m-drawer.is-open, .m-drawer:not([data-js]):target { display: block; }
.m-drawer:focus { outline: none; }
.m-drawer__top { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 20px; }
.m-drawer__en { font-family: var(--en); font-size: 12px; font-weight: 700; letter-spacing: 4px; color: var(--beige); }
.m-drawer__close { color: #FFFFFF; }
.m-drawer__nav { padding: 8px 20px 40px; }
.m-drawer__group { padding: 16px 0; border-top: 1px solid #44554E; }
.m-drawer__main { display: block; font-size: 20px; line-height: 32px; font-weight: 700; color: #FFFFFF; }
.m-drawer__main.is-active { color: var(--beige); }
.m-drawer__subs { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; }
.m-drawer__subs a { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; color: #C9D2CD; }
body.is-drawer-open { overflow: hidden; }

/* 하위 화면 제목 영역 */
.m-subhero { height: 104px; background: var(--green); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.m-subhero__en { font-family: var(--en); font-size: 11px; font-weight: 600; letter-spacing: 4px; color: var(--beige); margin-bottom: 6px; }
.m-subhero__title { font-size: 24px; line-height: 34px; font-weight: 700; color: #FFFFFF; }
/* 제목 아래 한 줄 문구(구성원 화면) */
.m-subhero--copy { height: auto; min-height: 104px; padding: 18px 0; }
.m-subhero__copy { margin: 6px 0 0; padding: 0 20px; max-width: 100%; font-size: 14px; line-height: 22px; color: var(--beige); overflow-wrap: anywhere; }

/* 하위 메뉴 줄 */
.m-subnav { height: 48px; background: var(--beige-light); display: flex; align-items: center; gap: 22px; padding: 0 20px; overflow-x: auto; white-space: nowrap; font-size: 14px; font-weight: 500; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.m-subnav::-webkit-scrollbar { display: none; }
.m-subnav a { flex: none; height: 48px; display: inline-flex; align-items: center; position: relative; }
.m-subnav a.is-active { font-weight: 700; }
.m-subnav a.is-active::after { content: ''; position: absolute; left: 0; right: 0; bottom: 10px; height: 2px; background: var(--green); }

/* 구역 */
.m-sec { padding: 32px 20px; }
.m-sec--beige { background: var(--beige-light); }
.m-sec--dark { background: var(--green); color: #FFFFFF; }
.m-sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.m-sec-head__en { font-family: var(--en); font-size: 12px; line-height: 18px; font-weight: 700; letter-spacing: 2px; color: var(--gold); }
.m-sec-head__title { font-size: 20px; line-height: 30px; font-weight: 700; color: var(--green); }
.m-sec-head__more { flex: none; min-height: 44px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; }
.m-sec--dark .m-sec-head__en { color: var(--beige); }
.m-sec--dark .m-sec-head__title { color: #FFFFFF; }
.m-sec--dark .m-sec-head__more { color: var(--beige); }

/* 대표 이미지가 있는 글 카드 */
.m-list { display: flex; flex-direction: column; gap: 12px; }
.m-thumb-card { min-height: 116px; border: 1px solid var(--line-3); display: flex; color: var(--text); }
.m-thumb-card__img { flex: none; width: 114px; background: var(--beige-light); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.m-thumb-card__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 사진이 없는 글: 법인 로고를 가운데에 둡니다. */
.m-thumb-card__img--none img { width: 74px; height: auto; object-fit: contain; }
.m-thumb-card__body { flex: 1; min-width: 0; padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.m-thumb-card__cat { font-size: 12px; color: var(--gold); font-weight: 700; }
.m-thumb-card__title { font-size: 15px; line-height: 22px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-thumb-card__meta { font-size: 12px; color: var(--text-3); }

/* 글 카드 */
.m-post-card { min-height: 124px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; color: var(--text); }
.m-post-card--beige { background: var(--beige-light); }
.m-post-card--white { background: #FFFFFF; }
.m-post-card__cat { font-size: 12px; color: var(--gold); font-weight: 700; }
.m-post-card__title { font-size: 16px; line-height: 24px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-post-card__meta { font-size: 12px; color: var(--text-3); }

/* 글 한 줄 */
.m-post-rows { border-bottom: 1px solid var(--line-2); }
.m-post-row { min-height: 72px; padding: 14px 0; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; justify-content: center; gap: 4px; color: var(--text); }
.m-post-row__title { font-size: 15px; line-height: 22px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-post-row__meta { font-size: 12px; color: var(--text-3); }

/* 분류 단추(어두운 배경) */
.m-chips { display: flex; gap: 8px; margin: 0 -20px 16px; padding: 0 20px; overflow-x: auto; white-space: nowrap; font-size: 14px; scrollbar-width: none; }
.m-chips::-webkit-scrollbar { display: none; }
.m-chips a { flex: none; display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border: 1px solid #5E6F68; color: #EAE4D4; }
.m-chips a.is-active { background: var(--beige); border-color: var(--beige); color: var(--green); font-weight: 700; }

/* 꼬리표·단추 */
.m-tags { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.m-tag { display: inline-flex; align-items: center; min-height: 30px; max-width: 100%; padding: 4px 12px; background: var(--beige-light); font-weight: 500; overflow-wrap: anywhere; }
.btn-dark, .btn-beige, .btn-line { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; font-size: 15px; font-weight: 700; }
.btn-dark { background: var(--green); color: #FFFFFF; }
.btn-beige { background: var(--beige); color: var(--green); }
.btn-line { border: 1px solid #FFFFFF; color: #FFFFFF; font-weight: 500; }

/* 변호사 사진 배열 */
.lineup { display: flex; justify-content: center; align-items: flex-end; }
.lineup img { display: block; flex: none; height: 150px; width: 100px; max-width: none; object-fit: cover; object-position: top; }
.lineup img + img { margin-left: -42px; }
/* 화면이 390px 보다 좁으면(6장 × 100px − 겹침 5 × 42px = 390px) 화면 폭에 맞춰 같은 비율로 줄여 6장이 모두 보이게 합니다. */
@media (max-width: 389px) {
  .lineup { --lineup-w: calc(100vw / 3.9); }
  .lineup img { width: var(--lineup-w); height: calc(var(--lineup-w) * 1.5); }
  .lineup img + img { margin-left: calc(var(--lineup-w) * -0.42); }
}

/* 쪽 번호 */
.pagination { margin-top: 28px; display: flex; justify-content: center; gap: 6px; font-family: var(--en); font-size: 14px; font-weight: 700; }
.pagination a, .pagination span { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.pagination a.is-current { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.pagination .is-disabled { color: #B9B4A8; }
/* 칸이 44px 아래로 줄어들지 않게: 좁은 화면에서는 간격을 줄이고, 더 좁으면 현재 쪽에서 먼 번호를 숨깁니다. */
.pagination a, .pagination span { flex: none; }
@media (max-width: 383px) { .pagination { gap: 4px; } }
@media (max-width: 371px) {
  .pagination { gap: 6px; }
  .pagination a.is-far { display: none; }
}

/* 안내 문구 */
.m-empty { padding: 40px 0; text-align: center; font-size: 14px; color: var(--text-3); }
.m-sec--dark .m-empty { color: var(--on-dark); }
.empty-page { padding: 80px 20px; text-align: center; }
.empty-page h1 { font-size: 22px; color: var(--green); margin-bottom: 8px; }
.empty-page p { color: var(--text-2); margin-bottom: 24px; }

/* 하단 */
.m-footer { background: var(--green-deep); color: #C9D2CD; padding: 28px 20px 32px; font-size: 12px; line-height: 20px; }
.m-footer__logo { display: block; height: 26px; width: auto; margin-bottom: 12px; }
.m-footer__links { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.m-footer__links a { min-height: 44px; display: inline-flex; align-items: center; color: #FFFFFF; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

/* 전화 상담 고정 바 */
.m-callbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-width: 640px; margin: 0 auto; height: calc(var(--callbar) + env(safe-area-inset-bottom, 0px)); background: var(--beige); padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; }
.m-callbar a { display: flex; align-items: center; justify-content: center; font-size: 15px; }
.m-callbar__tel { flex: 2; background: var(--green); color: #FFFFFF; font-weight: 700; }
.m-callbar__map { flex: 1; background: #FFFFFF; color: var(--green); font-weight: 500; }

/* 하단 이메일(줄 간격은 그대로 두고 누르는 범위만 44px 로 넓힘) */
.m-footer__mail { display: inline-block; margin: -12px 0; padding: 12px 0; color: #C9D2CD; }

/* 메인 화면 배경 사진(서서히 바뀜) */
.hero-slides { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: var(--green); }
/* 새 사진(is-active)은 이전 사진(is-leaving) 위에서 서서히 나타납니다. 이전 사진은 그동안 불투명한 채로, 확대된 크기도 그대로 두었다가
   새 사진이 다 나타난 뒤에 숨깁니다(hero.js). 그래서 전환 중에 어두운 바탕이 비치거나 사진 크기가 갑자기 바뀌지 않습니다. */
.hero-slides video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.hero-slides video::-webkit-media-controls, .hero-slides video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
.hero-slide { position: absolute; inset: 0; z-index: 0; opacity: 0; }
.hero-slide.is-leaving { z-index: 1; opacity: 1; }
.hero-slide.is-active { z-index: 2; opacity: 1; transition: opacity 1.8s ease; }
.hero-slide img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; transform: scale(1.02); }
.hero-slide.is-active img, .hero-slide.is-leaving img { animation: hero-zoom 14s ease-out forwards; }
.hero-slides::after { content: ''; position: absolute; inset: 0; z-index: 3; background: linear-gradient(180deg, rgba(24, 42, 35, 0.72) 0%, rgba(24, 42, 35, 0.52) 55%, rgba(24, 42, 35, 0.78) 100%); }
@keyframes hero-zoom { from { transform: scale(1.02); } to { transform: scale(1.1); } }
/* 움직임 줄이기 설정: 사진을 바꾸지 않고 첫 사진만 보여 줍니다(hero.js 도 전환을 하지 않음). */
@media (prefers-reduced-motion: reduce) {
  .hero-slide.is-active { transition: none; }
  .hero-slide.is-active img, .hero-slide.is-leaving img { animation: none; }
}

/* 인스타그램 게시물 칸의 본문 띠(한 줄, 넘치면 말줄임) */
.ig-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 5px 8px; background: rgba(24, 42, 35, 0.88); color: #FFFFFF; font-size: 11px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }

/* 전화번호가 비어 있어 전화 상담 고정 바가 없을 때: 그 자리만큼 두던 아래 여백을 없앱니다. */
body.no-callbar { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* 상단 고정 머리(56px)에 가리지 않게: 쪽 안의 위치(#list, #cases 등)로 이동할 때 그만큼 띄웁니다. */
:where([id]) { scroll-margin-top: 56px; }

/* 초점 테두리: 어두운 배경 위에서는 금색이 잘 보이지 않으므로 밝은 색으로 바꿉니다. */
.m-drawer a:focus-visible, .m-drawer button:focus-visible, .m-subhero a:focus-visible, .m-sec--dark a:focus-visible, .m-sec--dark button:focus-visible, .m-footer a:focus-visible { outline-color: #FFFFFF; }
/* 밝은 띠 위의 어두운 단추는 단추 안쪽에 밝은 테두리를 그립니다. */
.m-callbar__tel:focus-visible { outline-color: #FFFFFF; outline-offset: -5px; }
/* 좌우로 미는 줄 안의 항목은 테두리가 잘리지 않게 안쪽에 그립니다. */
.m-subnav a:focus-visible, .m-chips a:focus-visible { outline-offset: -2px; }
.m-chips a.is-active:focus-visible { outline-color: var(--green); }

/* 띄어쓰기 없는 긴 글(주소 등)이 들어와도 화면이 옆으로 밀리지 않게 합니다. 보통 글의 줄바꿈(단어 단위)은 그대로입니다. */
.m-subhero__title, .m-sec-head__title, .m-thumb-card__title, .m-thumb-card__cat, .m-post-card__title, .m-post-card__cat, .m-post-row__title, .m-drawer__main, .empty-page h1 { overflow-wrap: anywhere; }
.m-subhero__title { max-width: 100%; padding: 0 20px; }
.m-sec-head > div { min-width: 0; }
.m-footer > div { overflow-wrap: anywhere; }
.m-drawer__subs a { min-width: 0; overflow-wrap: anywhere; }

/* 인쇄: 메뉴·전화 바·지도·배경 사진은 빼고, 어두운 구역은 흰 바탕에 검은 글씨로 찍습니다. */
@media print {
  .skip, .m-header__menu, .m-drawer, .m-subnav, .m-chips, .m-column-chips, .m-callbar, .pagination, .hero-slides, .m-footer__links, .m-footer__logo, iframe { display: none !important; }
  html { background: #FFFFFF; }
  body { max-width: none; min-height: 0; padding-bottom: 0 !important; }
  .m-header { position: static; }
  .m-index-hero, .m-subhero, .m-sec--dark, .m-index-sec--dark, .m-index-latest, .m-about-team, .m-consult-call, .m-instagram-account, .m-lawyer-top__blog, .m-footer { background: #FFFFFF !important; color: #26282A !important; }
  .m-index-hero *, .m-subhero *, .m-sec--dark *, .m-index-sec--dark *, .m-index-latest *, .m-about-team *, .m-consult-call *, .m-instagram-account *, .m-footer * { color: #26282A !important; }
  .m-index-hero { min-height: 0 !important; }
  .m-subhero { height: auto; padding: 16px 0; }
  .m-subhero, .m-footer { border-top: 1px solid #D8D3C6; border-bottom: 1px solid #D8D3C6; }
  .m-index-latest, .m-consult-call, .m-instagram-account, .m-lawyer-top__blog, .btn-line, .btn-dark { border: 1px solid #D8D3C6; }
  .btn-dark { background: #FFFFFF !important; color: #26282A !important; }
  [class*="-card"], .m-post-row, .m-notice-row, .m-index-lawyer, .m-index-practice__grid a, .m-about-point, .m-consult-step, .m-consult-office, .m-consult-call, .m-practice-lawyer, .m-practice-services li, .m-lawyer-record__rows > div, .m-lawyer-practices a, img { break-inside: avoid; page-break-inside: avoid; }
  h1, h2, h3, .m-sec-head, .m-index-head { break-after: avoid; page-break-after: avoid; }
}
