/* 폰트 임포트 */
@font-face {
    font-family: 'Cafe24Dangdanghae';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.2/Cafe24Dangdanghae.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'HakgyoansimWoojuR';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2307-2@1.0/HakgyoansimWoojuR.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'HakgyoansimWoojuR';
    background: linear-gradient(135deg, #93939B 0%, #93939B 100%);
    min-height: 100vh;
    color: #333;
    padding: 20px;
}

/* 컨테이너 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 0;
}

/* 헤더 */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-family: 'Cafe24Dangdanghae';
    font-size: 2.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: normal;
    letter-spacing: 2px;
}

/* 메인 카드 */
.main-card {
    background: white;
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 8px solid #8B5A7C;
}

.card-content {
    padding: 40px;
}

/* 카테고리 선택기 */
.category-selector {
    margin-bottom: 30px;
}

.category-selector select {
    font-family: 'HakgyoansimWoojuR';
    width: 200px;
    padding: 10px 15px;
    border: 2px solid #8B5A7C;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.category-selector select:focus {
    outline: none;
    border-color: #8B5A7C;
    box-shadow: 0 0 0 3px rgba(139, 90, 124, 0.1);
}

/* 성향 제목 */
.orientation-title {
    background: #8B5A7C;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.orientation-title h2 {
    font-family: 'HakgyoansimWoojuR', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
}

/* 성향 설명 */
.orientation-description {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    line-height: 1.8;
}

.orientation-description p {
    font-family: 'HakgyoansimWoojuR';
    font-size: 1rem;
    color: #555;
    text-align: center;
}

/* 성향 그리드 - 1열 세로 배치 */
.orientation-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* 1열로 세로 배치 */
    gap: 15px;
    margin-bottom: 30px;
}

.grid-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    min-height: 150px;
    border: 2px solid #8B5A7C;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

/* 아이콘 영역 완전히 제거 */
.icon-placeholder {
    display: none;
}

/* 텍스트만 표시하도록 조정 */
.subcategory-title {
    font-family: 'HakgyoansimWoojuR', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #8B5A7C;
    margin-bottom: 10px;
}

