@charset "UTF-8";

/* =========================================
   모집기관 상세 모달 스타일 (Figma 디자인 기반)
   ========================================= */

/* 범용 유틸리티 (모달 내부에만 적용되도록 범위 한정) */
#instDetailModal .pc-only { display: inline-flex !important; }
#instDetailModal .mobile-only { display: none !important; }

/* 모달 본체 강제 스타일 (Bootstrap 연합 문제 해결 및 레이어 정렬) */
#instDetailModal.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 100000 !important; /* 최상위 레이어 보장 */
    background-color: rgba(0, 0, 0, 0.7) !important; /* 3. 외 영역 회색 처리 */
    overflow-x: hidden !important;
    overflow-y: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: none;
}

#instDetailModal.modal.show {
    display: flex !important; /* 가운데 정렬을 위해 flex 강제 적용 */
    align-items: center;
    justify-content: center;
}

/* 수동 백드롭 (Bootstrap 백드롭 미작동 대비) */
.modal-backdrop-custom {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    z-index: 99999 !important;
    display: none;
}

#instDetailModal .modal-dialog {
    max-width: 1440px; /* 3분할 레이아웃에 맞춰 확대 */
    width: calc(100% - 40px);
    margin: 0 auto !important; /* flex align-items: center가 대신 중앙 정렬 처리 */
    z-index: 100001;
    position: relative;
    padding: 0;
}

#instDetailModal .modal-content {
    border: none;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    font-family: 'Pretendard', sans-serif;
    padding: 48px;
    background-color: #fff;
}

#instDetailModal .modal-header {
    border: none;
    padding: 0 0 32px 0;
    align-items: flex-start;
}

#instDetailModal .modal-body {
    padding: 0;
    max-height: calc(85vh - 200px);
    overflow-y: auto;
}

#instDetailModal .modal-footer {
    border: none;
    padding: 48px 0 0 0;
    justify-content: center;
    gap: 12px;
}

/* 팝업 헤더 레이아웃 */
.modal-figma-header {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    flex-wrap: wrap;
}

.modal-figma-logo-box {
    width: 90px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.modal-figma-logo-box img {
    max-width: 100%;
    max-height: 100%;
}

.modal-figma-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-figma-title {
    font-size: 28px;
    font-weight: 700;
    color: #222;
    line-height: 1.2;
    margin: 0;
}

.modal-figma-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 14px;
    background-color: #00754A;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 999px;
    white-space: nowrap;
}

/* 닫기 버튼 커스텀 */
.btn-modal-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.6;
    position: absolute;
    top: 48px;
    right: 48px;
}

.btn-modal-close:hover {
    opacity: 1;
}

/* 메인 레이아웃: PC 상/하 Row 구조 */
.modal-figma-main-layout {
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: stretch;
}

/* 상단 행: 이미지 | 소개 | 가이드 */
.modal-figma-row-top {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

/* 하단 행: 연락처 | 지도 */
.modal-figma-row-bottom {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

/* 좌측 정렬 그룹: 이미지 박스 및 연락처 섹션 너비 일치 (300px) */
.modal-figma-img-wrapper,
.modal-figma-contact-section {
    width: 300px;
    flex-shrink: 0;
}

.modal-figma-img-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 24px;
    overflow: hidden;
    background-color: #f9f9f9;
}

.modal-figma-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-figma-contact-section {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* 우측 정렬 그룹: 텍스트 그리드 및 지도 영역 유동 너비 일치 */
.modal-figma-text-grid,
.modal-figma-map-wrapper {
    flex: 1;
    min-width: 0;
}

/* 소개 및 안내 (2컬럼 그리드) */
.modal-figma-text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.modal-figma-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    width: 100%;
}

.modal-figma-sec-title {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    line-height: 1.4;
    margin: 0;
}

.modal-figma-text-box {
    font-size: 16px;
    font-weight: 400;
    color: #555;
    line-height: 1.8;
    max-height: 256px;
    overflow-y: auto;
    padding-right: 12px;
    word-break: keep-all;
}

/* 에디터(p 태그 등)로 입력된 내용의 기본 여백 제거 */
.modal-figma-text-box p {
    margin: 0;
}


/* 텍스트 박스 내부 이미지 및 미디어 제어 */
.modal-figma-text-box img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 10px 0;
}

.modal-figma-text-box table {
    width: 100% !important;
    table-layout: fixed;
}

/* 지도 영역 */
.modal-figma-map-wrapper {
    width: 100%;
}

.modal-figma-map-box {
    width: 100%;
    height: 320px;
    border-radius: 24px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.modal-figma-map {
    width: 100%;
    height: 100%;
}

/* 정보 아이템 및 아이콘 버튼 */
.modal-figma-info-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-figma-info-content {
    font-size: 16px;
    font-weight: 400;
    color: #222;
    line-height: 1.5;
}

.modal-figma-footer-utils {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-figma-icon-group {
    display: flex;
    gap: 16px;
}

.modal-figma-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #666;
}

.modal-figma-icon-btn:hover {
    background-color: #fff;
    border-color: #00754A;
    box-shadow: 0 4px 12px rgba(0, 117, 74, 0.15);
    transform: translateY(-2px);
    border: 1px solid #00754A;
}

.modal-figma-icon-btn:hover svg path,
.modal-figma-icon-btn:hover svg rect,
.modal-figma-icon-btn:hover svg circle,
.modal-figma-icon-btn:hover svg polygon,
.modal-figma-icon-btn:hover svg polyline,
.modal-figma-icon-btn:hover svg line {
    stroke: #00754A !important;
}

/* 스크롤바 숨김 처리 (모든 스크롤바 대상) */
#instDetailModal ::-webkit-scrollbar {
    display: none !important;
}
#instDetailModal * {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

