/*
 * 商品卡片块（ricodisk/product-card）前台样式。
 * 视觉基线 = 决策票 04 定稿变体 B「柔和卡片 Soft」。
 * 经 register_block_type 的 'style' 按需入队（区块出现才加载），不进 functions.php 分段清单。
 * 数值对照：卡片宽 270 · 红条 18px/500 padding 0px 16px · 图片区 #fafbfc padding 12px 高 270 contain
 *          圆角 10 · 常态阴影 · hover 上移 5px 加深阴影 · 无主图给中性斜纹占位。
 */
.rd-pc {
    display: inline-block;
    width: auto;
    margin: 0 6px 24px;
}

/* 整卡是一个可点链接，同窗口跳详情页。 */
.rd-pc__link {
    display: block;
    width: 270px;
    text-decoration: none;
    color: inherit;
}

.rd-pc__card {
    display: flex;
    flex-direction: column;
    width: 270px;
    background: #fff;
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(12, 20, 32, 0.10);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rd-pc__link:hover .rd-pc__card,
.rd-pc__link:focus-visible .rd-pc__card {
    transform: translateY(-5px);
    box-shadow: 0 14px 30px rgba(12, 20, 32, 0.18);
}

/* 红条标题：品牌红 #e30613、18px/500、白色左对齐。 */
.rd-pc__title {
    background: #e30613;
    color: #fff;
    text-align: left;
    align-content: center;
    font-size: 18px;
    font-weight: 500;
    min-height: 40px;
    line-height: 1.2;
    letter-spacing: 0.01em;
    padding: 0 16px;
}

/* 图片区：#fafbfc 底、padding 12px、高 270px、contain 缩放（接受横图上下留白）。 */
.rd-pc__media {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 270px;
    padding: 12px;
    background: #fafbfc;
    box-sizing: border-box;
}

.rd-pc__media img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* 无主图占位：中性浅灰斜纹底 + 灰色图片图标 + 「图片待补充」，非红色、不像报错。 */
.rd-pc__media--empty {
    padding: 0;
}

.rd-pc__media-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    color: #a2a8b0;
    background: repeating-linear-gradient(45deg, #f6f7f9 0 12px, #f2f4f6 12px 24px);
    font-size: 14px;
    letter-spacing: 0.04em;
}

.rd-pc__media-placeholder svg {
    width: 40px;
    height: 40px;
    opacity: 0.7;
}

/* 响应式：卡片固定 270px（含左右 margin 各 6px 共占位 282px）；窄容器（< 282px）时留边距并允许图片缩放，保持规格协调。 */
@media (max-width: 281px) {
    .rd-pc__link,
    .rd-pc__card {
        width: 100%;
        max-width: 270px;
    }
}
