/* ==========================================================================
   Miscellaneous
   ========================================================================== */


   .entry-meta {
    font-size: 0.875rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 1rem;
}

.entry-meta > * {
    margin-right: 1rem;
}

.entry-meta a {
    color: inherit;
    text-decoration: none;
}

.entry-meta a:hover {
    color: var(--primary-color);
}

.entry-thumbnail {
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.entry-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition);
}

.entry-thumbnail a:hover img {
    transform: scale(1.05);
}

.read-more-link {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition);
}

.read-more-link:hover {
    color: var(--primary-hover);
}

.entry-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.entry-tags a,
.entry-categories a {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: var(--border-color);
    border-radius: 12px;
    margin: 0.125rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.75rem;
    transition: all var(--transition);
}

.entry-tags a:hover,
.entry-categories a:hover {
    background-color: var(--primary-color);
    color: white;
}

.toc-list a.active {
    background-color: var(--primary-color);
    color: white;
    padding-left: 0.5rem;
}

.mobile-nav .menu-section {
    padding: 1rem 1.5rem 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: none;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-nav-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.mobile-nav-footer .searchform {
    margin-bottom: 1rem;
}

.mobile-nav-footer input[type="search"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-color);
    color: var(--text-color);
}

.nav-info {
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.7;
}

.nav-info p {
    margin: 0;
}

.searchform {
    position: relative;
}

.searchform input[type="search"] {
    padding-right: 3rem;
}

.searchform input[type="submit"] {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
}

body.offline .content-card {
    opacity: 0.8;
}

body.offline .loading {
    display: none !important;
}

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

/* Focus styles for accessibility */
.header-btn:focus,
.search-input:focus,
.filter-select:focus,
.topic-title:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.note-item:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==========================================================================
   RTL Support
   ========================================================================== */
[dir="rtl"] .header-left {
    order: 3;
}

[dir="rtl"] .header-right {
    order: 1;
}

[dir="rtl"] .mobile-nav {
    left: auto;
    right: -100%;
}

[dir="rtl"] .mobile-nav.active {
    right: 0;
}

[dir="rtl"] .toc-panel {
    right: auto;
    left: -100%;
    border-left: none;
    border-right: 1px solid var(--border-color);
}

[dir="rtl"] .toc-panel.active {
    left: 0;
}


/* ==========================================================================
   LOAD MORE
   ========================================================================== */

.js-hidden-post {
    display: none !important;
}

.js-visible-post {
    display: block;
}

.js-load-more-container {
    text-align: center;
    margin: 3rem 0 2rem 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.js-load-more-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(0, 136, 204, 0.2);
    min-width: 200px;
}

.js-load-more-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 136, 204, 0.3);
}

.js-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: var(--text-muted);
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.js-load-progress {
    margin-top: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

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

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* No posts found styling */
.no-posts-found {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.no-posts-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-posts-found h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.no-posts-found p {
    font-size: 1rem;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Pagination styling */
.pagination-nav {
    margin: 2rem 0 1rem 0;
    text-align: center;
}

.pagination-nav ul {
    display: inline-flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-nav .page-numbers {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--transition);
    font-weight: 500;
    min-width: 44px;
    justify-content: center;
}

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

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

.pagination-nav .page-numbers.dots {
    border: none;
    background: none;
    cursor: default;
}

.pagination-nav .page-numbers.dots:hover {
    background: none;
    color: var(--text-muted);
}

.pagination-info {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.total-available-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
    display: block;
    margin-top: 0.25rem;
}
.js-post-reveal {
    animation: slideInUp 0.5s ease forwards;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .js-load-more-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .pagination-nav .page-numbers {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        min-width: 40px;
    }
    
    .pagination-nav ul {
        gap: 0.25rem;
    }
    
    .no-posts-found {
        padding: 3rem 1rem;
    }
    
    .no-posts-icon {
        font-size: 3rem;
    }
}

/* No-JS fallback */
.no-js .js-hidden-post {
    display: block !important;
}

.no-js .js-load-more-container {
    display: none;
}

/* ==========================================================================
   COLLECTION FILTERS
   Shared by blueprint and question archive pages.
   Horizontal scrollable row of category filter buttons.
   ========================================================================== */

.collection-filters {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* Hide scrollbar for WebKit browsers whilst maintaining scroll functionality */
.collection-filters::-webkit-scrollbar {
    height: 4px;
}

.collection-filters::-webkit-scrollbar-track {
    background: transparent;
}

.collection-filters::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.collection-filters::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Individual filter button */
.filter-btn {
    flex-shrink: 0;
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-medium);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.filter-btn:hover {
    background-color: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-weight: var(--font-weight-bold);
}

.filter-btn.active:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(214, 92, 69, 0.3);
}

.filter-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

[data-theme="dark"] .filter-btn {
    background-color: var(--card-bg);
}

[data-theme="dark"] .filter-btn:hover {
    background-color: var(--bg-secondary);
}

@media (max-width: 768px) {
    .collection-filters {
        padding: 1rem 0;
        margin-bottom: 1rem;
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }
}

@media (prefers-contrast: high) {
    .filter-btn {
        border-width: 2px;
        font-weight: var(--font-weight-bold);
    }

    .filter-btn.active {
        border-width: 3px;
    }
}

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

    .filter-btn:hover {
        transform: none;
    }
}

/* ==========================================================================
   PAGE NAVIGATION — NEXT PAGE LINK
   Shared by single-guidance.php and single-blueprint.php.
   Card-style link to the next page in a hierarchical content sequence.
   ========================================================================== */

.page-navigation {
    margin: 3rem 0;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.next-page-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: all var(--transition);
    gap: 1rem;
}

.next-page-link:hover,
.next-page-link:focus {
    background: var(--bg-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Small uppercase label e.g. "Next page" or "Next section" */
.next-page-label {
    display: block;
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Title of the destination page */
.next-page-title {
    display: block;
    font-size: 1.125rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-color);
    line-height: 1.4;
    flex: 1;
}

.next-page-link:hover .next-page-title {
    color: var(--primary-color);
}

/* Forward arrow */
.next-page-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
    transition: transform var(--transition);
}

.next-page-link:hover .next-page-arrow {
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .page-navigation {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    .next-page-link {
        padding: 1.25rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .next-page-title {
        font-size: 1rem;
    }

    .next-page-arrow {
        align-self: flex-end;
        margin-top: 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .next-page-link,
    .next-page-arrow {
        transition: none;
    }

    .next-page-link:hover {
        transform: none;
    }

    .next-page-link:hover .next-page-arrow {
        transform: none;
    }
}