/*
Theme Name: Contexture
Description: Minimalist file system theme with clean typography
Version: 62.0 - Quick Post Complete
*/

/* ========================================
   ACCESSIBILITY
======================================== */

/* キーボードフォーカス */
*:focus-visible {
    outline: 2px solid #111111;
    outline-offset: 2px;
}

/* スキップリンク */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #111111;
    color: #FFFFFF;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    :root {
        --color-text-primary: #000000;
        --color-text-secondary: #333333;
        --color-border: #000000;
    }
}

/* 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ARIAラベル用の視覚的隠し */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:root {
    /* Colors - Unified Light Gray Theme */
    --color-bg: #FFFFFF;
    --color-surface: #F8F8F8;
    --color-border: #E0E0E0;
    --color-text-primary: #111111;
    --color-text-secondary: #666666;
    --color-text-meta: #999999;
    --color-accent: #111111;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    
    /* Font Sizes */
    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 15px;
    --text-lg: 18px;
    --text-xl: 24px;
    --text-2xl: 32px;
    --text-3xl: 48px;
    --text-4xl: 64px;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;
    
    /* Layout */
    --sidebar-width: 280px;
    --content-max-width: 960px;
    --metadata-width: 260px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    margin: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.7;
}

/* ========================================
   LAYOUT - 3 COLUMN GRID (Desktop)
======================================== */

.site-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--metadata-width);
    height: 100vh;
    overflow: hidden;
}

/* ========================================
   LEFT SIDEBAR - Navigation
======================================== */

.file-system-sidebar {
    background-color: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.sidebar-header {
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.sidebar-header a {
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-primary);
    display: block;
}

.tree-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md) 0;
}

/* Scrollbar Styling */
.tree-nav::-webkit-scrollbar {
    width: 6px;
}

.tree-nav::-webkit-scrollbar-track {
    background: transparent;
}

.tree-nav::-webkit-scrollbar-thumb {
    background-color: var(--color-border);
    border-radius: 3px;
}

.tree-nav::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-text-secondary);
}

/* Tree Structure */
.file-tree-root {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    margin-left: var(--space-xl);
    padding-left: var(--space-md);
    border-left: 2px solid var(--color-border);
    display: none;
}

.folder-item.is-open > .sub-menu {
    display: block;
}

.tree-item {
    position: relative;
}

/* 全てのアイテムを統一 */
.tree-item > a,
.tree-item > .folder-label {
    display: block;
}

/* 直接リンク */
.tree-item > a {
    display: flex;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    margin: 3px var(--space-sm);
    font-size: 15px;
    color: var(--color-text-primary);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.15s ease;
    line-height: 1.5;
    min-height: 38px;
}

/* フォルダラベル */
.tree-item > .folder-label {
    margin: 3px var(--space-sm);
    display: block;
    min-height: 38px;
}

/* フォルダ内リンク */
.folder-link {
    display: flex;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    color: var(--color-text-primary);
    text-decoration: none;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.5;
    min-height: 38px;
}

.tree-item > a:hover,
.folder-link:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.tree-item.current-menu-item > a,
.tree-item.current-menu-item .folder-link,
.tree-item.current-menu-ancestor .folder-link {
    background-color: rgba(0, 0, 0, 0.08);
    font-weight: 500;
}

/* 矢印を右側に配置 */
.toggle-arrow {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    opacity: 0.7;
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: 4px;
    transition: opacity 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
    font-weight: bold;
}

.toggle-arrow:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.08);
}

.toggle-arrow::before {
    content: '›';
    font-size: 16px;
    font-weight: bold;
    color: var(--color-text-primary);
    transition: transform 0.15s ease;
    display: block;
}

.folder-item.is-open > .folder-label .toggle-arrow::before {
    transform: rotate(90deg);
}

.icon {
    width: 16px;
    height: 16px;
    margin-right: var(--space-sm);
    opacity: 0.5;
    flex-shrink: 0;
}

/* 子階層がないフォルダは通常のリンクスタイル */
.tree-item.no-children > a {
    padding: var(--space-sm) var(--space-md);
}

/* 子階層があるフォルダも同じパディング */
.tree-item.has-children .folder-link {
    /* padding is already set in .folder-link */
}

/* ルートレベルのアイテム間に適度な余白 */
.file-tree-root > .tree-item {
    margin-bottom: var(--space-sm);
}

/* 子階層があるフォルダは下に大きめの余白 */
.file-tree-root > .tree-item.has-children {
    margin-bottom: var(--space-lg);
}

/* 子階層が開いている場合は余白を減らす */
.file-tree-root > .tree-item.has-children.is-open {
    margin-bottom: var(--space-sm);
}

.folder-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    line-height: 1.5;
}

/* 階層の深さに応じた視覚的な区別 */
.sub-menu .sub-menu {
    margin-left: var(--space-xl);
    border-left-color: rgba(0, 0, 0, 0.12);
}

.sub-menu .sub-menu .sub-menu {
    margin-left: var(--space-xl);
    border-left-color: rgba(0, 0, 0, 0.1);
}

.sub-menu .sub-menu .sub-menu .sub-menu {
    margin-left: var(--space-lg);
    border-left-color: rgba(0, 0, 0, 0.08);
}

/* 深い階層でもフォントサイズは維持（可読性重視） */
.sub-menu .folder-text,
.sub-menu a {
    font-size: 15px;
}

.sub-menu .sub-menu .folder-text,
.sub-menu .sub-menu a {
    font-size: 14px;
}

.sub-menu .sub-menu .sub-menu .folder-text,
.sub-menu .sub-menu .sub-menu a {
    font-size: 14px;
}

.sub-menu .sub-menu .sub-menu .sub-menu .folder-text,
.sub-menu .sub-menu .sub-menu .sub-menu a {
    font-size: 13px;
}

/* ========================================
   MAIN CONTENT AREA
======================================== */

.site-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: visible;
    background-color: var(--color-bg);
}

.pane-container {
    flex: 1;
    overflow: visible;
    padding: var(--space-3xl) var(--space-2xl);
}


.pane-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text-meta);
    font-size: var(--text-base);
}

/* ========================================
   INDEX LIST - Archive Pages
======================================== */

