/* From list.skin.php */
html {
    scrollbar-gutter: stable;
}

/* 🎨 Pinterest Masonry Styles (Flexbox Multi-Column) */
.pin-grid-container {
    display: flex;
    gap: 20px;
    width: 100%;
    margin-bottom: 50px;
    align-items: flex-start;
}

.pin-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.pin-card-item {
    width: 100%;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s;
    box-sizing: border-box;
}

.pin-card-item.pin-notice-item {
    border: 2px solid #ef4444 !important;
    background-color: #fcf8f8 !important;
}

.pin-card-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.08);
}

.pin-thumb-wrap {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #f8fafc;
}

.pin-thumb-wrap img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.pin-card-item:hover .pin-thumb-wrap img {
    transform: scale(1.03);
}

.pin-notice-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.pin-body {
    padding: 16px;
}

.pin-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 5px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: keep-all;
}

.pin-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.pin-title a:hover {
    color: #3b82f6;
}

.pin-comment-badge {
    /* 숫자만 — 테두리도 바탕도 없다. 알약 꼴이면 카테고리 표와
       구분이 안 된다(색까지 같았다). */
    display: inline-block;
    margin-left: 6px;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 700;
    vertical-align: middle;
}

.pin-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #64748b;
    border-top: 1px dashed #f1f5f9;
    padding-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
.pin-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pin-meta span i {
    color: #cbd5e1;
    flex-shrink: 0;
}

.pin-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pin-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.pin-author-text {
    line-height: 1.3;
}

.pin-author-text strong {
    color: #0f172a;
}

/* 🔍 Infinite Scroll Loader Styles */
.pin-loader-wrap {
    text-align: center;
    padding: 30px 0;
    display: none;
}

.pin-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: pin-spin 1s linear infinite;
    display: inline-block;
}

@keyframes pin-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 🔒 Premium Modal Styles */
.pin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    overscroll-behavior: contain;
}

.pin-modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 1500px;
    height: 100%;
    border-radius: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
}

.pin-modal-overlay.show .pin-modal-container {
    transform: translateY(0);
}

.pin-modal-close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(241, 245, 249, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    z-index: 10100;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: background 0.2s, transform 0.2s;
    color: #475569;
}

.pin-modal-close-btn:hover {
    background: #e2e8f0;
    transform: scale(1.05);
    color: #0f172a;
}

.pin-modal-body {
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

#pinModalIframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Actions & Write Button */
.btn-primary-gradient {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #fff;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(59,130,246,0.3);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59,130,246,0.4);
    color: #fff;
}

.board-bottom-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    margin-bottom: 40px;
}

/* 🔍 Search Area Styles */
.pinboard-search-wrap {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 30px;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}
.premium-search {
    display: flex;
    justify-content: center;
}
.premium-search form {
    display: flex;
    background: #fff;
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 0 0 1px rgba(0,0,0,0.02);
    align-items: center;
    border: 1px solid #e2e8f0;
}
.premium-search select {
    border: none;
    background: transparent;
    padding: 10px 15px 10px 20px;
    color: #475569;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    flex-shrink: 0;
}
.premium-search input {
    border: none;
    background: transparent;
    padding: 10px 15px;
    width: 280px;
    outline: none;
    border-left: 1px solid #e2e8f0;
    font-size: 1.0rem;
}
.premium-search .camera-btn {
    background: none !important;
    border: none !important;
    color: #64748b !important;
    cursor: pointer;
    padding: 10px 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    box-shadow: none !important;
    flex-shrink: 0;
}
.premium-search .camera-btn:hover {
    color: #3b82f6 !important;
}
.premium-search .search-submit-btn {
    background: #1e293b;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 25px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 1px solid #e2e8f0;
    flex-shrink: 0;
    white-space: nowrap;
}
.premium-search .search-submit-btn:hover {
    background: #0f172a;
}

/* Image Search Preview Area */
.search-image-preview-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 15px;
}
.search-image-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    width: fit-content;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}
.search-image-preview .preview-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
}
.search-image-preview img {
    max-height: 60px;
    max-width: 100px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    object-fit: contain;
    display: block;
}
.search-image-preview .btn-reset-image {
    color: #ef4444;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 700;
    margin-left: 8px;
    transition: color 0.2s;
}
.search-image-preview .btn-reset-image:hover {
    color: #dc2626;
}

