/* shiguang-category 插件样式
 * 卡片本身的样式（网格、一行两个、悬停放大、自适应等）由 zibll 主题提供，
 * 本文件仅提供翻页 / 加载更多相关的少量样式，可按需扩展。
 */

.sgc-card-wrap {
    margin-top: 20px;
}

/* 翻页 */
.sgc-pager {
    text-align: center;
}

.sgc-pager .page-numbers {
    display: inline-block;
    margin: 0 3px;
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--main-bg, #fff);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.06);
    color: var(--main-color, #333);
}

.sgc-pager .page-numbers.current {
    background: #0991f5;
    color: #fff;
}

/* 加载更多 / 无限滚动 */
.sgc-loadmore {
    text-align: center;
}

.sgc-loadmore-btn[disabled] {
    opacity: .6;
    cursor: progress;
}

/* 区块标题与描述（页面美化） */
.sgc-page-header {
    margin: 0 0 20px;
    padding: 0 2px;
}

.sgc-page-header.text-center {
    text-align: center;
}

.sgc-page-title {
    position: relative;
    display: inline-block;
    margin: 0 0 10px;
    padding-left: 14px;
    font-size: 22px;
    font-weight: 700;
    color: var(--main-color, #333);
    line-height: 1.3;
}

.sgc-page-header.text-center .sgc-page-title {
    padding-left: 0;
}

.sgc-page-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 20px;
    border-radius: 3px;
    background: linear-gradient(135deg, #f97794 10%, #623aa2 100%);
}

.sgc-page-header.text-center .sgc-page-title::before {
    display: none;
}

.sgc-page-desc {
    color: var(--color-9, #888);
    font-size: 14px;
    line-height: 1.8;
    margin: 0;
}

.sgc-page-desc p {
    margin: 0 0 8px;
}

.sgc-page-desc p:last-child {
    margin-bottom: 0;
}

/* ============================================================
 * 封面图比例（通过外层 .sgc-cover-xxx 控制 .term-img 宽高比）
 * 原结构：.term-aggregation .term-img 默认 width:50%; height:100px
 * 这里改 height:auto + aspect-ratio，内部 .graphic(height:100%) 自动填满
 * ============================================================ */

/* 关键：禁止父级 flex 的 stretch 把封面高度拉伸/压没，保证比例生效 */
.sgc-card-wrap .term-aggregation .term-img {
    align-self: flex-start;
}

.sgc-cover-1x1 .term-aggregation .term-img {
    width: 40%;
    height: auto;
    aspect-ratio: 1 / 1;
}

.sgc-cover-4x3 .term-aggregation .term-img {
    width: 44%;
    height: auto;
    aspect-ratio: 4 / 3;
}

.sgc-cover-3x4 .term-aggregation .term-img {
    width: 38%;
    height: auto;
    aspect-ratio: 3 / 4;
}

.sgc-cover-16x9 .term-aggregation .term-img {
    width: 50%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.sgc-cover-21x9 .term-aggregation .term-img {
    width: 55%;
    height: auto;
    aspect-ratio: 21 / 9;
}

/* 移动端：比例样式仍然生效，但整宽略收紧避免过高 */
@media (max-width: 768px) {
    .sgc-cover-1x1 .term-aggregation .term-img,
    .sgc-cover-4x3 .term-aggregation .term-img,
    .sgc-cover-3x4 .term-aggregation .term-img,
    .sgc-cover-16x9 .term-aggregation .term-img,
    .sgc-cover-21x9 .term-aggregation .term-img {
        width: 48%;
    }
}

/* ============================================================
 * 卡片样式切换（通过外层 .sgc-style-xxx 控制排版）
 * ============================================================ */

/* 封面在上方：整宽封面 + 标题在下方 */
.sgc-style-cover_top .term-aggregation .hover-zoom-img {
    display: block;
}

.sgc-style-cover_top .term-aggregation .term-img {
    width: 100%;
    max-width: none;
    height: 160px;
    margin-bottom: 10px;
}

.sgc-style-cover_top .term-aggregation .term-title {
    margin-left: 0;
}

/* 纯列表：隐藏封面，标题与文章列表铺满 */
.sgc-style-list .term-aggregation .term-img {
    display: none;
}

.sgc-style-list .term-aggregation .hover-zoom-img {
    display: block;
}

.sgc-style-list .term-aggregation .term-title {
    margin-left: 0;
}

/* 无图片模式：隐藏专题/分类描述文字 */
.sgc-list-hide-desc .term-aggregation .term-title .text-ellipsis-2.muted-color {
    display: none;
}

/* 无图片模式：专题/分类名称居中显示 */
.sgc-list-title-center .term-aggregation .term-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* 名称本身占满一行并居中（覆盖主题 .flex>a.text-ellipsis 的 inline-block） */
.sgc-list-title-center .term-aggregation .term-title > a {
    display: block;
    width: 100%;
    text-align: center;
}

/* 卡片等高对齐：把子比自带的 Bootstrap3「浮动栅格」改为 flex 栅格。
   把 .row 设为 flex 容器、列设为 flex 子项后，同一行的卡片会被拉伸到相同高度，
   矮卡片自动撑满行高，避免文章数不同导致后续行错位（“前面对齐、后面不齐”）。
   注意：这三条缺一不可，否则仍是浮动栅格 → 参差不齐。 */
.sgc-card-wrap .row.gutters-5 {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    align-content: flex-start;
}

.sgc-card-wrap .row.gutters-5 > [class*="col-"] {
    display: flex;
    float: none;
}

.sgc-card-wrap .term-aggregation {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
}
