/* ===================================================
   MC Discord - Wiki Mod Project Styles (wiki.css)
   Phase 2: Freeform Bento Grid Architecture
   =================================================== */

/* Align header with wide wiki container ขยายแถบหัวเว็บของหน้าวิกิให้กว้างพอดีกับวิกิ (1820px) */
.main-header {
    max-width: 1820px !important;
    padding: 14px clamp(20px, 3vw, 48px) !important;
}

.wiki-container {
    max-width: 1820px;
    width: 100%;
    margin: 0 auto;
    padding: 24px clamp(20px, 3vw, 48px) 60px;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

/* ---------------------------------------------------
   1. Left Sidebar & Category Navigation
   --------------------------------------------------- */
.wiki-sidebar {
    background: var(--bg-card, #ffffff);
    border-radius: var(--border-radius-md, 16px);
    border: 1.5px solid rgba(76, 184, 184, 0.25);
    padding: 20px;
    box-shadow: 0 4px 20px rgba(76, 184, 184, 0.06);
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wiki-search-box {
    position: relative;
    width: 100%;
}

.wiki-search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border-radius: 999px;
    border: 1.5px solid #dce8e8;
    background: #f7fbfa;
    font-size: 14px;
    font-family: var(--font-primary, sans-serif);
    color: var(--text-main, #2b353e);
    outline: none;
    transition: var(--transition-smooth);
}

.wiki-search-box input:focus {
    border-color: var(--primary-cyan, #4cb8b8);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(76, 184, 184, 0.15);
}

.wiki-search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #708a8a);
    font-size: 14px;
}

.wiki-category-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted, #708a8a);
    margin-bottom: 8px;
}

.wiki-category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.wiki-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main, #2b353e);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.wiki-cat-item:hover {
    background: #eef8f8;
    color: var(--primary-cyan, #4cb8b8);
}

.wiki-cat-item.active {
    background: var(--primary-cyan, #4cb8b8);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(76, 184, 184, 0.3);
}

.wiki-cat-item .cat-icon {
    margin-right: 10px;
    width: 18px;
    text-align: center;
}

.wiki-cat-count {
    font-size: 12px;
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
}

.wiki-cat-item.active .wiki-cat-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.wiki-pages-quick-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid #edf4f4;
    padding-top: 14px;
}

.wiki-page-link-item {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--text-main);
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.2s;
}

.wiki-page-link-item:hover {
    background: #f0f7f7;
    color: var(--primary-cyan);
}

.wiki-page-link-item.active {
    background: rgba(76, 184, 184, 0.12);
    color: var(--primary-cyan);
    font-weight: 700;
    border-left: 3px solid var(--primary-cyan);
}

/* ---------------------------------------------------
   2. Main Wiki Content Area & Header Banner
   --------------------------------------------------- */
.wiki-main-viewport {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.wiki-page-header-card {
    background: var(--bg-card, #ffffff);
    border-radius: var(--border-radius-md, 16px);
    border: 1.5px solid rgba(76, 184, 184, 0.25);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(76, 184, 184, 0.06);
}

.wiki-banner-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    object-position: center 25%;
    background: linear-gradient(135deg, #bfecec, #64cccc);
    display: block;
}

.wiki-page-meta-bar {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.wiki-meta-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wiki-badges-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wiki-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-version {
    background: #eef8f8;
    color: var(--primary-cyan, #4cb8b8);
    border: 1px solid rgba(76, 184, 184, 0.3);
}

.badge-category {
    background: #fff0f5;
    color: #e04b7b;
    border: 1px solid rgba(224, 75, 123, 0.25);
}

.badge-revision {
    background: #f3f4f6;
    color: #4b5563;
}

.wiki-page-main-title {
    font-family: var(--font-heading, 'Lexend', sans-serif);
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main, #2b353e);
    margin: 0;
}

.wiki-meta-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wiki-btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-cyan, #4cb8b8);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(76, 184, 184, 0.3);
    transition: all 0.2s;
}

.wiki-btn-edit:hover {
    background: var(--primary-cyan-hover, #3da3a3);
    transform: translateY(-2px);
}

/* ---------------------------------------------------
   3. 12-Column Bento Grid Engine
   --------------------------------------------------- */
.wiki-bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    width: 100%;
}

.bento-card {
    background: var(--bg-card, #ffffff);
    border-radius: var(--border-radius-md, 16px);
    border: 1.5px solid rgba(76, 184, 184, 0.2);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
    padding: 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth, all 0.3s ease);
}

.bento-card:hover {
    box-shadow: 0 8px 26px rgba(76, 184, 184, 0.12);
    border-color: var(--primary-cyan, #4cb8b8);
}

/* Column Spans (1 to 12) */
.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-5 { grid-column: span 5; }
.col-span-6 { grid-column: span 6; }
.col-span-7 { grid-column: span 7; }
.col-span-8 { grid-column: span 8; }
.col-span-9 { grid-column: span 9; }
.col-span-10 { grid-column: span 10; }
.col-span-11 { grid-column: span 11; }
.col-span-12 { grid-column: span 12; }

/* ---------------------------------------------------
   4. Bento Block Components
   --------------------------------------------------- */

/* A. Heading & Hero Block */
.bento-heading-block {
    background: linear-gradient(135deg, #ffffff, #f3fcfc);
    border-left: 5px solid var(--primary-cyan, #4cb8b8);
}

.bento-heading-title {
    font-family: var(--font-heading, sans-serif);
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}

.bento-heading-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* B. Notice / Alert Block */
.bento-notice-block {
    padding: 18px 22px;
}

.notice-tip {
    background: #f0fbfb;
    border-color: #64cccc;
    border-left: 5px solid #4cb8b8;
}

.notice-warning {
    background: #fff8f0;
    border-color: #fbd38d;
    border-left: 5px solid #dd6b20;
}

.notice-info {
    background: #f0f4ff;
    border-color: #bee3f8;
    border-left: 5px solid #3182ce;
}

.notice-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 6px;
}

.notice-tip .notice-header { color: #2c7a7b; }
.notice-warning .notice-header { color: #c05621; }
.notice-info .notice-header { color: #2b6cb0; }

.notice-content {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.5;
}

/* C. Minecraft 3x3 Crafting Grid Block */
.bento-craft-block {
    background: #ffffff;
}

.craft-block-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.craft-workspace {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 16px;
    background: #c6c6c6;
    border: 3px solid #ffffff;
    border-right-color: #555555;
    border-bottom-color: #555555;
    border-radius: 8px;
    box-shadow: inset 2px 2px 0 #dbdbdb, inset -2px -2px 0 #8b8b8b;
    width: fit-content;
    margin: 0 auto;
}

.minecraft-grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(3, 44px);
    gap: 4px;
}

.mc-slot {
    width: 44px;
    height: 44px;
    background: #8b8b8b;
    border: 2px solid #373737;
    border-right-color: #ffffff;
    border-bottom-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    box-shadow: inset 1px 1px 0 #000000;
}

.mc-slot img {
    max-width: 32px;
    max-height: 32px;
    image-rendering: pixelated;
    transition: transform 0.15s ease;
}

.mc-slot:hover img {
    transform: scale(1.15);
}

.mc-arrow-divider {
    font-size: 24px;
    color: #4a4a4a;
    font-weight: 900;
}

.mc-result-slot-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.mc-result-slot {
    width: 56px;
    height: 56px;
    background: #8b8b8b;
    border: 3px solid #373737;
    border-right-color: #ffffff;
    border-bottom-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 2px 2px 0 #000000;
}

.mc-result-slot img {
    max-width: 40px;
    max-height: 40px;
    image-rendering: pixelated;
}

.craft-description {
    margin-top: 16px;
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
    text-align: center;
}

/* Tooltip for Minecraft Slot */
.mc-tooltip {
    display: none;
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: #100010;
    border: 2px solid #280070;
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 50;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.mc-slot:hover .mc-tooltip,
.mc-result-slot:hover .mc-tooltip {
    display: block;
}

/* D. Mob & Entity Stat Card Block */
.bento-stat-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-avatar {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
    border: 2px solid var(--primary-cyan);
    background: #eef8f8;
}

.stat-title-area h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.stat-behavior-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    background: #e6fffa;
    color: #234e52;
}

.stat-grid-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background: #f7fafc;
    border-radius: 12px;
    padding: 12px;
}

.stat-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.metric-icon {
    font-size: 16px;
    margin-bottom: 2px;
}

.metric-heart { color: #e53e3e; }
.metric-sword { color: #3182ce; }
.metric-shield { color: #805ad5; }

.metric-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
}

.metric-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-extra-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #4a5568;
}

.stat-extra-info strong {
    color: var(--text-main);
}

/* E. Code & Config Block */
.bento-code-block {
    background: #1e293b;
    border-color: #334155;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
}

.code-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: #0f172a;
    border-bottom: 1px solid #334155;
}

.code-file-title {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 12.5px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-copy-code {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy-code:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.code-snippet-pre {
    margin: 0;
    padding: 16px 20px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #38bdf8;
    background: #1e293b;
}

/* F. Rich Text Block */
.bento-text-block {
    line-height: 1.7;
    font-size: 15px;
    color: var(--text-main);
}

.bento-text-block h1 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    margin: 16px 0 10px;
    color: var(--text-main);
}

.bento-text-block h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    margin: 14px 0 8px;
    color: var(--text-main);
    border-bottom: 1px solid #edf4f4;
    padding-bottom: 6px;
}

.bento-text-block h3 {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    margin: 12px 0 6px;
    color: var(--text-main);
}

.bento-text-block h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 10px 0 4px;
    color: var(--text-main);
}

.bento-text-block p {
    margin-bottom: 12px;
}

.bento-text-block p:last-child {
    margin-bottom: 0;
}

.bento-text-block a {
    color: var(--primary-cyan, #4cb8b8);
    text-decoration: underline;
    font-weight: 600;
}

.bento-text-block blockquote {
    border-left: 4px solid var(--primary-cyan, #4cb8b8);
    background: rgba(76, 184, 184, 0.08);
    padding: 10px 16px;
    margin: 14px 0;
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
    font-style: italic;
}

.bento-text-block ul, .bento-text-block ol {
    margin: 12px 0;
    padding-left: 24px;
}

.bento-text-block li {
    margin-bottom: 6px;
}

.bento-text-block hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 20px 0;
}

.bento-text-block img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px auto;
    display: block;
}

.bento-text-block code {
    background: #f1f5f9;
    color: #0284c7;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.bento-text-block table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.bento-text-block th {
    background: #f8fafc;
    color: var(--text-main);
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    font-weight: 700;
    text-align: left;
}

.bento-text-block td {
    border: 1px solid #e2e8f0;
    padding: 9px 14px;
    color: var(--text-main);
}

.bento-text-block tr:nth-child(even) {
    background: #f8fafc;
}

/* G. Media / Screenshot Block */
.bento-media-block {
    padding: 0;
    overflow: hidden;
    position: relative;
}

.bento-media-img {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    display: block;
}

.bento-media-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
    color: #ffffff;
    padding: 16px 18px 12px;
    font-size: 13px;
}

/* ---------------------------------------------------
   5. Mobile Responsiveness (< 768px)
   --------------------------------------------------- */
@media (max-width: 992px) {
    .wiki-container {
        grid-template-columns: 240px 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .wiki-container {
        grid-template-columns: 1fr;
        padding: 16px 14px 40px;
    }

    .wiki-sidebar {
        position: static;
        max-height: none;
    }

    /* Linearize 12-Column Grid to single column on mobile */
    .wiki-bento-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .col-span-1, .col-span-2, .col-span-3,
    .col-span-4, .col-span-5, .col-span-6,
    .col-span-7, .col-span-8, .col-span-9,
    .col-span-10, .col-span-11, .col-span-12 {
        grid-column: span 12 !important;
        width: 100%;
    }

    .stat-grid-details {
        grid-template-columns: repeat(3, 1fr);
    }

    .wiki-page-main-title {
        font-size: 22px;
    }

    .wiki-banner-image {
        height: 130px;
    }
}

/* ===================================================
   6. Fast Reader Tools, Table of Contents & Instant Filter
   =================================================== */

.wiki-reader-toolbar {
    background: #ffffff;
    border: 1.5px solid rgba(76, 184, 184, 0.25);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(76, 184, 184, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reader-toolbar-top {
    display: flex;
    gap: 14px;
    align-items: center;
}

.reader-fast-search {
    position: relative;
    flex: 1;
}

.reader-fast-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-cyan, #4cb8b8);
    font-size: 15px;
}

.reader-fast-search input {
    width: 100%;
    padding: 10px 38px 10px 38px;
    border-radius: 999px;
    border: 1.5px solid #dce8e8;
    background: #f8fafc;
    font-size: 14px;
    font-family: var(--font-primary, sans-serif);
    color: var(--text-main, #2b353e);
    outline: none;
    transition: all 0.2s ease;
}

.reader-fast-search input:focus {
    border-color: var(--primary-cyan, #4cb8b8);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(76, 184, 184, 0.15);
}

.reader-fast-search button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}

.reader-fast-search button:hover {
    color: #e53e3e;
}

.reader-actions-group {
    display: flex;
    gap: 8px;
}

.reader-btn {
    background: #f1f5f9;
    color: var(--text-main, #2b353e);
    border: 1.5px solid #e2e8f0;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.reader-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.reader-btn-primary {
    background: rgba(76, 184, 184, 0.12);
    color: var(--primary-cyan, #4cb8b8);
    border-color: rgba(76, 184, 184, 0.35);
}

.reader-btn-primary:hover {
    background: var(--primary-cyan, #4cb8b8);
    color: #ffffff;
}

/* Component Filter Pills */
.reader-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    border-top: 1px solid #edf4f4;
    padding-top: 10px;
}

.reader-pill {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.reader-pill:hover {
    background: #f1f5f9;
    color: var(--text-main);
    border-color: #cbd5e1;
}

.reader-pill.active {
    background: var(--primary-cyan, #4cb8b8);
    color: #ffffff;
    border-color: var(--primary-cyan, #4cb8b8);
    box-shadow: 0 2px 8px rgba(76, 184, 184, 0.3);
}

.reader-pill span {
    font-weight: 800;
    font-size: 11.5px;
}

/* Collapsible Card Enhancements */
.bento-card {
    transition: all 0.25s ease;
    position: relative;
}

.bento-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid #edf4f4;
}

.bento-card-badge-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 800;
    color: var(--text-main);
}

.bento-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-action-btn {
    background: none;
    border: none;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.15s;
}

.card-action-btn:hover {
    background: #f1f5f9;
    color: var(--primary-cyan);
}

/* Collapsed State */
.bento-card.is-collapsed .bento-card-body {
    display: none;
}

.bento-card.is-collapsed {
    padding-bottom: 16px;
}

.card-compact-summary {
    display: none;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.bento-card.is-collapsed .card-compact-summary {
    display: block;
}

/* Filter out state */
.bento-card.is-filtered-out {
    display: none !important;
}

/* Target deep link glow animation */
@keyframes targetCardGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 184, 184, 0.7);
        border-color: #4cb8b8;
    }
    50% {
        box-shadow: 0 0 0 8px rgba(76, 184, 184, 0.3);
        border-color: #38bdf8;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 184, 184, 0);
        border-color: rgba(76, 184, 184, 0.25);
    }
}

.bento-card.is-targeted {
    animation: targetCardGlow 2.5s ease-out;
}

/* Keyword highlight */
mark.search-match {
    background: #fef08a;
    color: #854d0e;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 700;
}

/* 7. Table of Contents Slide-Out / Drawer Panel */
.wiki-toc-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    max-height: calc(100vh - 100px);
    background: #ffffff;
    border: 1.5px solid rgba(76, 184, 184, 0.3);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.25s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.wiki-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1.5px solid #edf4f4;
    background: #f8fafc;
    border-radius: 16px 16px 0 0;
}

.wiki-toc-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wiki-toc-close {
    background: none;
    border: none;
    font-size: 15px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.wiki-toc-close:hover {
    color: #e53e3e;
    background: #fee2e2;
}

.wiki-toc-scroll {
    overflow-y: auto;
    padding: 12px 14px;
    max-height: calc(100vh - 180px);
}

.wiki-toc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wiki-toc-item {
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
    text-decoration: none;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wiki-toc-item:hover {
    background: #eef8f8;
    color: var(--primary-cyan);
}

.wiki-toc-item.active {
    background: rgba(76, 184, 184, 0.12);
    color: var(--primary-cyan);
    font-weight: 700;
    border-left: 3px solid var(--primary-cyan);
}

.wiki-toc-item.level-2 {
    padding-left: 20px;
    font-size: 12.5px;
    color: #64748b;
}

.wiki-toc-item.level-3 {
    padding-left: 30px;
    font-size: 12px;
    color: #94a3b8;
}

/* 8. Floating Action Dock */
.wiki-floating-dock {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 990;
}

.dock-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid rgba(76, 184, 184, 0.4);
    color: var(--primary-cyan);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(76, 184, 184, 0.2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dock-btn:hover {
    background: var(--primary-cyan);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(76, 184, 184, 0.35);
}
