/** * toc-sidebar.css - Wiki-Style TOC Sidebar Styles * * For The Building Coder Archive * Author: GitHub Copilot * Date: January 2, 2026 * * Features: * - Fixed left sidebar with topic-based navigation * - Sticky search box with real-time filtering * - Drag-to-resize functionality * - Collapsible topic groups * - Current page highlighting * - Mobile-responsive hamburger menu */ /* ================================ CSS Variables ================================ */ :root { --tbc-sidebar-width: 280px; --tbc-sidebar-min-width: 180px; --tbc-sidebar-max-width: 500px; /* Soft, soothing light theme matching original blog styling */ --tbc-sidebar-bg: #f5f5f5; --tbc-sidebar-bg-light: #ebebeb; --tbc-sidebar-text: #333333; --tbc-sidebar-text-muted: #666666; --tbc-sidebar-hover: #e8e8e8; --tbc-sidebar-active: #0066cc; --tbc-sidebar-border: #dcdcdc; /* Accent colors - matching original link color */ --tbc-accent-primary: #0066cc; --tbc-accent-secondary: #0077dd; --tbc-accent-highlight: #3399ff; /* Search styling */ --tbc-search-bg: #ffffff; --tbc-search-border: #cccccc; --tbc-search-focus: #0066cc; --tbc-search-highlight: #fffacd; /* Layout */ --tbc-header-height: 50px; --tbc-search-height: 55px; --tbc-transition-speed: 0.2s; } /* ================================ Base Layout ================================ */ html { scroll-behavior: smooth; } body.tbc-has-sidebar { margin: 0; padding: 0; } /* ================================ Sidebar Container ================================ */ #tbc-sidebar { position: fixed; left: 0; top: 0; width: var(--tbc-sidebar-width); min-width: var(--tbc-sidebar-min-width); max-width: var(--tbc-sidebar-max-width); height: 100vh; background: var(--tbc-sidebar-bg); color: var(--tbc-sidebar-text); display: flex; flex-direction: column; z-index: 1000; box-shadow: 1px 0 3px rgba(31, 35, 40, 0.12); border-right: 1px solid var(--tbc-sidebar-border); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.5; } #tbc-sidebar * { box-sizing: border-box; } /* ================================ Main Content Area ================================ */ #tbc-content { margin-left: var(--tbc-sidebar-width); min-height: 100vh; padding: 20px 40px 20px 40px; transition: margin-left var(--tbc-transition-speed) ease; } /* Override the inline body styles when sidebar is present */ body.tbc-has-sidebar { max-width: none !important; margin: 0 !important; padding: 0 !important; } /* Allow article content to use full width while maintaining readability */ #tbc-content article, #tbc-content > .nav, #tbc-content > article { max-width: 900px; margin-left: 0; margin-right: auto; } /* ================================ Resize Handle ================================ */ #tbc-resize-handle { position: absolute; right: 0; top: 0; width: 5px; height: 100%; cursor: col-resize; background: transparent; transition: background var(--tbc-transition-speed); z-index: 1001; } #tbc-resize-handle:hover, #tbc-resize-handle.dragging { background: rgba(0, 102, 204, 0.4); } body.tbc-resizing { cursor: col-resize !important; user-select: none !important; } body.tbc-resizing * { cursor: col-resize !important; user-select: none !important; } /* ================================ Sidebar Header ================================ */ #tbc-sidebar-header { height: var(--tbc-header-height); padding: 10px 15px; background: var(--tbc-sidebar-bg-light); border-bottom: 1px solid var(--tbc-sidebar-border); display: flex; align-items: center; flex-shrink: 0; } #tbc-sidebar-header a { color: var(--tbc-sidebar-text); text-decoration: none; font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; } #tbc-sidebar-header a:hover { color: var(--tbc-sidebar-active); } #tbc-sidebar-header .tbc-logo { font-size: 20px; } /* ================================ Search Box ================================ */ #tbc-search-container { padding: 10px 12px; background: var(--tbc-sidebar-bg); border-bottom: 1px solid var(--tbc-sidebar-border); flex-shrink: 0; } .tbc-search-wrapper { display: flex; align-items: center; background: var(--tbc-search-bg); border: 2px solid var(--tbc-search-border); border-radius: 6px; padding: 6px 10px; transition: border-color var(--tbc-transition-speed), box-shadow var(--tbc-transition-speed); } .tbc-search-wrapper:focus-within { border-color: var(--tbc-search-focus); box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2); } .tbc-search-icon { color: var(--tbc-sidebar-text-muted); font-size: 14px; margin-right: 8px; flex-shrink: 0; } #tbc-search-input { border: none; outline: none; flex: 1; font-size: 14px; padding: 2px 0; background: transparent; color: var(--tbc-sidebar-text); min-width: 0; } #tbc-search-input::placeholder { color: var(--tbc-sidebar-text-muted); } #tbc-search-clear { background: none; border: none; cursor: pointer; color: #a0aec0; font-size: 16px; padding: 2px 4px; margin-left: 4px; border-radius: 3px; transition: color var(--tbc-transition-speed), background var(--tbc-transition-speed); flex-shrink: 0; } #tbc-search-clear:hover { color: #4a5568; background: #e2e8f0; } #tbc-search-clear.hidden { display: none; } #tbc-search-results { font-size: 12px; color: var(--tbc-sidebar-text-muted); margin-top: 6px; text-align: center; min-height: 18px; } #tbc-search-results.no-results { color: #fc8181; } /* Pagefind Search Results */ .tbc-search-loading, .tbc-search-no-results, .tbc-search-error { padding: 12px; text-align: center; font-size: 13px; color: var(--tbc-sidebar-text-muted); } .tbc-search-error { color: #fc8181; } .tbc-search-count { padding: 8px 12px; font-size: 12px; color: var(--tbc-sidebar-text-muted); border-bottom: 1px solid var(--tbc-sidebar-border); } .tbc-search-more { padding: 8px 12px; font-size: 12px; color: var(--tbc-sidebar-text-muted); text-align: center; font-style: italic; } .tbc-pagefind-results { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 250px); overflow-y: auto; } .tbc-pagefind-result { border-bottom: 1px solid var(--tbc-sidebar-border); } .tbc-pagefind-link { display: block; padding: 10px 12px; text-decoration: none; color: inherit; transition: background-color var(--tbc-transition-speed); } .tbc-pagefind-link:hover { background-color: var(--tbc-sidebar-hover); } .tbc-pagefind-title { display: block; font-weight: 500; color: var(--tbc-accent-primary); margin-bottom: 4px; font-size: 13px; line-height: 1.4; } .tbc-pagefind-excerpt { display: block; font-size: 12px; color: var(--tbc-sidebar-text-muted); line-height: 1.4; word-break: break-word; } /* Pagefind highlight marks in excerpts */ .tbc-pagefind-excerpt mark { background-color: rgba(255, 235, 59, 0.4); color: inherit; padding: 0 2px; border-radius: 2px; } /* ================================ Welcome Link ================================ */ #tbc-welcome-link { padding: 8px 12px; border-bottom: 1px solid var(--tbc-sidebar-border); } #tbc-welcome-link a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: linear-gradient(135deg, var(--tbc-accent-primary) 0%, var(--tbc-accent-secondary) 100%); color: white; text-decoration: none; border-radius: 6px; font-weight: 500; font-size: 14px; transition: all var(--tbc-transition-speed); box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2); } #tbc-welcome-link a:hover { background: linear-gradient(135deg, var(--tbc-accent-secondary) 0%, var(--tbc-accent-highlight) 100%); box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3); transform: translateY(-1px); } .tbc-welcome-icon { font-size: 16px; } /* ================================ Sidebar Footer (Nav Links) ================================ */ #tbc-sidebar-footer { flex-shrink: 0; border-top: 1px solid var(--tbc-sidebar-border); padding: 8px 12px; background: var(--tbc-sidebar-bg-light); } #tbc-nav-links { display: flex; flex-wrap: wrap; gap: 4px 8px; justify-content: center; } #tbc-nav-links a { display: inline-block; padding: 4px 8px; font-size: 12px; color: var(--tbc-sidebar-text-muted); text-decoration: none; border-radius: 3px; transition: background var(--tbc-transition-speed), color var(--tbc-transition-speed); } #tbc-nav-links a:hover { background: var(--tbc-sidebar-hover); color: var(--tbc-sidebar-text); } #tbc-nav-links a.active { background: var(--tbc-sidebar-active); color: #fff; font-weight: 500; } #tbc-sidebar-footer .tbc-shortcut-hint { text-align: center; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--tbc-sidebar-border); } /* ================================ Topics Container (Scrollable) ================================ */ #tbc-topics-container { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 0; } /* Custom scrollbar */ #tbc-topics-container::-webkit-scrollbar { width: 8px; } #tbc-topics-container::-webkit-scrollbar-track { background: var(--tbc-sidebar-bg); } #tbc-topics-container::-webkit-scrollbar-thumb { background: var(--tbc-sidebar-border); border-radius: 4px; } #tbc-topics-container::-webkit-scrollbar-thumb:hover { background: var(--tbc-sidebar-hover); } /* ================================ Section Headers (Topics/Archive) ================================ */ .tbc-section-header { display: flex; align-items: center; gap: 6px; padding: 10px 12px 6px; font-size: 12px; font-weight: 600; color: var(--tbc-sidebar-text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--tbc-sidebar-border); margin-bottom: 4px; position: sticky; top: 0; background: var(--tbc-sidebar-bg); z-index: 5; } .tbc-section-icon { font-size: 14px; } .tbc-section-title { flex: 1; } .tbc-section-count { font-weight: 400; font-size: 11px; color: var(--tbc-sidebar-text-muted); } .tbc-toggle-all { background: none; border: 1px solid var(--tbc-sidebar-border); border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: bold; color: var(--tbc-sidebar-text-muted); padding: 2px 8px; transition: all var(--tbc-transition-speed); } .tbc-toggle-all:hover { background: var(--tbc-sidebar-hover); color: var(--tbc-sidebar-text); } .tbc-topics-section { margin-bottom: 8px; } /* ================================ Topic Groups ================================ */ .tbc-topic { margin-bottom: 2px; } .tbc-topic-header { display: flex; align-items: center; padding: 8px 12px; cursor: pointer; transition: background var(--tbc-transition-speed); user-select: none; } .tbc-topic-header:hover { background: var(--tbc-sidebar-hover); } .tbc-topic-toggle { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; margin-right: 8px; font-size: 10px; color: var(--tbc-sidebar-text-muted); transition: transform var(--tbc-transition-speed); flex-shrink: 0; } .tbc-topic.expanded .tbc-topic-toggle { transform: rotate(90deg); } .tbc-topic-title { flex: 1; font-size: 13px; font-weight: 500; color: var(--tbc-sidebar-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tbc-topic-id { color: var(--tbc-sidebar-text-muted); font-size: 11px; font-weight: normal; margin-right: 6px; } .tbc-topic-count { font-size: 11px; color: var(--tbc-sidebar-text-muted); margin-left: 8px; flex-shrink: 0; } /* ================================ Topic Posts List ================================ */ .tbc-topic-posts { display: none; padding-left: 20px; background: rgba(0, 0, 0, 0.1); } .tbc-topic.expanded .tbc-topic-posts { display: block; } .tbc-post-link { display: block; padding: 6px 12px 6px 20px; color: var(--tbc-sidebar-text-muted); text-decoration: none; font-size: 12px; border-left: 2px solid transparent; transition: all var(--tbc-transition-speed); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tbc-post-link:hover { color: #fff; background: var(--tbc-sidebar-hover); border-left-color: var(--tbc-sidebar-active); } .tbc-post-link.current { color: #fff; background: var(--tbc-sidebar-active); border-left-color: #fff; font-weight: 500; } /* ================================ Sub-Topics ================================ */ .tbc-subtopic { margin-left: 10px; } .tbc-subtopic .tbc-topic-header { padding-left: 20px; } .tbc-subtopic .tbc-topic-title { font-size: 12px; } /* ================================ Search Highlighting ================================ */ .tbc-search-highlight { background-color: var(--tbc-search-highlight); color: #1f2328; padding: 0 2px; border-radius: 2px; font-weight: 600; } .tbc-search-no-match { display: none !important; } /* ================================ Content Match Indicators ================================ */ /* Content-only match background and indicator */ .tbc-post-link.tbc-content-match { background: linear-gradient(90deg, rgba(66, 153, 225, 0.10) 0%, rgba(66, 153, 225, 0.03) 100%); border-left: 2px solid var(--tbc-accent-primary, #0066cc); padding-left: 8px; border-radius: 0 4px 4px 0; } /* Content match icon indicator */ .tbc-post-link.tbc-content-match::after { /* Use a CSS-only indicator instead of an emoji for better accessibility */ content: ''; display: inline-block; width: 0.45em; height: 0.45em; margin-left: 0.35em; border-radius: 999px; background-color: var(--tbc-accent-primary, #0066cc); opacity: 0.7; vertical-align: middle; } /* Result count breakdown styling */ .tbc-result-breakdown { font-size: 10px; color: var(--tbc-sidebar-text-muted, #666); font-weight: normal; } /* ================================ Mobile Toggle Button ================================ */ #tbc-mobile-toggle { display: none; position: fixed; top: 10px; left: 10px; z-index: 1002; width: 44px; height: 44px; background: var(--tbc-sidebar-bg); border: 1px solid var(--tbc-sidebar-border); border-radius: 8px; cursor: pointer; box-shadow: 0 1px 3px rgba(31, 35, 40, 0.12); color: var(--tbc-sidebar-text); font-size: 24px; display: none; align-items: center; justify-content: center; } #tbc-mobile-toggle:hover { background: var(--tbc-sidebar-hover); } /* Mobile close button in sidebar */ #tbc-sidebar-close { display: none; position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; background: transparent; border: none; cursor: pointer; color: var(--tbc-sidebar-text); font-size: 20px; border-radius: 4px; z-index: 10; } #tbc-sidebar-close:hover { background: var(--tbc-sidebar-hover); } /* ================================ Keyboard Shortcut Hint ================================ */ .tbc-shortcut-hint { font-size: 11px; color: var(--tbc-sidebar-text-muted); text-align: center; padding: 4px; } .tbc-shortcut-hint kbd { background: var(--tbc-sidebar-bg); border: 1px solid var(--tbc-sidebar-border); border-radius: 3px; padding: 1px 5px; font-family: monospace; font-size: 11px; } /* ================================ Responsive Styles ================================ */ /* Tablet: Collapsible sidebar */ @media (max-width: 1024px) { :root { --tbc-sidebar-width: 260px; } } /* Mobile: Hidden sidebar with hamburger */ @media (max-width: 768px) { #tbc-sidebar { transform: translateX(-100%); transition: transform 0.3s ease; width: 85%; max-width: 320px; } #tbc-sidebar.open { transform: translateX(0); } #tbc-content { margin-left: 0 !important; padding: 60px 15px 15px 15px; /* Top padding for mobile toggle button */ } #tbc-content article, #tbc-content > .nav, #tbc-content > article { max-width: none; } #tbc-mobile-toggle { display: flex; } #tbc-sidebar-close { display: block; } #tbc-resize-handle { display: none; } /* Overlay when sidebar is open */ #tbc-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); z-index: 999; } #tbc-overlay.active { display: block; } .tbc-shortcut-hint { display: none; } } /* ================================ Print Styles ================================ */ @media print { #tbc-sidebar, #tbc-mobile-toggle, #tbc-overlay { display: none !important; } #tbc-content { margin-left: 0 !important; } } /* ================================ Accessibility ================================ */ .tbc-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } /* Focus styles */ #tbc-sidebar a:focus, #tbc-sidebar button:focus, .tbc-topic-header:focus { outline: 2px solid var(--tbc-sidebar-active); outline-offset: -2px; } /* Reduced motion */ @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; } #tbc-sidebar, .tbc-topic-toggle { transition: none !important; } } /* ================================ Loading State ================================ */ #tbc-sidebar.loading #tbc-topics-container { display: flex; align-items: center; justify-content: center; } .tbc-loading-spinner { width: 30px; height: 30px; border: 3px solid var(--tbc-sidebar-border); border-top-color: var(--tbc-sidebar-active); border-radius: 50%; animation: tbc-spin 0.8s linear infinite; } @keyframes tbc-spin { to { transform: rotate(360deg); } } /* ================================ Error State ================================ */ .tbc-error { padding: 20px; text-align: center; color: #fc8181; } .tbc-error-icon { font-size: 32px; margin-bottom: 10px; } .tbc-error-message { font-size: 13px; margin-bottom: 15px; } .tbc-retry-btn { background: var(--tbc-sidebar-hover); color: var(--tbc-sidebar-text); border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 13px; } .tbc-retry-btn:hover { background: var(--tbc-sidebar-active); } /* ================================ Code Block Copy Button ================================ */ .tbc-code-wrapper { position: relative; } .tbc-copy-btn { position: absolute; top: 8px; right: 8px; padding: 6px 8px; background: rgba(255, 255, 255, 0.9); border: 1px solid #ccc; border-radius: 4px; cursor: pointer; opacity: 0; transition: opacity 0.2s, background-color 0.2s; display: flex; align-items: center; justify-content: center; color: #666; z-index: 10; } .tbc-code-wrapper:hover .tbc-copy-btn { opacity: 1; } .tbc-copy-btn:hover { background: #f0f0f0; color: #333; } .tbc-copy-btn:active { background: #e0e0e0; } .tbc-copy-btn.tbc-copy-success { background: #d4edda; border-color: #28a745; color: #28a745; } .tbc-copy-btn svg { display: block; } /* Ensure pre elements work well with wrapper */ .tbc-code-wrapper pre { margin: 0 0 1em 0; } /* ================================ CHRONOLOGICAL TIMELINE COLUMN Integrated right-side navigation ================================ */ /* CSS Variables for Timeline */ :root { --tbc-chrono-width: 150px; --tbc-chrono-gap: 30px; --tbc-chrono-text: #6b7280; --tbc-chrono-text-muted: #9ca3af; --tbc-chrono-link: #4b5563; --tbc-chrono-link-hover: #2563eb; } /* Content wrapper - flexbox layout for content + timeline */ .tbc-content-wrapper { display: flex; gap: var(--tbc-chrono-gap); padding: 20px; padding-right: 20px; } /* Main blog content - MAXIMIZED, no max-width */ .tbc-blog-content { flex: 1; min-width: 0; /* Allow flex shrinking */ } /* Ensure article inside content has readable max-width on very wide screens */ .tbc-blog-content article { max-width: 900px; } /* Right column - integrated, minimal footprint */ .tbc-chrono-column { width: var(--tbc-chrono-width); flex-shrink: 0; background: transparent; /* Same as content area */ border: none; padding-top: 20px; font-size: 13px; color: var(--tbc-chrono-text); line-height: 1.8; } /* Sticky positioning for timeline nav */ .tbc-chrono-nav { position: sticky; top: 20px; } /* Section labels - subtle uppercase */ .tbc-chrono-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--tbc-chrono-text-muted); margin-bottom: 12px; display: block; font-weight: 500; } /* Previous/Next navigation */ .tbc-chrono-prevnext { margin-bottom: 24px; } .tbc-chrono-prev, .tbc-chrono-next { display: block; margin-bottom: 16px; text-decoration: none; color: var(--tbc-chrono-link); transition: color 0.15s ease; } .tbc-chrono-prev:hover, .tbc-chrono-next:hover { color: var(--tbc-chrono-link-hover); } .tbc-chrono-label { display: block; font-size: 11px; color: var(--tbc-chrono-text-muted); margin-bottom: 2px; } .tbc-chrono-title { display: block; font-size: 12px; line-height: 1.4; /* Truncate long titles */ overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } /* Current post indicator */ .tbc-chrono-current { margin-bottom: 24px; padding: 8px 10px; background: #f3f4f6; border-radius: 4px; border-left: 3px solid var(--tbc-accent-primary); } .tbc-chrono-current .tbc-chrono-label { color: var(--tbc-accent-primary); font-weight: 500; } .tbc-chrono-current .tbc-chrono-num { font-size: 12px; color: var(--tbc-chrono-text); } /* Year browser */ .tbc-chrono-years { margin-top: 16px; } .tbc-chrono-years ul { list-style: none; margin: 0; padding: 0; } .tbc-chrono-years li { margin-bottom: 4px; } .tbc-chrono-year-item { display: flex; align-items: baseline; gap: 6px; } .tbc-chrono-year-link { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--tbc-chrono-link); text-decoration: none; cursor: pointer; } .tbc-chrono-year-link:hover { color: var(--tbc-chrono-link-hover); text-decoration: underline; } .tbc-chrono-year-count { font-size: 11px; color: var(--tbc-chrono-text-muted); } /* Expanded year - posts list */ .tbc-chrono-year-posts { list-style: none; margin: 6px 0 12px 12px; padding: 0; display: none; } .tbc-chrono-year-posts.expanded { display: block; } .tbc-chrono-year-posts li { margin-bottom: 3px; } .tbc-chrono-post-link { font-size: 11px; color: var(--tbc-chrono-text-muted); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tbc-chrono-post-link:hover { color: var(--tbc-chrono-link-hover); } .tbc-chrono-post-link.current { color: var(--tbc-accent-primary); font-weight: 500; } /* Divider */ .tbc-chrono-divider { border: none; border-top: 1px solid #e5e7eb; margin: 16px 0; } /* ================================ Responsive: Timeline Column ================================ */ /* Hide timeline on narrower screens, move to bottom */ @media (max-width: 1000px) { .tbc-content-wrapper { flex-direction: column; } .tbc-chrono-column { width: 100%; padding-top: 0; margin-top: 30px; border-top: 1px solid #e5e7eb; padding-top: 24px; } .tbc-chrono-nav { position: static; } /* Horizontal prev/next layout */ .tbc-chrono-prevnext { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 20px; } .tbc-chrono-prev, .tbc-chrono-next { flex: 1; margin-bottom: 0; } .tbc-chrono-next { text-align: right; } /* Horizontal year browser */ .tbc-chrono-years ul { display: flex; flex-wrap: wrap; gap: 8px 16px; } .tbc-chrono-years li { margin-bottom: 0; } } /* When sidebar is collapsed on mobile, full width content */ @media (max-width: 768px) { .tbc-content-wrapper { padding: 15px; } .tbc-chrono-prevnext { flex-direction: column; gap: 12px; } .tbc-chrono-next { text-align: left; } } /* Print: hide timeline */ @media print { .tbc-chrono-column { display: none; } } /* ================================ MOBILE CHRONOLOGICAL BOTTOM SHEET ================================ */ /* CSS Custom Properties for Mobile Sheet */ :root { --tbc-sheet-collapsed-height: 48px; --tbc-sheet-partial-height: 50vh; --tbc-sheet-expanded-height: 85vh; --tbc-sheet-z: 1000; --tbc-sheet-transition: 250ms ease-out; --tbc-tab-transition: 150ms ease-in-out; --tbc-touch-min: 44px; } /* Body scroll lock when sheet is expanded */ body.tbc-sheet-open { overflow: hidden; position: fixed; width: 100%; height: 100%; } /* ================================ Mobile Bottom Sheet Container ================================ */ @media (max-width: 768px) { /* Overlay backdrop */ .tbc-chrono-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); z-index: calc(var(--tbc-sheet-z) - 1); opacity: 0; visibility: hidden; transition: opacity var(--tbc-sheet-transition), visibility var(--tbc-sheet-transition); } .tbc-chrono-overlay.visible { opacity: 1; visibility: visible; } /* Bottom sheet container */ .tbc-chrono-mobile-sheet { position: fixed; bottom: 0; left: 0; right: 0; height: var(--tbc-sheet-collapsed-height); background: var(--tbc-sidebar-bg); border-top-left-radius: 16px; border-top-right-radius: 16px; box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); z-index: var(--tbc-sheet-z); transition: height var(--tbc-sheet-transition); overflow: hidden; /* Safe area for notched phones */ padding-bottom: env(safe-area-inset-bottom); display: flex; flex-direction: column; } .tbc-chrono-mobile-sheet.partial { height: var(--tbc-sheet-partial-height); } .tbc-chrono-mobile-sheet.expanded { height: var(--tbc-sheet-expanded-height); } /* Hide desktop chrono column on mobile when sheet is present */ .tbc-chrono-mobile-sheet ~ .tbc-chrono-column, body.tbc-has-chrono-sheet .tbc-chrono-column { display: none !important; } /* Drag handle indicator */ .tbc-sheet-drag-handle { width: 36px; height: 4px; background: var(--tbc-sidebar-border); border-radius: 2px; margin: 8px auto 0; flex-shrink: 0; } /* Collapsed bar */ .tbc-sheet-collapsed-bar { display: flex; align-items: center; justify-content: center; height: calc(var(--tbc-sheet-collapsed-height) - 12px); padding: 0 16px; cursor: pointer; flex-shrink: 0; } .tbc-sheet-context { font-size: 14px; color: var(--tbc-sidebar-text); font-weight: 500; } /* Sheet content area */ .tbc-sheet-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; } /* Sheet header (shown in months view) */ .tbc-sheet-header { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--tbc-sidebar-border); gap: 12px; flex-shrink: 0; } .tbc-sheet-back, .tbc-sheet-close { width: var(--tbc-touch-min); height: var(--tbc-touch-min); border: none; background: transparent; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--tbc-sidebar-text); border-radius: 50%; transition: background-color var(--tbc-tab-transition); } .tbc-sheet-back:hover, .tbc-sheet-close:hover { background: var(--tbc-sidebar-hover); } .tbc-sheet-title { flex: 1; display: flex; flex-direction: column; gap: 2px; } .tbc-sheet-year { font-size: 18px; font-weight: 600; color: var(--tbc-sidebar-text); } .tbc-sheet-count { font-size: 12px; color: var(--tbc-sidebar-text-muted); } } /* ================================ Year Grid (Partial Expand State) ================================ */ @media (max-width: 768px) { .tbc-year-grid-header { font-size: 14px; font-weight: 600; color: var(--tbc-sidebar-text-muted); padding: 16px 16px 8px; text-transform: uppercase; letter-spacing: 0.5px; } .tbc-year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; padding: 8px 16px 16px; } .tbc-year-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 8px; min-height: var(--tbc-touch-min); background: var(--tbc-sidebar-bg-light); border: 1px solid var(--tbc-sidebar-border); border-radius: 8px; cursor: pointer; transition: background-color var(--tbc-tab-transition), border-color var(--tbc-tab-transition); } .tbc-year-chip:hover { background: var(--tbc-sidebar-hover); } .tbc-year-chip.current { border-color: var(--tbc-accent-primary); background: rgba(0, 102, 204, 0.08); } .tbc-year-chip-year { font-size: 16px; font-weight: 600; color: var(--tbc-sidebar-text); } .tbc-year-chip-count { font-size: 11px; color: var(--tbc-sidebar-text-muted); margin-top: 2px; } } /* ================================ Month Tabs (Expanded State) ================================ */ @media (max-width: 768px) { .tbc-month-tabs { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 0 16px; gap: 4px; border-bottom: 1px solid var(--tbc-sidebar-border); flex-shrink: 0; } .tbc-month-tabs::-webkit-scrollbar { display: none; } .tbc-month-tab { flex-shrink: 0; scroll-snap-align: start; padding: 12px 16px; min-width: var(--tbc-touch-min); text-align: center; border: none; background: transparent; color: var(--tbc-sidebar-text-muted); font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; transition: color var(--tbc-tab-transition), border-color var(--tbc-tab-transition); } .tbc-month-tab.active { color: var(--tbc-accent-primary); border-bottom-color: var(--tbc-accent-primary); } .tbc-month-tab-count { display: block; font-size: 11px; color: var(--tbc-sidebar-text-muted); margin-top: 2px; } .tbc-month-tab.active .tbc-month-tab-count { color: var(--tbc-accent-primary); } } /* ================================ Post List (Expanded State) ================================ */ @media (max-width: 768px) { .tbc-post-list { padding: 8px 0; } .tbc-post-item { display: flex; flex-direction: column; padding: 12px 16px; text-decoration: none; color: var(--tbc-sidebar-text); border-bottom: 1px solid var(--tbc-sidebar-border); transition: background-color var(--tbc-tab-transition); min-height: var(--tbc-touch-min); justify-content: center; } .tbc-post-item:hover { background: var(--tbc-sidebar-hover); } .tbc-post-item.current { background: rgba(0, 102, 204, 0.08); border-left: 3px solid var(--tbc-accent-primary); padding-left: 13px; } .tbc-post-num { font-size: 11px; color: var(--tbc-sidebar-text-muted); font-family: 'Consolas', 'Monaco', monospace; } .tbc-post-title { font-size: 14px; font-weight: 500; color: var(--tbc-sidebar-text); margin-top: 2px; line-height: 1.3; } .tbc-post-date { font-size: 11px; color: var(--tbc-sidebar-text-muted); margin-top: 4px; } } /* ================================ Empty State ================================ */ @media (max-width: 768px) { .tbc-sheet-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 200px; color: var(--tbc-sidebar-text-muted); text-align: center; padding: 24px; } .tbc-sheet-empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; } } /* ================================ Landscape Layout ================================ */ @media (max-width: 896px) and (orientation: landscape) { .tbc-chrono-mobile-sheet.expanded { height: 100vh; border-radius: 0; } .tbc-sheet-content-landscape { display: flex; height: calc(100% - 60px); } .tbc-month-list-sidebar { width: 140px; flex-shrink: 0; border-right: 1px solid var(--tbc-sidebar-border); overflow-y: auto; } .tbc-month-list-sidebar .tbc-month-tab { display: block; width: 100%; text-align: left; border-bottom: none; border-left: 2px solid transparent; padding: 10px 12px; } .tbc-month-list-sidebar .tbc-month-tab.active { border-left-color: var(--tbc-accent-primary); border-bottom-color: transparent; background: rgba(0, 102, 204, 0.08); } .tbc-post-list-main { flex: 1; overflow-y: auto; } } /* ================================ Reduced Motion Support ================================ */ @media (prefers-reduced-motion: reduce) { .tbc-chrono-mobile-sheet, .tbc-chrono-overlay, .tbc-month-tab, .tbc-year-chip, .tbc-post-item, .tbc-sheet-back, .tbc-sheet-close { transition: none !important; } } /* ================================ In-Page Content Highlighting ================================ */ /* Highlighted text */ .tbc-content-highlight { background-color: #fff3cd; color: inherit; padding: 1px 2px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.3); transition: background-color 0.3s ease; } .tbc-content-highlight.active { background-color: #ffc107; box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.5); } /* Pulse animation for first match */ .tbc-content-highlight.tbc-highlight-pulse { animation: highlightPulse 1.5s ease-out; } @keyframes highlightPulse { 0% { background-color: #ffc107; transform: scale(1.05); } 50% { background-color: #ffeb3b; } 100% { background-color: #fff3cd; transform: scale(1); } } /* Floating counter badge */ .tbc-highlight-counter { position: fixed; top: 20px; right: 20px; background: var(--tbc-sidebar-bg, #f5f5f5); border: 1px solid var(--tbc-sidebar-border, #ddd); border-radius: 8px; padding: 10px 15px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); z-index: 10000; display: flex; align-items: center; gap: 10px; font-size: 14px; max-width: 350px; } .tbc-highlight-count { background: var(--tbc-accent-primary, #0066cc); color: white; padding: 2px 8px; border-radius: 12px; font-weight: bold; min-width: 24px; text-align: center; } .tbc-highlight-label { color: var(--tbc-sidebar-text, #333); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; } .tbc-highlight-clear, .tbc-highlight-nav { background: transparent; border: 1px solid var(--tbc-sidebar-border, #ddd); border-radius: 4px; width: 28px; height: 28px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color 0.15s ease; font-size: 14px; color: var(--tbc-sidebar-text, #333); } .tbc-highlight-clear:hover, .tbc-highlight-nav:hover { background: var(--tbc-sidebar-hover, #e8e8e8); } /* Mobile adjustments for highlight counter */ @media (max-width: 768px) { .tbc-highlight-counter { top: auto; bottom: 70px; /* Above mobile sheet */ right: 10px; left: 10px; max-width: none; justify-content: center; } .tbc-highlight-label { display: none; } } /* Reduced motion for highlights */ @media (prefers-reduced-motion: reduce) { .tbc-content-highlight, .tbc-content-highlight.tbc-highlight-pulse { animation: none; transition: none; } .tbc-post-link.tbc-content-match { transition: none; } } /* Print: hide counter, keep highlights */ @media print { .tbc-highlight-counter { display: none; } .tbc-content-highlight { background-color: #ffff00 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }