/*
Theme Name: 光
Theme URI: https://wumengzhi.com/
Description: Personal theme for 光.
Author: LiLi
Template: twentytwentyfive
Version: 0.1.0
Text Domain: guang
*/

/* ---------- 光 · Base ---------- */

:root {
    --guang-paper: #f7f5ef;
    --guang-ink: #191919;
    --guang-muted: #77736b;
    --guang-line: #dedbd3;
}

html {
    background: var(--guang-paper);
}

body {
    background: var(--guang-paper);
    color: var(--guang-ink);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans SC",
        "Noto Sans CJK SC",
        "PingFang SC",
        "Hiragino Sans GB",
        "Microsoft YaHei",
        sans-serif;
    line-height: 1.85;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

p {
    line-height: 1.9;
}

/* 正文不要铺满屏幕 */
.wp-block-post-content {
    max-width: 720px;
}

/* 图片保持自然，不做卡片 */
.wp-block-post-content img {
    height: auto;
}

/* 日期和辅助信息 */
.wp-block-post-date,
.wp-block-post-author,
.wp-block-post-terms {
    color: var(--guang-muted);
    font-size: 0.82rem;
}

/* 去掉一些默认的“组件感” */
.wp-block-button__link {
    border-radius: 0;
}

.wp-block-search__input {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--guang-line);
    border-radius: 0;
}

/* 小屏幕 */
@media (max-width: 700px) {
    body {
        line-height: 1.75;
    }

    .wp-site-blocks {
        padding-left: 20px;
        padding-right: 20px;
    }
}


/* ==================================================
   光 · Layout v0.2
   ================================================== */

.wp-site-blocks {
    padding: 0;
}

.guang-header {
    width: 100%;
    max-width: none !important;
    padding: 34px 5vw 28px;
    box-sizing: border-box;
}

.guang-header-inner {
    width: min(1120px, 100%);
    margin: 0 auto;
    align-items: center;
    gap: 28px;
}

.guang-logo {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.06em;
    line-height: 1;
}

.guang-logo a {
    text-decoration: none;
}

.guang-nav {
    font-size: 0.88rem;
}

.guang-nav a {
    text-decoration: none;
}

.guang-nav a:hover {
    text-decoration: underline;
    text-underline-offset: 0.35em;
}


/* ---------- Main ---------- */

.guang-main {
    width: min(760px, calc(100% - 40px));
    margin: 72px auto 120px;
}

.guang-section-title {
    margin: 0 0 64px;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
}


/* ---------- Article list ---------- */

.guang-post-list .wp-block-post-template {
    display: block;
    padding: 0;
    margin: 0;
}

.guang-post-item {
    margin: 0 0 76px;
    padding: 0;
}

.guang-post-item .wp-block-post-title {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    line-height: 1.45;
    font-weight: 600;
    text-align: left;
}

.guang-post-item .wp-block-post-title a {
    text-decoration: none;
}

.guang-post-item .wp-block-post-date {
    margin: 0 0 22px;
    color: var(--guang-muted);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-align: left;
}

.guang-post-item .wp-block-post-excerpt {
    margin: 0;
    max-width: 700px;
    text-align: left;
}

.guang-post-item .wp-block-post-excerpt__excerpt {
    margin: 0;
    line-height: 1.9;
}

.guang-post-item .wp-block-post-excerpt__more-text {
    margin-top: 14px;
    font-size: 0.82rem;
}

.guang-post-item .wp-block-post-excerpt__more-link {
    text-decoration: none;
}


/* ---------- Mobile ---------- */

@media (max-width: 760px) {

    .guang-header {
        padding: 24px 20px;
    }

    .guang-header-inner {
        gap: 18px;
    }

    .guang-logo {
        font-size: 1.75rem;
    }

    .guang-main {
        margin-top: 48px;
        margin-bottom: 80px;
    }

    .guang-section-title {
        margin-bottom: 48px;
    }

    .guang-post-item {
        margin-bottom: 58px;
    }
}


/* ==================================================
   光 · Layout v0.2
   ================================================== */

.wp-site-blocks {
    padding: 0;
}

.guang-header {
    width: 100%;
    max-width: none !important;
    padding: 34px 5vw 28px;
    box-sizing: border-box;
}

.guang-header-inner {
    width: min(1120px, 100%);
    margin: 0 auto;
    align-items: center;
    gap: 28px;
}

.guang-logo {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.06em;
    line-height: 1;
}

.guang-logo a {
    text-decoration: none;
}

.guang-nav {
    font-size: 0.88rem;
}

.guang-nav a {
    text-decoration: none;
}

.guang-nav a:hover {
    text-decoration: underline;
    text-underline-offset: 0.35em;
}


/* ---------- Main ---------- */

.guang-main {
    width: min(760px, calc(100% - 40px));
    margin: 72px auto 120px;
}

.guang-section-title {
    margin: 0 0 64px;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
}


/* ---------- Article list ---------- */

