/* ==========================================================================
   파일명 : responsive.css
   설명 : 반응형 웹 구현 (태블릿, 모바일 대응)
   ========================================================================== */

/* 1. 모바일 메뉴 버튼 (기본은 숨김) */
.mobile-menu-btn {
    display: none; /* PC에서는 숨김 */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    padding: 0;
    z-index: 1002;
}

.mobile-menu-btn .icon-bar {
    width: 100%;
    height: 3px;
    background-color: var(--text-main);
    transition: all 0.3s;
}

/* --------------------------------------------------------------------------
   [Tablet & Mobile] 768px 이하
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    
    /* 레이아웃 여백 조정 */
    :root {
        --header-height: 60px;
    }

    .container {
        padding: 0 1rem;
    }

    body {
        padding-bottom: 56px;
    }

    /* 헤더 구조 변경 */
    #header .container {
        position: relative;
    }

    .mobile-menu-btn {
        display: flex; /* 모바일에서 보임 */
    }

    /* GNB (메뉴) - 모바일에서는 드로어(Drawer) 형태로 변형 */
    #gnb {
        position: fixed;
        top: var(--header-height);
        right: -100%; /* 화면 밖으로 숨김 */
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: var(--bg-body);
        transition: right 0.3s ease-in-out;
        z-index: 1001;
        border-top: 1px solid #eee;
        overflow-y: auto;
    }

    #gnb.active {
        right: 0; /* 화면 안으로 들어옴 */
    }

    #gnb ul {
        flex-direction: column; /* 세로 정렬 */
        gap: 0;
        padding: 1rem;
    }

    #gnb ul li {
        border-bottom: 1px solid #f0f0f0;
    }

    #gnb a {
        display: block;
        padding: 1rem;
        font-size: 1.1rem;
        text-align: left;
        /* [접근성] 터치 타겟 크기 확보 */
    }

    #gnb .gnb-sub-toggle {
        text-align: left;
    }

    /* 접근성 위젯: 모바일에서 콘텐츠와 하단 링크를 가리지 않도록 축소 */
    .a11y-widget {
        right: 8px;
        bottom: 8px;
        max-width: calc(100vw - 16px);
    }

    .a11y-widget .btn-toggle {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
        border-width: 2px;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.24);
    }

    .a11y-widget .panel {
        right: 0;
        bottom: 54px;
        width: min(280px, calc(100vw - 32px));
        max-height: 70vh;
        overflow-y: auto;
        border-radius: 8px;
        padding: 12px;
    }

    .a11y-widget .panel button {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    /* 메인 섹션 폰트 크기 조정 */
    .hero h2 {
        font-size: 2rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    .btn {
        width: 100%;
    }

    /* 카드 그리드 1단으로 변경 */
    .course-list {
        grid-template-columns: 1fr;
    }
}