.index-grid,
.explorer-view {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.index-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.index-item {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: var(--space-2xl);
    padding: var(--space-2xl) 0;
    border-bottom: 1px solid var(--color-border);
    align-items: start;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.index-item:hover {
    opacity: 0.7;
}

.index-item:first-child {
    border-top: 1px solid var(--color-border);
}

/* コンパクト表示モード - テーブル風 */
/* ========================================
   COMPACT DISPLAY (使用 Latest Posts テーブルスタイル)
======================================== */

/* 旧コンパクト表示スタイル - Latest Postsテーブルに統一したため不要
.index-item-compact {
    display: block;
    padding: 0;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
}
... 以下省略（posts-tableを使用）
*/

/* ========================================
   LIST DISPLAY (一覧表示)
======================================== */

.meta-table {
    width: 100%;
    font-size: var(--text-sm);
    border-collapse: collapse;
}

.meta-table td {
    padding: var(--space-xs) 0;
    color: var(--color-text-secondary);
}

.meta-table .meta-label {
    width: 100px;
    color: var(--color-text-meta);
    font-weight: 500;
}

/* 一覧表示モード - メタデータ表示 */
.index-core {
    min-width: 0;
}

.index-title {
    font-size: 20px;  /* タイトルサイズを小さく（24px → 20px） */
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.index-title a {
    color: var(--color-text-primary);
}

.index-excerpt {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-top: var(--space-sm);
}

.index-meta {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    font-size: 12px;  /* メタデータのフォントサイズを小さく */
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: var(--space-xs) 0;
}

.meta-row .k {
    color: var(--color-text-meta);
    font-weight: 500;
    min-width: 80px;
}

.meta-row .v {
    color: var(--color-text-primary);
    text-align: right;
    font-family: var(--font-mono);
}

/* 全文表示モード */
.index-item-full {
    padding: var(--space-3xl) 0;
    border-bottom: 1px solid var(--color-border);
}

.index-item-full:first-child {
    border-top: 1px solid var(--color-border);
}

.full-title {
    font-size: var(--text-xl);
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: var(--space-sm);
}

.full-title a {
    color: var(--color-text-primary);
}

.full-meta {
    font-size: var(--text-sm);
    color: var(--color-text-meta);
    margin-bottom: var(--space-2xl);
}

.full-content {
    font-size: var(--text-base);
    line-height: 1.8;
    color: var(--color-text-primary);
}

.full-content p {
    margin-bottom: var(--space-xl);
}

.full-content img {
    max-width: 100%;
    height: auto;
    margin: var(--space-2xl) 0;
}

.full-content h1,
.full-content h2,
.full-content h3 {
    margin-top: var(--space-3xl);
    margin-bottom: var(--space-lg);
    font-weight: 500;
}

/* ========================================
   RIGHT SIDEBAR - Metadata
======================================== */

.post-metadata-sidebar {
    background-color: var(--color-surface);
    border-left: 1px solid var(--color-border);
    padding: var(--space-xl) var(--space-md);
    overflow-y: auto;
    height: 100%;
}

.post-metadata-sidebar::-webkit-scrollbar {
    width: 6px;
}

.post-metadata-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.post-metadata-sidebar::-webkit-scrollbar-thumb {
    background-color: var(--color-border);
    border-radius: 3px;
}

.metadata-header {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-meta);
    margin-bottom: var(--space-lg);
}

.metadata-divider {
    width: 100%;
    height: 1px;
    background-color: var(--color-border);
    margin: var(--space-xl) 0;
}

.metadata-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.metadata-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.metadata-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-text-meta);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.metadata-value {
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    line-height: 1.5;
    word-break: break-word;
}

.metadata-value a {
    color: var(--color-text-primary);
    text-decoration: underline;
}

.metadata-value a:hover {
    opacity: 0.7;
}

/* ========================================
   SINGLE POST / PAGE
======================================== */

.single-wrap {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.single-header {
    margin-bottom: var(--space-3xl);
}

.entry-title {
    font-size: 32px;  /* タイトルサイズを小さく（40px → 32px） */
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
    color: var(--color-text-primary);
}

.entry-meta {
    font-size: var(--text-sm);
    color: var(--color-text-meta);
}

.entry-content {
    font-size: var(--text-base);
    line-height: 1.8;
    color: var(--color-text-primary);
}

.entry-content p {
    margin-bottom: var(--space-xl);
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    font-weight: 500;
    line-height: 1.3;
    margin-top: var(--space-3xl);
    margin-bottom: var(--space-lg);
}

.entry-content h1 {
    font-size: var(--text-3xl);
}

.entry-content h2 {
    font-size: var(--text-2xl);
}

.entry-content h3 {
    font-size: var(--text-xl);
}

.entry-content ul,
.entry-content ol {
    margin: var(--space-lg) 0;
    padding-left: var(--space-xl);
}

.entry-content li {
    margin-bottom: var(--space-sm);
}

.entry-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: var(--space-3xl) 0;
}

.entry-content blockquote {
    margin: var(--space-2xl) 0;
    padding-left: var(--space-xl);
    border-left: 4px solid var(--color-border);
    font-style: italic;
    color: var(--color-text-secondary);
}

.entry-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background-color: var(--color-surface);
    padding: 2px 6px;
    border-radius: 3px;
}

.entry-content pre {
    background-color: var(--color-surface);
    padding: var(--space-lg);
    border-radius: 4px;
    overflow-x: auto;
    margin: var(--space-2xl) 0;
}

.entry-content pre code {
    background: none;
    padding: 0;
}

/* ========================================
   RESPONSIVE - TABLET
======================================== */

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
        --metadata-width: 280px;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
======================================== */

@media (max-width: 768px) {
    body {
        padding-top: 56px;
        overflow: auto;
        height: auto;
    }
    
    .site-container {
        display: block;
        height: auto;
        min-height: calc(100vh - 56px);
    }
    
    .file-system-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        z-index: 300;
        background-color: var(--color-bg);
        border-right: none;
        border-bottom: none;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .file-system-sidebar.is-open {
        left: 0;
    }
    
    .site-main {
        height: auto;
        overflow: visible;
    }
    
    .pane-container {
        padding: var(--space-2xl) var(--space-md);
    }
    
    .index-item {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        padding: var(--space-xl) 0;
    }
    
    .index-title {
        font-size: 18px;  /* モバイルでさらに小さく */
    }
    
    .index-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
    }
    
    .meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }
    
    .meta-row .v {
        text-align: left;
    }
    
    .single-wrap {
        padding: var(--space-2xl) var(--space-md);
    }
    
    .entry-title {
        font-size: 24px;  /* モバイルでさらに小さく */
    }
    
    .entry-content {
        font-size: var(--text-base);
    }
    
    /* モバイルではメタデータサイドバーを非表示 */
    .post-metadata-sidebar {
        display: none;
    }
}

/* ========================================
   TABLET RESPONSIVE (769px - 1024px)
======================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
        --metadata-width: 220px;
    }
    
    .site-main {
        padding: var(--space-xl) var(--space-lg);
    }
    
    .post-metadata-sidebar {
        padding: var(--space-lg) var(--space-sm);
    }
    
    .metadata-header {
        font-size: 10px;
    }
    
    .metadata-label,
    .metadata-value {
        font-size: var(--text-xs);
    }
    
    /* Latest Posts テーブルを調整 */
    .posts-table {
        font-size: 12px;
    }
    
    .posts-table th,
    .posts-table td {
        padding: var(--space-sm) var(--space-xs);
    }
    
    .col-title {
        width: 30%;
    }
    
    .col-image {
        width: 12%;
    }
    
    .table-thumbnail {
        width: 60px;
        height: 45px;
    }
    
    .col-excerpt {
        width: 30%;
    }
}

/* ========================================
   MOBILE NAVIGATION
======================================== */

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: var(--space-md);
        background-color: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 250;
        height: 56px;
        box-sizing: border-box;
    }
    
    .mobile-menu-toggle {
        background: none;
        border: none;
        padding: var(--space-sm);
        cursor: pointer;
        font-size: var(--text-lg);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--color-text-primary);
    }
    
    .mobile-title {
        font-size: var(--text-sm);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--color-text-primary);
    }
    
    .sidebar-close {
        display: block;
        padding: var(--space-md);
        text-align: right;
        border-bottom: 1px solid var(--color-border);
    }
    
    .sidebar-close-button {
        background: none;
        border: none;
        font-size: var(--text-2xl);
        cursor: pointer;
        padding: var(--space-sm);
        color: var(--color-text-primary);
        line-height: 1;
    }
    
    /* Overlay when sidebar is open */
    body.sidebar-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 250;
    }
    
    body.sidebar-open {
        overflow: hidden;
    }
}

/* Desktop: Hide mobile elements */
@media (min-width: 769px) {
    .mobile-header,
    .mobile-menu-toggle,
    .mobile-search-toggle,
    .mobile-search-overlay,
    .sidebar-close {
        display: none;
    }
}

/* ========================================
   DATE ARCHIVE (Right Sidebar)
======================================== */

.date-archive-new {
    margin-bottom: var(--space-xl);
}

.archive-year-section {
    margin-bottom: var(--space-md);
}

.archive-year-header {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text-primary);
    padding: var(--space-sm) 0;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.archive-year-header::before {
    content: '▼';
    display: inline-block;
    margin-right: var(--space-xs);
    font-size: 10px;
    transition: transform 0.2s ease;
}