.guang-post-list .wp-block-post-template {
    display: block;
    padding: 0;
    margin: 0;
}

.guang-post-item {
    margin: 0 0 76px;
    padding: 0;
}

.guang-post-item .wp-block-post-title {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    line-height: 1.45;
    font-weight: 600;
    text-align: left;
}

.guang-post-item .wp-block-post-title a {
    text-decoration: none;
}

.guang-post-item .wp-block-post-date {
    margin: 0 0 22px;
    color: var(--guang-muted);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-align: left;
}

.guang-post-item .wp-block-post-excerpt {
    margin: 0;
    max-width: 700px;
    text-align: left;
}

.guang-post-item .wp-block-post-excerpt__excerpt {
    margin: 0;
    line-height: 1.9;
}

.guang-post-item .wp-block-post-excerpt__more-text {
    margin-top: 14px;
    font-size: 0.82rem;
}

.guang-post-item .wp-block-post-excerpt__more-link {
    text-decoration: none;
}


/* ---------- Mobile ---------- */

@media (max-width: 760px) {

    .guang-header {
        padding: 24px 20px;
    }

    .guang-header-inner {
        gap: 18px;
    }

    .guang-logo {
        font-size: 1.75rem;
    }

    .guang-main {
        margin-top: 48px;
        margin-bottom: 80px;
    }

    .guang-section-title {
        margin-bottom: 48px;
    }

    .guang-post-item {
        margin-bottom: 58px;
    }
}

/* 光 · Typography adjustment */

.guang-post-item .wp-block-post-excerpt {
    font-size: 14px;
    line-height: 1.8;
}

.guang-post-item .wp-block-post-excerpt__excerpt {
    line-height: 1.8;
}

.guang-post-meta {
    gap: 0.35em;
    margin: 0 0 20px;
    color: var(--guang-muted);
    font-size: 12px;
}

.guang-post-meta .wp-block-post-date,
.guang-post-meta .wp-block-post-comments-count {
    margin: 0;
    font-size: inherit;
    color: inherit;
}

.guang-post-item .wp-block-post-title {
    margin-bottom: 7px;
}

/* ==================================================
   Serendipity
   ================================================== */

.guang-serendipity {
    width: min(680px, calc(100% - 40px));
    margin: 58px auto 120px;
}

.serendipity-title {
    margin: 0 0 70px;
    font-size: 1.45rem;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.serendipity-item {
    margin: 0 0 72px;
    padding: 0;
}

.serendipity-meta {
    gap: .35em;
    margin: 0 0 14px;
    color: var(--guang-muted);
    font-size: 12px;
}

.serendipity-meta .wp-block-post-date,
.serendipity-meta .wp-block-post-comments-count {
    margin: 0;
    color: inherit;
    font-size: inherit;
}

.serendipity-item .wp-block-post-content {
    max-width: 100%;
    margin: 0;
    font-size: 14px;
    line-height: 1.85;
}

.serendipity-item .wp-block-post-content p {
    margin-top: 0;
    margin-bottom: 1em;
    line-height: 1.85;
}

.serendipity-item .wp-block-post-terms {
    margin-top: 14px;
    font-size: 12px;
}

.serendipity-item .wp-block-post-terms a {
    text-decoration: none;
}

@media (max-width: 760px) {
    .guang-serendipity {
        margin-top: 42px;
        margin-bottom: 80px;
    }

    .serendipity-title {
        margin-bottom: 52px;
    }

    .serendipity-item {
        margin-bottom: 56px;
    }
}

/* Serendipity inline comments */

.guang-comment-open {
    appearance: none;
    border: 0;
    background: none;
    padding: 2px 4px;
    color: var(--guang-muted);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.guang-comment-open:hover {
    color: var(--guang-ink);
}

.guang-comment-modal[hidden] {
    display: none;
}

.guang-comment-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.guang-comment-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, .28);
    backdrop-filter: blur(2px);
}

.guang-comment-panel {
    position: relative;
    width: min(560px, 100%);
    max-height: min(720px, 82vh);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 34px;
    background: var(--guang-paper);
    color: var(--guang-ink);
    box-shadow: 0 18px 60px rgba(0, 0, 0, .14);
}

.guang-comment-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: 0;
    background: none;
    color: var(--guang-muted);
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.guang-comment-loading,
.guang-no-comments {
    color: var(--guang-muted);
    font-size: 13px;
}

.guang-comment {
    padding: 0 0 22px;
    margin: 0 0 22px;
    border-bottom: 1px solid var(--guang-line);
}

.guang-comment-author {
    font-size: 13px;
    font-weight: 600;
}

.guang-comment-date {
    margin-top: 2px;
    color: var(--guang-muted);
    font-size: 11px;
}

.guang-comment-body {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.8;
}

