/* 模块：专栏页面 / Column pages styling. Provides card layout, gallery grid, and comment tiles. */

.column-stack {
    display: grid;
    gap: 1rem;
}

.article-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 12px 30px var(--shadow-color);
    padding: 1.1rem 1.2rem;
    display: grid;
    gap: 0.75rem;
    color: var(--text-color);
}

.article-card h1,
.article-card h2,
.article-card h3 {
    margin: 0;
}

.column-stack h3,
.column-stack h4,
.column-stack h5 {
    scroll-margin-top: calc(var(--header-height, 64px) + 1rem);
}

/* Ensure card anchors (e.g., jump links) aren't hidden under the fixed header */
.article-card[id] {
    scroll-margin-top: calc(var(--header-height, 64px) + 1rem);
}

.eyebrow {
    margin: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.82rem;
    color: rgba(100, 116, 139, 0.9);
}

.article-subtitle {
    margin: 0;
    color: rgba(100, 116, 139, 0.96);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.95rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    line-height: 1.1;
}

.pill-author {
    gap: 0.45rem;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.85rem;
    min-height: 44px;
    line-height: 0;
}

.pill-author img {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: block;
    align-self: center;
    vertical-align: middle;
    margin: 0;
}

.pill-author span {
    font-weight: 600;
    line-height: 1;
}

.pill i {
    margin-right: 0;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.pill--datapack {
    color: #2f9e44;
    border-color: rgba(47, 158, 68, 0.4);
    background: rgba(47, 158, 68, 0.12);
}

.pill--fabric {
    color: #a46300;
    border-color: rgba(164, 99, 0, 0.4);
    background: rgba(164, 99, 0, 0.12);
}

.pill--quilt {
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.45);
    background: rgba(168, 85, 247, 0.12);
}

.pill--forge {
    color: #374151;
    border-color: rgba(55, 65, 81, 0.45);
    background: rgba(55, 65, 81, 0.12);
}

.pill--neo-forge {
    color: #f97316;
    border-color: rgba(249, 115, 22, 0.45);
    background: rgba(249, 115, 22, 0.12);
}

.article-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.article-card p {
    margin: 0;
    line-height: 1.6;
}

.about-avatar {
    display: block;
    width: clamp(80px, 16vw, 104px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.08);
    object-fit: cover;
    flex-shrink: 0;
}

.gallery-grid {
    column-width: 260px;
    column-gap: 0.85rem;
    width: 100%;
}

.gallery-grid figure {
    margin: 0 0 0.75rem;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.65rem;
    display: inline-grid;
    gap: 0.5rem;
    width: 100%;
    break-inside: avoid;
    box-sizing: border-box;
}

/* 折叠敏感内容：保持排版位置，但默认限制高度并加遮罩，可点击展开 */
.gallery-grid figure.folded {
    position: relative;
    overflow: hidden;
}

.folded .folded-media {
    transition: max-height 180ms ease, filter 160ms ease, opacity 160ms ease;
}

.folded.collapsed .folded-media {
    max-height: 120px;
    filter: blur(10px);
    opacity: 0.6;
}

.folded.collapsed::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.08));
    pointer-events: none;
}

.fold-toggle {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    padding: 0.35rem 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: background 0.18s ease, border 0.18s ease, transform 0.14s ease;
}

.fold-toggle:hover { background: var(--hover-bg); }
.fold-toggle:active { transform: scale(0.98); }

.gallery-grid img,
.gallery-grid video,
.media-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    object-fit: cover;
}

.media-card video,
.media-card img,
.media-card a {
    width: 100%;
}

.note-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    display: grid;
    gap: 0.35rem;
}

.comment-list {
    display: grid;
    gap: 0.75rem;
}

.comment-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 0.65rem 0.85rem;
    align-items: flex-start;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
}

.comment-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    min-height: 48px;
}

.comment-reply {
    grid-column: 1 / span 2;
    display: grid;
    grid-template-columns: auto 40px minmax(0, 1fr);
    gap: 0.5rem 0.65rem;
    padding: 0.65rem 0.75rem;
    margin-top: 0.35rem;
    border-left: 3px solid var(--primary-color, var(--accent-color, var(--border-color)));
    background: rgba(148, 163, 184, 0.07);
    border-radius: 10px;
    align-items: flex-start;
    justify-items: flex-start;
}

.comment-reply .comment-meta {
    min-height: 40px;
    gap: 0.15rem;
}
.comment-reply i {
    align-self: flex-start;
    justify-self: flex-start;
    color: rgba(100, 116, 139, 0.9);
}
.comment-reply img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

.comment-reply-text {
    grid-column: 1 / span 3;
    margin: 0;
    line-height: 1.55;
}

.comment-avatar-link {
    display: inline-flex;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    align-self: center;
    border: 0;
    background: transparent;
    padding: 0;
    aspect-ratio: 1 / 1;
    min-width: 48px;
    min-height: 48px;
}

.comment-avatar-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: inherit;
}

.comment-avatar-link:focus-visible {
    outline: 2px solid var(--primary-color, #4A90E2);
    outline-offset: 2px;
}

.comment-reply .comment-avatar-link {
    width: 40px;
    height: 40px;
}

.comment-card img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

.comment-author {
    font-weight: 600;
    margin: 0;
}

.comment-date {
    margin: 0;
    font-size: 0.92rem;
    color: rgba(100, 116, 139, 0.96);
}

.comment-text {
    grid-column: 1 / span 2;
    margin: 0;
    line-height: 1.55;
}

.link-quiet {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    padding: 0.35rem 0.5rem;
}

.link-quiet:hover {
    background: var(--hover-bg);
    border-color: var(--border-color);
    box-shadow: none;
}

.link-quiet:active {
    transform: none;
    box-shadow: none;
}

.divider {
    height: 1px;
    background: var(--border-color);
    border: none;
    margin: 0.5rem 0;
}

/* 专栏内容与目录：右侧固定列表，左侧文章流 */
.column-layout {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 1.5rem;
    align-items: start;
}

.column-directory {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 10px 30px var(--shadow-color);
    position: sticky;
    top: calc(var(--header-height, 64px) + 1rem);
    max-height: calc(100vh - calc(var(--header-height, 64px) + 3rem));
    overflow: hidden;
    min-width: 220px;
}

.column-directory__title {
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 0.85);
}

.column-directory__content {
    max-height: calc(100vh - calc(var(--header-height, 64px) + 6rem));
    overflow-y: auto;
    padding-right: 0.3rem;
}

.column-directory__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.column-directory__item {
    margin: 0;
}

.column-directory__item.column-directory__level-4 {
    padding-left: 0.6rem;
}

.column-directory__item.column-directory__level-5 {
    padding-left: 1.2rem;
}

.column-directory__link {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.4;
    padding: 0.3rem 0.4rem;
    border-radius: 8px;
    transition: background 0.18s ease;
}

.column-directory__link:hover,
.column-directory__link:focus-visible {
    background: var(--hover-bg);
}

.column-directory__link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.column-directory__empty {
    margin: 0;
    color: rgba(100, 116, 139, 0.9);
    font-size: 0.92rem;
    line-height: 1.5;
}

.column-directory__content::-webkit-scrollbar {
    width: 6px;
}

.column-directory__content::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background: rgba(15, 23, 42, 0.2);
}

@media (max-width: 960px) {
    .column-layout {
        grid-template-columns: 1fr;
    }
    .column-directory {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 640px) {
    .article-card {
        padding: 0.95rem 1rem;
    }
    .gallery-grid {
        column-width: 100%;
    }
}