.archive-year-section.collapsed .archive-year-header::before {
    transform: rotate(-90deg);
}

.archive-year-section.collapsed .archive-month-section {
    display: none;
}

.archive-month-section {
    margin-left: var(--space-md);
    margin-bottom: var(--space-sm);
}

.archive-month-header {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: var(--space-xs) var(--space-sm);
    margin-left: var(--space-xs);
    cursor: pointer;
    user-select: none;
    position: relative;
}

.archive-month-header::before {
    content: '▼';
    display: inline-block;
    margin-right: var(--space-xs);
    font-size: 10px;
    transition: transform 0.2s ease;
}

.archive-month-section.collapsed .archive-month-header::before {
    transform: rotate(-90deg);
}

.archive-month-section.collapsed .archive-posts-list {
    display: none;
}

.archive-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
    margin-left: var(--space-lg);
}

.archive-post-item {
    margin: 2px 0;
}

.archive-post-item a {
    display: block;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.archive-post-item a:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--color-text-primary);
}

/* ========================================
   SEARCH FUNCTIONALITY
======================================== */

/* Sidebar Search */
.sidebar-search {
    padding: var(--space-lg);
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.search-form {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: var(--space-xs);
}

.search-field {
    flex: 1;
    border: none;
    background: none;
    font-size: var(--text-sm);
    padding: var(--space-xs);
    color: var(--color-text-primary);
    outline: none;
}

.search-field::placeholder {
    color: var(--color-text-meta);
}

.search-submit {
    background: none;
    border: none;
    padding: var(--space-xs);
    cursor: pointer;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.search-submit:hover {
    color: var(--color-text-primary);
}

/* Mobile Search */
.mobile-search-toggle {
    background: none;
    border: none;
    padding: var(--space-sm);
    cursor: pointer;
    font-size: var(--text-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
}

.mobile-search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 400;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-search-overlay.is-open {
    display: flex;
    opacity: 1;
}

.mobile-search-container {
    background-color: var(--color-bg);
    width: 100%;
    padding: var(--space-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-search-form {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.mobile-search-field {
    flex: 1;
    border: none;
    border-bottom: 2px solid var(--color-border);
    background: none;
    font-size: var(--text-lg);
    padding: var(--space-md) 0;
    color: var(--color-text-primary);
    outline: none;
}

.mobile-search-field:focus {
    border-bottom-color: var(--color-text-primary);
}

.mobile-search-field::placeholder {
    color: var(--color-text-meta);
}

.mobile-search-close {
    background: none;
    border: none;
    padding: var(--space-sm);
    cursor: pointer;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

body.search-open {
    overflow: hidden;
}

/* ========================================
   UTILITY CLASSES
======================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Icon styling */
.icon-folder,
.icon-file,
.icon-image,
.icon-page {
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ========================================
   CUSTOM METADATA DISPLAY
======================================== */

.custom-metadata-section {
    margin-top: var(--space-3xl);
    padding-top: var(--space-2xl);
}

.custom-metadata-divider {
    width: 100%;
    height: 1px;
    background-color: var(--color-border);
    margin-bottom: var(--space-xl);
}

.custom-metadata-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.custom-metadata-item {
    display: flex;
    align-items: baseline;
    font-size: var(--text-sm);
    line-height: 1.8;
    padding: var(--space-xs) 0;
}

/* 1行表示モード（ラベルと値を横並び） */
.custom-metadata-item.single-line {
    display: flex;
    flex-direction: row;
    align-items: baseline;
}

.custom-meta-label {
    color: var(--color-text-meta);
    font-weight: 500;
    min-width: 120px;
    flex-shrink: 0;
}

/* 1行表示の場合はラベルを短く */
.custom-metadata-item.single-line .custom-meta-label {
    min-width: auto;
}

.custom-meta-separator {
    margin: 0 var(--space-sm);
    color: var(--color-text-meta);
}

.custom-meta-value {
    color: var(--color-text-primary);
    flex: 1;
    word-break: break-word;
}

/* リンクのスタイル */
.custom-meta-value a {
    color: var(--color-text-primary);
    text-decoration: underline;
}

.custom-meta-value a:hover {
    opacity: 0.7;
}

/* 本文の上に表示する場合 */
.metadata-above {
    margin-bottom: var(--space-md);
    padding-bottom: 0;
}

.metadata-above .custom-metadata-divider {
    margin-top: var(--space-md);
    margin-bottom: 0;
}

/* 行数に応じた幅調整 */
.custom-metadata-section.metadata-narrow {
    max-width: 400px;
}

.custom-metadata-section.metadata-medium {
    max-width: 550px;
}

.custom-metadata-section.metadata-wide {
    max-width: 700px;
}

.custom-metadata-section.metadata-full {
    max-width: 100%;
}

/* メタデータリストの表示 */
.custom-metadata-list {
    /* max-heightを削除 - 全て表示 */
}

/* 空白行（グループ区切り） - 視覚的な区切り線 */
.custom-metadata-divider-line {
    margin: var(--space-xl) 0;
    height: 1px;
    background: var(--color-border);
    opacity: 0.5;
    display: block;
}

/* 旧セパレーター（使用しない） */
.custom-metadata-separator {
    height: var(--space-2xl);
    width: 100%;
    display: block !important;
    visibility: visible !important;
    min-height: 48px;
}

/* ========================================
   GALLERY LAYOUT - Photography Focus
======================================== */

/* WordPress標準ギャラリー + Gutenbergギャラリー対応 */
.wp-block-gallery,
.blocks-gallery-grid,
.gallery,
.entry-content .gallery {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px; /* 上下左右均等に8px */
    margin: var(--space-2xl) 0 !important; /* 上下余白を縮小 */
    list-style: none !important;
    padding: 0 !important;
    justify-content: flex-start;
}

/* ギャラリーアイテム */
.wp-block-gallery .blocks-gallery-item,
.blocks-gallery-item,
.gallery-item,
.gallery .gallery-item {
    flex: 1 1 auto;
    min-width: 250px;
    max-width: 400px;
    position: relative;
    margin: 0 !important;
    list-style: none !important;
}

/* 画像自体のスタイル */
.gallery-item img,
.blocks-gallery-item img,
.gallery img {
    width: 100%;
    height: auto;
    display: block !important;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 2px;
}

.gallery-item a,
.blocks-gallery-item a {
    display: block;
    line-height: 0;
}

.gallery-item img:hover,
.blocks-gallery-item img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Gutenberg specific */
.wp-block-gallery.has-nested-images figure.wp-block-image {
    flex: 1 1 auto;
    min-width: 250px;
    max-width: 400px;
    margin: 0 !important;
}

/* ライトボックス */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay.active {
    display: flex !important;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 36px;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10000;
    border-radius: 4px;
    line-height: 1;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* タブレット対応 */
@media (max-width: 1024px) {
    .wp-block-gallery .blocks-gallery-item,
    .blocks-gallery-item,
    .gallery-item {
        min-width: 200px;
        max-width: 45%;
    }
}

/* モバイル対応 */
@media (max-width: 768px) {
    .wp-block-gallery .blocks-gallery-item,
    .blocks-gallery-item,
    .gallery-item {
        min-width: 100%;
        max-width: 100%;
    }
    
    .wp-block-gallery,
    .gallery {
        gap: 8px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 28px;
        width: 48px;
        height: 48px;
    }
    
    .lightbox-close {
        width: 48px;
        height: 48px;
        font-size: 32px;
    }
}

/* ========================================
   PHOTOGRAPHY-FOCUSED LAYOUT
======================================== */

/* ========================================
   HOME CATALOG LAYOUT
======================================== */

.catalog-container {
    max-width: 100%;
    margin: 0 auto;
}

.catalog-header {
    margin-bottom: var(--space-3xl);
    padding-bottom: var(--space-2xl);
    border-bottom: 1px solid var(--color-border);
}

.catalog-title {
    font-size: var(--text-2xl);
    font-weight: 500;
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.catalog-description {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.catalog-table-wrapper {
    overflow-x: auto;
}

.catalog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    background-color: var(--color-bg);
}

.catalog-table thead {
    border-bottom: 2px solid var(--color-border);
}

.catalog-table thead th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-meta);
    background-color: var(--color-surface);
}

.catalog-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.catalog-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.catalog-table td {
    padding: var(--space-lg);
    vertical-align: top;
}

.col-title {
    width: 30%;
    min-width: 200px;
}

.col-year {
    width: 10%;
    min-width: 80px;
    font-family: var(--font-mono);
    color: var(--color-text-secondary);
}

.col-category {
    width: 15%;
    min-width: 120px;
    color: var(--color-text-secondary);
}

.col-description {
    width: 45%;
    min-width: 250px;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.title-wrapper {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.row-thumbnail {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 2px;
}

.row-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.title-link {
    font-weight: 500;
    color: var(--color-text-primary);
    text-decoration: none;
    line-height: 1.5;
    display: block;
}

.title-link:hover {
    opacity: 0.7;
}

.no-posts {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--color-text-meta);
    font-size: var(--text-base);
}

/* カタログのレスポンシブ対応 */
@media (max-width: 1024px) {
    .catalog-table {
        font-size: 12px;
    }
    
    .catalog-table td {
        padding: var(--space-md);
    }
    
    .row-thumbnail {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    .catalog-header {
        margin-bottom: var(--space-2xl);
    }
    
    .catalog-title {
        font-size: var(--text-xl);
    }
    
    /* モバイルではカード形式に変更 */
    .catalog-table thead {
        display: none;
    }
    
    .catalog-table,
    .catalog-table tbody,
    .catalog-table tr,
    .catalog-table td {
        display: block;
        width: 100%;
    }
    
    .catalog-table tr {
        margin-bottom: var(--space-xl);
        border: 1px solid var(--color-border);
        border-radius: 4px;
        padding: var(--space-md);
    }
    
    .catalog-table td {
        padding: var(--space-sm) 0;
        border: none;
    }
    
    .col-title {
        width: 100%;
        margin-bottom: var(--space-sm);
    }
    
    .title-wrapper {
        flex-direction: column;
    }
    
    .row-thumbnail {
        width: 100%;
        height: 200px;
        margin-bottom: var(--space-sm);
    }
    
    .col-year,
    .col-category {
        display: inline-block;
        width: auto;
        margin-right: var(--space-md);
    }
    
    .col-year::before {
        content: 'Year: ';
        font-weight: 600;
        color: var(--color-text-meta);
    }
    
    .col-category::before {
        content: 'Category: ';
        font-weight: 600;
        color: var(--color-text-meta);
    }
    
    .col-description {
        width: 100%;
        margin-top: var(--space-sm);
    }
}

/* ========================================
   PHOTOGRAPHY-FOCUSED LAYOUT
======================================== */

/* 写真表示の最適化 */
.entry-content img,
.full-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: var(--space-3xl) 0;
}

/* 単一画像の場合は中央配置 */
.entry-content p > img:only-child,
.full-content p > img:only-child {
    margin-left: auto;
    margin-right: auto;
}

/* ギャラリーブロック */
.wp-block-gallery {
    margin: var(--space-3xl) 0;
}

/* コンパクト表示モード - アイキャッチ画像付き */
.index-item-compact.has-thumbnail .compact-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: var(--space-md);
    align-items: center;
}

.compact-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 2px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.compact-row:hover .compact-thumbnail {
    opacity: 1;
}

.compact-row-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
}

/* 一覧表示モード - アイキャッチ画像付き */
.index-item.has-thumbnail {
    display: grid;
    grid-template-columns: 200px 1fr 240px;
    gap: var(--space-2xl);
    padding: var(--space-2xl) 0;
    border-bottom: 1px solid var(--color-border);
    align-items: start;
}

.index-thumbnail {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 2px;
}

/* 全文表示モード - アイキャッチ画像付き */
.index-item-full.has-thumbnail .full-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-xl);
}

.full-thumbnail {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 2px;
}

.full-header-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 投稿ページ - アイキャッチ画像 */
.single-featured-image {
    margin: var(--space-3xl) 0;
}

.single-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* タイポグラフィ - 写真家向けの洗練された余白 */
.entry-content,
.full-content {
    line-height: 1.8;
    letter-spacing: 0.01em;
}

.entry-content p,
.full-content p {
    margin-bottom: var(--space-xl);
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.full-content h1,
.full-content h2,
.full-content h3 {
    margin-top: var(--space-3xl);
    margin-bottom: var(--space-lg);
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* 単一投稿ページのヘッダー余白 */
.single-header {
    margin-bottom: var(--space-3xl);
}

.entry-title {
    margin-bottom: var(--space-md);
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .index-item.has-thumbnail {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .index-thumbnail {
        width: 100%;
        max-width: 400px;
    }
    
    .index-item-full.has-thumbnail .full-header {
        grid-template-columns: 1fr;
    }
    
    .full-thumbnail {
        max-width: 400px;
    }
}

/* ========================================
   LATEST POSTS DESKTOP (default)
======================================== */

.posts-table {
    width: 100%;
    border-collapse: collapse;
}

.posts-table thead {
    border-bottom: 1px solid var(--color-border);
}

.posts-table th {
    padding: var(--space-md) var(--space-sm);
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-meta);
}

.posts-table tbody tr {
    border-bottom: 1px solid var(--color-border);
}

.posts-table td {
    padding: var(--space-lg) var(--space-sm);
    vertical-align: middle;
}

.post-details-row {
    display: none !important;
}

/* ========================================
   LATEST POSTS MOBILE (≤1024px)
======================================== */

@media (max-width: 1024px) {
    /* Latest Posts モバイル - 参考画像に完全準拠 */
    .posts-table {
        display: block;
        border-top: 1px solid var(--color-border);
    }
    
    .posts-table thead {
        display: none;
    }
    
    .posts-table tbody {
        display: block;
    }
    
    .post-row {
        display: table;
        width: 100%;
        border-bottom: 1px solid var(--color-border);
        background-color: var(--color-bg);
        cursor: pointer;
        transition: background-color 0.15s ease;
    }
    
    .post-row:active {
        background-color: rgba(0, 0, 0, 0.02);
    }
    
    /* デフォルト表示: Year | Title のテーブルレイアウト */
    .posts-table td {
        display: none;
    }
    
    .col-year,
    .col-title {
        display: table-cell !important;
        vertical-align: middle;
        padding: 16px 16px !important;
        border: none !important;
    }
    
    /* Year列 */
    .col-year {
        width: 90px;
        font-size: 13px;
        color: var(--color-text-secondary);
        font-family: var(--font-mono);
        white-space: nowrap;
        padding-right: 12px !important;
        line-height: 1.6;
    }
    
    /* Title列 */
    .col-title {
        font-size: 14px;
        font-weight: 400;
        line-height: 1.6;
        color: var(--color-text-primary);
        padding-left: 12px !important;
    }
    
    .col-title a {
        color: var(--color-text-primary);
        text-decoration: none;
        pointer-events: none;
        display: block;
    }
    
    /* 詳細行（展開時） */
    .post-details-row {
        display: none !important;
    }
    
    .post-details-row.is-visible {
        display: table-row !important;
    }
    
    .post-details-cell {
        display: table-cell !important;
        padding: 0 !important;
        border: none !important;
        background: var(--color-surface);
    }
    
    .post-details-content {
        padding: 16px;
        border-top: 1px solid var(--color-border);
    }
    
    /* Path */
    .detail-path {
        font-size: 13px;
        color: var(--color-text-secondary);
        margin-bottom: 12px;
        line-height: 1.5;
    }
    
    /* Description */
    .detail-description {
        font-size: 14px;
        line-height: 1.7;
        color: var(--color-text-primary);
        margin-bottom: 16px;
    }
    
    /* Image */
    .detail-image {
        margin-bottom: 16px;
    }
    
    .detail-image img {
        width: 100%;
        height: auto;
        display: block;
        border-radius: 4px;
    }
    
    /* Read More Button */
    .read-more-btn {
        display: inline-block;
        padding: 10px 20px;
        background: var(--color-text-primary);
        color: var(--color-bg);
        text-decoration: none;
        font-size: 13px;
        font-weight: 500;
        border-radius: 4px;
        transition: opacity 0.2s;
    }
    
    .read-more-btn:hover {
        opacity: 0.85;
    }
    
    /* Latest Postsタイトル */
    .section-title {
        font-size: 22px;
        font-weight: 600;
        margin-bottom: 24px;
        color: var(--color-text-primary);
    }
    
    /* Latest Postsのタイトル */
    .section-title {
        font-size: var(--text-xl);
        margin-bottom: var(--space-lg);
    }
}

/* ========================================
   HOME PAGE TABLE DISPLAY
======================================== */

.home-content {
    max-width: 100%;
    margin: 0 auto;
}

.home-page-content {
    max-width: var(--content-max-width);
    margin: 0 auto var(--space-3xl);
    font-size: var(--text-base);
    line-height: 1.8;
}

.latest-posts-table {
    max-width: 100%;
    margin-top: var(--space-3xl);
}

.section-title {
    font-size: var(--text-xl);
    font-weight: 500;
    margin-bottom: var(--space-2xl);
    color: var(--color-text-primary);
}

.posts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    background-color: var(--color-bg);
}

.posts-table thead {
    border-bottom: 2px solid var(--color-border);
}

.posts-table th {
    padding: var(--space-md) var(--space-sm);
    text-align: left;
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-meta);
    background-color: var(--color-surface);
}

.posts-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.posts-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.posts-table td {
    padding: var(--space-md) var(--space-sm);
    vertical-align: middle;
    color: var(--color-text-primary);
}

.col-year {
    width: 10%;
    font-family: var(--font-mono);
    color: var(--color-text-secondary);
}

.col-title {
    width: 25%;
    font-weight: 500;
}

.col-title a {
    color: var(--color-text-primary);
    text-decoration: none;
}

.col-title a:hover {
    opacity: 0.7;
}

.col-path {
    width: 20%;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    font-family: var(--font-mono);
}

.col-description {
    width: 30%;
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.col-image {
    width: 15%;
}

.table-thumbnail {
    width: 80px;
    height: 60px;
    overflow: hidden;
    border-radius: 2px;
}

.table-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 旧カラム名（削除） */
.col-date {
    width: 10%;
    font-family: var(--font-mono);
    color: var(--color-text-secondary);
}

.col-location {
    width: 15%;
    color: var(--color-text-secondary);
}

.col-excerpt {
    width: 35%;
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--color-text-secondary);
}

/* テーブルの最初の行 */
.posts-table tbody tr:first-child {
    border-top: 1px solid var(--color-border);
}

/* 空のセルのスタイル */
.posts-table td:empty::after {
    content: '—';
    color: var(--color-text-meta);
}

/* ========================================
   PAGINATION
======================================== */

.pagination {
    margin-top: var(--space-3xl);
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--color-border);
}

.pagination .page-numbers {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    padding: 0;
    margin: 0;
}

.pagination .page-numbers li {
    display: inline-block;
}

.pagination .page-numbers a,
.pagination .page-numbers .current {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: var(--text-sm);
    text-decoration: none;
    color: var(--color-text-primary);
    transition: all 0.2s ease;
}

.pagination .page-numbers a:hover {
    background-color: var(--color-surface);
    border-color: var(--color-text-meta);
}

.pagination .page-numbers .current {
    background-color: var(--color-text-primary);
    color: var(--color-bg);
    border-color: var(--color-text-primary);
    font-weight: 600;
}

.pagination .page-numbers .dots {
    padding: 0 var(--space-xs);
    color: var(--color-text-meta);
}

@media (max-width: 768px) {
    .pagination {
        margin-top: var(--space-2xl);
        padding-top: var(--space-xl);
    }
    
    .pagination .page-numbers {
        flex-wrap: nowrap;
        gap: 6px;
        justify-content: center;
    }
    
    .pagination .page-numbers a,
    .pagination .page-numbers .current {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 8px;
        border-radius: 50%;
    }
    
    /* 前へ・次へのテキストを矢印に */
    .pagination .page-numbers .prev,
    .pagination .page-numbers .next {
        min-width: 32px;
        padding: 0;
        font-size: 14px;
    }
    
    /* dotsを小さく */
    .pagination .page-numbers .dots {
        font-size: 12px;
        padding: 0 4px;
    }
}


/* ========================================
   RELATED POSTS
======================================== */

.related-posts {
    margin-top: var(--space-4xl);
    padding-top: var(--space-3xl);
    border-top: 1px solid var(--color-border);
}

.related-posts-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-2xl);
    color: var(--color-text-primary);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.related-post-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    transition: transform 0.2s ease;
}

.related-post-item:hover {
    transform: translateY(-4px);
}

.related-post-thumbnail {
    display: block;
    overflow: hidden;
    border-radius: 4px;
    aspect-ratio: 16/9;
}

.related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-item:hover .related-post-thumbnail img {
    transform: scale(1.05);
}

.related-post-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.related-post-title {
    font-size: var(--text-base);
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
}

.related-post-title a {
    color: var(--color-text-primary);
    text-decoration: none;
}

.related-post-title a:hover {
    opacity: 0.7;
}

.related-post-date {
    font-size: var(--text-sm);
    color: var(--color-text-meta);
    font-family: var(--font-mono);
}

@media (max-width: 768px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

/* ========================================
   BREADCRUMB NAVIGATION
======================================== */

.breadcrumb {
    margin-bottom: var(--space-2xl);
    padding: var(--space-md) 0;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: var(--text-sm);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: '›';
    margin-left: var(--space-sm);
    color: var(--color-text-meta);
    font-weight: bold;
}

.breadcrumb-item a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--color-text-primary);
}

.breadcrumb-current {
    color: var(--color-text-primary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .breadcrumb-list {
        font-size: var(--text-xs);
    }
}

/* ========================================
   RELATED POSTS - MAIN COLUMN
======================================== */

.related-posts-main {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}

.related-title-main {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.related-grid-main {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.related-item-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-thumb-main {
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 2px;
    display: block;
}

.related-thumb-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-item-main:hover .related-thumb-main img {
    transform: scale(1.05);
}

.related-content-main h3 {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
}

.related-content-main a {
    color: var(--color-text-primary);
    text-decoration: none;
}

.related-content-main a:hover {
    opacity: 0.7;
}

.related-content-main time {
    font-size: 11px;
    color: var(--color-text-meta);
    font-family: var(--font-mono);
}

@media (max-width: 768px) {
    .related-grid-main {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   UPDATE NOTIFICATION BANNER
======================================== */

.update-notification {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 24px;
    margin-bottom: 32px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.notification-icon {
    font-size: 24px;
}

.notification-text {
    flex: 1;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-primary);
}

.notification-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s;
}

.notification-close:hover {
    background: rgba(255,255,255,0.3);
}

/* ========================================
   COMPACT DISPLAY - ROW CLICK (PC)
======================================== */

@media (min-width: 1025px) {
    .posts-table-archive .post-row {
        cursor: pointer;
        transition: background-color 0.15s ease;
    }
    
    .posts-table-archive .post-row:hover {
        background-color: rgba(0, 0, 0, 0.02);
    }
    
    .posts-table-archive .post-row .col-title a {
        pointer-events: none;
    }
}

/* ========================================
   PINNED POSTS
======================================== */

.pinned-posts {
    margin-bottom: 48px;
    padding: 32px;
    background: var(--color-surface);
    border-radius: 8px;
}

.pinned-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--color-text-primary);
}

.pinned-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.pinned-item {
    background: var(--color-bg);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.pinned-item:hover {
    transform: translateY(-4px);
}

.pinned-item img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.pinned-item h3 {
    padding: 16px;
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

.pinned-item a {
    color: var(--color-text-primary);
    text-decoration: none;
}

/* ========================================
   ALL POSTS PAGE
======================================== */

.category-section {
    margin-bottom: 48px;
}

.category-section h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-border);
}

.category-section .posts-table {
    margin-bottom: 32px;
}

/* ========================================
   V53.1 - NOTIFICATION DESIGN UPDATE
======================================== */

.notification-icon {
    width: 8px;
    height: 8px;
    background: var(--color-text-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.notification-close {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s;
}

.notification-close:hover {
    background: var(--color-surface);
    border-color: var(--color-text-meta);
}

.update-notification {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* ========================================
   V53.2 - METADATA BLOCK
======================================== */

.custom-metadata-block {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    font-size: 14px;
    line-height: 1.6;
}

.custom-metadata-block .metadata-label {
    font-weight: 500;
    color: var(--color-text-secondary);
    min-width: 80px;
}

.custom-metadata-block .metadata-label::after {
    content: ':';
    margin-left: 4px;
}

.custom-metadata-block .metadata-value {
    color: var(--color-text-primary);
}

/* ========================================
   V53.3 - PINNED POSTS
======================================== */

.pinned-posts {
    margin-bottom: 48px;
    padding: 32px;
    background: var(--color-surface);
    border-radius: 8px;
}

.pinned-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--color-text-primary);
}

.pinned-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.pinned-item {
    background: var(--color-bg);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.pinned-item:hover {
    transform: translateY(-4px);
}

.pinned-item img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.pinned-item h3 {
    padding: 16px;
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

.pinned-item a {
    color: var(--color-text-primary);
    text-decoration: none;
}

/* ========================================
   V53.4 - DATA MAP PAGE
======================================== */

.map-subtitle {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 32px;
}

.data-map-container {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 20px;
    margin: 32px 0;
}

/* ========================================
   DATA MAP - FULL IMPLEMENTATION
======================================== */

#dataMapSvg {
    min-height: 600px;
}

.data-node {
    transition: all 0.2s ease;
}

.data-node:hover circle {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.data-node:hover text {
    font-weight: bold;
}

@media (max-width: 768px) {
    #dataMapSvg {
        height: 600px;
    }
}

/* ========================================
   POST NAVIGATION
======================================== */

.post-navigation {
    margin: 48px 0;
    padding: 24px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.post-nav-links {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.post-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
    max-width: 45%;
}

.post-nav-link:hover {
    color: var(--color-text-primary);
}

.post-nav-prev {
    justify-content: flex-start;
}

.post-nav-next {
    justify-content: flex-end;
    margin-left: auto;
}

.post-nav-label {
    font-size: 16px;
    color: var(--color-text-meta);
    flex-shrink: 0;
}

.post-nav-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-nav-prev .post-nav-title {
    text-align: left;
}

.post-nav-next .post-nav-title {
    text-align: right;
}

@media (max-width: 768px) {
    .post-nav-links {
        flex-direction: column;
        gap: 16px;
    }
    
    .post-nav-link {
        max-width: 100%;
    }
    
    .post-nav-next {
        margin-left: 0;
    }
}

/* ========================================
   QUICK POST PAGE
======================================== */

.quick-post-page .pane-container {
    max-width: 600px;
}

.post-form {
    border: 1px solid var(--color-border);
    padding: 30px;
    margin-bottom: 60px;
    background: var(--color-surface);
    border-radius: 4px;
}

/* 投稿アイテム */
.post-item {
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
}

.post-item:first-child {
    border: none;
    padding: 0 0 24px 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--color-border);
}

.post-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.post-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.remove-post-btn {
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    background: transparent;
    color: #d32f2f;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.remove-post-btn:hover {
    background: #ffebee;
    border-color: #d32f2f;
}

/* 投稿追加エリア */
.add-post-container {
    text-align: center;
    margin: 24px 0;
    padding: 24px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.add-post-btn {
    padding: 12px 32px;
    border: 2px dashed var(--color-border);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.add-post-btn:hover {
    background: var(--color-surface);
    border-color: var(--color-text-primary);
    color: var(--color-text-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.form-group textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--color-border);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    background: var(--color-bg);
    border-radius: 4px;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--color-text-meta);
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--color-text-meta);
    margin-top: 5px;
}

.char-count.warning {
    color: #ff6b6b;
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    font-family: inherit;
    font-size: 14px;
    background: var(--color-bg);
    border-radius: 4px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-text-meta);
}

/* 画像プレビュー */
.image-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.preview-img {
    position: relative;
    padding-top: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    overflow: hidden;
}

.remove-img {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.remove-img:hover {
    background: rgba(0, 0, 0, 0.8);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.button-group button {
    padding: 12px 24px;
    border: 1px solid var(--color-text-primary);
    background: var(--color-bg);
    color: var(--color-text-primary);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
}

.button-group button:hover {
    background: var(--color-text-primary);
    color: var(--color-bg);
}

.button-group button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.button-group button.secondary {
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}

.button-group button.secondary:hover {
    background: var(--color-surface);
    color: var(--color-text-secondary);
}

/* タイムライン */
.timeline-header {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 30px;
}

.quick-post-page .post-card {
    padding: 16px 0 16px 24px;
    border-bottom: 1px solid #eff3f4;
    background: var(--color-bg);
    transition: background 0.2s;
}

.quick-post-page .post-card:hover {
    background: var(--color-surface);
}

.quick-post-page .thread {
    margin-bottom: 0;
    position: relative;
}

.quick-post-page .thread .post-card {
    position: relative;
}

.quick-post-page .thread .post-card:only-child::before {
    display: none;
}

.quick-post-page .thread .post-card:first-child:not(:only-child)::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 16px;
    bottom: 0;
    width: 2px;
    background: #cbd6e2;
}

.quick-post-page .thread .post-card.reply::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #cbd6e2;
}

.quick-post-page .thread .post-card.reply:last-child::before {
    bottom: auto;
    height: calc(16px + 6.5px);
}

.quick-post-page .thread .post-card:not(:only-child) .post-meta::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--color-bg);
    border: 2px solid #cbd6e2;
    border-radius: 50%;
    z-index: 1;
}

.quick-post-page .post-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    font-size: 13px;
    color: #536471;
    position: relative;
}

.quick-post-page .post-date {
    letter-spacing: 0.03em;
}

.quick-post-page .post-path {
    color: #8b98a5;
    font-size: 12px;
}

.quick-post-page .post-content {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 12px;
    white-space: pre-wrap;
    color: var(--color-text-primary);
}

.quick-post-page .post-images {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
}

.quick-post-page .post-images.images-1 {
    grid-template-columns: 1fr;
}

.quick-post-page .post-images.images-2 {
    grid-template-columns: repeat(2, 1fr);
}

.quick-post-page .post-images.images-3 {
    grid-template-columns: repeat(2, 1fr);
}

.quick-post-page .post-images.images-3 img:first-child {
    grid-row: 1 / 3;
}

.quick-post-page .post-images.images-4 {
    grid-template-columns: repeat(2, 1fr);
}

.quick-post-page .post-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/9;
}

