/* mobile.css */
/* 768px 이하에서만 적용 */
@media (max-width: 768px) {
    body {
        margin: 0;
        padding: 0;
        font-size: 14px;
    }

    /* 상단바: 좌측 햄버거 + JUP, 우측 로그인 영역 */
    .top-inner {
        padding: 0 12px;
        height: 52px;
        display: flex;
        align-items: center;
        justify-content: flex-start; /* 왼쪽 정렬 후 오른쪽 영역만 밀기 */
        gap: 6px;
    }

    .brand-text {
        font-weight: 700;
        font-size: 18px;
    }

    /* 가운데 검색박스 / 글쓰기 / 쪽지 아이콘은 모바일에선 숨김 */
    .search-box,
    #addBtn,
    #inboxBtn {
        display: none !important;
    }

    /* 햄버거 버튼은 모바일에서만 보이게 */
    .hamburger,
    .icon-btn.hamburger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 999px;
        background: transparent;
        border: none;
        padding: 0;
    }

    .hamburger svg rect {
        fill: #fff;
    }

    /* 오른쪽 로그인/프로필 영역을 맨 오른쪽으로 밀기 */
    #authArea,
    .right-group {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    #loginBtn {
        padding: 6px 10px;
        font-size: 13px;
    }

    /* 헤더 프로필 아이콘 (조금 줄이기) */
    #userAvatar,
    #userBtn img {
        width: 32px;
        height: 32px;
    }

    /* ---------- 모바일 메뉴 슬라이드 ---------- */

    .mobile-menu-wrap {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 9999;
    }

    .mobile-menu-wrap.active {
        display: block;
    }

    .mobile-menu-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
    }

    .mobile-menu {
        position: absolute;
        left: 0; /* ⬅ 왼쪽에서 열리게 */
        top: 0;
        width: 72%;
        max-width: 320px;
        height: 100%;
        background: #181818;
        padding: 20px 18px;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.4);
        color: #fff;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        transform: translateX(-100%);
        animation: slideIn 0.25s ease forwards;
    }

    @keyframes slideIn {
        from {
            transform: translateX(-100%);
        }
        to {
            transform: translateX(0);
        }
    }

    .close-menu {
        align-self: flex-end;
        background: none;
        border: none;
        color: #fff;
        font-size: 24px;
        cursor: pointer;
        margin-bottom: 12px;
    }

    .mobile-menu-section {
        margin-bottom: 8px;
    }

    .mobile-search {
        width: 100%;
        padding: 9px 10px;
        border-radius: 8px;
        border: 1px solid #333;
        background: #202020;
        color: #fff;
        font-size: 14px;
    }

    .mobile-search::placeholder {
        color: #888;
    }

    .mobile-menu-item {
        width: 100%;
        text-align: center; /* 중앙 정렬 */
        padding: 10px 2px;
        background: none;
        border: none;
        color: #fff;
        font-size: 16px;
        cursor: pointer;
    }

    .mobile-menu-item:hover {
        color: #ffd66b;
    }

    .mobile-menu hr {
        border: none;
        border-bottom: 1px solid #333;
        margin: 6px 0;
    }

    /* ===========================
       글 등록 페이지 모바일 튜닝
       =========================== */

    /* 컨테이너: 좌우 여백 조금만, 화면 폭에 맞게 */
    .container {
        max-width: 480px;
        margin: 16px auto 40px;
        padding: 0 12px 40px;
    }

    .hero {
        padding: 16px 14px;
        border-radius: 16px;
        gap: 12px;
    }

    .hero-text {
        font-size: 22px;
    }

    .hero-subtext {
        font-size: 13px;
        margin-top: 8px;
    }

    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .hero-stat {
        padding: 10px 10px 11px;
        border-radius: 12px;
    }

    .hero-stat-value {
        font-size: 18px;
    }

    .hero-notes {
        gap: 6px;
    }

    .hero-note {
        min-height: 30px;
        padding: 0 10px;
        font-size: 11px;
    }

    /* 모바일 목록 카드는 1열로 보여줘야 폭이 넓어져 덜 길쭉해 보임 */
    .listings {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .card {
        border-radius: 14px;
    }

    .card .thumb,
    .thumb {
        height: 168px;
    }

    .card-body {
        padding: 12px;
        gap: 8px;
    }

    .card-topline {
        gap: 10px;
    }

    .title {
        font-size: 15px;
        line-height: 1.4;
    }

    .card-summary {
        -webkit-line-clamp: 1;
        min-height: auto;
        font-size: 12px;
    }

    .card-tags {
        gap: 5px;
    }

    .card-tag {
        padding: 4px 8px;
        font-size: 10px;
    }

    .card-meta {
        font-size: 12px;
    }

    .list-section-header {
        margin: 14px 0 6px;
        padding-top: 4px;
    }

    .topbar--home .header-actions {
        padding: 0;
        border: 0;
        background: transparent;
    }

    .modal-meta {
        gap: 6px;
    }

    .modal-meta-chip {
        min-height: 30px;
        padding: 0 10px;
        font-size: 11px;
    }

    /* 글 등록 카드가 화면에 꽉 차게 */
    .register-card {
        width: 100%;
        max-width: none;
        padding: 16px 14px 18px;
        border-radius: 14px;
    }

    .register-form-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .register-section {
        padding: 14px;
        border-radius: 16px;
    }

    .register-fields--two {
        grid-template-columns: 1fr;
    }

    .date-field {
        gap: 10px;
    }

    .date-input {
        max-width: none;
    }

    /* 제목 "글 등록" 사이즈 살짝 키우기 */
    .page-heading {
        font-size: 20px;
        margin: 6px 4px 16px;
    }

    /* 라벨 / 인풋 비율 보정 */
    .form-field {
        gap: 4px;
    }

    .label-title,
    .label {
        font-size: 13px;
    }

    /* 텍스트/셀렉트 박스 높이 조금 키우기 */
    .control,
    .input,
    .select {
        height: 44px;
        padding: 0 12px;
        font-size: 14px;
    }

    textarea.control,
    .textarea {
        min-height: 120px;
        font-size: 14px;
    }

    /* 파일 업로드 박스도 한 줄로 보기 좋게 */
    .file-drop {
        height: 46px;
        font-size: 14px;
    }

    .preview img {
        width: 130px;
        height: 96px;
    }

    .btn-row {
        justify-content: flex-end;
        margin-top: 10px;
    }

    .register-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .register-actions .btn-row {
        justify-content: stretch;
        flex-direction: column-reverse;
        width: 100%;
    }

    .btn {
        height: 38px;
        padding: 0 14px;
        font-size: 14px;
    }

    /* 체크박스 텍스트 줄간 간격 */
    .toggle-box {
        font-size: 13px;
        gap: 6px;
    }

    /* ===========================
       프로필 페이지 모바일 튜닝
       =========================== */

    /* 프로필 카드 너비를 화면에 맞게 */
    .profile-container,
    .profile-main,
    .profile-card {
        max-width: 480px;
        margin: 16px auto 40px;
        padding: 0 12px;
    }

    .profile-card {
        width: 100%;
        border-radius: 18px;
        padding: 18px 16px 20px;
    }

    /* 프로필 안의 큰 아바타가 너무 커 보일 수 있으니 살짝 축소 */
    .profile-card img,
    .profile-avatar {
        max-width: 220px;
        max-height: 220px;
    }

    /* 프로필 정보 텍스트도 모바일 기준으로 줄이기 */
    .profile-card .info-row {
        font-size: 14px;
    }

    .profile-card .btn-row,
    .profile-card .form-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
    }
}

/* ===== 프로필 페이지 모바일 보정 ===== */
@media (max-width: 768px) {
    /* 프로필 카드 전체 폭 고정 */
    .profile-card {
        width: 100% !important;
        max-width: 460px !important;
        margin: 0 auto 24px !important;
        padding: 20px 18px !important;
    }

    /* 내부 컨텐츠는 가로로 절대 튀어나가지 않게 */
    .profile-card * {
        max-width: 100% !important;
        box-sizing: border-box;
        word-break: break-word;
    }

    /* 아바타 중앙 정렬 유지 */
    .card-inner {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100%;
    }

    /* 프로필 정보는 세로 정렬 + 100% 폭 */
    .profile-info {
        width: 100% !important;
        margin-top: 16px;
    }

    .profile-info .info-row {
        width: 100% !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        white-space: normal; /* 줄바꿈 허용 */
    }

    .profile-info .value {
        flex: 1;
        text-align: right;
    }
}
