/* Tag filter buttons */
.tag-filters {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem 0;
    flex-wrap: wrap;
}

.tag-filter {
    padding: 0.3rem 0.75rem;
    background: transparent;
    border: none;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #999;
    text-decoration: none;
}

.tag-filter:hover {
    color: var(--primary-color);
}

.tag-filter.active {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Post tags */
.post-tags {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.post-tags .tag {
    font-size: 0.8rem;
    padding: 0;
    background: transparent;
    border: none;
    color: #999;
    cursor: default;
    transition: color 0.2s ease;
    pointer-events: none;
}

.post-tags .tag::before {
    content: '#';
    color: #ccc;
    margin-right: 0.1rem;
    transition: color 0.2s ease;
}

.post-tags .tag.highlighted {
    color: var(--primary-color);
    font-weight: 500;
}

.post-tags .tag.highlighted::before {
    color: var(--primary-color);
}

/* No hover effects on tags */
.post-tags .tag:hover {
    background: transparent;
    color: inherit;
}

/* Empty state message */
.empty-state-message {
    padding: 2rem 0;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

/* Blog index styles */
.blog-posts {
    margin-top: 2rem;
}

.blog-post-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
    gap: 1.5rem;
}

.blog-post-item .post-date {
    font-size: 0.9rem;
    color: #666;
    min-width: 110px;
    flex-shrink: 0;
    padding-top: 0.15rem;
    line-height: 1.5;
}

.blog-post-item .post-content {
    flex-grow: 1;
    min-width: 0;
}

.blog-post-item h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: normal;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    line-height: 1.4;
}

.blog-post-item h3 a {
    color: var(--primary-color, #4a4a4a);
    text-decoration: none;
}

.blog-post-item h3 a:hover {
    text-decoration: underline;
}

.blog-post-item .post-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

.post-date {
    color: #666;
    font-size: 0.875rem;
}

.blog-analysis-section {
    margin: 2rem 0;
}

.blog-analysis-section .toggle-analysis {
    display: inline;
}


/* Override main site header styling for blog pages */
body #header-placeholder header,
body header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 2rem !important;
    padding-bottom: 1rem !important;
    border-bottom: 1px solid #eee !important;
}

/* Reduce footer spacing for blog posts */
.blog-post + .footer {
    margin: 2rem auto 1rem !important;
}

/* Lighter color for footer links */
.footer a,
footer a {
    color: #888;
    text-decoration: underline;
    transition: color 0.2s;
}

.footer a:hover,
footer a:hover {
    color: var(--primary-color);
}

.filter-container {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    position: relative;
}

.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    background: transparent;
    border: none;
    transition: all 0.2s ease;
    opacity: 0.7;
    color: var(--primary-color);
}

.filter-toggle:hover {
    opacity: 1;
    background: #f5f5f5;
}

.filter-toggle svg {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

.tag-container {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    opacity: 0.9;
    display: none;
    padding: 0.8rem;
    border-radius: 8px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 1;
    min-width: 200px;
}

.tag-container.visible {
    display: flex;
}

.tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    color: var(--primary-color);
}

.tag:hover {
    background: #f0f0f0;
    border-color: #d0c0ff;
}

.tag.active {
    background: #f5f0ff;
    color: var(--primary-color);
    border-color: #d0c0ff;
    font-weight: 500;
}

.post-tags {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    opacity: 0.8;
}

.post-tag {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    color: var(--primary-color);
}

.blog-post.hidden {
    display: none;
}

@media (max-width: 768px) {
    .blog-analysis-section .toggle-analysis {
        display: none;
    }

    .blog-analysis-section .analysis-section {
        display: none !important;
    }
}

.date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 2rem;
}

.blog-post {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    line-height: 1.65;
    color: var(--primary-color);
    background: var(--background-color);
}

