/**
 * news-nhx-mobile.css — 뉴스포털 인덱스 nhx 골격 모바일 고도화 (CSS only).
 *  마크업/PHP 변경 없음. 폭·간격·썸네일 크기는 clamp()/%/min() 으로 보간하여
 *  280px ~ 1024px 사이의 모든 화면에서 자연스럽게 반응한다(하드코딩 px 단계 금지).
 *  폰트는 9단계 토큰(--fs-*) 만 사용.
 */

/* ─────────────────────────────────────────────
 * 0) EDITOR'S PICK · HOT — 모든 폭에서 반응형 (≤1024px 공통 SSOT)
 *    미디어쿼리 분기 대신 clamp/min/%·min-width:0·overflow:hidden 으로 대응.
 * ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  /* (A) 추천뉴스 / 실시간뉴스 2탭 (jhi-editor-line) : 세로 리스트 */
  .jhi-editor-line {
    display: block !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 0 clamp(14px, 3vw, 22px);
    padding: 0;
    background: #fff;
    border: 1px solid var(--jhi-line);
    border-top: 4px solid var(--jhi-ink);
    border-radius: 0;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
  }
  /* 모바일에서도 탭바는 동일 패턴(상단 행) — 패널은 기존 jhi-editor-scroll 모바일 스타일 그대로 적용 */
  .jhi-pick-tabs.jhi-editor-line {
    padding: 0;
  }
  .jhi-pick-tabbar {
    display: flex !important;
    gap: 0;
    width: 100%;
    border-bottom: 1px solid var(--jhi-line);
    background: #f8fafc;
  }
  .jhi-pick-tab {
    flex: 1 1 50%;
    justify-content: center;
    padding: 12px 8px;
    font-size: var(--fs-md, 17px);
    font-weight: 800;
    color: var(--jhi-muted, #64748b);
    border-right: 1px solid var(--jhi-line);
  }
  .jhi-pick-tab:last-of-type { border-right: 0; }
  .jhi-pick-panel {
    padding: clamp(2px, 1vw, 6px) clamp(10px, 3vw, 18px) clamp(2px, 1vw, 8px);
  }
  /* 활성 패널: 데스크톱은 flex(가로 스크롤), 모바일은 block(세로 리스트) */
  #jhi-pick-rec:checked  ~ .jhi-pick-panel--rec,
  #jhi-pick-live:checked ~ .jhi-pick-panel--live {
    display: block;
  }
  .jhi-editor-line strong {
    display: inline-flex !important;
    align-items: center;
    align-self: auto !important;
    height: clamp(26px, 6.5vw, 32px) !important;
    margin: 0 0 clamp(8px, 2vw, 12px) !important;
    padding: 0 clamp(10px, 2.5vw, 14px) !important;
    background: var(--jhi-ink) !important;
    color: #fff !important;
    font-size: var(--fs-xs, 14px) !important;
    font-weight: 900;
    letter-spacing: 0.06em;
    border-radius: 999px !important;
  }
  .jhi-editor-scroll {
    display: block !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible !important;
    gap: 0 !important;
    padding: 0 !important;
  }
  .jhi-editor-scroll > a,
  .jhi-editor-scroll > span {
    position: relative;
    display: block !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: clamp(10px, 2.6vw, 14px) 4px clamp(10px, 2.6vw, 14px) clamp(14px, 4vw, 20px);
    border-bottom: 1px solid var(--jhi-line);
    color: var(--jhi-ink) !important;
    font-size: var(--fs-base, 16px) !important;
    font-weight: 700 !important;
    line-height: 1.42;
    white-space: normal !important;
    word-break: keep-all;
    overflow-wrap: break-word;
    overflow: visible;
    text-overflow: clip;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    box-sizing: border-box;
  }
  .jhi-editor-scroll > a::before,
  .jhi-editor-scroll > span::before {
    content: "";
    position: absolute;
    left: 4px;
    top: clamp(16px, 4.5vw, 22px);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--jhi-brand, #dc2626);
  }
  .jhi-editor-scroll > a:last-child,
  .jhi-editor-scroll > span:last-child { border-bottom: 0; }
  .jhi-editor-scroll > a:active { background: #f8fafc; }

  /* (B) HOT : 세로 랭킹 리스트 — 박스 폭 100%, 트랙·썸은 clamp 보간 */
  .jhi-play-zone {
    display: grid !important;
    gap: clamp(12px, 3vw, 18px);
    margin-bottom: clamp(18px, 4vw, 28px);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
  }
  .jhi-fun-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
  }
  .jhi-hot-strip {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0 !important;
    background: transparent !important;
    border: 1px solid var(--jhi-line);
    border-top: 4px solid #dc2626;
    border-radius: 0 !important;
    overflow: hidden;
    box-sizing: border-box;
  }
  .jhi-hot-head {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: clamp(8px, 2vw, 12px) !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: clamp(40px, 10vw, 48px) !important;
    height: auto !important;
    padding: clamp(8px, 2vw, 12px) clamp(10px, 3vw, 14px) !important;
    background: linear-gradient(90deg, #dc2626, #ef4444) !important;
    border-radius: 0 !important;
    overflow: visible;
    box-sizing: border-box;
  }
  .jhi-hot-head span {
    flex: 0 0 auto;
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: clamp(22px, 5.5vw, 26px) !important;
    padding: 0 clamp(8px, 2vw, 12px) !important;
    background: rgba(0, 0, 0, 0.28) !important;
    color: #fff;
    font-size: var(--fs-xs, 14px) !important;
    font-weight: 900;
    border-radius: 999px;
  }
  /* 1위 기사 제목 — 줄임 없음. 길면 2줄/3줄로 자연 줄바꿈 */
  .jhi-hot-head a,
  .jhi-hot-head strong {
    display: block !important;
    flex: 1 1 auto !important;
    align-self: center;
    min-width: 0 !important;
    max-width: 100% !important;
    color: #fff !important;
    font-size: var(--fs-base, 16px) !important;
    font-weight: 900 !important;
    line-height: 1.32 !important;
    white-space: normal !important;
    word-break: keep-all;
    overflow-wrap: break-word;
    overflow: visible !important;
    text-overflow: clip !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
  }
  .jhi-hot-cards {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    padding: 0 !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
  }
  /* 그리드 3열 폭은 화면에 따라 보간:
   *   숫자  : 24~36px
   *   썸네일: 14vw 기준 48~72px
   *   본문  : 남는 폭 전부 (minmax(0,1fr) — min-width:0 필수) */
  .jhi-hot-card {
    display: grid !important;
    grid-template-columns: clamp(24px, 7vw, 36px) clamp(48px, 14vw, 72px) minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: clamp(4px, 1.2vw, 8px) clamp(8px, 2.4vw, 12px) !important;
    align-items: start !important;
    align-content: start !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: clamp(10px, 2.8vw, 14px) clamp(8px, 2.4vw, 12px) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--jhi-line) !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    transform: none !important;
    overflow: hidden;
    box-sizing: border-box;
  }
  .jhi-hot-card:last-child { border-bottom: 0 !important; }
  .jhi-hot-card:hover,
  .jhi-hot-card:focus-visible { transform: none !important; box-shadow: none !important; }
  .jhi-hot-card:active { background: #f8fafc !important; }
  .jhi-hot-card b {
    grid-column: 1 !important;
    grid-row: 1 / -1 !important;
    align-self: center !important;
    text-align: center;
    color: #dc2626 !important;
    font-size: var(--fs-xl, 20px) !important;
    font-weight: 900 !important;
    line-height: 1;
    font-style: italic;
  }
  .jhi-hot-thumb {
    grid-column: 2 !important;
    grid-row: 1 / -1 !important;
    align-self: start !important;
    width: 100% !important;
    max-width: clamp(48px, 14vw, 72px) !important;
    aspect-ratio: 1 / 1;
    height: auto !important;
    border-radius: 4px !important;
    flex-shrink: 0;
  }
  /* min-width:0 없으면 긴 한국어 제목이 트랙을 밀어 우측 잘림 */
  .jhi-hot-card strong {
    grid-column: 3 !important;
    grid-row: 1 !important;
    align-self: start !important;
    display: block !important;
    width: 100%;
    min-width: 0 !important;
    max-width: 100% !important;
    color: var(--jhi-ink) !important;
    font-size: var(--fs-base, 16px) !important;
    font-weight: 800 !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: break-word;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    text-overflow: clip !important;
    overflow: hidden;
  }
  .jhi-hot-card em {
    grid-column: 3 !important;
    grid-row: 2 !important;
    align-self: start !important;
    display: block !important;
    width: 100%;
    min-width: 0 !important;
    max-width: 100% !important;
    color: var(--jhi-muted) !important;
    font-size: var(--fs-sm, 15px) !important;
    font-style: normal !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow: hidden;
  }

  /* news-nhx.css 기본값 덮어쓰기 — nowrap/line-clamp/ellipsis (PHP 전체 제목과 짝) */
  .jhi-editor-scroll a,
  .jhi-editor-scroll span {
    white-space: normal !important;
    text-overflow: clip !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    display: block !important;
  }
  .jhi-hot-head a,
  .jhi-hot-head strong {
    white-space: normal !important;
    text-overflow: clip !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
  }
  .jhi-hot-card strong {
    display: block !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    text-overflow: clip !important;
    overflow: visible !important;
  }
}

