/*
.gallery-container
grid (gallery, zine)
grid-item
gallery-item
thumbnail / item-info
cnt / info
*/

/* 정렬 버튼 드롭다운 스타일 */
.sort-dropdown-container {
    position: relative;
    display: inline-block;
}

.sort-button {
	margin-left: 10px;
    width: 105px;
    height: 36px;
    background: #ffffff;
    border: 1px solid #DADADA;
    border-radius: 4px;
    padding: 7px 15px;
	padding-left: .5rem !important;
	padding-right: .7rem !important;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.6;
    letter-spacing: -0.02em;
    color: #636363;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-button:hover {
    background: #f8f9fa;
    border-color: #c0c0c0;
}

.sort-button.active {
    /*border-color: #007bff;
    background: #f8f9ff;*/
}

.sort-arrow {
    transition: transform 0.2s ease;
}

.sort-button.active .sort-arrow {
    transform: rotate(180deg);
}

.sort-dropdown-menu {
	width: 105px;
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid #DADADA;
    border-radius: 4px;
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.sort-dropdown-menu.show {
    display: block;
}

.sort-dropdown-menu.dropup {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
}

.sort-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 13px;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: 11px;
    line-height: 1.6;
	letter-spacing: -0.015em;
    color: #4C4C4c;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
	white-space: nowrap;
    position: relative;
}

.sort-option span {
    flex: 1;
}

.sort-option:last-child {
    border-bottom: none;
}

.sort-option:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: #333333;
}

.sort-option:hover span {
    color: rgba(96, 15, 201, 1);
    text-decoration: underline;
}

.sort-option.active {
    background: transparent;
    color: #4C4C4c;
}

.sort-option.active:hover {
    background: #f8f9fa;
    color: #333333;
}

.sort-option.active:hover span {
    color: rgba(96, 15, 201, 1);
    text-decoration: underline;
}

.sort-close-btn {
    background: none;
    border: none;
    padding: 0;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.sort-close-btn svg {
    width: 14px;
    height: 14px;
    display: block;
}

.sort-close-btn svg path {
    transition: fill 0.2s ease;
}

.sort-close-btn:hover svg path {
    fill: rgba(99, 99, 99, 1);
}

.sort-option.active .sort-close-btn svg path {
    fill: #C0C0C0;
}

.sort-option.active .sort-close-btn:hover svg path {
    fill: rgba(99, 99, 99, 1);
}


.gallery-container {
    width: 100%;
    height: 100%;
}

.gallery-container .grid {
    width: 100%;
    min-height: 100px;
}

.gallery-container .grid .grid-item {
    padding: 10px;
    box-sizing: border-box;
    width: 100%; /* 기본 1열 */
    break-inside: avoid;
}

/* 반응형 설정 */
@media (min-width: 576px) {
    .gallery-container .grid .grid-item {
        width: 50%; /* 2열 */
    }
}
@media (min-width: 768px) {
    .gallery-container .grid .grid-item {
        width: 33.333%; /* 3열 */
    }
}
@media (min-width: 1200px) {
    .gallery-container .grid .grid-item {
        width: 25%;
    }
}

.gallery-container .grid .thumbnail {
    width: 100%;
    position: relative;
    border: 1px solid #eee;
    overflow: hidden;
}

.gallery-container .grid .thumbnail img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 5 / 4;
    transition: transform 0.3s ease;
}
.gallery-container .grid .thumbnail .title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.gallery-container .item-info .info {
    font-size: .875rem;
    color: #888;
}
.gallery-container .item-info .info > span {
    margin-right: .5rem;
}

.gallery-container .item-info .info .manager-box {
    position: absolute;
    bottom: 0;
    right: 0;
}
.board .btn-more {
    color: #fff;
    background-color: #111;
}
.board .btn-more:hover {
    color: #fff;
    background-color: rgb(var(--main-rgb));
}

/*

board_zine

*/
.board_zine .gallery-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.board_zine .gallery-item:hover {
    box-shadow: 0 5px 10px rgba(0,0,0,0.05);
}

.board_zine .item-info {
    padding: 15px;
    font-size: 14px;
}

