.moment-board {
    --moment-accent: #d68a7f;
    --moment-accent-soft: rgba(214, 138, 127, 0.10);
    --moment-accent-border: rgba(214, 138, 127, 0.36);
    --moment-ink: #2f2a28;
    --moment-subtle: #8f817b;
    --moment-line: rgba(47, 42, 40, 0.10);
    --moment-surface: #fffaf8;
    --moment-surface-alt: #fffdfc;
    position: relative;
    margin: 0 0 30px;
}

#primary.home-card-mode .moment-board,
#primary.home-card-mode .content-section-title,
.home-card-grid .moment-board,
.home-card-grid .content-section-title {
    grid-column: 1 / -1;
}

.moment-board-header,
.content-section-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.content-section-title {
    margin: 12px 0 18px;
}

.moment-board-header-copy h2,
.content-section-title-copy h2 {
    margin: 6px 0 0;
    font-size: 24px;
    line-height: 1.25;
    color: var(--moment-ink);
    letter-spacing: 0.01em;
}

.moment-board-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--moment-accent);
}

.moment-board-eyebrow::before {
    content: "";
    width: 22px;
    height: 1px;
    background: currentColor;
    opacity: 0.65;
}

.moment-board-more,
.moment-single-more,
.moment-modal-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 96px;
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid rgba(214, 138, 127, 0.24);
    background: #fff;
    color: var(--moment-ink) !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.moment-board-more:hover,
.moment-single-more:hover,
.moment-modal-next:hover {
    background: #fff7f4;
    border-color: var(--moment-accent-border);
    transform: translateY(-1px);
}

.moment-modal-next[disabled] {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

.moment-modal-next.is-end {
    opacity: .58;
    border-color: rgba(47, 42, 40, 0.12);
    background: #fbf7f5;
    color: var(--moment-subtle) !important;
}

.moment-modal-next.is-end:hover {
    background: #fbf7f5;
    border-color: rgba(47, 42, 40, 0.12);
    transform: none;
}

.moment-board-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.moment-card-item {
    min-width: 0;
}

.moment-card-trigger {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    padding: 16px 18px;
    border: 1px dashed var(--moment-accent-border);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--moment-surface-alt), var(--moment-surface));
    text-align: left;
    box-shadow: none;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.moment-card-trigger:hover,
.moment-card-trigger:focus-visible {
    background: #fff7f4;
    border-color: rgba(214, 138, 127, 0.54);
    transform: translateY(-1px);
    outline: none;
}

.moment-card-glow,
.moment-card-author-avatar,
.moment-modal-template-avatar {
    display: none !important;
}

.moment-card-head,
.moment-card-foot,
.moment-modal-template-meta,
.moment-single-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.moment-card-meta,
.moment-card-author-meta,
.moment-modal-template-author,
.moment-single-author {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.moment-card-meta strong,
.moment-modal-template-author strong,
.moment-single-author strong {
    display: block;
    color: var(--moment-ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.moment-card-meta time,
.moment-card-badge,
.moment-modal-template-author time,
.moment-modal-template-relative,
.moment-single-meta time {
    color: var(--moment-subtle);
    font-size: 12px;
    line-height: 1.45;
}

.moment-card-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-weight: 500;
}

.moment-card-body {
    display: block;
    margin: 12px 0 0;
}

.moment-card-mark {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--moment-accent-soft);
    color: var(--moment-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.moment-card-text {
    display: -webkit-box;
    margin-top: 10px;
    color: var(--moment-ink);
    font-size: 15px;
    line-height: 1.9;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.moment-card-foot {
    margin-top: 12px;
    padding-top: 0;
    border-top: 0;
    color: var(--moment-subtle);
    font-size: 12px;
    justify-content: flex-start;
}

.moment-card-foot-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.moment-card-foot-meta i,
.moment-card-open i,
.moment-modal-next i {
    color: var(--moment-accent);
}

.moment-card-open {
    display: none;
}

.moment-board--home {
    margin-bottom: 28px;
}

.moment-archive-page #main.site-main {
    width: min(1080px, calc(100% - 48px));
    max-width: 1080px;
    margin: 0 auto;
}

.moment-board--archive {
    margin-top: 42px;
    margin-bottom: 40px;
}

.moment-board-empty {
    padding: 26px 20px;
    border-radius: 12px;
    text-align: center;
    color: var(--moment-subtle);
    background: var(--moment-surface);
    border: 1px dashed var(--moment-accent-border);
}

.moment-pagination-wrap {
    margin-top: 26px;
}

.moment-pagination-wrap .navigator {
    margin-top: 0;
}

.moment-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}

.moment-modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.moment-modal[hidden] {
    display: none !important;
}

.moment-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 20, 22, 0.52);
    backdrop-filter: blur(6px);
}

.moment-modal-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(860px, 100%);
    max-height: calc(100vh - 48px);
    padding: 22px 22px 18px;
    border-radius: 8px;
    border: 1px solid rgba(214, 138, 127, 0.18);
    background: #fffdfc;
    box-shadow: 0 16px 42px rgba(18, 12, 15, 0.18);
    transform: translateY(12px);
    transition: transform .22s ease;
    overflow: hidden;
}

.moment-modal.is-visible .moment-modal-dialog {
    transform: translateY(0);
}

.moment-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(214, 138, 127, 0.16);
    background: #fff;
    color: var(--moment-ink);
    z-index: 2;
    transition: background .2s ease, border-color .2s ease;
}

.moment-modal-close:hover,
.moment-modal-close:focus-visible {
    background: #fff7f4;
    border-color: var(--moment-accent-border);
    outline: none;
}

