/* ===== Global scale ===== */
html { font-size: 14px !important; }          /* 16px → 14px (전체 12.5% 축소) */
@media (min-width: 1400px){ html { font-size: 13.5px !important; } } /* xxl에서 더 콤팩트 */

/* ===== Container widths (전체 폭 축소) ===== */
.container,
.container-sm, .container-md, .container-lg, .container-xl, .container-xxl {
    max-width: 1080px !important;               /* 기본 1140/1320보다 줄이기 */
}

/* 헤더 패딩/높이 축소 */
.main-header .px-2, .main-header .px-3, .main-header .py-3, .main-header .py-2 {
    padding: .35rem !important;
}
.main-header .logo { font-size: 0.95rem !important; }

/* 기본 본문 폰트/라인 높이 조정 (BS 5.3 변수도 함께) */
:root { --bs-body-font-size: .9rem; --bs-body-line-height: 1.4; }
body { font-size: .9rem !important; line-height: 1.4 !important; }

/* 제목 축소 */
h1 { font-size: 1.6rem !important; }
h2 { font-size: 1.35rem !important; }
h3 { font-size: 1.15rem !important; }

/* 버튼/폼 입력 축소 */
.btn {
    --bs-btn-padding-y: .35rem;
    --bs-btn-padding-x: .55rem;
    --bs-btn-font-size: .88rem;
}
.form-control { padding: .35rem .55rem !important; font-size: .9rem !important; }

/* 카드/리스트 여백 축소 */
.card-body { padding: .75rem !important; }
.card-footer { padding: .5rem .75rem !important; }
.list-group-item { padding: .5rem .75rem !important; }

/* 갤러리 카드 타이틀/도메인 축소 */
.bb-site-name { font-size: 1rem !important; }
.bb-domain { font-size: .8rem !important; }

/* 상단 랭킹 배지 살짝 축소 */
.bb-rank-badge { width: 32px; height: 32px; font-size: .95rem; }

/* 헤더/푸터 부가 메뉴 글씨 축소 */
.default-menu a,
.footer, .footer .list-group-item,
.tail-menu a, .tail-copyright { font-size: .85rem !important; }

/* 모바일에서도 살짝 컴팩트하게 */
@media (max-width: 575.98px) {
    html { font-size: 13.5px !important; }
    .container { padding-left: .75rem; padding-right: .75rem; }
}

@media (max-width: 768px) {
    h2 {
        font-size: 14px !important;
    }
}

/* 전역: 모바일에서 가로 스크롤 잠금 */
@media (max-width: 991px) {
    html, body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden; /* 최후 방어막 */
    }
}