/* =========================================================
   ARCHIVE PAGES - DESK WORKSPACE LAYOUT (v2.0)
   Cards float on brown desk background, no parchment
   ========================================================= */

/* =========================================================
   CATEGORY CORKBOARD LAYOUT
   ========================================================= */
.category-corkboard {
    min-height: 100vh;
    padding: 120px 32px 80px;
    align-items: flex-start;
}

.corkboard-area {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 95vw;
    height: calc(100vh - 140px);
    overflow: hidden;
}

.corkboard-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #8a4e00;
    top: 0;
    left: 0;
    z-index: 1;
    opacity: 0.9;
    border: 10px solid #dea050;
}

.corkboard-texture {
    position: absolute;
    inset: 0;
    z-index: 1;
    /* High frequency (0.95) creates a fine "dust" rather than "stains" */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='corkNoise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23corkNoise)' opacity='0.15'/%3E%3C/svg%3E");
    
    background-blend-mode: overlay;
    pointer-events: none;
}

.corkboard-content {
    position: absolute;
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 2;
    height: auto;
    padding: 32px 40px 40px;
    overflow: auto;
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    column-gap: 20px;
    row-gap: 24px;
    align-content: start;
    color: #2a1b10;
    box-sizing: border-box;
}

/* ========== CORKBOARD HEADER (Centered) ========== */
.corkboard-header {
    grid-column: 1 / -1;
    background-color: rgba(255, 250, 241, 0.9);
    text-align: center; /* Centers all text inside */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-blend-mode: multiply;
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    position: relative;
}

.corkboard-eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.8rem; /* Slightly adjusted for balance */
    color: #7a4d18;
    font-weight: 700;
    display: block;
}

.corkboard-title {
    margin: 0;
    font-size: 1.8rem;
    color: #3b2411;
    line-height: 1.4;
}

/* --- Dual Pins for Corkboard Header --- */

/* Base reset: ensure old SVG thumbtack is gone */
.corkboard-header::after,
.corkboard-header::before {
    background: none;
    mask: none;
    -webkit-mask: none;
}

/* Common Pin Styles */
.corkboard-header::before,
.corkboard-header::after {
    content: "";
    position: absolute;
    top: 15px; /* Distance from the top edge */
    width: 14px;
    height: 14px;
    background-color: #c2453c; /* Push-pin red */
    border-radius: 50%;
    z-index: 10;
    
    /* 3D shading and drop shadow */
    box-shadow: 
        inset -2px -2px 4px rgba(0,0,0,0.4), 
        0 3px 5px rgba(0,0,0,0.3);
}

/* Left Pin */
.corkboard-header::before {
    left: 20px;
}

/* Right Pin */
.corkboard-header::after {
    right: 20px;
}

/* Optional: Slight rotation to the header to look 'heavy' */
.corkboard-header {
    position: relative;
    /* Removed the previous rotation if any, or keep it very subtle */
    transform: rotate(0.2deg); 
}

.corkboard-description {
    font-size: 0.95rem;
    line-height: 1.6;
}

.corkboard-postits ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.corkboard-postit-item {
    display: flex;
    justify-content: flex-start;
}

.post-it {
    display: inline-block;
    position: relative;
    padding: 0.5em 1em;
    border-right: 27px solid #2589d0;
    background-color: #f5f5f5;
    color: #333333;
    text-decoration: none;
    font-weight: 600;
}

.post-it::before {
    position: absolute;
    bottom: 2px;
    right: -20px;
    z-index: -1;
    transform: rotate(5deg);
    width: 100%;
    height: 50%;
    background-color: #d0d0d0;
    content: "";
    filter: blur(4px);
}

.corkboard-postit-item.is-active .post-it {
    border-right-color: #e07a00;
    background-color: #fff2d9;
}

.corkboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.corkboard-card {
    --card-line-height: 1.6em;
    background-color: #ffffff;
    background-image:
        linear-gradient(
            180deg,
            #ffffff 3rem,
            #f0a4a4 calc(3rem),
            #f0a4a4 calc(3rem + 2px),
            transparent 1px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent var(--card-line-height),
            #dddddd 1px,
            #dddddd calc(var(--card-line-height) + 1px)
        );
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25);
    width: 400px;
    max-width: 100%;
    min-height: 14rem;
    height: auto;
    border-radius: 0;
    padding: 16px 18px;
    line-height: 1.6;
}

.corkboard-card-title {
    margin: 0 0 18px;
    font-size: 1.05rem;
}

.corkboard-card-title a {
    color: #3b2411;
    text-decoration: none;
}

.corkboard-card-title a:hover {
    text-decoration: underline;
}

.corkboard-card-date {
    display: block;
    font-size: 0.85rem;
    color: #7a5b3a;
    margin-bottom: 10px;
}

.corkboard-card-excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #4c3a2a;
}

.corkboard-card-excerpt p {
    margin: 0;
}