/* ─────────────────────────────────────────────
 * 1) <=1024px : 태블릿 — side-rail 풀폭 떨어진 후 카드 호흡 보강
 * ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .jhi-wrap { padding: 22px 0 56px; }

  .jhi-section { margin-top: 28px; }
  .jhi-section-head h2 { font-size: var(--fs-xl, 20px); }

  /* 태블릿부터 메가+스택 세로 1열(기존 2열은 좁은 화면에서 변화 없어 보임) */
  .jhi-hero {
    grid-template-columns: 1fr !important;
    gap: 18px;
  }
  .jhi-side-rail { gap: 14px; }

  /* 우측 vertical-tabs 패널 본문 가독성 */
  .jhi-vertical-tabs .jhi-tab-panel { padding: 14px 14px 18px; }
  .jhi-vertical-tabs .jhi-tab-panel a { padding: 10px 4px; }
}

/* ─────────────────────────────────────────────
 * 2) <=768px : 모바일 본격 최적화
 * ───────────────────────────────────────────── */
@media (max-width: 768px) {
  /* 본문 좌우 게이지 */
  .jhi-wrap { padding: 14px 0 40px; }
  /* .jhi-container width — layout.css SSOT (--news-page-inset-x-md) */

  /* 섹션 간 호흡 */
  .jhi-section { margin-top: 22px; }
  .jhi-section + .jhi-section { margin-top: 24px; }
  .jhi-section-head { gap: 8px; }
  .jhi-section-head h2 { font-size: var(--fs-lg, 18px); line-height: 1.3; }
  .jhi-section-head a { font-size: var(--fs-sm, 15px); }

  /* (a) EDITOR'S PICK / (i) HOT — §0 에서 ≤1024px 공통 SSOT 로 처리 */

  /* (b) hero-main : 메인 뉴스 — 터치 타겟·읽기 흐름 정돈 */
  .jhi-hero-main { padding-bottom: 18px; border-bottom: 1px solid var(--jhi-line); }
  .jhi-photo-main { aspect-ratio: 16 / 9; margin-bottom: 12px; border-radius: 6px; }
  .jhi-photo-main span { left: 10px; top: 10px; padding: 4px 10px; font-size: var(--fs-xs, 14px); }
  .jhi-hero-main h1 {
    margin: 8px 0 10px;
    font-size: var(--fs-2xl, 24px);
    font-weight: 900;
    line-height: 1.32;
    letter-spacing: -0.01em;
  }
  .jhi-hero-main p {
    margin: 0 0 10px;
    font-size: var(--fs-base, 16px);
    line-height: 1.55;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .jhi-hero-main .jhi-meta { font-size: var(--fs-sm, 15px); }

  /* (c) hero-stack : 가로 카드(썸/텍스트) 모바일 친화 */
  .jhi-hero-stack { gap: 6px; margin-top: 2px; }
  .jhi-hero-stack article {
    grid-template-columns: 110px minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 2px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--jhi-line);
  }
  .jhi-hero-stack .jhi-photo { aspect-ratio: 4 / 3; border-radius: 4px; }
  .jhi-hero-stack .jhi-hero-foot { gap: 1px; }
  .jhi-hero-stack h2 { font-size: var(--fs-md, 17px); line-height: 1.28; }
  .jhi-hero-stack .jhi-hero-foot .jhi-meta { font-size: var(--fs-sm, 15px); line-height: 1.15; }

  /* (d) side-rail : 카드형 변환, sticky 해제 */
  .jhi-side-rail { gap: 18px; position: static !important; }
  .jhi-rank-panel,
  .jhi-vertical-tabs {
    padding: 14px 14px 16px;
    border-radius: 6px;
    background: #fff;
  }
  .jhi-panel-head h2 { font-size: var(--fs-lg, 18px); }
  .jhi-panel-head a { font-size: var(--fs-sm, 15px); }
  .jhi-rank-panel ol { gap: 10px; }
  .jhi-rank-panel li {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 4px 10px;
    padding: 6px 0;
  }
  .jhi-rank-panel li::before { font-size: var(--fs-xl, 20px); }
  .jhi-rank-panel li a { font-size: var(--fs-base, 16px); line-height: 1.4; }
  .jhi-rank-panel li span { font-size: var(--fs-sm, 15px); }

  /* (d-2) vertical-tabs : 모바일 라벨 가로 스크롤·패널 카드 */
  .jhi-vertical-tabs { padding: 0; }
  .jhi-tab-labels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow-x: auto;
    scrollbar-width: none;
  }
  .jhi-tab-labels::-webkit-scrollbar { display: none; }
  .jhi-tab-labels label {
    min-height: 44px;       /* 터치 타겟 44px */
    padding: 0 10px;
    font-size: var(--fs-md, 17px);
    font-weight: 800;
  }
  .jhi-vertical-tabs .jhi-tab-panel { padding: 14px 14px 16px; }
  .jhi-vertical-tabs .jhi-tab-panel a {
    padding: 12px 4px;
    border-bottom: 1px solid var(--jhi-line);
  }
  .jhi-vertical-tabs .jhi-tab-panel a:last-child { border-bottom: 0; }
  .jhi-vertical-tabs .jhi-tab-panel strong { font-size: var(--fs-base, 16px); }
  .jhi-vertical-tabs .jhi-tab-panel span { font-size: var(--fs-sm, 15px); }

  /* (e) wing-grid : 모바일 가로 카드 (좌썸 우텍스트) */
  .jhi-wing-grid {
    grid-template-columns: 1fr !important;
    gap: 0;
    padding-bottom: 4px;
  }
  .jhi-wing-grid article {
    display: grid !important;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px 12px;
    align-items: start;
    padding: 14px 0;
    border-bottom: 1px solid var(--jhi-line);
  }
  .jhi-wing-grid article:last-child { border-bottom: 0; }
  .jhi-wing-grid .jhi-photo {
    aspect-ratio: 4 / 3;
    margin-bottom: 0;
    grid-row: 1 / 4;
    border-radius: 4px;
  }
  .jhi-wing-grid .jhi-badges { margin: 0 0 4px; }
  .jhi-wing-grid h2 {
    margin: 0;
    font-size: var(--fs-base, 16px);
    font-weight: 900;
    line-height: 1.38;
  }
  .jhi-wing-grid h2 a {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* (f) category-matrix : 1열 가로 카드형 (썸/제목/리스트) */
  .jhi-category-matrix {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .jhi-cat-card {
    padding: 16px 0 18px;
    border-bottom: 1px solid var(--jhi-line);
  }
  .jhi-cat-card:last-child { border-bottom: 0; }
  .jhi-cat-card h3 {
    margin: 0 0 10px;
    padding-bottom: 6px;
    font-size: var(--fs-lg, 18px);
  }
  .jhi-cat-card .jhi-photo {
    aspect-ratio: 16 / 10;
    margin-bottom: 8px;
    border-radius: 4px;
  }
  .jhi-cat-card h4 { font-size: var(--fs-base, 16px); line-height: 1.4; }
  .jhi-cat-card ul { gap: 8px; }
  .jhi-cat-card li {
    font-size: var(--fs-base, 16px);
    line-height: 1.45;
    padding: 4px 0 4px 12px;
  }

  /* (g) special / issue-board / local / more-grid : 2열 유지 + 호흡 */
  .jhi-special-grid,
  .jhi-issue-board-grid,
  .jhi-local-grid,
  .jhi-more-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
  }
  .jhi-special-grid h3,
  .jhi-issue-board-grid h3,
  .jhi-more-grid h3 {
    font-size: var(--fs-base, 16px);
    line-height: 1.38;
  }
  .jhi-special-main { grid-column: 1 / -1; }
  .jhi-special-main h3 { font-size: var(--fs-xl, 20px); }

  /* (h) photo-grid : 캡션 가독성 */
  .jhi-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .jhi-photo-grid a { min-height: 180px; border-radius: 4px; }
  .jhi-photo-grid span {
    padding: 12px;
    font-size: var(--fs-sm, 15px);
    line-height: 1.4;
  }

  /* (i) HOT — §0 에서 ≤1024px 공통 SSOT 로 처리 (clamp 기반) */

  /* 지역 티저 3열 그리드 → 가로 스와이프 카드 */
  /* 지역별 뉴스 v2 — 칩 탭은 가로 스와이프, 패널은 1열 */
  .jhi-region-teasers {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: clamp(12px, 3vw, 18px) !important;
    overflow: hidden;
    box-sizing: border-box;
  }
  .jhi-region-tabs {
    margin: 0 -4px clamp(10px, 2.5vw, 14px);
    gap: clamp(6px, 1.4vw, 8px);
  }
  .jhi-region-tabs label {
    height: clamp(34px, 9vw, 40px);
    padding: 0 clamp(10px, 2.6vw, 14px);
    gap: clamp(4px, 1vw, 6px);
    font-size: var(--fs-sm, 15px) !important;
  }
  .jhi-region-tabs label i { font-size: var(--fs-xs, 14px); }
  .jhi-region-tabs label em { height: clamp(20px, 5vw, 24px); }

  /* "현재 ▶ 여수" 배지 — 모바일에서 작게, 줄 바꿈 시 헤더 우측 정렬 유지 */
  .jhi-region-now {
    height: clamp(28px, 7vw, 32px);
    padding: 0 clamp(8px, 2vw, 12px);
    font-size: var(--fs-sm, 15px);
  }
  .jhi-region-now i { font-size: var(--fs-xs, 14px); }

  .jhi-region-panel .jhi-region-head h3 { font-size: var(--fs-base, 16px) !important; gap: 6px; }
  .jhi-region-now-pill { height: 20px; padding: 0 6px; font-size: var(--fs-xs, 14px); }
  .jhi-region-panel .jhi-region-head a { font-size: var(--fs-sm, 15px) !important; }

  /* lead — 좁은 화면(<= 480) 1열, 그 위는 가로 그대로(썸 110~140px) */
  .jhi-region-panel .jhi-region-lead,
  .jhi-region-empty .jhi-region-lead {
    grid-template-columns: clamp(110px, 32vw, 140px) minmax(0, 1fr) !important;
    gap: clamp(10px, 3vw, 14px) !important;
  }
  .jhi-region-lead-body b { font-size: var(--fs-base, 16px) !important; line-height: 1.34 !important; }
  .jhi-region-lead-body p { font-size: var(--fs-sm, 15px) !important; }

  .jhi-region-lines li {
    padding: clamp(10px, 2.4vw, 12px) 4px clamp(10px, 2.4vw, 12px) 14px !important;
  }
  .jhi-region-lines a { font-size: var(--fs-base, 16px) !important; }
  .jhi-region-lines em { font-size: var(--fs-sm, 15px) !important; }

  .jhi-play-head h2 { font-size: var(--fs-lg, 18px); }
  .jhi-play-head span,
  .jhi-play-head-all { font-size: var(--fs-sm, 15px); }
}

