/* 기본 설정 */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: Arial, sans-serif;
    background: #ffffff;
    color: #111;
}
* { box-sizing: border-box; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 15px; }


.logo { display:inline-block; width:320px; height:80px; text-decoration:none; }
.logo img { width:100%; height:auto; display:block; }

/* 검색창 */
.search-box {
    display:flex;
    align-items:center;
    gap:8px;
    width:100%;
}
.search-box input {
    height:45px;
    padding:0 12px;
    border:1px solid #ccc;
    border-radius:6px;
    flex:1;
}
.search-btn {
    height:45px;
    padding:0 18px;
    background:#ddd;
    border:1px solid #bbb;
    border-radius:6px;
    font-size:14px;
    cursor:pointer;
    white-space:nowrap;
}
.search-btn:hover { background:#ccc; }
@media(max-width:600px){
    .search-box { flex-direction:row; width:100%; }
    .search-box input { height:45px; width:100%; }
    .search-btn { height:45px; font-size:15px; padding:0 16px; }
}

/* 카테고리 메뉴 */
.category-area {
    width: 100%;
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.category-area > *:not(:last-child) {
    margin-bottom: 10px;
}
.cat-item { margin:3px; padding:0; }
.cat-item a {
    display:flex;
    justify-content:center;
    align-items:center;
    width:100%;
    height:38px;
    background:#f4f4f4;
    border-radius:6px;
    border:1px solid #ddd;
    color:#000;
    text-decoration:none;
    font-size:14px;
    font-weight:500;
    white-space:nowrap;
    transition:0.2s;
}
.cat-item a:hover { background:#e7e7e7; }

.cat-h2 {
    display: block; /* 버튼처럼 보이게 */
    width: 100%;
    height: 45px;
    background: #e0e0e0;
    border: 1px solid #bbb;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
    line-height: 45px; /* 수직 정렬 */
    cursor: pointer;
    padding: 0; /* 버튼 높이에 맞춰 정리 */
}

/* PC 기본 스타일 */
.cat-box {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    column-gap: 16px;
    row-gap: 0px;
}

/* 버튼은 PC에서는 숨김 */
.cat-open-btn {
    display: none;
}

/* 모바일 전용 스타일 */
@media (max-width: 600px) {
    .cat-box {
        display: none; /* 모바일에서는 기본 숨김 */
        flex-direction: column;
        gap: 3px;
        padding: 4px 0;
    }

    .cat-box.open {
        display: flex; /* 버튼 누르면 나타남 */
    }

    .cat-open-btn {
        display: inline-block;
        width: 100%;
        height: 45px;
        background: #e0e0e0;
        border: 1px solid #bbb;
        border-radius: 6px;
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 10px;
        text-align: center;
        line-height: 45px;
        padding: 0;
        box-sizing: border-box;
    }
 
    .cat-item a {
        width: 100%;
        height: 34px;
        background: #efefef;
        border: 1px solid #ccc;
        border-radius: 6px;
        font-size: 14px;
        text-align: center;
    }
}

/* 카드형 목록 */
.item-list {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:15px;
}
.item {
    background:#fff;
    border:1px solid #eee;
    border-radius:8px;
    overflow:hidden;
}
.item-link { display:block; color:inherit; text-decoration:none; }

.item .thumb {
    width: 100%;
    /* 16:9 비율 고정 (320/180 비율 유지) */
    padding-top: 56.25%; 
    position: relative;
    background: #ccc;
    overflow: hidden;
    border-radius: 6px;
}

.item .thumb img {
    position: absolute;
    top: 0; 
    left: 0;
    /* CSS가 아닌 HTML width/height 속성 값을 따르도록 함 */
    width: 100%;
    height: 100%;
    /* 16:9 영역을 유지하면서 이미지가 잘리지 않도록 꽉 채웁니다. */
    object-fit: cover; 
    /* 로딩 최적화를 위해 will-change 속성 추가 */
    will-change: transform, opacity; 
}

.item .info { 
    padding: 10px; 
}

.item-hcut { 
    /* 제목 줄 자르기 (1줄 제한) */
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.item-pcut { 
    /* 설명 줄 자르기 (2줄 제한) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    font-size: 14px;
    font-weight: 400;
    color: #555;
    line-height: 1.5;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.item .date { font-size:12px; color:#777; }
.item-link:hover .title { text-decoration:underline; }
@media(max-width:900px){
    .item-list { grid-template-columns:repeat(3,1fr); }
}
@media(max-width:600px){
    .item-list { grid-template-columns:repeat(2,1fr); }
}
@media(max-width:400px){
    .item-list { grid-template-columns:repeat(1,1fr); }
}

/* 뷰페이지 */
h1 {
    word-break: break-all;
    overflow-wrap: break-word;
    white-space: normal;
}
.content {
    line-height:1.6;
    font-size:16px;
    margin-top:20px;
}

/* 모든 영상 요소를 반응형으로 고정 (video / iframe / embed / object) */
.content img,
.content video,
.content iframe,
.content embed,
.content object,
.video-wrap video {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* iframe이 비율을 유지하면서 반응형이 되도록 처리 */
.content iframe {
    aspect-ratio: 16 / 9;
}

/* picture 태그 및 내부 이미지 대응 */
.content picture,
.content picture img {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* 영상 영역 */
.video-wrap {
    position:relative;
    width:100%;
    padding-top:56.25%;
    margin:20px 0;
    background:#000;
    border-radius:8px;
    overflow:hidden;
}
.video-wrap video {
    position:absolute;
    top:0; left:0;
    width:100%!important;
    height:100%!important;
    object-fit:cover;
    border-radius:8px;
    background:#000;
}

/* 추천 게시물 */
.recommend-card {
    display:flex;
    justify-content:center;
    align-items:center;
    padding:12px;
    background:#f4f4f4;
    border:1px solid #ddd;
    border-radius:6px;
    text-align:center;
    transition:0.2s;
    min-height:42px;
}
.recommend-card:hover { background:#e7e7e7; }
.recommend-card a {
    display:block;
    width:100%;
    color:#000;
    font-size:14px;
    font-weight:500;
    text-decoration:none;
    word-break:break-all;
    white-space:normal;
}
.recommend-grid {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:10px;
}
@media(max-width:600px){
    .recommend-grid { grid-template-columns:1fr; }
}

/* hero-about */
.hero-image-container {
    margin: 20px 0;
    width: 100%;
}
.hero-image-container picture,
.hero-image-container img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}
.hero-text {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 25px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 6px;
}

.about-image-container {
    margin: 20px 0;
    width: 100%;
}
.about-image-container picture,
.about-image-container img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}
.about-text {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 25px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 6px;
}


.title, .item .info, .item-link, .content {
    word-wrap:break-word;
    overflow-wrap:break-word;
    word-break:break-all;
}

/* 배너 전체 영역 */
.banner-area{
    width:100%;
    margin:10px 0 15px;
}

.banner-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:10px;
}

.banner-item a{
    display:block;
    width:100%;
}

.banner-item img{
    width:100%;
    height:auto;
    display:block;
    border-radius:6px;
}

/* 모바일 전용 */
@media(max-width:600px){
    .banner-grid{
        grid-template-columns:1fr;
        gap:8px;
    }

    .mobile-hide{
        display:none !important;
    }
}

/* 푸터 */
.footer-area {
    margin-top:50px;
    padding:20px 0;
    text-align:center;
    border-top:1px solid #ddd;
    color:#555;
}

/* 전체 푸터 링크 영역 */
.footer-links-area {
    width: 100%;
    max-width: 700px;
    margin: 0 auto 25px;
    padding: 0 10px;
}

.footer-toggle-btn {
    width: 100%;
    height: 45px;
    background: #f3f3f3;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    line-height: 45px;
    cursor: pointer;
    text-align: center;
}

.footer-links-wrapper {
    display: none;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-top: 10px;
    padding: 15px;
}

.footer-links-wrapper.open {
    display: block;
}

.footer-links-box h3 {
    margin: 0; /* 기본 마진 제거 */
}

.footer-links-box {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.footer-links-box a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    color: #333;
    text-decoration: none;
}

.footer-links-box a:hover {
    background: #eee;
}

.footer-links-text {
    margin-top: 10px;
    font-size: 14px;
    color: #777;
    text-align: center;
}

.footer-links-text a {
    color: #777;
    text-decoration: none;
    margin: 0 4px;
}

.footer-links-text a:hover {
    text-decoration: underline;
}


@media(max-width:600px){
    .footer-links-area {
        max-width: 100%;
        padding: 0 8px;
    }

    .footer-toggle-btn {
        font-size: 15px;
        height: 42px;
    }
	
    .footer-links-box a {
        font-size: 14px;
        padding: 10px;
    }
}