.board_zine .item-info .title {
    margin: 0 0 10px 0;
    font-weight: 600;
    line-height: 1.4;
}

.board_zine .item-info .title a {
    color: #333;
    text-decoration: none;
}

.board_zine .item-info .title a:hover {
    color: #007bff;
}

.board_zine .item-info .info > span {
    margin-right: 5px;
}

.board_zine .thumbnail:hover img {
    transform: scale(1.05);
}

.board_zine .scrap-btn.active {
    background-color: #007bff;
    color: white;
}
.board_zine .scrap-btn.active i {
    color: #ffc107;
}





/*

board_gallery

*/
.board_gallery .gallery-item {
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.board_gallery .gallery-item .thumbnail:hover img {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.board_gallery .thumbnail {
    border-radius: 8px;
}
.board_gallery .thumb-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    padding: 1rem;
    color: #fff;
}


.board_gallery .title {
    position: absolute;
    left: 0;
    bottom: 0;
    margin: 0;
    padding: 2rem 6rem 1.5rem 1rem;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    opacity: 0;
    moz-transition: all .3s ease;
    -o-transition: all .3s ease;
    -webkit-transition: all .3s ease;
    transition: all .3s ease;
}
.board_gallery .title a {
    color: #333;
    text-decoration: none;
}
.board_gallery .thumbnail a.gradient:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0) 0%, rgba(18, 18, 18, 0) 50%, rgba(0, 0, 0, 0.35) 85%);
    background-size: 100% 180%;
    background-position: 0 55%;
    opacity: 0;
    moz-transition: all .3s ease;
    -o-transition: all .3s ease;
    -webkit-transition: all .3s ease;
    transition: all .3s ease;
}
.board_gallery .thumbnail:hover a.gradient:before {
    opacity: 1;
}
.board_gallery .thumbnail .extra-wrap {
    display: flex;
    moz-transition: all .3s ease;
    -o-transition: all .3s ease;
    -webkit-transition: all .3s ease;
    transition: all .3s ease;
    opacity: 0;
}
.board_gallery .thumbnail:hover .extra-wrap {
    opacity: 1;
}
.board_gallery .item-info .title a:hover {
    color: #007bff;
}
.board_gallery .item-info>div {
    height: 24px;
}
.board_gallery .item-info .subject {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
.board_gallery .scrap-count {
    color: #A0A0A0;
}
.board_gallery .scrap-count svg {
    flex-shrink: 0;
}


/* FAQ accordion*/
.accordion .accordion-item.notice .edit {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    white-space: nowrap;
    transform: translateY(-50%);
    z-index: 2;
}
.accordion .accordion-item.notice .accordion-button:not(.collapsed)::after,
.accordion .accordion-item.notice .accordion-button::after {
    display: none;
}
.accordion .accordion-item,
.accordion .accordion-button {
    color: #555;
    border: 0;
}
.accordion-button:focus,
.accordion-button:not(.collapsed) {
    background: none;
    box-shadow: none;
}
.accordion-collapse.collapse {
    background-color: #f9f9f9;
}
.accordion-button:not(.collapsed)::after,
.accordion-button::after {
    content: '\F64D';
    font-family: 'Bootstrap-Icons';
    background-image: none;

}
.accordion-button:not(.collapsed)::after {
    content: '\F63B';
    transform: rotate(0deg);
}
.accordion-button,
.accordion-body {
    padding-top: 2rem;
    padding-bottom: 2rem;
}
.accordion-button .num {
    font-size: 1.25rem;
    font-weight: bold;
}
.accordion-item {
    color: #777;
}

/*mobile-overlay PC 화면에서 숨김*/
.mobile-overlay {
    display: none;
}

@media (max-width: 767px) {
    .mobile-overlay {
        display: block;
    }
}

/*media*/
@media (min-width: 992px) {

}
@media (min-width: 1200px) {

}

@media (max-width: 1199px) {
    .cTab {
        display: flex;
        padding-bottom: 1rem;
        width: 100%;
        flex-wrap: inherit;
        overflow: hidden;
        white-space: nowrap;
        overflow-x: scroll;
/*        scrollbar-width: thin;*/
    }
    .cTab::-webkit-scrollbar {
        height: 5px;
    }
    .cTab::-webkit-scrollbar-track {
        background-color: #eee;
    }
    .cTab::-webkit-scrollbar-thumb {
        background-color: #111;
    }
}

@media (max-width: 767px) {
    .board .search-end .iText,
    .search-width,
    .search-form {
        width: 100%;
    }

	.search-form .tag-list-widget {
		margin-bottom: .7rem;
	}
}

@media (max-width: 420px) {
    .gallery-container .grid .thumbnail .title {
        padding-right: 7rem;
    }
    /*write*/
    .exForm table td input[type="file"] {
        max-width: 250px;
    }
}
@media (max-width: 340px) {
    /*write*/
    .exForm table td input[type="file"] {
        max-width: 180px;
    }
}

/* 스켈레톤 UI 스타일 */
.skeleton-container {
    width: 100%;
    padding: 20px 0;
}

/* 갤러리 스켈레톤 */
.skeleton-gallery {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    padding: 10px;
}

@media (min-width: 576px) {
    .skeleton-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .skeleton-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .skeleton-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

.skeleton-gallery-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.skeleton-thumbnail {
    width: 100%;
    height: 0;
    padding-bottom: 80%;
    position: relative;
    overflow: hidden;
}

.skeleton-item-info {
    padding: 12px;
}

.skeleton-title {
    height: 20px;
    border-radius: 4px;
    margin-bottom: 12px;
    width: 80%;
}

.skeleton-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.skeleton-stat-item {
    height: 16px;
    border-radius: 4px;
    width: 60px;
}

.skeleton-info-line {
    height: 14px;
    border-radius: 4px;
    margin-top: 8px;
    width: 50%;
}

/* 리스트 스켈레톤 */
.skeleton-list {
    width: 100%;
}

.skeleton-list-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.skeleton-list-item:last-child {
    border-bottom: none;
}

.skeleton-list-no {
    width: 40px;
    height: 16px;
    border-radius: 4px;
    margin-right: 16px;
}

.skeleton-list-title {
    flex: 1;
    height: 18px;
    border-radius: 4px;
    margin-right: 16px;
}

.skeleton-list-author {
    width: 80px;
    height: 16px;
    border-radius: 4px;
    margin-right: 16px;
}

.skeleton-list-date {
    width: 70px;
    height: 16px;
    border-radius: 4px;
}

/* 웹진 스켈레톤 */
.skeleton-webzine {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
}

@media (min-width: 768px) {
    .skeleton-webzine {
        grid-template-columns: repeat(2, 1fr);
    }
}

.skeleton-webzine-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.skeleton-webzine-thumbnail {
    width: 100%;
    height: 200px;
}

.skeleton-webzine-content {
    padding: 15px;
}

.skeleton-webzine-title {
    height: 24px;
    border-radius: 4px;
    margin-bottom: 12px;
    width: 70%;
}

.skeleton-webzine-summary {
    height: 16px;
    border-radius: 4px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-webzine-summary:last-of-type {
    width: 60%;
}

.skeleton-webzine-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.skeleton-webzine-author {
    width: 100px;
    height: 16px;
    border-radius: 4px;
}

.skeleton-webzine-count {
    width: 50px;
    height: 16px;
    border-radius: 4px;
}

/* Shimmer 애니메이션 */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Pulse 애니메이션 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 스켈레톤 요소에 애니메이션 적용 */
.skeleton-thumbnail,
.skeleton-title,
.skeleton-stat-item,
.skeleton-info-line,
.skeleton-list-no,
.skeleton-list-title,
.skeleton-list-author,
.skeleton-list-date,
.skeleton-webzine-thumbnail,
.skeleton-webzine-title,
.skeleton-webzine-summary,
.skeleton-webzine-author,
.skeleton-webzine-count {
    background: linear-gradient(
        90deg,
        #E6E6E6 0%,
        #F0F0F0 20%,
        #E6E6E6 40%,
        #E6E6E6 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 1.5s infinite linear, pulse 2s infinite ease-in-out;
}
