/* certi-2026 디자인 층 (2026-11-25)
 * portal.css 뒤에 로드한다. 기존 화면 규칙을 지우지 않고 덮어쓴다.
 * 방향: 공공 '등록 원부' 느낌 — 파란 잉크, 종이 바탕, 등록번호는 증서 일련번호판처럼.
 * 웹폰트 0건. 움직임은 hover 색 전환만(동작 줄이기 설정 존중). */

:root {
    --c26-ink: #14284a;
    --c26-blue: #215cbd;
    --c26-blue-deep: #17375f;
    --c26-paper: #f5f7fb;
    --c26-line: #dbe3ee;
    --c26-seal: #b8322a;
    --c26-pass: #187248;
    --c26-foot: #0f2240;
    --c26-foot-text: #d3deec;
    --c26-foot-muted: #93a9c8;
    --c26-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --c26-sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", Pretendard, "Noto Sans KR", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
}
body { font-family: var(--c26-sans); word-break: keep-all; -webkit-font-smoothing: antialiased; }
:is(.stat-number, .kf-value, td, .badge) { font-variant-numeric: tabular-nums; }

/* ── 머리글: 아이콘 색을 하나로, 모바일 검색 버튼 ── */
.top-bar { background: var(--c26-blue-deep) !important; }
.main-header .nav-link > .bi, .main-header .dropdown-item > .bi { color: var(--portal-blue) !important; opacity: .8; }
.main-header .nav-link.active, .main-header .nav-link[aria-current="page"] { color: var(--portal-blue); box-shadow: inset 0 -2px 0 var(--portal-blue); border-radius: 8px 8px 0 0; }
.navbar-brand { display: inline-flex; align-items: baseline; gap: .35rem; }
.c26-brand-tag { display: inline-block; padding: .05rem .45rem; border: 1px solid #b9cbe6; border-radius: 6px; color: var(--portal-blue); font-size: .8125rem; font-weight: 750; letter-spacing: 0; line-height: 1.5; }
.c26-header-tools { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.c26-search-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 9px; color: var(--portal-ink); font-size: 1.15rem; text-decoration: none; }
.c26-search-btn:hover, .c26-search-btn[aria-expanded="true"] { background: var(--portal-blue-soft); color: var(--portal-blue); }
.c26-mobile-search { border-top: 1px solid var(--portal-line); background: var(--portal-surface); }
.c26-mobile-search form { display: flex; gap: .5rem; padding-block: .75rem; }
.c26-mobile-search .form-control { flex: 1 1 auto; min-width: 0; background: var(--portal-soft); }
@media (min-width: 992px) { .c26-header-tools { display: none; } }

/* ── 상세 히어로: 등록번호 일련번호판·모바일 버튼 한 줄 ── */
.c26-reg-plate { display: inline-flex; align-items: baseline; gap: .45rem; padding: .2rem .6rem; border: 3px double rgb(255 255 255 / 55%); border-radius: 6px; font-family: var(--c26-mono); font-size: .9375rem; letter-spacing: .04em; color: #fff; }
.c26-reg-plate__label { font-family: var(--c26-sans); font-size: .75rem; letter-spacing: 0; opacity: .8; }
#main-content .info-table code, #main-content code.c26-reg-no { display: inline-block; padding: .1rem .5rem; border: 3px double #b9c7da; border-radius: 6px; background: var(--c26-paper); color: var(--c26-ink); font-family: var(--c26-mono); font-size: .9375rem; letter-spacing: .04em; }
.cert-hero { position: relative; overflow: hidden; }
.cert-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border: 2px solid rgb(255 255 255 / 9%); border-radius: 50%; box-shadow: 0 0 0 14px rgb(255 255 255 / 4%); pointer-events: none; }
.cert-hero > * { position: relative; z-index: 1; }
.cert-hero-actions .btn { min-height: 40px; }

/* 판단 표지: 국가공인 아님·폐지·취소는 인주색 테두리로만 구분 */
#main-content .badge.bg-secondary, #main-content .badge.bg-dark { background: #eef1f6 !important; color: #3d4c61 !important; border: 1px solid #c3ccd9; }
.cert-hero .badge.bg-dark { background: rgb(255 255 255 / 12%) !important; color: #fff !important; border: 1px solid rgb(255 255 255 / 45%); }
#main-content .badge.c26-not-accredited { background: #fff6f5 !important; color: var(--c26-seal) !important; border: 1px solid #e6b7b2; }

/* ── 본문 카드·제목 ── */
#main-content :is(.card-header, .sidebar-card .card-header) .bi:first-child { color: var(--portal-blue) !important; }
.section-title { position: relative; padding-left: .85rem; }
.section-title::before { content: ""; position: absolute; left: 0; top: .2em; bottom: calc(.8rem + .2em); width: 4px; border-radius: 2px; background: var(--portal-blue); }
.sidebar-card { border: 1px solid var(--portal-line); border-radius: 14px; overflow: hidden; background: var(--portal-surface); }
.detail-page-nav { position: relative; }

/* 자매 서비스 카드 */
.c26-sister-link { display: grid; gap: .2rem; padding: .9rem 1rem; border: 1px solid var(--portal-line); border-radius: 12px; background: var(--portal-soft); color: var(--portal-ink); text-decoration: none; }
.c26-sister-link strong { color: var(--portal-blue); font-size: 1rem; }
.c26-sister-link span { font-size: .875rem; color: var(--portal-ink); }
.c26-sister-link small { color: var(--portal-muted); font-size: .8125rem; }
.c26-sister-link:hover { border-color: #9ab8e4; background: var(--portal-blue-soft); }

/* 검색 목록 제목 */
.c26-page-head { margin: 0 0 1rem; }
.c26-page-head h1 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 1.85rem); font-weight: 800; letter-spacing: -.03em; color: var(--portal-ink); }
.c26-page-head p { margin: .35rem 0 0; color: var(--portal-muted); font-size: .9375rem; }

/* ── 바닥글: 연결 허브 ── */
.main-footer { background: var(--c26-foot) !important; }
.c26-footer-brand p { color: var(--c26-foot-text); font-size: .9375rem; line-height: 1.75; }
.c26-footer-brand .c26-footer-logo { display: inline-flex; align-items: baseline; gap: .4rem; color: #fff; font-size: 1.2rem; font-weight: 850; letter-spacing: -.04em; text-decoration: none; }
.c26-footer-brand .c26-brand-tag { border-color: #4f6c95; color: #b9d2ff; }
.c26-footer-hub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1.25rem; }
.c26-footer-hub h2 { margin: 0 0 .5rem; color: var(--c26-foot-muted); font-size: .8125rem; font-weight: 750; letter-spacing: .06em; }
.c26-footer-hub ul { margin: 0; padding: 0; list-style: none; }
.c26-footer-hub li a { display: inline-flex; align-items: center; min-height: 40px; color: var(--c26-foot-text); font-size: .9375rem; text-decoration: none; }
.c26-footer-hub li a:hover, .c26-footer-row a:hover { color: #fff; text-decoration: underline; }
.c26-footer-brand { grid-column: 1 / -1; }
.c26-footer-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1.25rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid #2b456b; }
.c26-footer-row > h2 { flex-basis: 100%; margin: 0 0 .25rem; color: var(--c26-foot-muted); font-size: .8125rem; font-weight: 750; letter-spacing: .06em; }
.c26-footer-row a { display: inline-flex; align-items: baseline; gap: .4rem; min-height: 40px; padding-block: .5rem; color: var(--c26-foot-text); font-size: .9375rem; text-decoration: none; }
.c26-footer-row a small { color: var(--c26-foot-muted); font-size: .8125rem; }
.c26-footer-meta { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid #2b456b; color: var(--c26-foot-muted); font-size: .875rem; line-height: 1.8; }
.c26-footer-meta a { color: var(--c26-foot-text); }
.c26-footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-top: 1rem; color: var(--c26-foot-muted); font-size: .875rem; }
.c26-footer-legal nav { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.c26-footer-legal nav a { display: inline-flex; align-items: center; min-height: 40px; color: var(--c26-foot-text); }
.main-footer .footer-subscriptions { border-color: #2b456b; }
@media (min-width: 768px) {
    .c26-footer-hub { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
    .c26-footer-hub { grid-template-columns: 1.5fr repeat(6, minmax(0, 1fr)); gap: 1.5rem; }
    .c26-footer-brand { grid-column: auto; }
}

/* ── 휴대폰 ── */
@media (max-width: 991.98px) {
    .main-header .navbar > .container-xl { flex-wrap: wrap; }
}
@media (max-width: 767.98px) {
    /* 섹션 바로가기는 한 줄 가로 스크롤 */
    .detail-page-nav__links { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-inline: -.25rem; padding-inline: .25rem; mask-image: linear-gradient(90deg, #000 88%, transparent); }
    .detail-page-nav__links::-webkit-scrollbar { display: none; }
    .detail-page-nav__link { flex: 0 0 auto; white-space: nowrap; }
}
@media (max-width: 575.98px) {
    .cert-hero { padding: 1.25rem 1.1rem; border-radius: 14px; }
    .cert-hero-title { margin-bottom: .75rem !important; }
    .cert-hero-meta { gap: .35rem 1rem !important; }
    .cert-hero-actions { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; margin-top: 1rem !important; padding-bottom: .15rem; mask-image: linear-gradient(90deg, #000 85%, transparent); }
    .cert-hero-actions::-webkit-scrollbar { display: none; }
    .cert-hero-actions .btn { flex: 0 0 auto; white-space: nowrap; }
    .cert-hero::after { width: 150px; height: 150px; right: -50px; top: -50px; }
    .hero-section { padding-block: 2.25rem 2.5rem; }
}

/* ── 어두운 화면 ── */
[data-bs-theme="dark"] .c26-brand-tag { border-color: #4f6c95; color: #b9d2ff; }
[data-bs-theme="dark"] #main-content :is(.info-table code, code.c26-reg-no) { background: var(--portal-soft); color: var(--portal-ink); border-color: #4c6283; }
[data-bs-theme="dark"] #main-content .badge.bg-secondary, [data-bs-theme="dark"] #main-content .badge.bg-dark { background: #2a3a52 !important; color: #d6e0ee !important; border-color: #4c6283; }
[data-bs-theme="dark"] .c26-mobile-search { background: var(--portal-surface); }
[data-bs-theme="dark"] #main-content .badge.c26-not-accredited { background: #3a2226 !important; color: #ffb9b1 !important; border-color: #7a4248; }

@media (prefers-reduced-motion: no-preference) {
    .c26-sister-link, .c26-search-btn, .c26-footer-hub li a { transition: background-color .15s, border-color .15s, color .15s; }
}
@media print {
    .c26-header-tools, .c26-mobile-search, .c26-sister-card, .cert-hero-actions, .cert-hero::after { display: none !important; }
    .c26-reg-plate { color: #000; border-color: #888; }
}