/* 매우 좁은 폰 — lead 1열로 떨어뜨리기 */
@media (max-width: 420px) {
  .jhi-region-panel .jhi-region-lead,
  .jhi-region-empty .jhi-region-lead {
    grid-template-columns: 1fr !important;
  }
  .jhi-region-panel .jhi-region-thumb,
  .jhi-region-empty .jhi-region-thumb {
    aspect-ratio: 16 / 9;
  }

  /* (j) 빠른 선택 4카드 — 가로형 + 라벨 잘림 방지(<=1024px 전용)
   *   · 1열 그리드: 아이콘 좌 + 본문 우 (기존 동작)
   *   · 좁은 폰(<=480px) 변환은 이 미디어쿼리 밖의 별도 480 블록에서 처리 */
  .jhi-action-grid {
    gap: clamp(8px, 2vw, 12px);
    grid-template-columns: 1fr;
  }
  .jhi-action-card {
    min-height: clamp(64px, 16vw, 76px);
    padding: clamp(10px, 2.6vw, 14px) clamp(12px, 3vw, 16px) clamp(10px, 2.6vw, 14px) clamp(14px, 3.4vw, 18px);
  }
  .jhi-action-icon {
    width: clamp(40px, 10.4vw, 48px);
    height: clamp(40px, 10.4vw, 48px);
    font-size: var(--fs-lg, 18px);
  }
  .jhi-action-head strong { font-size: var(--fs-md, 17px); }
  .jhi-action-preview { font-size: var(--fs-sm, 15px); }
  .jhi-action-sub { font-size: var(--fs-sm, 15px); }

  /* (k) news-gnb : 9개 메뉴 4열로 — 더 많은 카테고리 노출 */
  .jhi-news-gnb { gap: 0; }
  .jhi-news-gnb-item { border-right: 1px solid var(--jhi-line); }
  .jhi-news-gnb-link {
    min-height: 48px;          /* 터치 타겟 */
    font-size: var(--fs-base, 16px);
    padding: 0 8px;
  }

  /* (l) news-lnb : hover dropdown 모바일에서 click(focus)으로 동작 */
  .jhi-news-gnb-item:focus-within .jhi-news-lnb {
    display: grid !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    z-index: 50;
  }
  .jhi-news-lnb a { padding: 12px 10px; font-size: var(--fs-base, 16px); }

  /* (m) badges 터치 가독성 */
  .jhi-badges span {
    min-height: 26px;
    padding: 0 8px;
    font-size: var(--fs-xs, 14px);
  }
}