.corkboard-card-excerpt p + p {
    margin-top: 0.75rem;
}

.corkboard-pagination {
    grid-column: 1 / -1;
    justify-content: center;
    margin-top: -8px;
}

.corkboard-empty {
    grid-column: 1 / -1;
    padding: 20px;
    background: rgba(255, 250, 241, 0.9);
    border-radius: 10px;
}

@media (max-width: 900px) {
    .corkboard-area {
        height: calc(100vh - 140px);
        padding-bottom: 40px;
    }

    .corkboard-bg {
        height: 100%;
    }

    .corkboard-content {
        grid-template-columns: 1fr;
        padding: 24px;
    }
}

/* Archive-specific desk stage */
.archive-desk {
    min-height: 100vh;
    height: auto;
    padding: 120px 48px 80px;
    overflow: visible;
    align-items: flex-start;
}

/* Main workspace container */
.archive-workspace {
    max-width: 1400px;
    margin: 0 auto;
}

.archive-layout {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
}

.archive-sidebar {
    position: sticky;
    top: 120px;
    background: linear-gradient(160deg, rgba(255, 250, 241, 0.98) 0%, rgba(244, 235, 219, 0.96) 100%);
    border: 1px solid rgba(212, 196, 168, 0.9);
    border-left: 6px solid #e07a00;
    border-radius: 18px;
    padding: 26px 22px;
    box-shadow:
        0 12px 26px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.archive-sidebar-section + .archive-sidebar-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed rgba(224, 122, 0, 0.25);
}

.archive-sidebar-title {
    margin: 0 0 12px;
    font-size: 0.9rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #8b6a47;
    font-weight: 700;
}

.archive-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.archive-sidebar-list li a {
    display: block;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid rgba(212, 196, 168, 0.55);
    background: rgba(255, 255, 255, 0.8);
    color: #5a4943;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.archive-sidebar-list li a:hover {
    border-color: #e07a00;
    color: #e07a00;
    background: rgba(255, 250, 241, 0.98);
}

.archive-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* ========== ARCHIVE HEADER ========== */
.archive-header {
    background: linear-gradient(160deg, rgba(255, 250, 241, 0.98) 0%, rgba(244, 235, 219, 0.96) 100%);
    border: 1px solid rgba(212, 196, 168, 0.9);
    border-left: 6px solid #e07a00;
    border-radius: 18px;
    padding: 34px 40px;
    box-shadow: 
        0 16px 32px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
}

.archive-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, rgba(224, 122, 0, 0.2), rgba(224, 122, 0, 0.85), rgba(224, 122, 0, 0.2));
}

.archive-header::after {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px dashed rgba(224, 122, 0, 0.18);
    border-radius: 14px;
    pointer-events: none;
}

.archive-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.7rem;
    color: #8b6a47;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.archive-title {
    color: #e07a00;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid #e07a00;
    font-family: "Noto Serif JP", serif;
    line-height: 1.3;
}

.archive-description {
    color: #5a4943;
    line-height: 1.8;
    font-size: 1rem;
    margin-bottom: 16px;
}

.archive-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: #8b6a47;
    font-weight: 600;
}

.archive-count {
    background: rgba(224, 122, 0, 0.15);
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(224, 122, 0, 0.3);
}

/* ========== POST PREVIEW GRID ========== */
.post-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    align-items: start;
}

.post-preview {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 250, 241, 0.98) 0%, rgba(246, 238, 224, 0.96) 100%);
    border: 1px solid rgba(212, 196, 168, 0.85);
    border-top: 4px solid #e07a00;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 
        0 18px 36px rgba(0, 0, 0, 0.24),
        0 6px 12px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.post-preview:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 22px 40px rgba(0, 0, 0, 0.28),
        0 10px 18px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    z-index: 10;
}

