/* =============================================================
 * 2026 메인 개편 — 보조 스타일 (main.css 원본 무수정 원칙)
 * - 원본 디자인 산출물(main.css)은 그대로 두고,
 *   JSP 연동에 필요한 추가 UI(스킵링크·로그인영역·알림·슬라이드 상태)만 정의
 * ============================================================= */

/* common.css의 * { font-family: NotoSansKR } 직접 지정 상쇄 — 개편 디자인 폰트 복원
   (main.css는 body 상속 방식이라 전역 셀렉터에 밀림. 본 파일이 마지막에 로드되어 우선함) */
* {
  font-family: "Gmarket Sans", "Pretendard", "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
}
/* common.css body{letter-spacing:-1px} 상쇄 — 원본 디자인은 자간 조정 없음 */
body {
  letter-spacing: 0;
}

/* common.css input::placeholder{color:#000} 상쇄 —
   원본 디자인은 placeholder 규칙이 없으므로 revert로 브라우저 기본값 복원
   (크롬 #757575, 사파리/파이어폭스는 각자 기본 — 원본 샘플과 동일 렌더링) */
.search input::placeholder {
  color: revert;
  font-size: revert;
  font-weight: revert;
}

/* common.css의 .inner{max-width:1280px} 오버라이드 — 개편 디자인 폭(1430px) 유지 */
.inner {
  max-width: var(--max);
}

/* common.css의 footer{background:#141E2C; margin-top:80px} 상쇄 — 개편 푸터는 밝은 배경 */
footer.footer {
  margin-top: 0;
  background: var(--white);
}

/* 본문 바로가기 (reset.css 미로딩 환경 대응) */
.accessibility {
  overflow: hidden;
  z-index: 1000;
  width: 100%;
}
.accessibility a {
  position: absolute;
  top: -100%;
  left: 0;
  width: 120px;
  padding: 5px;
  border: 2px solid rgb(244, 186, 104);
  border-radius: 5px;
  font-size: 13px;
  color: #fff;
  background: #333;
  text-align: center;
}
.accessibility a:focus {
  top: 0;
}

/* ---- topbar 로그인 영역 ---- */
.topbar__inner a {
  color: inherit;
}
.topbar .log_timer {
  align-items: center;
  margin-right: 6px;
}
.topbar .log_timer time {
  font-variant-numeric: tabular-nums;
}
.topbar .log_timer a {
  color: var(--navy);
  width: 44px;
  height: 22px;
  font-size: 11px;
  margin-left: 8px;
}