/* Responsive Grid columns */
@media (max-width: 768px) {
    .board-bottom-actions {
        justify-content: center !important;
    }
    .pinboard-search-wrap {
        width: 100%;
        gap: 10px !important;
    }
    .premium-search {
        width: 100%;
    }
    .premium-search form {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .premium-search select {
        padding: 8px 10px 8px 15px !important;
        font-size: 0.85rem !important;
        max-width: 100px !important;
    }
    .premium-search input {
        padding: 8px 10px !important;
        font-size: 0.85rem !important;
        width: auto !important;
        flex-grow: 1 !important;
        min-width: 0 !important;
        border-left: 1px solid #e2e8f0 !important;
    }
    .premium-search .camera-btn {
        padding: 8px 10px !important;
        font-size: 1rem !important;
    }
    .premium-search .search-submit-btn {
        padding: 8px 15px !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
    }
}
@media (max-width: 640px)  { 
    .pin-grid-container { gap: 12px; } 
    .pin-column { gap: 12px; }
    .pin-card-item { border-radius: 12px; }
    .pin-body { padding: 10px; }
    .pin-title { font-size: 0.85rem; margin-bottom: 8px; }
    .pin-modal-overlay { padding: 0; }
    .pin-modal-container { height: 100%; border-radius: 0; }
    .pin-modal-close-btn { top: 10px; right: 10px; width: 32px; height: 32px; font-size: 1.2rem; }
}

/* 뷰 토글 버튼 스타일 */
.pinboard-view-toggle-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    gap: 8px;
    width: 100%;
}
.pinboard-view-toggle-wrap .toggle-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.pinboard-view-toggle-wrap .toggle-view-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    color: #1e293b;
    transform: translateY(-1px);
}
.pinboard-view-toggle-wrap .toggle-view-btn.active {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6) !important;
    border-color: #1e3a8a !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(59,130,246,0.2);
}

/* 📏 크기고정 (1:1 비율) 스타일 */
.pin-grid-container.pin-fixed-mode .pin-thumb-wrap {
    width: 100%;
    padding-top: 100%; /* 가로 너비 대비 1:1 비율 강제 생성 */
    position: relative;
    overflow: hidden;
    height: 0 !important; /* aspect-ratio 오작동 방지 */
}
.pin-grid-container.pin-fixed-mode .pin-thumb-wrap .pin-view-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.pin-grid-container.pin-fixed-mode .pin-thumb-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
}

/* From view.skin.php */
/* 🎨 Premium View Styles */
.view-wrapper {
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.05), 0 0 0 1px rgba(0,0,0,0.02);
    overflow: hidden;
}

.view-header-area {
    padding: 40px 40px 30px;
    border-bottom: 1px solid #f1f5f9;
}

.view-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 20px;
}

.view-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    color: #64748b;
    background: #f8fafc;
    padding: 6px 12px;
    border-radius: 50px;
    font-weight: 500;
}

.meta-item i {
    color: #94a3b8;
}

.view-body {
    padding: 40px;
}





/* YouTube Embed Box */
.youtube-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
    margin: 30px 0;
}
.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* External Link Banner */
.external-link-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to right, #eff6ff, #f8fafc);
    border-left: 4px solid #3b82f6;
    padding: 20px 25px;
    border-radius: 12px;
    margin: 30px 0;
    text-decoration: none;
    color: #1e293b;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.external-link-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59,130,246,0.1);
}
.external-link-info strong {
    display: block;
    font-size: 1.1rem;
    color: #1d4ed8;
    margin-bottom: 4px;
}
.external-link-info span {
    color: #64748b;
    font-size: 0.9rem;
}

/* Attachments */
.attachments-area {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px dashed #cbd5e1;
}
.attachments-title {
    font-weight: 700;
    color: #334155;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    padding: 12px 20px;
    border-radius: 12px;
    text-decoration: none;
    color: #475569;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}
.attachment-item:hover {
    background: #fff;
    border-color: #3b82f6;
    color: #1d4ed8;
    transform: translateX(5px);
}

/* Action Buttons */
.view-actions {
    background: #f8fafc;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn-modern {
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-list {
    background: #fff;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.btn-list:hover {
    background: #f1f5f9;
    color: #1e293b;
}
.btn-primary-action {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    box-shadow: 0 4px 10px rgba(59,130,246,0.3);
}
.btn-primary-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59,130,246,0.4);
}
.btn-danger-action {
    background: #fff;
    color: #ef4444;
    border: 1px solid #fecaca;
}
.btn-danger-action:hover {
    background: #fef2f2;
}

