/* Post-specific styles */

.post-content {
    max-width: 750px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Post Header - Centered */
.post-header {
    text-align: center;
    margin-bottom: 2rem;
}

.post-content h1 {
    font-size: 2.4rem;
    color: #1a1a2e;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.post-authors {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.post-meta {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.tag {
    background: #f7fafc;
    color: #4a5568;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    border: 1px solid #e2e8f0;
}

/* Report Tabs - Minimal & Chic */
.report-tabs {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.report-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    background: none;
    color: #4a5568;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1.5px solid transparent;
    padding-bottom: 2px;
}

.report-tab:hover {
    color: #1a1a2e;
    border-bottom-color: #1a1a2e;
}

.tab-arrow {
    font-size: 0.75rem;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.report-tab:hover .tab-arrow {
    opacity: 1;
    transform: translate(1px, -1px);
}

.tab-label {
    white-space: nowrap;
}

/* Section styling */
.post-content section {
    margin-bottom: 3rem;
}

.post-content h2 {
    font-size: 1.6rem;
    color: #2c3e50;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

.post-content h3 {
    font-size: 1.3rem;
    color: #34495e;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.post-content h4 {
    font-size: 1.1rem;
    color: #555;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* Special boxes */
.tldr-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 10px;
    margin: 2rem 0;
}

.tldr-box h2 {
    color: white;
    border: none;
    margin-top: 0;
    font-size: 1.3rem;
}

.tldr-box p {
    margin-bottom: 0;
}

.tldr-box strong {
    color: #ffd700;
}

.example-box {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.example-box h4 {
    color: #3498db;
    margin-top: 0;
}

.key-question {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-size: 1.1rem;
}

.takeaway-box {
    background: #d4edda;
    border: 1px solid #28a745;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.takeaway-box strong {
    color: #155724;
}

.theorem-box {
    background: #e7e9fd;
    border: 2px solid #5c6bc0;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-style: italic;
}

/* Custom colored boxes */
.box-red {
    background: #ffebee;
    border-left: 4px solid #e53935;
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.box-orange {
    background: #fff3e0;
    border-left: 4px solid #fb8c00;
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.box-blue {
    background: #e3f2fd;
    border-left: 4px solid #1e88e5;
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.box-purple {
    background: #f3e5f5;
    border-left: 4px solid #8e24aa;
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.box-gray {
    background: #f5f5f5;
    border-left: 4px solid #757575;
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

/* Collapsible prompt details */
.prompt-details {
    margin-top: 1rem;
}

.prompt-details summary {
    cursor: pointer;
    color: #1976d2;
    font-weight: 500;
    padding: 0.5rem 0;
    user-select: none;
}

.prompt-details summary:hover {
    color: #1565c0;
    text-decoration: underline;
}

.prompt-details[open] summary {
    margin-bottom: 0.75rem;
}

.prompt-content {
    margin-top: 0.5rem;
}

.prompt-box {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.prompt-box h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.prompt-box p {
    margin: 0.5rem 0;
}

.prompt-box pre {
    background: #263238;
    color: #aed581;
    padding: 0.75rem;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.8rem;
    margin: 0.5rem 0;
}

.prompt-box ol, .prompt-box ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.prompt-box li {
    margin-bottom: 0.25rem;
}

/* GPT-5 prompt styles - red shades */
.system-prompt {
    background: #ffebee;
    border: 1px solid #ef9a9a;
}

.user-prompt {
    background: #ffcdd2;
    border: 1px solid #e57373;
}

/* CWM prompt styles - gray shades */
.cwm-input-prompt {
    background: #f5f5f5;
    border: 1px solid #bdbdbd;
}

.cwm-output-prompt {
    background: #eeeeee;
    border: 1px solid #9e9e9e;
}

/* Definition box */
.definition-box {
    background: #fff8e1;
    border: 1px solid #ffb300;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.definition-box::before {
    content: "Definition: ";
    font-weight: bold;
    color: #ff8f00;
}

/* Side-by-side comparison boxes */
.comparison-side-by-side {
    display: flex;
    gap: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
}

.comparison-side-by-side > div {
    flex: 1;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    text-align: left;
}

.comparison-panel-left {
    background: #fff8e6;
    border: 2px solid #f5c542;
}

.comparison-panel-right {
    background: #e8f5e9;
    border: 2px solid #66bb6a;
}

.comparison-side-by-side h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.comparison-side-by-side .code-line {
    margin: 0.25rem 0;
    white-space: pre;
}

.comparison-side-by-side .comment {
    color: #888;
}

.comparison-side-by-side .correct {
    color: #2e7d32;
}

.comparison-side-by-side .hallucinated {
    color: #e65100;
    font-weight: bold;
}

.comparison-side-by-side .highlight-box {
    display: inline-block;
    border: 2px solid;
    padding: 0 4px;
    border-radius: 3px;
    margin: 0 2px;
}

.comparison-side-by-side .highlight-red {
    border-color: #e53935;
    background: #ffebee;
}

.comparison-side-by-side .highlight-green {
    border-color: #43a047;
    background: #e8f5e9;
}

@media (max-width: 768px) {
    .comparison-side-by-side {
        flex-direction: column;
    }
}

/* Code transformation figure */
.transformation-figure {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    margin: 2rem 0;
    align-items: start;
}

.transformation-panel {
    flex: 1;
    min-width: 0;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

.transformation-panel-header {
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    color: white;
    letter-spacing: 0.3px;
}

.transformation-panel-header.composition {
    background: linear-gradient(135deg, #475569, #334155);
}

.transformation-panel-header.string-manip {
    background: linear-gradient(135deg, #64748b, #475569);
}

.transformation-content {
    padding: 1.25rem;
}

.transform-block {
    margin-bottom: 0.75rem;
}

.transform-block:last-child {
    margin-bottom: 0;
}

.transform-block.original-block {
    height: 115px;
}

.transform-block.original-block .transform-code {
    height: calc(115px - 28px);
}

.transform-block.transformed-block {
    height: 145px;
}

.transform-block.transformed-block .transform-code {
    height: calc(145px - 28px);
}

.transform-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.transform-label.original {
    background: #f1f5f9;
    color: #475569;
}

.transform-label.transformed {
    background: #fef3c7;
    color: #92400e;
}

.transform-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
}

.transform-code .keyword {
    color: #c792ea;
}

.transform-code .function {
    color: #82aaff;
}

.transform-code .string {
    color: #c3e88d;
}

.transform-code .number {
    color: #f78c6c;
}

.transform-code .variable {
    color: #ffcb6b;
}

.transform-code .temp-var {
    color: #ff5370;
    font-weight: bold;
}

.transform-code .comment {
    color: #546e7a;
    font-style: italic;
}

.transform-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem 0;
    color: #94a3b8;
}

.transform-arrow svg {
    width: 20px;
    height: 20px;
}

.transform-insight {
    background: #f8fafc;
    border-left: 3px solid #94a3b8;
    padding: 0.6rem 0.9rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .transformation-figure {
        flex-direction: column;
    }
}

/* Tokenization Discontinuity Figure */
.tokenization-figure {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.tokenization-figure-title {
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.tokenization-row {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.tokenization-row:last-child {
    margin-bottom: 0;
}

.tokenization-label {
    width: 110px;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
}

.tokenization-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.state-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    color: #334155;
}

.state-box .highlight-char {
    color: #dc2626;
    font-weight: 600;
}

.token {
    display: inline-block;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid;
}

.token.blue {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

.token.orange {
    background: #fed7aa;
    border-color: #fdba74;
    color: #9a3412;
}

.token.green {
    background: #bbf7d0;
    border-color: #86efac;
    color: #166534;
}

.token-count {
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.token-count.blue {
    background: #dbeafe;
    color: #1e40af;
}

.token-count.orange {
    background: #fed7aa;
    color: #9a3412;
}

.token-count.green {
    background: #bbf7d0;
    color: #166534;
}

.edit-marker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    padding-left: 110px;
}

.edit-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.edit-text {
    font-size: 0.8rem;
    color: #475569;
}

.edit-text code {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

.tokenization-arrow {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0;
    color: #94a3b8;
}

.tokenization-arrow svg {
    width: 20px;
    height: 20px;
    transform: rotate(90deg);
}

.summary-box {
    background: #f0f7ff;
    border: 2px solid #2196f3;
    padding: 1.5rem 2rem;
    border-radius: 10px;
    margin: 2rem 0;
}

.recommendations {
    background: #fff8e1;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.recommendations h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

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

.recommendations li {
    margin-bottom: 0.75rem;
}

/* Code examples */
.code-example {
    background: #1e1e1e;
    border-radius: 8px;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.code-example pre {
    margin: 0;
    padding: 1rem 1.5rem;
}

.code-example code {
    color: #d4d4d4;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Notation box for definitions */
.notation-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-left: 4px solid #6366f1;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notation-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 1rem;
}

.notation-term {
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.notation-term.action {
    background: #dbeafe;
    color: #1e40af;
}

.notation-term.state {
    background: #fef3c7;
    color: #92400e;
}

.notation-equals {
    color: #64748b;
    font-weight: 500;
}

.notation-definition {
    color: #475569;
    font-style: italic;
}

/* Tables - Simple & Clean */
.comparison-table {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    font-size: 0.95rem;
}

.comparison-table th {
    background: transparent;
    color: #1a1a2e;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #1a1a2e;
}

.comparison-table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
}

.comparison-table tr:last-child td {
    border-bottom: 1px solid #e2e8f0;
}

.comparison-table tr:hover {
    background: #f7fafc;
}

/* Figure placeholder */
.figure-placeholder {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    padding: 3rem 2rem;
    text-align: center;
    color: #888;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-style: italic;
}

/* Figure container for actual images/PDFs */
/* CSS Counter for automatic figure numbering */

.figure-container {
    margin: 1.5rem 0;
    text-align: center;
}

.figure-container img,
.figure-container embed,
.figure-container object {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.figure-caption {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.75rem;
    font-style: italic;
}

/* References */
.references-list {
    padding-left: 1.5rem;
}

.references-list li {
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.references-list li em {
    font-style: italic;
}

.references-list li a {
    color: #3498db;
}

/* Citation */
.citation-box {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.citation-box pre {
    margin: 0;
    padding: 1rem;
    font-size: 0.85rem;
    overflow-x: auto;
}

/* Lists */
.post-content ul, .post-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

/* Links in content */
.post-content a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.post-content a:hover {
    border-bottom-color: #3498db;
}

/* Resources section */
#resources ul {
    list-style: none;
    padding: 0;
}

#resources li {
    padding: 0.5rem 0;
}

#resources a {
    font-size: 1.05rem;
}

/* Responsive */
@media (max-width: 768px) {
    .post-content h1 {
        font-size: 1.8rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tldr-box {
        padding: 1rem 1.25rem;
    }
}
