/* ==========================================================================
   Single Post
   ========================================================================== */
.single-post {
  max-width: none;
  margin: 0;
  background-color: transparent;
  border-radius: 0;
  border: none;
  padding: 0;
  margin-bottom: 0;
}

.post-header {
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-color);  
  padding-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.post-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 1.5rem 0;
  line-height: 1.2;
}

.post-content {
  line-height: 1.7;
  color: var(--text-color);
  margin-bottom: 2rem;
}

.post-footer {
  padding: 0;
}

.post-thumbnail {
  margin: 2rem 0;
  text-align: center;
}

.post-thumbnail img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.meta-item strong {
  color: var(--text-color);
  font-weight: 600;
}

.meta-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-badge.pinned {
  background-color: rgba(0, 136, 204, 0.15);
  color: var(--primary-color);
}

.meta-badge.featured {
  background-color: rgba(255, 193, 7, 0.15);
  color: #f39c12;
}

.post-taxonomy {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-categories,
.post-tags {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.post-categories strong,
.post-tags strong {
  color: var(--text-color);
  font-weight: 600;
  margin-right: 0.5rem;
}

/* ==========================================================================
   Featured Video Styles
   ========================================================================== */
.post-header-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.post-header-video.loaded {
    opacity: 1;
}

.post-header.has-featured-video {
    min-height: 300px;
    background-color: var(--card-bg);
}

.post-header.has-featured-video.video-loaded .post-header-video {
    opacity: 1;
}

.post-header.has-featured-video.video-error .post-header-video {
    display: none;
}

.post-header.has-featured-video.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Connection-based optimisations */
.post-header.slow-connection .post-header-video {
    display: none;
}

/* Battery saving mode */
body.battery-low .post-header-video {
    display: none;
}

/* ==========================================================================
   Featured Image Styles 
   ========================================================================== */
.post-header.has-featured-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    -webkit-background-clip: padding-box;
    background-clip: padding-box;
}

.post-header.has-featured-video {
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    overflow: hidden;
    -webkit-transform: translateZ(0); /* Hardware acceleration for smoother corners */
    transform: translateZ(0);
}

.post-header-video {
    border-radius: inherit; /* Inherit the container's border radius */
    -webkit-backface-visibility: hidden; /* Prevent rendering artifacts */
    backface-visibility: hidden;
}


.post-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    transition: background-color var(--transition);
    /* Light theme: Semi-transparent white overlay */
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 1));
}

[data-theme="dark"] .post-header-overlay {
    /* Dark theme: Semi-transparent dark overlay */
    background: linear-gradient(to bottom, rgba(45, 45, 45, 0.7), rgba(45, 45, 45, 1));
}

/* Ensure content is positioned above video/image */
.post-header-content {
    position: relative;
    z-index: 2;
}

/* Enhanced text readability with subtle shadows */
.post-header.has-featured-image .post-title,
.post-header.has-featured-video .post-title {
   
    color: var(--text-color);
}

.post-header.has-featured-image .post-meta,
.post-header.has-featured-image .post-taxonomy,
.post-header.has-featured-video .post-meta,
.post-header.has-featured-video .post-taxonomy {
    
}

/* Stronger text shadows for dark theme over light backgrounds */
[data-theme="dark"] .post-header.has-featured-image .post-title,
[data-theme="dark"] .post-header.has-featured-image .post-meta,
[data-theme="dark"] .post-header.has-featured-image .post-taxonomy,
[data-theme="dark"] .post-header.has-featured-image .meta-item,
[data-theme="dark"] .post-header.has-featured-image .meta-item strong,
[data-theme="dark"] .post-header.has-featured-video .post-title,
[data-theme="dark"] .post-header.has-featured-video .post-meta,
[data-theme="dark"] .post-header.has-featured-video .post-taxonomy,
[data-theme="dark"] .post-header.has-featured-video .meta-item,
[data-theme="dark"] .post-header.has-featured-video .meta-item strong {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Enhanced badges and links over backgrounds */
.post-header.has-featured-image .meta-badge,
.post-header.has-featured-video .meta-badge {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(2px);
}

[data-theme="dark"] .post-header.has-featured-image .meta-badge,
[data-theme="dark"] .post-header.has-featured-video .meta-badge {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
}

.post-header.has-featured-image .topic-category,
.post-header.has-featured-image .topic-tag,
.post-header.has-featured-video .topic-category,
.post-header.has-featured-video .topic-tag {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(2px);
    transition: all var(--transition);
}

[data-theme="dark"] .post-header.has-featured-image .topic-category,
[data-theme="dark"] .post-header.has-featured-image .topic-tag,
[data-theme="dark"] .post-header.has-featured-video .topic-category,
[data-theme="dark"] .post-header.has-featured-video .topic-tag {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
}

.post-header.has-featured-image .topic-category:hover,
.post-header.has-featured-image .topic-tag:hover,
.post-header.has-featured-video .topic-category:hover,
.post-header.has-featured-video .topic-tag:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}