/* ---- 사용자알림 카드 스택 (기획서 No.6: 메인 진입 시 우측 상단 자동 표시) ---- */
main#container {
  position: relative;
}
.ntf-stack {
  position: absolute;
  top: 20px;
  right: 24px; /* max() 미지원 브라우저 폴백 */
  right: max(24px, calc((100% - var(--max)) / 2));
  z-index: 9; /* 메뉴 펼침영역(.site-header z:10)보다 아래, 본문 콘텐츠보다는 위 */
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ntf-card {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 430px;
  max-width: 600px;
  padding: 17px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(7, 24, 43, 0.14);
  font-size: 15px;
  color: var(--ink);
}
.ntf-card__msg {
  margin: 0;
  flex: 1;
  line-height: 1.45;
}
.ntf-card__go {
  color: #1d75cd;
  font-weight: 700;
  text-decoration: underline;
  white-space: nowrap;
}
.ntf-card__close {
  border: 0;
  padding: 2px 4px;
  background: transparent;
  color: #e5484d;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
@media (max-width: 560px) {
  .ntf-stack {
    left: 12px;
    right: 12px;
  }
  .ntf-card {
    min-width: 0;
    width: 100%;
    font-size: 13px;
    gap: 10px;
    padding: 12px 14px;
  }
}

/* ---- 슬라이드(알려드립니다·홍보자료) DB 다건 렌더링 상태 ---- */
.notice-visual .mobility-card {
  display: none;
}
.notice-visual .mobility-card.is-active {
  display: block;
}
.promo .video-card {
  display: none;
}
.promo .video-card.is-active {
  display: block;
}

/* ---- 알려드립니다 : 카드뉴스 2건 동시 노출 (2026-08) ----
   운영 카드뉴스 썸네일은 12건 중 11건이 정사각(1:1)이다. 기존 805×340(2.37:1) 한 장 배치에서는
   object-fit:cover 로 세로의 43%만 보이고 나머지가 잘렸다.
   2단 그리드로 카드 폭을 절반(약 395px)으로 줄이고 박스를 1:1 로 맞춰 잘림을 없앤다. */
.notice-visual .mobility-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
/* 카드가 1건만 등록된 경우 — 카드 크기는 그대로 두고 가운데 정렬(반쪽만 차서 비어 보이는 것 방지) */
.notice-visual .mobility-cards.is-single {
  grid-template-columns: minmax(0, calc(50% - 9px));
  justify-content: center;
}
/* 좁은 화면에서는 2단으로 쪼개면 카드가 너무 작아 본문이 읽히지 않는다 → 1건씩 전체 폭
   (main-page.js 의 perPage 도 같은 560px 기준으로 1건으로 전환된다) */
@media (max-width: 560px) {
  .notice-visual .mobility-cards,
  .notice-visual .mobility-cards.is-single {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 카드 이미지 — 잘림 없이 전체 노출. 비정사각 이미지의 여백은 카드 배경(#cfe9ff)이 채운다.
   (대체 이미지 noimg.jpg가 3200×3200이라 aspect-ratio 없이는 과대 표시되는 문제도 함께 방지) */
.notice-visual .mobility-card img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
}
.promo .video-card > img,
.promo .video-card .videoimg {
  aspect-ratio: 510 / 286; /* 디자인 시안 Tabpanel.png 비율 */
  object-fit: cover;
}
/* 대체 이미지(noimg/nourl)도 cover로 카드 전체를 채움 —
   noimg.jpg는 회색 배경+중앙 아이콘 구성이라 cover 시 배경이 꽉 차 자연스럽다 */

/* aspect-ratio 미지원(구형 Safari 등) 폴백 — 대형 정사각 대체 이미지 과대 표시 방지 */
@supports not (aspect-ratio: 1 / 1) {
  .notice-visual .mobility-card img {
    max-height: 400px;
  }
  .promo .video-card > img,
  .promo .video-card .videoimg {
    max-height: 286px;
  }
}

/* 넘길 페이지가 없을 때(1페이지) 슬라이더 조작 영역(카운터·좌우·일시정지)을 숨긴다.
   .slider-control 이 display:flex 라 hidden 속성만으로는 감춰지지 않는다. */
.slider-control[hidden] {
  display: none;
}

/* ---- 슬라이더 일시정지 시 시작(재생) 아이콘 전환 ---- */
.slider-control button.is-paused {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.slider-control button.is-paused img {
  display: none;
}
.slider-control button.is-paused::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #697482;
}

/* ---- 소식 카드 타이틀·본문 발췌 ---- */
/* 타이틀 잘림 완화: 2줄 → 3줄 노출 (main.css -webkit-line-clamp:2 오버라이드) */
.tab-panel a {
  -webkit-line-clamp: 3;
}
/* 본문 발췌는 2줄까지만 — 레이아웃 보호 */
.tab-panel p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
/* 발췌문이 없는 카드에서도 날짜가 항상 하단 정렬되도록 */
.tab-panel article time {
  margin-top: auto;
  padding-top: 22px;
}

/* ---- 소식 탭 패널·페이지네이션 ---- */
.tab-panel[hidden] {
  display: none !important;
}
.tab-panel article[hidden] {
  display: none !important;
}
/* 새소식(통합) 탭 활성 시 더보기 숨김 */
.tabs .more[hidden] {
  display: none !important;
}