.subcategory-desc {
    font-family: 'HakgyoansimWoojuR', sans-serif;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* 버튼 컨테이너 */
.button-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

/* 버튼 스타일 */
.btn {
    font-family: 'HakgyoansimWoojuR';
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    display: block;
}

.home-button {
    position: fixed;
    top: 20px;
    left: 20px;
    background: linear-gradient(180deg, #4C5B8C 0%, #3F4454 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 90, 124, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

.home-button:hover {
    background: linear-gradient(180deg, #3C4B7C 0%, #2F3444 100%);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(139, 90, 124, 0.4);
}

.home-button:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(180deg, #4C5B8C 0%, #3F4454 100%);
    color: white;
    display: block;
    margin-right: 10px;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #3C4B7C 0%, #2F3444 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(76, 91, 140, 0.3), inset 2px 3px 3px -2px rgba(243, 252, 255, 0.8);
}

.orientation-image {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 15px;
    display: block;
    transition: opacity 0.3s ease;
    /* transform이 아니라 transition */
}

.hover-image {
    position: absolute;
    top: 0;
    left: 50%;
    /* 중앙 정렬을 위해 50% */
    transform: translateX(-50%);
    /* 중앙 정렬 완성 */
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 10px;
    display: block;
    /* margin-bottom과 align-items 제거 - position:absolute에서는 불필요 */
}

/* 이미지 컨테이너 추가 */
.image-container {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

/* 호버 효과 */
.grid-item:hover .orientation-image {
    opacity: 0;
}

.grid-item:hover .hover-image {
    opacity: 1;
}

/* 모바일에서도 데스크탑 그리드 유지하는 반응형 디자인 */
@media (max-width: 768px) {
    body {
        padding: 15px;
        /* 패딩 줄임 */
    }

    .container {
        padding: 15px 0;
        /* 패딩 줄임 */
        max-width: 100%;
        /* 전체 너비 사용 */
    }

    .main-card {
        margin: 0 5px;
        /* 좌우 마진 줄임 */
        border: 4px solid #8B5A7C;
        /* 테두리 두께 줄임 */
    }

    .card-content {
        padding: 20px 12px;
        /* 패딩 줄임 */
    }

    .header {
        margin-bottom: 25px;
        /* 마진 줄임 */
    }

    .header h1 {
        font-size: 1.8rem;
        /* 폰트 크기 줄임 */
        letter-spacing: 1px;
        /* 자간 줄임 */
    }

    /* 카테고리 선택기 모바일 조정 */
    .category-selector {
        margin-bottom: 20px;
        /* 마진 줄임 */
    }

    .category-selector select {
        width: 100%;
        /* 전체 너비 */
        padding: 8px 12px;
        /* 패딩 줄임 */
        font-size: 0.9rem;
        /* 폰트 크기 줄임 */
        background-size: 14px;
        /* 아이콘 크기 줄임 */
        padding-right: 35px;
        /* 우측 패딩 줄임 */
    }

    /* 성향 제목 모바일 조정 */
    .orientation-title {
        padding: 12px 15px;
        /* 패딩 줄임 */
        margin-bottom: 15px;
        /* 마진 줄임 */
    }

    .orientation-title h2 {
        font-size: 1.1rem;
        /* 폰트 크기 줄임 */
    }

    /* 성향 설명 모바일 조정 */
    .orientation-description {
        padding: 15px 12px;
        /* 패딩 줄임 */
        margin-bottom: 20px;
        /* 마진 줄임 */
        line-height: 1.6;
        /* 행간 줄임 */
    }

    .orientation-description p {
        font-size: 0.9rem;
        /* 폰트 크기 줄임 */
    }

    /* 핵심: 그리드 1열 세로 배치 유지 */
    .orientation-grid {
        grid-template-columns: 1fr;
        /* 1열로 세로 배치 */
        gap: 12px;
        /* 간격 늘림 */
        margin-bottom: 15px;
        /* 마진 줄임 */
    }

    .grid-item {
        min-height: 60px;
        /* 높이 매우 작게 */
        padding: 8px 6px;
        /* 패딩 조정 */
        border-radius: 5px;
        /* 모서리 덜 둥글게 */
        border: 1px solid #8B5A7C;
        /* 테두리 얇게 */
        justify-content: center;
        /* 텍스트만 중앙 정렬 */
    }

    /* 아이콘 완전히 제거 */
    .icon-placeholder {
        display: none;
        /* 아이콘 완전히 숨김 */
    }

    /* 제목 스타일 조정 */
    .subcategory-title {
        font-size: 0.75rem;
        /* 폰트 크기 작게 */
        margin-bottom: 4px;
        /* 마진 조정 */
        line-height: 1.1;
        /* 행간 최소화 */
    }

    /* 설명 스타일 조정 */
    .subcategory-desc {
        font-size: 0.65rem;
        /* 폰트 크기 작게 */
        line-height: 1.2;
        /* 행간 최소화 */
    }

    /* 버튼 컨테이너 조정 */
    .button-container {
        margin-top: 20px;
        /* 마진 줄임 */
    }

    .btn {
        padding: 12px 25px;
        /* 패딩 줄임 */
        font-size: 1rem;
        /* 폰트 크기 줄임 */
    }
}

/* 더 작은 화면 (480px 이하) */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 10px 0;
    }

    .main-card {
        margin: 0 2px;
        border: 3px solid #8B5A7C;
    }

    .card-content {
        padding: 15px 8px;
        /* 더 작은 패딩 */
    }

    .header h1 {
        font-size: 1.5rem;
        letter-spacing: 0.5px;
    }

    .category-selector select {
        padding: 7px 10px;
        font-size: 0.85rem;
        background-size: 12px;
        padding-right: 30px;
    }

    .orientation-title {
        padding: 10px 12px;
        margin-bottom: 12px;
    }

    .orientation-title h2 {
        font-size: 1rem;
    }

    .orientation-description {
        padding: 12px 10px;
        margin-bottom: 15px;
    }

    .orientation-description p {
        font-size: 0.85rem;
    }

    /* 그리드 1열 세로 배치 유지 */
    .orientation-grid {
        grid-template-columns: 1fr;
        /* 1열로 세로 배치 */
        gap: 10px;
        /* 간격 늘림 */
        margin-bottom: 12px;
    }

    .grid-item {
        min-height: 50px;
        /* 높이 최소화 */
        padding: 6px 4px;
        /* 패딩 조정 */
        border-radius: 4px;
        border: 1px solid #8B5A7C;
        /* 테두리 얇게 */
        justify-content: center;
        /* 텍스트만 중앙 정렬 */
    }

    .icon-placeholder {
        display: none;
        /* 아이콘 숨김 */
    }

    .subcategory-title {
        font-size: 0.7rem;
        /* 폰트 최소화 */
        margin-bottom: 3px;
        line-height: 1.0;
    }

    .subcategory-desc {
        font-size: 0.6rem;
        /* 폰트 최소화 */
        line-height: 1.1;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* 매우 작은 화면 (360px 이하) */
@media (max-width: 360px) {
    .card-content {
        padding: 12px 6px;
        /* 최소 패딩 */
    }

    .header h1 {
        font-size: 1.3rem;
    }

    .orientation-grid {
        grid-template-columns: 1fr;
        /* 1열로 세로 배치 */
        gap: 8px;
        /* 간격 적당히 늘림 */
    }

    .grid-item {
        min-height: 45px;
        /* 높이 극도로 최소화 */
        padding: 5px 4px;
        /* 패딩 조정 */
        border: 1px solid #8B5A7C;
        justify-content: center;
        /* 텍스트만 중앙 정렬 */
    }

    .icon-placeholder {
        display: none;
        /* 아이콘 숨김 */
    }

    .subcategory-title {
        font-size: 0.65rem;
        margin-bottom: 2px;
        line-height: 0.9;
    }

    .subcategory-desc {
        font-size: 0.55rem;
        line-height: 1.0;
    }
}

/* 터치 디바이스 대응 */
@media (hover: none) and (pointer: coarse) {
    .grid-item:active {
        transform: scale(0.98);
        background: #f0f1f2;
    }

    .btn:active {
        transform: translateY(1px);
        box-shadow: 0 2px 4px rgba(76, 91, 140, 0.2);
    }
}

/* 가로 모드 대응 (모바일) */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        margin-bottom: 20px;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .card-content {
        padding: 15px 10px;
    }

    .orientation-grid {
        gap: 12px;
    }

    .grid-item {
        min-height: 110px;
    }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {

    .btn,
    .grid-item {
        transition: none;
    }
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .grid-item {
        border-width: 3px;
        border-color: #000;
    }

    .orientation-title {
        border: 2px solid #000;
    }
}

.eng {
    font-size: 0.7rem;
    font-weight: normal;
    opacity: 0.8;
    color: #888;
}

/* 푸터 */
.site-footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.site-footer .copyright {
    color: white;
    opacity: 0.5;
    font-size: 0.8rem;
}


/* 푸터 내비게이션 (검색엔진 크롤링 경로 + 사이트 이동) */
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    justify-content: center;
    margin-bottom: 10px;
}

.footer-nav a {
    color: white;
    opacity: 0.75;
    font-size: 0.85rem;
    text-decoration: none;
}

.footer-nav a:hover {
    opacity: 1;
    text-decoration: underline;
}
