/*
Theme Name: 我的 WP6.8.3 主题
Theme URI: https://example.com/
Author: 你的名称
Author URI: https://example.com/
Description: 基于 WordPress 6.8.3 开发的基础主题，兼容古腾堡编辑器，支持响应式布局。
Version: 1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: my-wp6-theme
Tags: 响应式、古腾堡兼容、基础主题、自定义菜单
Requires at least: 6.0
Requires PHP: 7.4
*/

/* 基础样式重置（适配 WP 6.8.3 块编辑器默认样式） */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f9f9f9;
}
a {
    color: #2271b1;
    text-decoration: none;
}
a:hover {
    color: #135e96;
    text-decoration: underline;
}
img {
    max-width: 100%;
    height: auto;
}

/* 容器样式 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.site-header {
    background: #fff;
    padding: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.site-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.site-description {
    font-size: 1rem;
    color: #666;
}

/* 导航样式 */
.main-nav {
    margin: 1rem 0;
}
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}
.main-nav a {
    font-weight: 500;
}

/* 内容区域样式 */
.site-content {
    padding: 2rem 0;
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
}
@media (max-width: 768px) {
    .site-content {
        grid-template-columns: 1fr; /* 移动端单列布局 */
    }
}

/* 文章卡片样式 */
.post {
    background: #fff;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.post-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}
.post-meta {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.post-excerpt {
    margin-bottom: 1rem;
}
.read-more {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #2271b1;
    color: #fff;
    border-radius: 4px;
}
.read-more:hover {
    background: #135e96;
    text-decoration: none;
}

/* 侧边栏样式 */
.site-sidebar {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.widget {
    margin-bottom: 2rem;
}
.widget-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}
.widget ul {
    list-style: none;
}
.widget li {
    margin-bottom: 0.5rem;
}

/* 底部样式 */
.site-footer {
    background: #333;
    color: #fff;
    padding: 2rem 0;
    text-align: center;
}
:root {
    --primary-color: var(--wp--preset--color--primary, #2271b1);
    --text-color: var(--wp--preset--color--text, #333);
}
/* 16:9图片容器（关键：padding-top=9/16*100%=56.25%） */
.img-16-9-wrapper {
    position: relative;
    width: 100%; /* 宽度自适应父容器，可自定义固定宽度如800px */
    padding-top: 56.25%; /* 16:9比例核心值 */
    overflow: hidden;
    border-radius: 4px; /* 可选：圆角 */
}

/* 图片适配16:9容器，不拉伸、只裁剪 */
.img-16-9-wrapper img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 裁剪多余部分，保持比例 */
    object-position: center; /* 优先裁剪图片边缘，保留中心 */
    transform: translate(-50%, -50%);
}

/* 默认图样式（可选：不裁剪，居中显示） */
.img-16-9-wrapper img.default-img {
    object-fit: contain;
    background: #f5f5f5;
}
