/**
 * 슬롯링크 반응형 · 모바일 최적화 (PC/모바일 공통)
 */
:root {
    --sl-header-m: 64px;
    --sl-touch: 44px;
    --sl-radius: 12px;
    --sl-gap: 12px;
    --sl-bg: #ebedf3;
    --sl-card: #fff;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

img,
video {
    max-width: 100%;
    height: auto;
}

/* 모바일 · 태블릿 (1250px 이하) */
@media (max-width: 1250px) {
    main {
        margin-top: var(--sl-header-m) !important;
        padding: 0 var(--sl-gap) 24px !important;
        gap: var(--sl-gap) !important;
    }

    header #main {
        height: var(--sl-header-m);
        min-height: var(--sl-header-m);
    }

    header #main .logo {
        height: var(--sl-header-m);
    }

    header #main .logo img {
        width: 160px;
        max-height: 44px;
    }

    header #toggleBtn,
    header #alarmBtn {
        width: var(--sl-touch);
        height: var(--sl-touch);
    }

    header #main .search form {
        max-width: 100%;
    }

    /* 사이드바: 본문 아래, 카드형 */
    slotaside {
        gap: var(--sl-gap) !important;
    }

    slotaside .ol,
    slotaside .userContainer,
    slotaside #widget,
    slotaside #sideRanking,
    slotaside .pic_lt {
        border-radius: var(--sl-radius);
    }

    article {
        gap: var(--sl-gap) !important;
    }

    .section,
    .mainSection,
    #title,
    #bo_list,
    #bo_v,
    #bo_w {
        border-radius: var(--sl-radius);
        padding: 12px !important;
    }

    /* 게시판 테이블 가로 스크롤 */
    .tbl_wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tbl_head01 table,
    .tbl_head03 table {
        min-width: 520px;
    }

    .tbl_head01 td,
    .tbl_head03 td {
        font-size: 0.95rem;
        padding: 12px 8px !important;
    }

    /* 입력창 iOS 줌 방지 */
    input,
    select,
    textarea,
    button {
        font-size: 16px;
    }

    /* 터치 영역 */
    .btn,
    .btn_bo_user li a,
    .btn_bo_user li button,
    header nav a {
        min-height: var(--sl-touch);
        display: inline-flex;
        align-items: center;
    }

    /* 네비 드로어 */
    header #nav.active .navWrap {
        max-height: calc(100vh - var(--sl-header-m));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    header nav > ul > li > .menu > a {
        padding: 14px 16px;
        font-size: 1rem;
    }

    /* 배너 iframe */
    #main_banner,
    iframe[id="main_banner"] {
        min-height: 80px;
        border-radius: var(--sl-radius);
    }

    #widget .widget.Bookmark .items {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--sl-gap) !important;
    }

    .pic_lt ul {
        gap: var(--sl-gap) !important;
    }

    footer,
    .footer {
        padding: 16px var(--sl-gap);
        font-size: 0.9rem;
    }
}

@media (max-width: 600px) {
    :root {
        --sl-header-m: 56px;
        --sl-gap: 10px;
    }

    main {
        padding: 0 8px 20px !important;
    }

    header #main .logo img {
        width: 140px;
        max-height: 38px;
    }

    #widget .widget.Bookmark .items {
        grid-template-columns: 1fr !important;
    }

    .tbl_head01 table,
    .tbl_head03 table {
        min-width: 480px;
    }

    h1 {
        font-size: 1.25rem !important;
    }

    #title h1 {
        font-size: 1.2rem !important;
    }
}

/* PC: 사이드 고정 너비 유지 */
@media (min-width: 1251px) {
    main {
        max-width: 1250px;
    }
}

/* 다크모드 대응 */
@media (max-width: 1250px) {
    [data-theme='dark'] .section,
    [data-theme='dark'] #bo_list,
    [data-theme='dark'] #bo_v,
    [data-theme='dark'] #bo_w {
        border-radius: var(--sl-radius);
    }
}

/* 인쇄 · 접근성 */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
