/* === clinic/css/mobile_base.css ===
   터치 영역, 폰트, 가로 스크롤, 접근성 보강 */

/* 1. 터치 영역 — Apple HIG 권장 44x44 */
@media (max-width: 768px) {
    button, .btn, a.btn, input[type="button"], input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 16px;
        font-size: 16px;
        touch-action: manipulation;
    }
    
    input[type="text"], input[type="email"], input[type="tel"],
    input[type="password"], input[type="number"], input[type="search"],
    input[type="date"], textarea, select {
        font-size: 16px !important;
        min-height: 44px;
    }
    
    body, html {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .container, main, .page-content {
        padding-left: 12px;
        padding-right: 12px;
        box-sizing: border-box;
    }
    
    body { font-size: 15px; }
    .small, small, .text-xs { font-size: 13px !important; }
    
    .modal, [role="dialog"] {
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }
}

@media (max-width: 375px) {
    h1 { font-size: 1.4rem !important; }
    h2 { font-size: 1.15rem !important; }
    h3 { font-size: 1.0rem !important; }
}

/* 2. 키보드 포커스 표시 — 접근성 핵심 */
*:focus-visible {
    outline: 3px solid #3b82f6 !important;
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible, .btn:focus-visible, a.btn:focus-visible {
    outline: 3px solid #f59e0b !important;
    outline-offset: 2px;
}

input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 3px solid #3b82f6 !important;
    outline-offset: 0;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* 3. 모션 감소 선호 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* 4. 색상 대비 보강 — WCAG AA */
.text-muted, .text-secondary, .text-slate-400 {
    color: #64748b !important;
}
.text-slate-300 {
    color: #94a3b8 !important;
}

/* 5. 스크린 리더 전용 텍스트 */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 6. Skip-to-main 링크 */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background: #1e293b;
    color: #fff;
    padding: 8px 16px;
    z-index: 9999;
    text-decoration: none;
}
.skip-to-main:focus { top: 0; }