.quick-post-page .post-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.quick-post-page .post-tags .tag {
    font-size: 12px;
    color: #1d9bf0;
}

.quick-post-page .post-tags .tag::before {
    content: '#';
}

.success-message {
    padding: 15px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    margin-bottom: 20px;
    font-size: 14px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .post-form {
        padding: 20px;
    }
    
    .quick-post-page .thread .post-card.reply {
        padding-left: 30px;
    }
}

/* ========================================
   LOG-STYLE ARCHIVE
======================================== */

.log-archive .log-timeline {
    max-width: 600px;
    margin: 0 auto;
}

.archive-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.archive-description {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 32px;
}

.log-archive .thread {
    margin-bottom: 0;
    position: relative;
}

.log-archive .post-card {
    padding: 16px 0 16px 24px;
    border-bottom: 1px solid #eff3f4;
    background: var(--color-bg);
    transition: background 0.2s;
    position: relative;
}

.log-archive .post-card:hover {
    background: var(--color-surface);
}

.log-archive .thread .post-card:only-child::before {
    display: none;
}

.log-archive .thread .post-card:first-child:not(:only-child)::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 16px;
    bottom: 0;
    width: 2px;
    background: #cbd6e2;
}

.log-archive .thread .post-card.reply::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #cbd6e2;
}

