/* ==================================
     운세 이야기 페이지 공통 스타일
   ================================== */

body {
    background-color: #f0f2f5;
}

/* --- 페이지 전체를 감싸는 컨테이너 --- */
.story-container {
    width: 100%;
    max-width: 1200px;
    /* 콘텐츠 영역을 더 넓게 */
    margin: 50px auto 40px auto;
    padding: 20px;
    color: #333;
}
/* --- 페이지 제목 스타일 --- */
.story-container h1 {
    font-size: 2.8rem;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 15px;
}
.story-container>p {
    text-align: center;
    color: #555;
    margin-bottom: 50px;
    font-size: 1.1rem;
}
/* --- 카드 목록 레이아웃 (Grid) --- */
.story-list {
    display: grid;
    /* 화면 크기에 맞춰 1~3개의 카드가 자동으로 정렬됩니다 */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    /* 카드 사이의 간격 */
}
/* --- 개별 카드 아이템 스타일 --- */
.story-item {
    display: flex;
    flex-direction: column;
    /* 이미지를 위, 텍스트를 아래로 배치 */
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.story-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
/* --- 카드 이미지 스타일 --- */
.story-item img {
    width: 100%;
    height: 200px;
    /* 모든 카드의 이미지 높이를 통일 */
    object-fit: cover;
    /* 이미지가 잘리더라도 비율에 맞게 꽉 채움 */
}

/* --- 카드 텍스트 영역 스타일 --- */
.story-item .story-text {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* 텍스트 영역이 카드의 남은 공간을 모두 차지 */
}

.story-item h2 {
    font-size: 1.5rem;
    margin: 0 0 10px 0;
    color: #1a2533;
}

.story-item p {
    font-size: 1rem;
    line-height: 1.6;
    color: #4a4a4a;
    flex-grow: 1;
    /* 설명 텍스트가 남은 공간을 차지 */
}

/* --- 플로팅 서브메뉴 컨테이너 --- */
.stories-nav {
    position: fixed;
    bottom: 63px;
    z-index: 999;
/* calc()를 사용하여 story-container를 기준으로 위치 계산 */
    /* 50vw = 화면 너비의 절반 */
    /* 600px = story-container 최대 너비(1200px)의 절반 */
    /* 30px = story-container와 메뉴 사이의 추가 간격 */
    right: calc(50vw - 600px - 140px);

    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    /* 뒷배경 블러 효과 */
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    padding: 10px;

    /* 내부 버튼들을 세로로 배치 */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* --- 플로팅 서브메뉴 안의 버튼 --- */
.stories-nav .story-nav-button {
    padding: 8px 18px;
    border: none;
    background-color: #f0f0f0;
    color: #555;
    text-decoration: none;

    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
    transition: all 0.2s ease;
}

.stories-nav .story-nav-button:hover {
    background-color: #e0e0e0;
}

/* 활성화된 버튼 스타일 */
.stories-nav .story-nav-button.active {
    background-color: #e57373;
    color: white;
    font-weight: bold;
}

/* --- 탭 버튼 --- */
/* --- 탭 전체를 감싸는 컨테이너 스타일 추가 --- */
.tab-container {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
}

/* --- 기존 탭 버튼 스타일 약간 수정 --- */
.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    /* 추가: 컨테이너 안에서 경계선 역할 */
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f2f5;
}

.tab-button {
    padding: 10px 15px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.tab-button:hover {
    background-color: #ddd;
}

.tab-button.active {
    background-color: #e57373;
    color: white;
    border-color: #e57373;
}

.tab-button .date {
    font-size: 0.8em;
    margin-left: 5px;
    color: #777;
}

.tab-button.active .date {
    color: white;
}

/* --- 탭 콘텐츠 --- */
.tab-content {
    display: none;
    background-color: #ffffff;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.tab-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #333;
}

.tab-content h3 {
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #444;
}

.tab-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* ✅ 이미지와 텍스트를 감싸는 .face-item 스타일 */
.face-item {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    align-items: flex-start;
}
/* 더 구체적인 선택자로 우선순위를 높입니다 */
.image-content-top {
    width: auto !important;
    max-width: 100% !important;;
    /* 기존 max-width를 덮어쓰기 위해 추가 */
    min-height: 200px !important;;
}

.face-item img {
    max-width: 200px;
    min-height: 200px;
    border-radius: 8px;
    flex-shrink: 0;
    object-fit: contain;
}

.face-item .text-content {
    flex: 1;
}

.face-item h3,
.face-item p {
    margin-top: 0;
}

/* ✅ 요약(.summary) 스타일 */
.summary {
    font-size: 0.95rem;
    color: #555;
    background-color: #f9f9f9;
    padding: 15px;
    border-left: 4px solid #e57373;
    border-radius: 4px;
    line-height: 1.6;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


/* ==================================
     모바일 반응형 스타일
   ================================== */
@media (max-width: 768px) {
    .story-container {
            margin-top: 20px;
            margin-bottom: 20px;
            padding: 15px;
        }

        .story-container h1 {
            font-size: 2rem;
        }

        .story-list {
            gap: 20px;
        }

    /* --- 별자리 탭 버튼 작고 예쁘게 모으기 --- */
    .tab-buttons {
        gap: 8px;
    }

    .tab-button {
        flex: 1 1 28%;
        padding: 8px 5px;
        font-size: 14px;
        line-height: 1.3;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-height: 50px;
    }

    .tab-button .date {
        font-size: 11px;
        margin-top: 2px;
        margin-left: 0;
    }

    /* --- 서브네비게이션 숨기기 --- */
    .stories-nav {
        flex-direction: row;
        /* 버튼을 다시 가로로 배치 */
        justify-content: space-around;
        /* 버튼들을 균등하게 분배 */

        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 12px 12px 0 0;
        /* 위쪽 모서리만 둥글게 */
        padding: 8px 5px;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    }
    .stories-nav .story-nav-button {
        flex-grow: 1;
        /* 버튼들이 가능한 공간을 모두 차지 */
    }

/* --- 모바일에서 특정 페이지 이미지 숨기기 --- */
/* stories-style.css 파일의 @media 블록 안에 추가 */

/* --- 콘텐츠 영역의 모든 이미지 숨기기 (모바일) --- */
/* 이 규칙 하나로 모든 관련 페이지의 콘텐츠 이미지가 숨겨집니다. */
.story-container img,
.container img {
    display: none;
}
    .constellation-page .face-item {
        gap: 0;
    }

    /* --- 별자리 페이지 summary 클래스 숨기기 --- */
    .constellation-page .summary {
        /* ✅ display: none; 대신 스타일 초기화 */
        padding: 0;
        border: none;
        background-color: transparent;
        font-size: 1rem;
        line-height: 1.7;
    }
}