/* 하위 메뉴(게시판·콘텐츠·자가검진) 모바일 폭(767px 이하) 다듬기 — hmt-front#44
   원본 CSS(style.css·sub.css·bootstrap·board.css·selfcheck.css)는 건드리지 않고
   이 파일에서 덮어쓴다. 768px 이상(태블릿·PC)에는 어떤 규칙도 적용하지 않는다.
   첫 화면(/)은 #43에서 끝났으므로 .page-header / .sub_layout / #ctt_con 처럼
   하위 페이지에만 있는 요소로 범위를 좁힌다. */

@media (max-width: 767px) {

    /* ── 공통 상단 사진 띠 ─────────────────────────────────── */
    .page-header {
        height: 176px !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin-bottom: 14px !important;
        position: relative !important;
        overflow: hidden;
        background-size: cover !important;
        background-position: center center !important;
    }

    /* 사진 아래쪽을 어둡게 깔아 흰 제목·경로가 묻히지 않게 한다 */
    .page-header::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.18) 0%,
            rgba(0, 0, 0, 0.04) 38%,
            rgba(0, 0, 0, 0.62) 100%);
        pointer-events: none;
        z-index: 0;
    }

    .page-header > .container {
        position: relative;
        z-index: 1;
        height: 100%;
        max-width: 100% !important;
        padding: 0 16px 16px !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: flex-start;
    }

    .page-header h1,
    .page-header h1.s_tit,
    .page-header .display-3,
    .page-header .display-6 {
        color: #fff !important;
        font-size: 23px !important;
        line-height: 1.3 !important;
        font-weight: 700 !important;
        letter-spacing: -0.01em !important;
        margin: 0 0 5px !important;
        text-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
    }

    .page-header .breadcrumb {
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        font-size: 13px !important;
        line-height: 1.4 !important;
        flex-wrap: wrap;
        row-gap: 2px;
    }

    .page-header .breadcrumb-item,
    .page-header .breadcrumb-item a,
    .page-header .breadcrumb-item.active {
        color: rgba(255, 255, 255, 0.92) !important;
        font-size: 13px !important;
        font-weight: 400 !important;
    }

    .page-header .breadcrumb-item u {
        text-decoration-color: rgba(255, 255, 255, 0.6);
        text-underline-offset: 2px;
    }

    .page-header .breadcrumb-item + .breadcrumb-item::before {
        color: rgba(255, 255, 255, 0.5) !important;
        padding: 0 6px !important;
    }

    /* 게시판에만 있는 모바일 전용 경로 — 데스크톱에서는 인라인 display:none 으로 숨긴다 */
    .page-header .crumb_mobile {
        display: block !important;
    }

    /* ── 본문 틀 · 좌우 여백 16px ─────────────────────────── */
    .page-header + .container-xxl {
        padding: 18px 0 30px !important;
    }

    .page-header + .container-xxl > .container {
        max-width: 100% !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .sub_layout,
    .sub_layout.w1440 {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 좁은 화면에서는 좌측 메뉴를 접고 본문을 폭 전체로 쓴다(원본은 450 이하만 접는다) */
    .sub_layout .lnb {
        display: none !important;
    }

    .sub_cont {
        width: 100% !important;
        max-width: 100% !important;
    }

    .s_tit_box {
        margin-bottom: 18px !important;
    }

    .s_tit_box .s_tit {
        font-size: 22px !important;
        line-height: 1.3 !important;
        padding: 4px 0 12px !important;
        margin: 0 !important;
    }

    /* ── 글자 꺾임·넘침 공통 ──────────────────────────────── */
    .sub_cont,
    .sub_cont p,
    .sub_cont li,
    .sub_cont dd,
    .sub_cont dt,
    .sub_cont td,
    .sub_cont th,
    .sub_cont h2,
    .sub_cont h3,
    .sub_cont h4,
    #ctt_con,
    #ctt_con p {
        word-break: keep-all !important;
        overflow-wrap: break-word;
    }

    .sub_cont img,
    #ctt_con img {
        max-width: 100% !important;
    }

    /* 카카오 로드맵은 타일 이미지에 인라인 width/height 를 쓰므로 건드리지 않는다 */
    .root_daum_roughmap img,
    .root_daum_roughmap_landing img,
    #daumRoughmapContainer1625037878290 img {
        max-width: none !important;
    }

    /* ── 게시판 목록 — 한 줄 목록형(제목 + 아래 날짜) ──────── */
    .bo_mobile_list thead {
        display: none !important;
    }

    .bo_mobile_list table,
    .bo_mobile_list tbody {
        display: block !important;
        width: 100% !important;
        border-top: 0 !important;
    }

    .bo_mobile_list tr {
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        gap: 2px 8px;
        padding: 13px 4px !important;
        border-bottom: 1px solid #eef1f5 !important;
        background: transparent !important;
    }

    .bo_mobile_list tr.bo_notice {
        padding: 12px 10px !important;
        border-bottom-color: #f8e6ee !important;
        border-radius: 8px;
        background: #fff6fa !important;
    }

    .bo_mobile_list td {
        display: block !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        text-align: left !important;
    }

    .bo_mobile_list .td_num2,
    .bo_mobile_list .td_name,
    .bo_mobile_list .td_num {
        display: none !important;
    }

    /* 공지 행의 '공지' 표시는 남긴다 */
    .bo_mobile_list .bo_notice .td_num2 {
        display: inline-flex !important;
        flex: 0 0 auto;
        order: 0;
    }

    .bo_mobile_list .notice_icon {
        display: inline-flex;
        align-items: center;
        height: 22px;
        padding: 0 8px;
        border-radius: 999px;
        background: #f9267f;
        color: #fff !important;
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
        letter-spacing: 0;
    }

    .bo_mobile_list .td_subject {
        order: 1;
        flex: 1 1 0%;
        min-width: 0;
    }

    .bo_mobile_list .bo_tit {
        display: flex !important;
        align-items: center;
        gap: 5px;
        min-width: 0;
    }

    .bo_mobile_list .bo_tit a {
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        flex: 1 1 auto;
        min-width: 0;
        color: #1f2430 !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        line-height: 1.45 !important;
        word-break: keep-all;
    }

    .bo_mobile_list .bo_tit i {
        flex: none;
    }

    .bo_mobile_list .td_datetime {
        order: 2;
        flex: 1 1 100%;
        width: auto !important;
        margin-top: 3px;
        color: #94a3b8 !important;
        font-size: 12px !important;
        line-height: 1.3 !important;
        text-align: left !important;
        white-space: nowrap !important;
    }

    .bo_mobile_list .empty_table {
        display: block !important;
        padding: 30px 0 !important;
        text-align: center !important;
        color: #8a93a2;
    }

    .pg_wrap {
        margin: 18px 0 26px !important;
    }

    /* ── 연혁(1020) — 연도 탭을 가로 스크롤로 ─────────────── */
    .history .his_tab {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        gap: 6px;
        overflow-x: auto !important;
        overflow-y: hidden;
        padding: 0 0 8px !important;
        margin-bottom: 14px !important;
        -webkit-overflow-scrolling: touch;
    }

    .history .his_tab::before,
    .history .his_tab::after,
    .history .his_tab > span {
        display: none !important;
    }

    .history .his_tab li {
        width: auto !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
    }

    .history .his_tab li button {
        width: auto !important;
        padding: 9px 14px !important;
        border: 1px solid #dfe5ec !important;
        border-radius: 999px !important;
        background: #fff !important;
        color: #555 !important;
        font-size: 14px !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
    }

    .history .his_tab li .nav-link.active {
        background: #65bb50 !important;
        border-color: #65bb50 !important;
        color: #fff !important;
        font-weight: 700 !important;
    }

    .history .his_tab li .nav-link.active::before {
        display: none !important;
    }

    .history .his_year {
        margin-top: 16px !important;
    }

    .history .his_year .his_wrap {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        margin-bottom: 18px;
    }

    .history .his_year .his_tit {
        width: auto !important;
        margin: 0 0 8px !important;
        font-size: 30px !important;
        line-height: 1.1 !important;
    }

    .history .his_year .history_line {
        display: none !important;
    }

    /* 원본 sub.css(런타임 주입)의 `.history .his_year dl{margin-top:100px !important}` 를
       이기려고 .his_wrap 을 한 단계 더 붙여 특이도를 높인다. */
    .history .his_year .his_wrap dl {
        width: 100% !important;
        flex: none !important;
        margin: 10px 0 0 !important;
        padding-left: 16px !important;
    }

    .history .his_year dl dd {
        margin-bottom: 8px !important;
        font-size: 14px !important;
        line-height: 1.6 !important;
    }

    .history .his_year dl dd::before {
        top: 9px;
        left: -14px;
    }

    /* ── 조직도(1040) — 상단 도형을 세로로 쌓는다 ─────────── */
    .organization_chart .org_high {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        height: auto !important;
        gap: 12px;
        margin-bottom: 20px !important;
    }

    .organization_chart .org_high .org_col_3 {
        width: 100% !important;
        height: auto !important;
        display: flex;
        justify-content: center;
    }

    .organization_chart .org_top_01,
    .organization_chart .org_top_02,
    .organization_chart .org_border_r {
        width: auto !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        box-sizing: border-box;
    }

    /* 운영위원회·센터장 — 글자에 맞춰 줄어 테두리에 닿지 않게 좌우 여백과 최소 너비를 준다.
       (원본은 width:220px·line-height:65px 인 알약인데, 모바일 width:auto 가 이를 글자 폭까지 줄였다.) */
    .organization_chart .org_border_r {
        min-width: 170px;
        padding: 10px 24px !important;
        white-space: nowrap;
    }

    /* 천주의 성 요한 의료봉사 수도회 — 안쪽 두 줄의 인라인 font-size 보다 우선한다 */
    .organization_chart .org_top_01 {
        min-width: 236px;
        padding: 12px 20px !important;
    }

    .organization_chart .org_top_01 > div {
        font-size: 15px !important;
        line-height: 1.4 !important;
        word-break: keep-all;
        overflow-wrap: break-word;
    }

    .organization_chart .org_top_01 > div + div {
        margin-top: 3px !important;
        font-size: 11.5px !important;
        font-weight: 300 !important;
        word-break: normal;
    }

    .organization_chart .org_top_01 img,
    .organization_chart .org_top_02 img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* 세로로 쌓으면 위쪽 가로·세로 점선은 의미가 없다 */
    .organization_chart .org_high:first-child::before,
    .organization_chart .org_high:first-child::after {
        display: none !important;
    }

    /* ── 지역사회 자원정보(3030) — 탭 가로 스크롤 · 표를 카드로 ── */
    .medical_map .map_tab ul,
    .medical_map .map_tab2 ul {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        padding-bottom: 4px !important;
        -webkit-overflow-scrolling: touch;
    }

    .medical_map .map_tab ul li,
    .medical_map .map_tab2 ul li {
        width: auto !important;
        flex: 0 0 auto !important;
    }

    .medical_map .map_tab ul li a,
    .medical_map .map_tab2 ul li a {
        padding: 0 12px;
        font-size: 13px !important;
        white-space: nowrap !important;
    }

    .table_list1 {
        display: block !important;
        width: 100% !important;
        border: 0 !important;
        border-top: 0 !important;
        background: transparent !important;
        table-layout: auto !important;
    }

    .table_list1 tbody {
        display: block !important;
    }

    .table_list1 tbody tr {
        display: block !important;
        margin-bottom: 10px;
        padding: 12px 14px !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 10px;
        background: #fff !important;
    }

    /* 첫 줄은 표 머리글 — 카드에서는 감춘다 */
    .table_list1 tbody tr:first-child {
        display: none !important;
    }

    .table_list1 tbody td,
    .table_list1 tbody th {
        display: block !important;
        width: auto !important;
        margin: 0 !important;
        padding: 2px 0 !important;
        border: 0 !important;
        background: transparent !important;
        color: #444 !important;
        font-size: 14px !important;
        line-height: 1.55 !important;
        text-align: left !important;
    }

    .table_list1 tbody td:nth-child(1) {
        display: none !important;
    }

    /* 의료기관 안내(/hmt/medical_001007006~010.html)는 첫 칸이 「구분」이라 감추면 안 된다.
       3030 탭 표(첫 칸 번호)는 위 규칙대로 감추고, 이 표들만 라벨을 붙여 보이게 한다. */
    .medical_map > .contentBody > .table_list1 tbody td:nth-child(1) {
        display: block !important;
    }

    .medical_map > .contentBody > .table_list1 tbody td:nth-child(1)::before {
        content: "구분";
        display: inline-block;
        min-width: 52px;
        color: #8a93a2;
        font-size: 13px;
        font-weight: 600;
    }

    .table_list1 tbody td:nth-child(2) {
        color: #1f2430 !important;
        font-size: 15px !important;
        font-weight: 700 !important;
    }

    .table_list1 tbody td:nth-child(2)::before {
        content: "기관명";
        display: inline-block;
        min-width: 52px;
        color: #8a93a2;
        font-size: 13px;
        font-weight: 600;
    }

    .table_list1 tbody td:nth-child(3)::before {
        content: "주소";
        display: inline-block;
        min-width: 52px;
        color: #8a93a2;
        font-size: 13px;
        font-weight: 600;
    }

    .table_list1 tbody td:nth-child(4)::before {
        content: "연락처";
        display: inline-block;
        min-width: 52px;
        color: #8a93a2;
        font-size: 13px;
        font-weight: 600;
    }

    .table_list1 tbody td:nth-child(5)::before {
        content: "홈페이지";
        display: inline-block;
        min-width: 52px;
        color: #8a93a2;
        font-size: 13px;
        font-weight: 600;
    }

    .table_list1 tbody td:nth-child(5) img {
        width: 18px;
        height: 18px;
        vertical-align: middle;
    }

    /* ── P/G 신청(503010) — 탭·동영상·신청 표 ─────────────── */
    .pg_menu .pg_tab > .tab-nav {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 6px;
        justify-content: space-between !important;
        margin-bottom: 20px !important;
    }

    .pg_menu .pg_tab > .tab-nav > .tnb {
        width: auto !important;
        flex: 1 1 0 !important;
        min-width: 0;
        margin: 0 !important;
        border: 1px solid #e8e8e8 !important;
    }

    .pg_menu .pg_tab > .tab-nav > .tnb a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 50px;
        padding: 6px 4px !important;
        font-size: clamp(11.5px, 3.6vw, 13px) !important;
        line-height: 1.3 !important;
        letter-spacing: -0.03em;
        text-align: center;
        white-space: normal !important;
        word-break: keep-all;
        overflow-wrap: break-word;
    }

    .video_wrap {
        display: block !important;
    }

    .program_v {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 14px 0 0 !important;
    }

    .program_v iframe,
    .video_wrap iframe {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9;
        margin: 0 !important;
    }

    .program_v .program_txt,
    .stress_tit {
        width: auto !important;
        max-width: 100% !important;
    }

    .program_table {
        display: table !important;
        width: 100% !important;
        max-width: 100% !important;
        font-size: 13px !important;
    }

    .program_table th,
    .program_table td {
        padding: 8px 6px !important;
        word-break: keep-all;
    }

    /* ── 게시글 상세 ──────────────────────────────────────── */
    .hmt-post header h2 {
        font-size: 20px !important;
        line-height: 1.4 !important;
    }

    .hmt-post-nb li {
        gap: 8px;
        font-size: 14px;
    }

    .hmt-post-nb a {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        word-break: keep-all;
    }
}