/* iframe 전용 스타일링 재정의 */
body.is-iframe .view-wrapper {
    border-radius: 0;
    box-shadow: none;
}
body.is-iframe .section-padding { padding: 40px 0; }

@media (max-width: 768px) {
    .section-padding { padding: 50px 0; }
    .container { padding: 0; width: 100%; max-width: 100%; }
    .view-wrapper {
        border-radius: 0;
        box-shadow: none;
    }
    .view-header-area, .view-body, .view-actions { padding: 25px 15px; }
    .view-title { font-size: 1.8rem; }
    .view-actions { flex-direction: column; gap: 15px; }
    .view-actions .action-group { width: 100%; display: flex; justify-content: space-between; }
    .prev-next-area { padding: 15px 15px !important; }
}

/* From write.skin.php */
/* 🎨 Premium Write Form Styles */
.write-wrapper {
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.05), 0 0 0 1px rgba(0,0,0,0.02);
    padding: 40px;
}
.write-group {
    margin-bottom: 28px;
}
.write-label {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    font-size: 1.05rem;
}
.write-input {
    width: 100%;
    padding: 16px 20px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    color: #334155;
    transition: all 0.3s ease;
}
.write-input:focus {
    outline: none;
    background-color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}
.write-input::placeholder {
    color: #94a3b8;
}

/* Callout Boxes (YouTube & Link) */
.feature-box {
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 28px;
    transition: transform 0.2s ease;
}
.feature-box:hover {
    transform: translateY(-2px);
}
.feature-box-link {
    background: linear-gradient(to right, #f1f5f9, #f8fafc);
    border-left: 5px solid #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}
.feature-box-youtube {
    background: linear-gradient(to right, #fef2f2, #fff5f5);
    border-left: 5px solid #ef4444;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}
.feature-title {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.feature-box-link .feature-title { color: #1e40af; }
.feature-box-youtube .feature-title { color: #991b1b; }

/* Custom Checkboxes */
.custom-checkbox-wrap {
    display: flex;
    gap: 24px;
    margin-top: 14px;
}
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #475569;
    user-select: none;
}
.custom-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    cursor: pointer;
}

/* File Upload Area */
.file-upload-area {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}
.file-upload-area:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}
.file-upload-area input[type="file"] {
    display: block;
    margin: 0 auto;
    font-size: 1rem;
    color: #64748b;
}

/* Buttons */
.btn-submit {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    padding: 16px 48px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.5);
}
.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -10px rgba(59, 130, 246, 0.6);
}
.btn-cancel {
    background: #f1f5f9;
    color: #475569;
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}
.btn-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Responsive */
@media (max-width: 768px) {
    .write-wrapper { padding: 20px; }
    .custom-checkbox-wrap { flex-direction: column; gap: 12px; }
}

@media (max-width: 768px) {
    .section-padding { padding-bottom: 100px !important; }
}

/* 📱 Full-screen Iframe View Layout Overrides */
body.is-iframe .site-header,
body.is-iframe .site-footer,
body.is-iframe .mobile-bottom-bar,
body.is-iframe .mobile-bottom-menu,
body.is-iframe .normal-header-only,
/* 본문 하위 메뉴 띠(공지사항·갤러리·자유갤러리·통합 검색).
   레이어창은 iframe 으로 게시판 화면을 통째로 부르는데, 이 띠만
   감추기 목록에서 빠져 있어 레이어 안에 사이트 메뉴가 딸려 나왔다. */
body.is-iframe .intro-subnav-sticky-wrapper,
body.is-iframe .breadcrumb-nav,
body.is-iframe .top-notice-banner {
    display: none !important;
}

body.is-iframe .section-padding {
    padding: 0 !important;
}
body.is-iframe .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
}
body.is-iframe .view-wrapper {
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}