.guang-comment-panel textarea,
.guang-comment-panel input[type="text"],
.guang-comment-panel input[type="email"],
.guang-comment-panel input[type="url"] {
    width: 100%;
    box-sizing: border-box;
    border: 0;
    border-bottom: 1px solid var(--guang-line);
    border-radius: 0;
    background: transparent;
    padding: 9px 2px;
    color: var(--guang-ink);
    font: inherit;
}

.guang-comment-panel textarea {
    min-height: 110px;
    resize: vertical;
}

.guang-comment-panel input[type="submit"] {
    border: 1px solid var(--guang-ink);
    border-radius: 0;
    background: transparent;
    color: var(--guang-ink);
    padding: 8px 18px;
    cursor: pointer;
}

.guang-comment-panel input[type="submit"]:hover {
    background: var(--guang-ink);
    color: var(--guang-paper);
}

body.guang-modal-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .guang-comment-modal {
        align-items: flex-end;
        padding: 0;
    }

    .guang-comment-panel {
        width: 100%;
        max-height: 86vh;
        padding: 30px 22px 24px;
    }
}

/* Home pagination */

.guang-home-pagination {
    margin-top: 72px;
    padding-top: 20px;
    border-top: 1px solid var(--guang-line);
    font-size: 13px;
}

.guang-home-pagination a {
    color: var(--guang-muted);
    text-decoration: none;
}

.guang-home-pagination a:hover {
    color: var(--guang-ink);
}

.guang-home-pagination .page-numbers.current {
    color: var(--guang-ink);
}

/* Home comment bubble */

.guang-post-comment-link {
    color: var(--guang-muted);
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}

.guang-post-comment-link:hover {
    color: var(--guang-ink);
}

/* Home post footer actions */

.guang-post-actions {
    margin-top: 14px;
    gap: 18px;
    align-items: center;
}

.guang-post-actions .wp-block-post-comments-link,
.guang-post-actions .wp-block-read-more {
    margin: 0;
    font-size: 12px;
}

.guang-post-actions a,
.guang-read-more {
    color: var(--guang-muted);
    text-decoration: none;
}

.guang-post-actions a:hover,
.guang-read-more:hover {
    color: var(--guang-ink);
}

/* Serendipity media */

.guang-serendipity .serendipity-item figure.wp-block-image {
    margin: 18px 0;
}

.guang-serendipity .serendipity-item figure.wp-block-image img {
    display: block;
    width: auto;
    max-width: min(100%, 560px);
    height: auto;
    object-fit: contain;
}

.guang-serendipity .serendipity-item figure.wp-block-video {
    margin: 18px 0;
    max-width: 560px;
}

.guang-serendipity .serendipity-item video {
    display: block;
    width: 100%;
    height: auto;
}

@media (max-width: 600px) {
    .guang-serendipity .serendipity-item figure.wp-block-image img,
    .guang-serendipity .serendipity-item figure.wp-block-video {
        max-width: 100%;
    }
}

/* Serendipity typography refinement */

.guang-serendipity .serendipity-item .wp-block-post-content {
    font-size: 17px;
    line-height: 1.9;
}

.guang-serendipity .serendipity-item .wp-block-post-content p {
    font-size: inherit;
    line-height: inherit;
}

.guang-serendipity .serendipity-meta-bottom {
    margin-top: 18px;
    gap: 10px;
    color: var(--guang-muted);
    font-size: 12px;
}

.guang-serendipity .serendipity-meta-bottom .wp-block-post-date {
    margin: 0;
}

@media (max-width: 600px) {
    .guang-serendipity .serendipity-item .wp-block-post-content {
        font-size: 16.5px;
        line-height: 1.9;
    }
}

/* Serendipity separators */

.guang-serendipity .serendipity-item {
    padding-bottom: 48px;
    margin-bottom: 48px;
    border-bottom: 1px solid var(--guang-line);
}

/* 最后一条不需要多余的分割线 */
.guang-serendipity .serendipity-item:last-child {
    border-bottom: 0;
}

/* Serendipity entry separators - Query Loop level */

.guang-serendipity .wp-block-post-template > li.wp-block-post {
    border-bottom: 1px solid #dedbd3 !important;
    padding-bottom: 48px;
    margin-bottom: 48px;
}

.guang-serendipity .wp-block-post-template > li.wp-block-post:last-child {
    border-bottom: none !important;
}

/* Serendipity spacing correction */

.guang-serendipity .serendipity-item {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.guang-serendipity .wp-block-post-template > li.wp-block-post {
    border-bottom: 1px solid #dedbd3 !important;
    padding-bottom: 24px;
    margin-bottom: 30px;
}

/* Serendipity opening character */

.guang-serendipity .serendipity-item .wp-block-post-content > p:first-of-type::first-letter {
    font-size: 2em;
    font-weight: 600;
    line-height: 0.9;
    margin-right: 0.06em;
}

/* Serendipity opening character - lighter */

.guang-serendipity .serendipity-item .wp-block-post-content > p:first-of-type::first-letter {
    font-size: 1.35em;
    font-weight: 400;
    line-height: 1;
    margin-right: 0.03em;
}