.moment-modal-body {
    flex: 1 1 auto;
    max-height: calc(100vh - 150px);
    padding-top: 18px;
    padding-right: 6px;
    overflow-y: auto;
}

.moment-modal-body::-webkit-scrollbar {
    width: 8px;
}

.moment-modal-body::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(214, 138, 127, 0.26);
}

.moment-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--moment-line);
}

.moment-modal-template {
    padding: 4px 0 2px;
}

.moment-modal-template-meta,
.moment-single-meta {
    margin-bottom: 18px;
    padding: 0 34px 12px 0;
    border-bottom: 1px dashed rgba(214, 138, 127, 0.24);
}

.moment-modal-cover,
.moment-single-cover {
    margin-bottom: 18px;
    border-radius: 10px;
    overflow: hidden;
}

.moment-modal-cover img,
.moment-single-cover img {
    display: block;
    width: 100%;
    height: auto;
}

.moment-modal-template-content,
.moment-single-content {
    color: var(--moment-ink);
    font-size: 16px;
    line-height: 1.95;
}

.moment-modal-template-content p:last-child,
.moment-single-content p:last-child {
    margin-bottom: 0;
}

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

.moment-single-page #main.site-main {
    width: min(920px, calc(100% - 48px));
    max-width: 920px;
    margin: 42px auto 40px;
}

.moment-single-shell {
    padding: 28px;
    border-radius: 12px;
    background: #fffdfc;
    border: 1px dashed var(--moment-accent-border);
    box-shadow: none;
}

.moment-single-copy {
    margin-bottom: 22px;
}

.moment-single-copy h1 {
    margin: 8px 0 10px;
    color: var(--moment-ink);
    font-size: 30px;
    line-height: 1.32;
}

.moment-single-copy p {
    margin: 0;
    color: var(--moment-subtle);
    font-size: 14px;
    line-height: 1.8;
}

.moment-single-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

body.dark .moment-board,
body.dark .moment-modal-dialog,
body.dark .moment-single-shell {
    --moment-ink: #f4efed;
    --moment-subtle: rgba(244, 239, 237, 0.70);
    --moment-line: rgba(244, 239, 237, 0.12);
    --moment-surface: rgba(51, 41, 43, 0.92);
    --moment-surface-alt: rgba(56, 45, 47, 0.94);
}

body.dark .moment-card-trigger,
body.dark .moment-board-empty,
body.dark .moment-modal-dialog,
body.dark .moment-single-shell {
    background: var(--moment-surface);
    border-color: rgba(244, 239, 237, 0.18);
}

body.dark .moment-card-trigger:hover,
body.dark .moment-card-trigger:focus-visible,
body.dark .moment-board-more:hover,
body.dark .moment-single-more:hover,
body.dark .moment-modal-next:hover,
body.dark .moment-modal-close:hover,
body.dark .moment-modal-close:focus-visible {
    background: rgba(72, 58, 61, 0.96);
    border-color: rgba(214, 138, 127, 0.46);
}

body.dark .moment-modal-backdrop {
    background: rgba(7, 7, 9, 0.72);
}

body.dark .moment-board-more,
body.dark .moment-single-more,
body.dark .moment-modal-next,
body.dark .moment-modal-close {
    background: rgba(255, 255, 255, 0.04);
    color: #f4efed !important;
    border-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 1100px) {
    .moment-archive-page #main.site-main,
    .moment-single-page #main.site-main {
        width: calc(100% - 36px);
    }
}

@media (max-width: 782px) {
    .moment-board-header,
    .content-section-title,
    .moment-card-head,
    .moment-modal-template-meta,
    .moment-single-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .content-section-title {
        margin: 8px 0 16px;
    }

    .moment-board-header-copy h2,
    .content-section-title-copy h2,
    .moment-single-copy h1 {
        font-size: 22px;
    }

    .moment-board {
        margin-bottom: 24px;
    }

    .moment-card-trigger {
        padding: 14px 14px 15px;
        border-radius: 10px;
    }

    .moment-card-body {
        margin-top: 10px;
    }

    .moment-card-text {
        font-size: 14px;
        -webkit-line-clamp: 5;
    }

    .moment-archive-page #main.site-main,
    .moment-single-page #main.site-main {
        width: calc(100% - 24px);
    }

    .moment-modal {
        padding: 12px;
    }

    .moment-modal-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        padding: 18px 16px 14px;
        border-radius: 8px;
    }

    .moment-modal-close {
        top: 10px;
        right: 10px;
    }

    .moment-modal-body {
        max-height: calc(100vh - 130px);
        padding-top: 14px;
        padding-right: 2px;
    }

    .moment-modal-footer {
        margin-top: 12px;
        padding-top: 12px;
    }

    .moment-modal-next,
    .moment-board-more,
    .moment-single-more {
        min-width: 88px;
        height: 36px;
        padding: 0 14px;
        font-size: 12px;
    }

    .moment-single-shell {
        padding: 20px 16px;
    }
}

@media (max-width: 480px) {
    .moment-board-header-copy h2,
    .content-section-title-copy h2 {
        font-size: 20px;
    }

    .moment-board-eyebrow {
        letter-spacing: 0.14em;
    }

    .moment-card-trigger {
        padding: 13px 12px 14px;
    }

    .moment-card-text,
    .moment-modal-template-content,
    .moment-single-content {
        font-size: 14px;
        line-height: 1.85;
    }

    .moment-modal-template-meta,
    .moment-single-meta {
        padding-right: 0;
    }

    .moment-modal-footer {
        justify-content: stretch;
    }

    .moment-modal-next {
        width: 100%;
    }
}