.log-archive .thread .post-card.reply:last-child::before {
    bottom: auto;
    height: calc(16px + 6.5px);
}

.log-archive .thread .post-card:not(:only-child) .post-meta::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--color-bg);
    border: 2px solid #cbd6e2;
    border-radius: 50%;
    z-index: 1;
}

.log-archive .post-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    font-size: 13px;
    color: #536471;
    position: relative;
}

.log-archive .post-date {
    letter-spacing: 0.03em;
}

.log-archive .post-path {
    color: #8b98a5;
    font-size: 12px;
}

.log-archive .post-content {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 12px;
    white-space: pre-wrap;
    color: var(--color-text-primary);
}

.log-archive .post-images {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
}

.log-archive .post-images.images-1 {
    grid-template-columns: 1fr;
}

.log-archive .post-images.images-2 {
    grid-template-columns: repeat(2, 1fr);
}

.log-archive .post-images.images-3 {
    grid-template-columns: repeat(2, 1fr);
}

.log-archive .post-images.images-3 img:first-child {
    grid-row: 1 / 3;
}

.log-archive .post-images.images-4 {
    grid-template-columns: repeat(2, 1fr);
}

.log-archive .post-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/9;
}

.log-archive .post-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.log-archive .post-tags .tag {
    font-size: 12px;
    color: #1d9bf0;
}

