:root {
    --main-color: #d9534f;
    --text-color: #333;
    --bg-light: #f4f1eb;
    --bg-white: #fff;
}

/*
 * 기본 스타일
 */
body, h1, h2, h3, p, ul, li {
    margin: 0;
    padding: 0;
    font-family: 'AppleSDGothicNeo-Regular', 'Malgun Gothic', '맑은 고딕', dotum, '돋움', sans-serif;
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
}

body {
    background-color: var(--bg-light);
    color: var(--text-color);
}

.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 0 10px;
}

.section {
    position: relative;
    padding: 10px 0;
    overflow: hidden;
}

.edit-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: var(--main-color);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
    z-index: 100;
    font-size: 0.85em;
}
.edit-post-btn {
    background-color: var(--main-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
	padding: 2px 5px;
}
.edit-cmt-btn {
    background-color: #a11414;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
	padding: 2px 5px;
}
.publish-btn {
	border-radius: 5px;
	border: 1px solid #ddd;
}
/*
 * 헤더
 */
header {
    padding: 20px 0;
    background-color: var(--bg-white);
    border-bottom: 1px solid #eee;
    text-align: center;
}

header h1 {
    font-weight: 900;
}

header h1 span {
    color: var(--main-color);
}

/*
 * 히어로 섹션
 */
.hero {
    position: relative;
    height: 50vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    overflow: hidden;
    margin-bottom: 20px;
}

.hero-content-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
}

