.post-header {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.post-header .event-time,
.post-header .title-section,
.post-header .author-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-header .left,
.post-header .right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-header .label {
    font-weight: 600;
    color: #555555;
    margin-right: 5px;
}

.title-section {
    word-wrap: break-word; /* 길이가 긴 단어를 강제로 줄바꿈 */
    word-break: break-word; /* 긴 단어가 줄바꿈 없이 넘어가지 않게 처리 */
    white-space: normal; /* 기본적으로 줄바꿈을 허용 */
}

.post-header .remaining-time {
    width: 220px;
    font-weight: 600;
    color: #ff4444;
    background-color: #fff0f0;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #ffcccc;
}

.post-header img.grade {
    width: 30px;
    height: 30px;
}

.post-header p {
    margin: 0;
    font-size: 16px;
    color: #333333;
}

/* 이미지 갤러리 스타일 */
.image-gallery {
    flex-wrap: wrap;
    gap: 10px;
}

/* 개별 이미지 컨테이너 */
.image-container {
    position: relative;
    max-width: 100%; /* 본문을 벗어나지 않도록 제한 */
    /*max-height: 600px; !* 이미지 최대 높이 제한 *!*/
    overflow: hidden; /* 컨테이너 크기 초과 이미지는 숨김 */
}

/* 이미지 스타일 */
.image-container img {
    width: auto; /* 이미지 원래 비율 유지 */
    height: auto; /* 이미지 원래 비율 유지 */
    max-width: 100%; /* 컨테이너 크기를 초과하지 않음 */
    max-height: 100%; /* 컨테이너 크기를 초과하지 않음 */
    display: block;
}

/* 특정 카테고리에만 적용되는 스타일 */
.event-gallery {
    display: flex;
    flex-direction: column; /* 세로 정렬 */
    justify-content: center; /* 가로 중앙 정렬 */
    align-items: center; /* 세로 중앙 정렬 */
    flex-wrap: wrap; /* 이미지가 여러 줄로 자동 줄바꿈 */
}

.event-gallery .image-container {
    position: relative;
    max-width: 100%; /* 본문을 벗어나지 않도록 제한 */
    text-align: center; /* 이미지 중앙 정렬 */
    margin: 10px; /* 이미지들 간격 추가 */
}

.event-gallery .image-container img {
    max-width: 100%; /* 이미지 크기 조정 */
    height: auto; /* 비율 유지 */
}

.post-recommend-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.comment-function-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.popup {
    display: none; /* 기본적으로 숨김 */
    position: absolute;
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 5px;
    z-index: 1000;
    width: 200px;
}

.popup a {
    display: block;
    text-decoration: none;
    color: black;
    margin: 5px 0;
    padding: 5px;
    border-radius: 3px;
}

.popup a:hover {
    background-color: #f0f0f0;
}

.post-body {
    min-height: 400px; /* 기본 최소 높이 설정 */
    padding: 10px; /* 적절한 여백 추가 */
    line-height: 1.5; /* 줄 간격 설정 */
    word-wrap: break-word; /* 긴 단어가 줄 바꿈이 되도록 설정 */
}

.post-body img, .post-body video, .post-body iframe {
    max-width: 100%; /* 부모 요소의 너비를 초과하지 않도록 제한 */
}

/* 첨부파일 텍스트의 hover 효과 */
.attachment-text {
    cursor: pointer;
    font-weight: bold;
    transition: color 0.3s ease;
}

/* 마우스를 올리면 색상이 변경되도록 */
.attachment-text:hover {
    color: #007bff; /* 원하는 hover 색상으로 변경 */
}

.recommend-button-img {
    margin: 0;
    padding: 0;
    width: 30px;
    height: 30px;
}

@media screen and (max-width: 768px) {

    .post-header {
        padding: 10px;
    }

    .post-header .event-time,
    .post-header .title-section,
    .post-header .author-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .popup {
        transform: translateX(-50%);
    }
}