.log-archive .post-tags .tag::before {
    content: '#';
}

.log-archive .no-posts {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary);
}

@media (max-width: 768px) {
    .log-archive .post-card {
        padding-left: 20px;
    }
    
    .log-archive .thread .post-card.reply {
        padding-left: 30px;
    }
}


/* ===== Log mode polish (reading comfort) ===== */
.log-timeline .post-content{
  line-height: 1.85;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Keep paragraphs compact but readable */
.log-timeline .post-content p{
  margin: 0.8em 0;
}

/* Subtle date */
.log-timeline .post-meta{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.log-timeline .post-date{
  opacity: 0.55;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.log-timeline .post-path{
  opacity: 0.4;
  font-size: 12px;
}

/* Tags as subtle pills */
.log-timeline .post-tags{
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.log-timeline .post-tags .tag{
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 999px;
  font-size: 12px;
  text-decoration: none;
  opacity: 0.85;
}
.log-timeline .post-tags .tag:hover{
  opacity: 1;
}

/* Infinite scroll loading */
.log-loading{
  padding: 18px 0;
  text-align: center;
  opacity: 0.5;
  font-size: 12px;
}

/* Responsive container + prevent inner scrollbars */
html, body{ overflow-x: hidden; }
.site-main, .pane-container, .log-timeline{
  overflow: visible !important;
  height: auto !important;
}

/* Center column */
.log-archive, .site-main{
  width: 100%;
  display: flex;
  justify-content: center;
}
.log-timeline{
  width: 100%;
  max-width: 720px;
  padding: 0 20px;
  box-sizing: border-box;
}
@media (max-width: 1024px){
  .log-timeline{ max-width: 90%; }
}
@media (max-width: 600px){
  .log-timeline{ max-width: 100%; padding: 0 14px; }
}


/* ===== Log timeline layout v2 (center + borders + gutter) ===== */
.log-archive .pane-container.log-timeline{
  /* keep the feed centered inside main area */
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding-top: 18px;
  border-left: 1px solid #eff3f4;
  border-right: 1px solid #eff3f4;
  box-sizing: border-box;
}

/* match other pages' vertical rhythm a bit more */
.log-archive .archive-title{
  margin-top: 6px;
  margin-bottom: 10px;
  text-align: center;
}
.log-archive .archive-description{
  text-align: center;
  margin-bottom: 26px;
}

/* Wider gutter so dot/line doesn't compete with text */
.log-archive{
  --log-gutter: 56px;   /* space reserved on the left */
  --log-rail-x: 26px;   /* x position of the rail (line + dot center) */
}

.log-archive .post-card{
  padding-left: var(--log-gutter);
}

/* Rail (vertical line) */
.log-archive .thread .post-card:first-child:not(:only-child)::before{
  left: var(--log-rail-x);
  top: 0;
  bottom: 0;
  width: 2px;
  background: #cbd6e2;
}
.log-archive .thread .post-card.reply::before{
  left: var(--log-rail-x);
  top: 0;
  bottom: 0;
  width: 2px;
  background: #cbd6e2;
}

/* Dot: move from post-meta to post-card so it aligns perfectly */
.log-archive .thread .post-card:not(:only-child) .post-meta::before{
  display: none;
}
.log-archive .thread .post-card:not(:only-child)::after{
  content:'';
  position:absolute;
  left: calc(var(--log-rail-x) - 5px);
  top: 18px;
  width: 10px;
  height: 10px;
  background: var(--color-bg);
  border: 2px solid #cbd6e2;
  border-radius: 50%;
  z-index: 2;
}

/* Give meta/content a bit more breathing room */
.log-archive .post-meta{
  margin-bottom: 12px;
}
.log-archive .post-content{
  margin-bottom: 10px;
}

/* Tags: ensure no forced '#' prefix and keep pill styling */
.log-archive .post-tags .tag::before{
  content: '' !important;
}

/* Responsive tuning */
@media (max-width: 1024px){
  .log-archive .pane-container.log-timeline{
    max-width: 90%;
  }
}
@media (max-width: 600px){
  .log-archive .pane-container.log-timeline{
    max-width: 100%;
    border-left: none;
    border-right: none;
    padding-top: 14px;
  }
  .log-archive{
    --log-gutter: 48px;
    --log-rail-x: 22px;
  }
}


/* ===== Log timeline layout v3 (rail + dot + grouping + stronger borders) ===== */

/* Stronger feed borders (desktop/tablet) */
.log-archive .pane-container.log-timeline{
  border-left: 1px solid #d0d7de;
  border-right: 1px solid #d0d7de;
}

/* Grouping: remove dividers inside a thread; keep only after the last post */
.log-archive .thread .post-card{
  border-bottom: none;
}
.log-archive .thread .post-card:last-child{
  border-bottom: 1px solid #eff3f4;
}

/* Rail should not run through the dot: start the rail below the dot for thread roots */
.log-archive{
  --log-dot-size: 10px;
  --log-dot-top: 18px;
  --log-rail-top: calc(var(--log-dot-top) + var(--log-dot-size) + 8px);
}

/* Root post rail (starts below dot) */
.log-archive .thread .post-card:first-child:not(:only-child)::before{
  top: var(--log-rail-top);
}

/* Dot stays above rail */
.log-archive .thread .post-card:not(:only-child)::after{
  top: var(--log-dot-top);
  width: var(--log-dot-size);
  height: var(--log-dot-size);
  left: calc(var(--log-rail-x) - (var(--log-dot-size) / 2));
  z-index: 3;
}

/* Slightly more top padding so dot never collides with title/meta */
.log-archive .post-card{
  padding-top: 18px;
  padding-bottom: 18px;
}


/* ===== Shared lightbox ===== */
.site-lightbox{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.site-lightbox.is-open{ display: block; }
.site-lightbox__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.72);
}
.site-lightbox__panel{
  position:absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 24px;
  box-sizing:border-box;
}
.site-lightbox__img{
  max-width: min(1100px, 96vw);
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 14px;
  background: #111;
}
body.is-lightbox-open{ overflow:hidden; }

/* Log: match separators with feed borders */
.log-archive .thread .post-card:last-child{
  border-bottom-color: #d0d7de;
}


/* ===== Scroll reliability fix ===== */
/* Keep app-like layout (sidebar fixed), but make inner panes scroll reliably */
body{
  height: 100vh;
  overflow: hidden;
}
.site-container{
  height: 100vh;
  overflow: hidden;
}
.site-main{
  min-height: 0; /* critical for nested overflow */
  overflow: hidden;
}
.pane-container{
  min-height: 0; /* critical for nested overflow */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Quick Post: ensure bottom buttons are reachable */
.quick-post-page .pane-container{
  padding-bottom: 110px; /* space for button group */
}

/* Log timeline: keep borders visible inside scroll pane */
.log-archive .pane-container.log-timeline{
  overflow-y: auto;
}

.site-lightbox__btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.35);
  color: #fff;
  border-radius: 999px;
  font-size: 28px;
  line-height: 40px;
  cursor: pointer;
  z-index: 10001;
}
.site-lightbox__prev{ left: 16px; }
.site-lightbox__next{ right: 16px; }
.site-lightbox__btn:hover{ background: rgba(0,0,0,0.5); }
@media (max-width: 600px){
  .site-lightbox__prev{ left: 10px; }
  .site-lightbox__next{ right: 10px; }
}

/* Log: Load more button fallback */
.log-loadmore{
  width: 100%;
  padding: 14px 16px;
  margin: 14px 0 24px;
  border: 1px solid #d0d7de;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  opacity: 0.9;
}
.log-loadmore:hover{ opacity: 1; }
.log-noscript{ padding: 12px 0 24px; opacity: 0.6; font-size: 12px; }


/* Ensure inner pane can actually scroll in desktop flex/grid layouts */
.site-container, .site-main, .pane-container{ min-height: 0; }


/* ===== v12: Force normal page scrolling (most reliable across desktop/mobile) ===== */
html, body{
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden;
}
.site-container{
  height: auto !important;
  overflow: visible !important;
}
.site-main{
  min-height: auto !important;
  overflow: visible !important;
}
.pane-container{
  min-height: auto !important;
  overflow: visible !important;
}

/* Keep sidebar usable */
.sidebar{
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: fit-content;
}

/* Ensure quick post buttons are always reachable */
.quick-post-page{
  padding-bottom: 120px;
}


/* Log: subtle admin action */
.log-archive .post-meta{
  position: relative;
}
.log-archive .post-action{
  margin-left: 10px;
  font-size: 12px;
  opacity: 0.45;
  text-decoration: none;
}
.log-archive .post-action:hover{
  opacity: 0.85;
  text-decoration: underline;
}
@media (pointer:fine){
  .log-archive .post-action{ opacity: 0; }
  .log-archive .post-card:hover .post-action{ opacity: 0.55; }
}

.page-template-page-quick-post .file-system-sidebar{display:none}
.page-template-page-quick-post .site-container{grid-template-columns:1fr}
.page-template-page-quick-post .pane-container{max-width:820px;margin:0 auto}
.page-template-page-quick-post .page-title{display:none}
.page-template-page-quick-post .mobile-header{display:none}


/* ===== v19: Modern pinned posts ===== */
.pinned-posts{
  padding: 28px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-text-primary) 10%, transparent);
}