/* Navigation overlay fixes (for consistency) */
.nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    transition: background-color var(--transition);
    background-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .nav-overlay {
    background-color: rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Post Navigation
   ========================================================================== */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  margin-top: 2rem;
}

.nav-previous,
.nav-next {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: all var(--transition);
  background-color: var(--card-bg);
}

.nav-previous:hover,
.nav-next:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.nav-previous a,
.nav-next a {
  display: block;
  aspect-ratio: 16 / 9;
  padding: 2rem;
  color: var(--text-color);
  text-decoration: none;
}

.nav-next a {
  text-align: right;
}

.nav-subtitle {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.nav-title {
  display: block;
  font-weight: 600;
  line-height: 1.4;
  font-size: 1.125rem;
  
}

/* Featured image navigation */
.nav-previous.has-featured-image,
.nav-next.has-featured-image {
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
    position: relative;
    -webkit-background-clip: padding-box;
    background-clip: padding-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.nav-previous.has-featured-image {background-position: right;}
.nav-next.has-featured-image {background-position: left;}


.nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    transition: background-color var(--transition); 
    background-color: rgba(244, 211, 244, 0.9); 
}

[data-theme="dark"] .nav-overlay {
    background-color: rgba(76, 175, 80, 0.75);
}


.nav-content {
    position: relative;
    z-index: 2;
}

.nav-previous.has-featured-image a,
.nav-next.has-featured-image a {
    position: relative;
    z-index: 2;
}

[data-theme="dark"] .nav-previous.has-featured-image .nav-subtitle,
[data-theme="dark"] .nav-previous.has-featured-image .nav-title,
[data-theme="dark"] .nav-next.has-featured-image .nav-subtitle,
[data-theme="dark"] .nav-next.has-featured-image .nav-title {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Share and Related Content
   ========================================================================== */
.post-share,
.related-topics {
  
}

.post-share h4,
.related-topics h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.share-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.share-btn {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--bg-color);
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.share-btn:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.related-item {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: all var(--transition);
  background-color: var(--card-bg);
}

.related-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.related-link {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  color: var(--text-color);
  text-decoration: none;
  gap: 1rem;
}

.related-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.related-title {
  font-weight: 600;
  line-height: 1.4;
}

/* ==========================================================================
   Pagination and Page Links
   ========================================================================== */
.page-links {
  margin: 2rem 0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-links-title {
  font-weight: 600;
  color: var(--text-color);
  margin-right: 1rem;
}

.page-links a,
.page-links .current {
  display: inline-block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  text-decoration: none;
  color: var(--text-color);
  transition: all var(--transition);
  font-weight: 500;
  min-width: 44px;
  text-align: center;
}

.page-links a:hover,
.page-links .current {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination {
    margin: 2rem 0;
    text-align: center;
}

.page-numbers {
    display: inline-flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--primary-color);
}

.page-numbers .page-number,
.page-numbers .prev,
.page-numbers .next {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--transition);
    min-width: 44px;
    text-align: center;
}

.page-numbers .page-number:hover,
.page-numbers .prev:hover,
.page-numbers .next:hover {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.page-numbers .current {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .post-header {
        padding: 1.5rem;
        min-height: 250px;
    }

    .post-header.has-featured-video {
        min-height: 250px;
    }

    .post-title {
        font-size: 1.875rem;
    }

    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .post-taxonomy {
        margin-top: 1rem;
    }

    .post-content,
    .post-footer {
        padding: 1.5rem;
    }

    .post-navigation {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .nav-previous a,
    .nav-next a {
        padding: 1.5rem;
        text-align: left;
    }

    .share-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .share-btn {
        text-align: center;
    }

    .related-list {
        grid-template-columns: 1fr;
    }

    .page-links {
        flex-direction: column;
        gap: 0.75rem;
    }

    .page-links-title {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .post-header {
        padding: 1rem;
        min-height: 200px;
    }

    .post-header.has-featured-video {
        min-height: 200px;
    }

    .post-title {
        font-size: 1.5rem;
    }

    .post-content,
    .post-footer {
        padding: 1rem;
    }

    .nav-previous a,
    .nav-next a {
        padding: 1rem;
    }

    .related-link {
        padding: 1rem;
    }
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .post-header-video {
        display: none !important;
    }
    
    .post-header.has-featured-video {
        background-image: var(--fallback-image, none);
        background-size: cover;
        background-position: center;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .post-header.has-featured-video.loading::before {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .post-header-overlay {
        background-color: rgba(255, 255, 255, 0.95) !important;
    }
    
    [data-theme="dark"] .post-header-overlay {
        background-color: rgba(0, 0, 0, 0.9) !important;
    }
    
    .meta-badge {
        border: 2px solid currentColor;
    }

    .share-btn,
    .page-links a,
    .page-numbers .page-number,
    .page-numbers .prev,
    .page-numbers .next {
        border-width: 2px;
    }
}

/* Focus styles for keyboard navigation */
.share-btn:focus,
.page-links a:focus,
.page-numbers a:focus,
.related-link:focus,
.nav-previous a:focus,
.nav-next a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .post-header-video {
        display: none !important;
    }
    
    .post-header.has-featured-video,
    .post-header.has-featured-image {
        background-image: none !important;
    }
    
    .post-header-overlay {
        display: none;
    }
    
    .share-buttons,
    .post-navigation {
        display: none;
    }
    
    .post-header,
    .post-content,
    .post-footer {
        border: none;
        box-shadow: none;
        background: white !important;
        color: black !important;
    }
}

/* Dark theme specific adjustments */
[data-theme="dark"] .post-header.has-featured-video.loading::before {
    border-color: var(--border-color);
    border-top-color: var(--primary-color);
}

/* Loading state improvements */
.post-header.loading .post-header-content {
    opacity: 0.8;
}

.post-header.video-loaded .post-header-content {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

/* Video error state */
.post-header.video-error {
    background-size: cover;
    background-position: center;
}

/* Connection-specific optimisations */
body.connection-slow-2g .post-header-video,
body.connection-2g .post-header-video {
    display: none;
}

/* Reduced data preferences */
@media (prefers-reduced-data: reduce) {
    .post-header-video {
        display: none !important;
    }
}

.question-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Single post layout with TOC */
.single-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin-bottom: 2rem;
}

.single-post {
    min-width: 0; /* Prevent flex overflow */
}

/* TOC styles (copied from page-toc.php) */
.post-toc {
    border-left: 1px solid var(--border-color);
    padding-left: 2rem;
    position: sticky;
    top: 2rem;
    height: fit-content;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
}

.toc-container {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.toc-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.toc-nav {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 0.25rem;
}

.toc-list a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.4;
    border-radius: 4px;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.toc-list a:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.toc-list a.active {
    background-color: rgba(0, 136, 204, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.toc-list .toc-h3 {
    padding-left: 1.5rem;
}

.toc-list .toc-h4 {
    padding-left: 2.25rem;
    font-size: 0.8rem;
}

/* Reading progress */
.reading-progress {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Related topics section */
.related-topics-section {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin-bottom: 2rem;
}

.section-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.related-topics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.related-topic-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all var(--transition);
}

.related-topic-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

/* Navigation tiles */
.post-navigation-tiles {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin-bottom: 2rem;
}

.nav-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.nav-tile {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all var(--transition);
}

.nav-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

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

.nav-tile-info {
    padding: 1rem;
}

.nav-direction {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.nav-next .nav-direction {
    justify-content: flex-end;
}

.nav-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.nav-category {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsive design */
@media (max-width: 1024px) {
    .single-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .post-toc {
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-left: 0;
        padding-top: 2rem;
        position: static;
        max-height: none;
    }
    
    .related-topics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .single-layout {
        padding: 1.5rem;
    }
    
    .related-topics-section,
    .post-navigation-tiles {
        padding: 1.5rem;
    }
    
    .related-topics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .nav-tiles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .single-layout {
        padding: 1rem;
    }
    
    .related-topics-section,
    .post-navigation-tiles {
        padding: 1rem;
    }
}

/* Navigation tiles - 3 column layout */
.nav-tiles-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* prev | spacer | next */
    gap: 1.5rem;
    align-items: stretch;
}

.nav-spacer {
    width: 2rem; /* Adjustable spacer width */
    min-height: 1px;
}

/* Empty placeholder styling */
.nav-empty {
    background-color: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius);
    opacity: 0.6;
    pointer-events: none;
}

.nav-empty-content {
    padding: 1rem;
    text-align: center;
}

.nav-empty .topic-placeholder {
    background-color: var(--bg-color);
}

.nav-empty .placeholder-icon.disabled {
    color: var(--text-muted);
    opacity: 0.5;
}

.nav-empty .nav-direction.disabled {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Ensure consistent heights */
.nav-tile,
.nav-empty {
    display: flex;
    flex-direction: column;
    min-height: 200px; /* Adjust as needed */
}

.nav-tile-link,
.nav-empty-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nav-tile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Responsive: Collapse to 2 columns on smaller screens */
@media (max-width: 768px) {
    .nav-tiles-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .nav-spacer {
        display: none;
    }
    
    /* On mobile, hide empty placeholders completely */
    .nav-empty {
        display: none;
    }
    
    /* If both exist, show them side by side */
    .nav-tiles-grid:has(.nav-previous):has(.nav-next) {
        grid-template-columns: 1fr 1fr;
    }
    
    /* If only one exists, center it */
    .nav-tiles-grid:has(.nav-previous):not(:has(.nav-next)) .nav-previous,
    .nav-tiles-grid:has(.nav-next):not(:has(.nav-previous)) .nav-next {
        grid-column: 1 / -1;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .nav-tiles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .nav-tile,
    .nav-empty {
        min-height: 150px;
    }
}