.blog-post .intro {
    display: block;
    margin-bottom: 3rem;
    margin-top: 0;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.blog-post .intro h1 {
    font-size: 2rem;
    color: var(--primary-color, #4a4a4a);
    margin: 0 0 0.5rem 0;
}

.blog-post .intro .post-tags {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.blog-post .intro .date {
    font-size: 0.9rem;
    color: #999;
    margin: 0;
}

.blog-post .intro .desc {
    font-size: 1rem;
    color: #666;
    line-height: 1.5;
    margin: 0.5rem 0 0 0;
}

.blog-post h1 {
    font-size: 2rem;
    color: var(--primary-color, #4a4a4a);
}

.blog-post-date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 2rem;
}

.blog-post h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-post a {
    color: var(--primary-color);
    text-decoration: underline;
}

.blog-post a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Code block styling */
.blog-post pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.blog-post pre code {
    background: transparent;
    padding: 0;
    border: none;
    font-size: inherit;
    color: #333;
}

.blog-post code {
    background: #f1f3f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.85em;
    color: #d73a49;
}

/* Blog post list styling - match main site style */
.blog-post ul {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-left: 2rem;
}

.blog-post ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.blog-post ul li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: #4a4a4a;
}

.blog-post ol {
    padding-left: 2rem;
    margin: 1rem 0;
}

.blog-post ol li {
    padding: 0.5rem 0;
    line-height: 1.65;
}

/* Ensure all text elements have proper fonts */
.blog-post p {
    line-height: 1.65;
    color: var(--primary-color);
}

.example-box {
    background-color: #f5f5f5;
    border-left: 3px solid #4a4a4a;
    border-radius: 0;
    padding: 1.5rem;
    margin: 2rem 0;
    color: #4a4a4a;
}

.example-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-left: 2rem;
}

.example-box ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.example-box ul li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: #4a4a4a;
}

.example-box ol {
    padding-left: 2rem;
    margin: 1rem 0;
}

.example-box ol li {
    padding: 0.5rem 0;
    line-height: 1.65;
}

.example-box-title {
    display: block;
    margin-bottom: 1rem;
    color: #4a4a4a;
    font-weight: 600;
    font-size: 1rem;
}

.example-box-prompt {
    margin: 10px 0;
}

.code {
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
}

.example-box-completion {
    margin: 10px 0;
}

.example-box-description {
    color: #666;
    font-size: 0.8em;
}

.image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.image-grid figure {
    margin: 0;
    text-align: center;
}

.image-grid img {
    max-height: 400px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-grid figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}


/* Footnote styling */
.footnotes {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    font-size: 0.85rem;
    color: #666;
}

.footnotes hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 1rem 0;
}

.footnotes ol {
    padding-left: 1.5rem;
    margin: 0;
}

.footnotes li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.footnotes .footnote-backref {
    text-decoration: none;
    color: #999;
    font-size: 0.8em;
    margin-left: 0.3rem;
}

.footnotes .footnote-backref:hover {
    color: var(--primary-color);
}

/* Inline footnote references */
sup a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.8em;
}

sup a:hover {
    text-decoration: underline;
}

/* Footnote tooltip on hover */
.footnote-tooltip {
    position: fixed;
    max-width: 400px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #666;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.footnote-tooltip.visible {
    opacity: 1;
}

.footnote-tooltip a {
    color: var(--primary-color);
    text-decoration: underline;
}

.footnote-tooltip a:hover {
    color: var(--primary-color);
}

/* Hover effect on footnote reference */
sup a {
    transition: background 0.2s ease;
    padding: 0 2px;
    margin: 0 -2px;
    border-radius: 3px;
}

sup a:hover {
    background: #faf9f6;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .image-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .footnotes {
        font-size: 0.8rem;
    }
}

/* For theorem, lemma, etc. */
.env-box {
    margin: 1.5rem 0;
    padding: 0;
    border: none;
    background: transparent;
}

.env-box-title {
    margin-bottom: 0.5rem;
}

.env-box-title strong {
    font-weight: bold;
}

.env-box-title em {
    font-style: italic;
}

.env-box-title .env-title {
    font-weight: normal;
}

.proof-box-content::after {
    content: "";
    display: table;
    clear: both;
}

.qed-box {
    float: right;
    width: 0.7em;
    height: 0.7em;
    border: 1px solid var(--primary-color);
    margin-left: 1em; /* Space from text */
    margin-bottom: 0.2em; /* Align with bottom of text */
}

/* Collapsible Proofs */
.proof-box summary {
    display: inline-block;
    list-style: none; /* Hide marker in Firefox */
}

.proof-box summary::-webkit-details-marker {
    display: none; /* Hide marker in Chrome/Safari */
}

.proof-box .proof-toggle-text {
    font-style: normal;
    font-weight: normal;
    color: #999;
    font-size: 0.9em;
}