.pinned-title{
  display:flex;
  align-items:center;
  gap:10px;
  letter-spacing: .02em;
}

.pinned-grid{
  gap: 18px;
}

.pinned-item{
  background: transparent;
  border-radius: 16px;
  overflow: visible;
  transform: none;
}

.pinned-link{
  display:block;
  color: inherit;
  text-decoration:none;
}

.pinned-card{
  display:flex;
  gap: 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--color-text-primary) 12%, transparent);
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.04);
}

@media (prefers-reduced-motion: reduce){
  .pinned-card{ transition:none; }
}

.pinned-link:hover .pinned-card{
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(0,0,0,.08);
  border-color: color-mix(in srgb, var(--color-text-primary) 18%, transparent);
}

.pinned-thumb{
  width: 160px;
  flex: 0 0 160px;
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
}

.pinned-thumb img{
  width:100%;
  height:100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  display:block;
}

.pinned-body{
  min-width: 0;
  display:flex;
  flex-direction:column;
  gap: 8px;
  padding: 2px 0;
}

.pinned-meta{
  display:flex;
  align-items:center;
  gap:10px;
  opacity: .75;
  font-size: 12px;
}

.pinned-badge{
  display:inline-flex;
  align-items:center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--color-text-primary) 14%, transparent);
  background: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
  font-size: 11px;
  letter-spacing: .04em;
}