.hero-content {
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero h2 {
    font-size: 2.5em;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5em;
}

.hero p {
    font-size: 1.2em;
    font-weight: 300;
    margin-top: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/*
 * 섹션 타이틀
 */
.section-title {
    font-size: 20px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 10px;
}

.section-title span {
    color: var(--main-color);
}

/*
 * 비디오 섹션
 */
.video-section-inner {
    background-color: var(--bg-white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.video-main {
    margin-bottom: 30px;
}

.video-player {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background-color: #000;
    border-radius: 8px;
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-main h3 {
    font-size: 22px;
    margin-top: 20px;
    font-weight: 700;
}

.video-playlist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.video-thumb {
    text-align: center;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.video-thumb:hover,
.video-thumb.active {
    opacity: 1;
}

.video-thumb img {
    width: 100%;
    height: 112px;
    border-radius: 5px;
    object-fit: cover;
    border: 3px solid transparent;
    transition: border-color 0.2s;
}

.video-thumb.active img {
    border-color: var(--main-color);
}

.video-thumb p {
    font-size: 0.95em;
    font-weight: 400;
    margin-top: 8px;
}

/*
 * 갤러리 및 카드 뉴스
 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item img:hover {
    transform: scale(1.05);
}

.card {
    background-color: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    cursor: pointer;
}

.card-content {
    padding: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 0.9em;
    font-weight: 700;
    margin-bottom: 10px;
}

.card-content p {
    font-size: 0.95em;
    color: #666;
    line-height: 1.4;
    flex-grow: 1;
}

.read-more-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 4px 8px;
    background-color: var(--main-color);
    color: white;
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.85em;
    transition: background-color 0.2s;
    align-self: flex-start;
}

.read-more-btn:hover {
    background-color: #c9302c;
}

.read-new-btn {
    display: inline-block;
    padding: 4px 8px;
    background-color: var(--main-color);
    color: white;
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.85em;
    transition: background-color 0.2s;
    align-self: flex-start;
}

.read-new-btn:hover {
    background-color: #c9302c;
}

/*
 * 가로 카드 뉴스
 */
.horizontal-card-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.horizontal-card {
    display: flex;
    background-color: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.horizontal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.horizontal-card img {
    width: 200px;
    height: auto;
    object-fit: cover;
    cursor: pointer;
}

.horizontal-card .card-content {
    justify-content: center;
}

/*
 * 라이트박스
 */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.lightbox img {
    max-width: 90%;
    max-height: 80%;
}

.lightbox .close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* 라이트박스 네비게이션 버튼 */
.lightbox .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 60px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10000;
    padding: 0 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transition: color 0.2s ease;
    -webkit-text-stroke: 1px black;
}

.lightbox .nav-btn:hover {
    color: var(--main-color);
}

.lightbox .prev-btn {
    left: 10px;
}

.lightbox .next-btn {
    right: 10px;
}

.lightbox .nav-btn.disabled {
    color: rgba(255, 255, 255, 0.3);
    cursor: default;
}

/*
 * 푸터
 */
footer {
    position: relative;
    padding: 60px 20px;
    text-align: center;
    background-color: #333;
    color: #aaa;
}

footer p {
    padding: 10px 0;
}

/*
 * 스크롤 애니메이션
 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: none;
}

.fade-in-from-bottom { transform: translateY(150px); }
.fade-in-from-left { transform: translateX(-150px); }
.fade-in-from-right { transform: translateX(150px); }

/*
 * 반응형 디자인
 */
@media (max-width: 992px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .horizontal-card-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h2 {
        font-size: 36px;
    }

    .video-playlist {
        grid-template-columns: 1fr;
    }

    .video-thumb {
        display: flex;
        text-align: left;
        align-items: center;
    }

    .video-thumb img {
        width: 120px;
        height: 68px;
        flex-shrink: 0;
    }

    .video-thumb p {
        margin-top: 0;
        margin-left: 15px;
    }

    .hero {
        background-attachment: scroll;
    }

    .horizontal-card {
        flex-direction: column;
    }

    .horizontal-card img {
        width: 100%;
        height: 180px;
    }
	.video-section-inner {
		padding: 10px;
	}
}

/*
 * 게시판 섹션
 */
.bbs-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 20px;
}

.bbs-form-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.bbs-form-group input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.bbs-post {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

.bbs-post img,
.bbs-post iframe {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 10px;
    border-radius: 4px;
}

.bbs-post p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.bbs-post small {
    color: #999;
    margin-top: 5px;
    display: block;
}

.bbs-pagination {
    text-align: center;
    margin-top: 20px;
}

.bbs-pagination a {
    text-decoration: none;
    color: #1DA1F2;
    padding: 8px 12px;
    border: 1px solid #ddd;
    margin: 0 5px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.bbs-pagination a.active,
.bbs-pagination a:hover {
    background-color: #1DA1F2;
    color: #fff;
}

#bbs-status {
    margin-top: 10px;
    text-align: right;
    color: #888;
}

.ads-container {
    display: none;
}

/*
 * 자유 게시판
 */
#free_talk {
    background-color: #f8f8f8;
}

#bbs_board {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.comment-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 새 글 작성 폼 */
.comment-form {
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fcfcfc;
}

.comment-form h3 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 22px;
    color: #555;
    text-align: center;
}

.comment-form form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-form .form-group {
    width: 100%;
}

.comment-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #444;
    font-size: 0.95em;
}

.comment-form input[type="text"],
.comment-form textarea,
.comment-form input[type="file"] {
    width: calc(100% - 10px);
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 0.9em;
    display: block;
    margin: 0 auto;
}

.comment-form textarea {
    min-height: 90px;
    resize: vertical;
}

.comment-form small#status-message {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: grey;
}

.comment-form button {
    padding: 12px 25px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.comment-form button:hover {
    background-color: #218838;
}

/*
 * 게시판 검색
 */
.bbs-search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.bbs-search-form input[type="text"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.bbs-search-form button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.bbs-search-form button:hover {
    background-color: #0056b3;
}

.search-reset-link {
    display: block;
    text-align: right;
    margin-top: 5px;
    font-size: 0.9em;
    color: #d9534f;
}

/*
 * 게시글 목록
 */
.post-list-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-post {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 18px 20px;
    background-color: #f9f9f9;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-post:nth-child(odd) {
    background-color: #e9f5e9;
}

.comment-post:nth-child(even) {
    background-color: #f1f1f1;
}

.comment-post .post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
    flex-wrap: wrap;
    gap: 5px;
}

.comment-post .author strong {
    color: #0056b3;
    font-size: 0.95em;
}

.comment-post .date {
    font-size: 0.85em;
    color: #777;
}

.comment-post .delete-btn {
    color: #d9534f;
    text-decoration: none;
    margin-left: 15px;
    white-space: nowrap;
}

.post-content p {
    margin-bottom: 12px;
    /*white-space: pre-wrap;*/
	line-height: 1.4;
    color: #333;
    font-size: 0.95em;
}

.youtube-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-bottom: 12px;
    border-radius: 5px;
}

.youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.post-image {
    text-align: center;
    margin-bottom: 12px;
}

.post-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-height: 500px; /* 이미지 높이가 400px 이상이면 자동으로 400px로 제한 */
    object-fit: cover;  /* 필요시 이미지를 잘라서 맞출 때 */
}

.no-posts {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 30px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    background-color: #fefefe;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 8px;
}

.pagination .page-link {
    display: block;
    padding: 8px 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.pagination .page-link.active {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
    font-weight: bold;
}

.pagination .page-link:hover {
    background-color: #e9e9e9;
    border-color: #aaa;
}

/*
 * 댓글 섹션
 */
.post-comments-section {
    border-top: 1px solid #eee;
}

.comment {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

.comment-author {
    font-weight: bold;
    color: #333;
}

.comment-body {
    word-wrap: break-word;
    line-height: 1.4;
}

.post-comments-section .comment-form {
    padding: 0;
    border: none;
    background-color: transparent;
}

.post-comments-section .comment-form form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-comments-section .comment-form input,
.post-comments-section .comment-form textarea {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}

.post-comments-section .comment-form button {
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0;
    font-size: 0.9em;
}

.post-comments-section .comment-form button:hover {
    background-color: #45a049;
}

.comment-count-display {
    text-align: right;
    color: #555;
    font-size: 0.9em;
    padding: 5px 0;
}

/*
 * 모바일 반응형
 */
@media (max-width: 768px) {
    #bbs_board {
        padding: 5px;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 5px;
    }

    .comment-form h3 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .comment-form button {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .comment-form {
        padding: 10px;
    }

    .comment-post {
        padding: 10px;
    }

    .comment-post .post-header {
        align-items: flex-start;
        gap: 3px;
    }

    .comment-post .delete-btn {
        margin-left: 0;
        margin-top: 5px;
    }

    .comment-body {
        font-size: 0.95em;
    }

    .pagination .page-link {
        padding: 6px 10px;
        font-size: 0.85em;
    }
}

/*
 * 광고 컨테이너
 */
.flex-ad-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

@media (max-width: 820px) {
    .flex-ad-wrapper {
        gap: 0;
    }

    .ad-container {
        margin: 15px 0;
    }
}

.ad-container-mobl {
    display: none;
}

@media (max-width: 680px) {
    .ad-container-desktop {
        display: none;
    }

    .ad-container-mobl {
        display: block;
    }
}

@media (max-width: 610px) {
	.post-image img {
		max-height: 320px;
	}
}
/*
 * 구글 검색 결과
 */
#google_search_results {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
    display: none;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 980px) {
    #google_search_results {
        padding: 0;
    }
}

/*
 * 대댓글
 */
.reply-form-container {
    padding-left: 20px;
    margin-top: 10px;
    border-left: 2px solid #ddd;
}

.comment-form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-form-group input[type="text"],
.comment-form-group textarea {
    width: 100%;
    box-sizing: border-box;
}

.comment-form-group input[type="text"] {
    height: 25px;
}

.comment-form-group button {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0;
    font-size: 0.9em;
}

/*
 * 캡차
 */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-label {
    height: 20px;
    line-height: 20px;
    font-size: 14px !important;
    font-weight: normal !important;
    color: blue !important;
}

.captcha-input {
    height: 22px;
    width: 70px !important;
    padding: 0 !important;
}

.btn_gap {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/*
 * 댓글 그리드
 */
.comment-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

@media (max-width: 768px) {
    .comment-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.comment-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 7px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    position: relative;
    line-height: 1.4;
}

.comment-author {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.comment-message {
    font-size: 0.95em;
    color: #555;
    margin-bottom: 20px;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comment-link {
    display: inline-block;
    font-size: 0.8em;
    color: #007bff;
    text-decoration: none;
    word-break: break-all;
    position: absolute;
    bottom: 5px;
    right: 10px;
}

.comment-link:hover {
    text-decoration: none;
}