/* ===== 반응형: 태블릿 (1024px 이하) ===== */
@media (max-width: 1280px) {
    #instDetailModal .modal-dialog {
        max-width: 95%;
    }

    .modal-figma-row-top,
    .modal-figma-row-bottom {
        flex-direction: column;
        gap: 32px;
    }

    .modal-figma-img-wrapper,
    .modal-figma-contact-section,
    .modal-figma-text-grid,
    .modal-figma-map-wrapper {
        width: 100%;
    }

    .modal-figma-img-box {
        aspect-ratio: 16 / 9;
    }
}

/* ===== 반응형: 모바일 (768px 이하) ===== */
@media (max-width: 1280px) {
    #instDetailModal .pc-only { display: none !important; }
    #instDetailModal .mobile-only { display: flex !important; }

    #instDetailModal .modal-dialog {
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        height: 100% !important;
        transform: none !important;
    }

    #instDetailModal .modal-content {
        border-radius: 0 !important;
        height: 100% !important;
        min-height: 100vh !important;
        padding: 0 !important;
        display: flex;
        flex-direction: column;
        border: none !important;
    }

    #instDetailModal .modal-header {
        position: relative;
        flex-shrink: 0;
        border-bottom: none !important;
        padding: 0 20px !important;
        min-height: 56px;
        display: block; /* Override default flex to ensure it behaves correctly */
    }

    .modal-figma-header-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 12px;
        padding-right: 0;
    }

    .modal-figma-header-mobile .modal-figma-title {
        font-size: 20px;
        font-weight: 700;
        line-height: 30px;
        word-break: keep-all;
        flex: 1;
        margin: 0;
    }

    .modal-figma-header-mobile .modal-figma-logo-box {
        width: 96px;
        height: 30px;
        flex-shrink: 0;
    }

    .modal-figma-title {
        font-size: 20px;
        font-weight: 700;
        line-height: 30px;
        word-break: keep-all;
    }

    .btn-modal-close {
        top: 15px !important;
        right: 16px !important;
        padding: 4px;
        z-index: 10;
    }

    #instDetailModal .modal-body {
        max-height: none !important;
        overflow-y: auto !important;
        flex: 1;
        padding: 0 20px 48px !important;
        -webkit-overflow-scrolling: touch;
    }

    /* 플렉스 + 오더링 핵심 로직 */
    .modal-figma-main-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 32px !important;
    }

    /* 컨테이너 해제 (order 자유 부여를 위해 display: contents 사용) */
    .modal-figma-row-top,
    .modal-figma-row-bottom,
    .modal-figma-text-grid,
    .modal-figma-contact-section,
    .modal-figma-map-wrapper {
        display: contents !important;
    }

    /* 1. 대표이미지 */
    .modal-figma-img-wrapper {
        order: 1 !important;
        width: 100% !important;
        margin-bottom: 8px;
    }
    .modal-figma-img-box {
        aspect-ratio: 16 / 9;
        border-radius: 16px;
    }

    /* 2. 모집분야 뱃지 영역 */
    .modal-figma-badge-mobile-wrap {
        order: 2 !important;
        display: flex !important;
        flex-direction: column;
        gap: 8px;
    }
    .modal-figma-badge {
        height: 20px;
        padding: 6px 8px;
        font-size: 12px;
        line-height: 20px;
        align-self: flex-start;
        display: inline-flex !important;
        border-radius: 999px;
    }

    /* 3. 모집기관 소개 (피그마 11395:27056 모바일 버전에서는 제외됨) */
    .modal-figma-intro-section {
        display: none !important;
    }

    /* 4. 참여 안내 */
    .modal-figma-guide-section {
        order: 3 !important;
    }

    /* 5. 지도 */
    .modal-figma-map-wrapper {
        order: 4 !important;
        display: block !important;
    }
    .modal-figma-map-box {
        height: 240px;
        min-height: 240px;
        border-radius: 16px;
    }

    /* 6. 주소 */
    .item-addr {
        order: 5 !important;
        display: flex !important;
        flex-direction: column;
        gap: 8px;
    }

    /* 7. 대표 연락처 */
    .item-tel {
        order: 6 !important;
        display: flex !important;
        flex-direction: column;
        gap: 8px;
    }

    /* 8. 홍보자료 */
    .modal-figma-footer-utils {
        order: 7 !important;
        flex-direction: column;
        gap: 16px;
        margin-top: 0;
    }
    .modal-figma-icon-group {
        gap: 16px;
    }
    .modal-figma-icon-btn {
        width: 34px !important;
        height: 34px !important;
    }
    .modal-figma-icon-btn svg {
        width: 20px;
        height: 20px;
    }

    .modal-figma-sec-title {
        font-size: 16px;
        font-weight: 700;
        line-height: 24px;
        color: #222;
        margin: 0;
    }

    .modal-figma-text-box {
        max-height: none;
        padding-right: 0;
        font-size: 12px;
        line-height: 20px;
        color: #222;
        padding: 10px;
    }

    .modal-figma-info-content {
        font-size: 12px;
        line-height: 20px;
        color: #222;
    }
}