.post-preview-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* ========== MEDIA SECTION ========== */
.post-preview-media {
    background: #f4efe6;
    border-bottom: 1px solid rgba(212, 196, 168, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    max-height: 160px;
    position: relative;
    overflow: hidden;
}

.post-preview-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.post-preview:hover .post-preview-media img {
    transform: scale(1.08);
}

.post-preview-placeholder {
    font-family: "Noto Serif JP", serif;
    color: #8b6a47;
    font-size: 1.4rem;
    letter-spacing: 0.3em;
    font-weight: 600;
}

/* ========== BODY SECTION ========== */
.post-preview-body {
    padding: 26px 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.post-preview h2 {
    font-size: 1.2rem;
    margin: 0;
    color: #3b2411;
    font-family: "Noto Serif JP", serif;
    line-height: 1.4;
    font-weight: 700;
}

/* =========================================================
   Compatibility: Archive viewer layout (linguistics markup)
   ========================================================= */

.archive-viewer {
    min-height: 100vh;
    padding: 120px 40px 60px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
    background: #6b5847 url(http://itako999.com/blog/bg/) repeat;
}

.archive-viewer .archive-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #fffaf1 0%, #f7efe1 100%);
    border: 2px solid #d4c4a8;
    border-radius: 14px;
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 18px 16px;
}

.archive-viewer .archive-stream {
    flex: 1;
    min-width: 0;
}

.archive-viewer .stream-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.archive-viewer .compact-card {
    background: linear-gradient(180deg, #fffaf1 0%, #f7efe1 100%);
    border: 2px solid #d4c4a8;
    border-radius: 12px;
    padding: 22px 20px;
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.25),
        0 4px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.archive-viewer .compact-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 16px 32px rgba(0, 0, 0, 0.3),
        0 6px 14px rgba(0, 0, 0, 0.2);
}

.post-preview .meta {
    font-size: 0.8rem;
    color: #8b7b72;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 196, 168, 0.3);
}

.post-preview .meta a {
    color: #8b7b72;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-preview .meta a:hover {
    color: #e07a00;
}

.post-preview-categories a {
    background: rgba(224, 122, 0, 0.12);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.post-preview-categories a:hover {
    background: rgba(224, 122, 0, 0.25);
}

.post-preview .excerpt {
    color: #5a4943;
    font-size: 0.9rem;
    line-height: 1.7;
    flex: 1;
}

.post-preview-cta {
    margin-top: auto;
    font-size: 0.85rem;
    font-weight: 700;
    color: #e07a00;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.post-preview:hover .post-preview-cta {
    transform: translateX(4px);
}

/* ========== PAGINATION ========== */
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.pagination .nav-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.pagination a,
.pagination span {
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(212, 196, 168, 0.85);
    background: linear-gradient(180deg, #fffaf1 0%, #f7efe1 100%);
    color: #5a4943;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.14);
}

.pagination a:hover {
    background: linear-gradient(180deg, #fff 0%, #fffaf1 100%);
    border-color: #e07a00;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.pagination .current {
    background: linear-gradient(135deg, #e07a00, #f28b1a);
    color: #fff;
    border-color: #e07a00;
    box-shadow: 
        0 4px 12px rgba(224, 122, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ========== NO POSTS MESSAGE ========== */
.no-posts-message {
    background: linear-gradient(180deg, #fffaf1 0%, #f7efe1 100%);
    border: 2px solid #d4c4a8;
    border-radius: 12px;
    padding: 48px 40px;
    text-align: center;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.no-posts-message h2 {
    color: #e07a00;
    font-family: "Noto Serif JP", serif;
    margin-bottom: 20px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .archive-desk {
        padding: 90px 20px 50px;
    }

    .archive-layout {
        grid-template-columns: 1fr;
    }

    .archive-sidebar {
        position: static;
        order: 2;
    }

    .archive-header {
        padding: 24px 22px;
    }

    .archive-title {
        font-size: 1.6rem;
    }

    .post-preview-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .post-preview:hover {
        transform: translateY(-6px);
    }
}

@media (max-width: 480px) {
    .archive-sidebar {
        padding: 20px 16px;
    }

    .archive-header {
        padding: 20px 16px;
    }

    .archive-eyebrow {
        font-size: 0.65rem;
    }

    .post-preview-body {
        padding: 20px 18px;
    }

/* =========================================================
   SEARCH INDEX
   ========================================================= */
.search-index {
    max-width: 960px;
    margin: 0 auto;
    padding: 120px 24px 80px;
    color: #1f1f1f;
}

.search-index__header {
    margin-bottom: 32px;
}

.search-index__eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    color: #6d6d6d;
}

.search-index__title {
    margin: 0 0 12px;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 600;
}

.search-index__summary {
    margin: 0;
    font-size: 1rem;
    color: #444444;
}

.search-index__list {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    display: grid;
    gap: 24px;
}

.search-index__item {
    margin: 0;
}

.search-card {
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    padding: 20px 24px;
    background-color: #ffffff;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
}

.search-card__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.search-card__title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.search-card__title a {
    color: inherit;
    text-decoration: none;
}

.search-card__title a:hover,
.search-card__title a:focus {
    text-decoration: underline;
}

.search-card__date {
    font-size: 0.9rem;
    color: #6d6d6d;
}

.search-card__excerpt {
    font-size: 1rem;
    line-height: 1.7;
    color: #3b3b3b;
}

.search-card__chips {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-card__chips a {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #d1d1d1;
    font-size: 0.8rem;
    color: #3b3b3b;
    text-decoration: none;
}

.search-card__chips a:hover,
.search-card__chips a:focus {
    border-color: #999999;
}

.search-index__pagination {
    display: flex;
    justify-content: center;
}

.search-index__pagination .nav-links {
    display: inline-flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-index__pagination a,
.search-index__pagination span {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #d5d5d5;
    text-decoration: none;
    color: #3b3b3b;
}

.search-index__pagination .current {
    background: #f2f2f2;
    font-weight: 600;
}

.search-index__empty {
    padding: 24px 0;
    font-size: 1rem;
}