.pinned-h3{
  margin:0;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 650;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

.pinned-excerpt{
  margin:0;
  font-size: 13px;
  line-height: 1.6;
  opacity: .78;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

@media (max-width: 640px){
  .pinned-posts{ padding: 20px; }
  .pinned-card{ gap: 12px; }
  .pinned-thumb{ width: 120px; flex-basis: 120px; }
}


/* Align category label in log feed */
.log-archive .post-category{
  margin-left: 0;
  transform: translateY(1px);
  opacity: .55;
}


.log-archive .post-content p + p{
  margin-top: 0.85em;
}



.log-archive .post-content p + p {
  margin-top: 0.6em;
}

.log-archive .post-content p + .post-images,
.log-archive .post-content p + figure {
  margin-top: 0.7em;
}

.log-archive .post-images + p,
.log-archive figure + p {
  margin-top: 0.7em;
}


/* Modern pinned badge */
.pinned-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .08em;
  font-weight: 500;
  color: color-mix(in srgb, var(--color-text-primary) 75%, transparent);
  background: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-text-primary) 12%, transparent);
}

.pinned-badge::before{
  content:"";
  width:6px;
  height:6px;
  border-radius:50%;
  background: currentColor;
  opacity:.8;
}


/* ===== v24: Twitter-like typography for Log feed only ===== */
.log-archive .post-content{
  font-size: 15px;
  line-height: 1.45;
}

/* Paragraphs behave like tweet line breaks (tight, readable) */
.log-archive .post-content p{
  margin: 0;
}

/* Blank line (new paragraph) should feel like Twitter: modest gap */
.log-archive .post-content p + p{
  margin-top: 0.52em;
}

/* Tighten text ↔ media rhythm */
.log-archive .post-content p + .post-images,
.log-archive .post-content p + figure,
.log-archive .post-content p + .wp-block-image{
  margin-top: 0.6em;
}

.log-archive .post-content .post-images + p,
.log-archive .post-content figure + p,
.log-archive .post-content .wp-block-image + p{
  margin-top: 0.6em;
}

/* WordPress block spacing can add extra gaps; neutralize for Log */
.log-archive .post-content > *{
  margin-top: 0;
  margin-bottom: 0;
}
.log-archive .post-content > * + *{
  margin-top: 0.6em;
}

/* Links: keep Twitter-like subtle emphasis */
.log-archive .post-content a{
  text-underline-offset: 2px;
}
