/**
 * 微刊封面图集 - 前端样式
 * 整合子比杂志工具包封面角标风格：位置 / 颜色 / 全宽底部条
 */

.wcg-cover-gallery {
    margin: 30px 0;
    width: 100%;
    clear: both;
}

.wcg-grid {
    display: grid;
    grid-template-columns: repeat(var(--wcg-cols, 4), 1fr);
    gap: 16px 12px;
}

.wcg-item {
    width: 100%;
    min-width: 0;
}

.wcg-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 100 / 140;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcg-cover:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.wcg-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.wcg-cover:hover img {
    transform: scale(1.02);
}

/* ========== 角标（整合工具包风格） ========== */
.wcg-badge {
    position: absolute;
    z-index: 6;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: var(--wcg-badge-bg, var(--theme-color, #4caf50));
    pointer-events: none;
    line-height: 1.3;
    transition: filter 0.25s ease;
}

.wcg-cover:hover .wcg-badge {
    filter: brightness(1.06);
}

/* 底部居中：全宽矩形条（工具包默认风格） */
.wcg-badge.pos-bottom-center {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    text-align: center;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 0;
}

/* 四角：贴边矩形，内侧圆角 */
.wcg-badge.pos-bottom-left {
    left: 0;
    bottom: 0;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 0 var(--main-radius, 8px) 0 0;
}

.wcg-badge.pos-bottom-right {
    right: 0;
    bottom: 0;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: var(--main-radius, 8px) 0 0 0;
}

.wcg-badge.pos-top-left {
    left: 0;
    top: 0;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 0 0 var(--main-radius, 8px) 0;
}

.wcg-badge.pos-top-right {
    right: 0;
    top: 0;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 0 0 0 var(--main-radius, 8px);
}

/* 兼容旧版无位置 class 的情况 */
.wcg-badge:not([class*="pos-"]) {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 8px 10px;
    font-size: 13px;
}

/* 单张最后封面：默认与内容区同宽，不再强制缩小 */
.wcg-last-cover {
    margin: 20px 0;
    width: 100%;
    max-width: 100%;
}

.wcg-last-cover .wcg-cover {
    aspect-ratio: 100 / 140;
    width: 100%;
}

.wcg-last-cover .wcg-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 如需缩小，可自行加 class：wcg-size-sm / wcg-size-md */
.wcg-last-cover.wcg-size-sm { max-width: 240px; }
.wcg-last-cover.wcg-size-md { max-width: 360px; }
.wcg-last-cover.wcg-size-lg { max-width: 480px; }

.wcg-last-cover.aligncenter {
    margin-left: auto;
    margin-right: auto;
}

.wcg-last-cover.alignleft {
    float: left;
    margin-right: 20px;
    margin-bottom: 15px;
    max-width: 360px;
}

.wcg-last-cover.alignright {
    float: right;
    margin-left: 20px;
    margin-bottom: 15px;
    max-width: 360px;
}

/* 响应式 */
@media (max-width: 1200px) {
    .wcg-grid {
        gap: 14px 10px;
    }
}

@media (max-width: 992px) {
    .wcg-grid {
        grid-template-columns: repeat(min(var(--wcg-cols, 4), 3), 1fr);
        gap: 14px 10px;
    }
}

@media (max-width: 768px) {
    .wcg-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 10px;
    }

    .wcg-badge.pos-bottom-center {
        font-size: 12px;
        padding: 6px 8px;
    }

    .wcg-badge.pos-bottom-left,
    .wcg-badge.pos-bottom-right,
    .wcg-badge.pos-top-left,
    .wcg-badge.pos-top-right {
        font-size: 11px;
        padding: 5px 8px;
    }
}

@media (max-width: 480px) {
    .wcg-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px 8px;
    }

    .wcg-badge.pos-bottom-center {
        font-size: 11px;
        padding: 5px 6px;
    }
}