/* ─────────────────────────────────────────────
 * 3) <=480px : 작은 폰 — 1열 친화 + hero-stack 가로
 * ───────────────────────────────────────────── */
@media (max-width: 480px) {
  /* .jhi-container width — layout.css SSOT (--news-page-inset-x-sm) */

  /* HOT / EDITOR'S PICK 의 폭·간격은 §0 의 clamp 가 자동 보간 — 별도 단계 하드코딩 없음 */

  /* 빠른 선택 4카드 — 2×2 그리드 + 세로 정렬 (한국어 단어 잘림 방지) */
  .jhi-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }
  .jhi-action-card {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto;
    justify-items: center;
    text-align: center;
    gap: 6px;
    min-height: 132px;
    padding: 14px 10px 12px;
  }
  .jhi-action-card::before {
    width: auto;
    right: 0;
    height: 4px;
    bottom: auto;
  }
  .jhi-action-icon {
    width: 44px;
    height: 44px;
    font-size: var(--fs-lg, 18px);
  }
  .jhi-action-body { align-items: center; gap: 3px; }
  .jhi-action-head { justify-content: center; flex-wrap: wrap; }
  .jhi-action-head strong { font-size: var(--fs-base, 16px); }
  .jhi-action-preview { font-size: var(--fs-sm, 15px); line-height: 1.35; }
  .jhi-action-sub { font-size: var(--fs-sm, 15px); }

  /* 섹션 헤더 줄바꿈 허용 */
  .jhi-section-head { flex-wrap: wrap; row-gap: 4px; }
  .jhi-section-head h2 { font-size: var(--fs-lg, 18px); }

  /* hero-stack 가로 카드, 사진 비율 살림 */
  .jhi-hero-stack article {
    grid-template-columns: 96px minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 2px;
    padding-bottom: 4px;
  }
  .jhi-hero-stack .jhi-photo { aspect-ratio: 1 / 1; }

  /* wing-grid 썸 작게 */
  .jhi-wing-grid article { grid-template-columns: 100px minmax(0, 1fr); }

  /* category-matrix 사진 16:9 */
  .jhi-cat-card .jhi-photo { aspect-ratio: 16 / 9; }

  /* 2열 → 1열로 일부 변환 (issue-board / 포토는 2열 유지 — 사용자 지시 2026-05-24) */
  .jhi-special-grid,
  .jhi-more-grid,
  .jhi-local-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .jhi-special-grid > article,
  .jhi-more-grid > article,
  .jhi-local-grid > article {
    padding: 14px 0;
    border-bottom: 1px solid var(--jhi-line);
  }
  .jhi-special-grid > article:last-child,
  .jhi-more-grid > article:last-child,
  .jhi-local-grid > article:last-child { border-bottom: 0; }

  /* 오늘의 뉴스 키워드: 작은 폰에서도 2열 유지 (8/12개 빠른 스캔) */
  .jhi-issue-board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .jhi-issue-board-grid > article {
    padding: 12px 10px;
    border: 1px solid var(--jhi-line);
    background: var(--jhi-soft);
  }

  /* news-gnb 3열 */
  .jhi-news-gnb { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* photo-grid 1열 풀폭 */
  .jhi-photo-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .jhi-photo-grid a { min-height: 220px; }

  /* action-grid 2열 유지 (1열로 너무 길어지는 것 방지) */
  .jhi-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─────────────────────────────────────────────
 * 4) <=360px : 초소형 폰 안전망
 * ───────────────────────────────────────────── */
@media (max-width: 360px) {
  .jhi-hero-main h1 { font-size: var(--fs-xl, 20px); }
  .jhi-hero-stack article { grid-template-columns: 80px minmax(0, 1fr); }
  .jhi-wing-grid article  { grid-template-columns: 88px minmax(0, 1fr); }
  .jhi-news-gnb { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─────────────────────────────────────────────
 * 5) sticky 회피 — 모바일에서 nph subheader 와 본문 광고 sticky 가
 *    위·아래 동시에 잡히면 시야가 사라진다. side-rail 의 sticky 만
 *    해제하고 그 외 sticky 는 데스크탑에서만 유지.
 * ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .jhi-side-rail,
  .jhi-side-rail .jhi-rank-panel,
  .jhi-side-rail .jhi-vertical-tabs { position: static !important; top: auto !important; }
}

/* ─────────────────────────────────────────────
 * 6) 모바일 기본 터치 타겟·active 상태 (전 폰 공통)
 * ───────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .jhi-wrap a:active,
  .jhi-wrap button:active { opacity: 0.78; }
  .jhi-cat-card:hover { transform: none; }
}
