/* Post Page Styles */

.post-container {
    max-width: min(95%, 1600px);
    margin: 0 auto;
    padding: 2rem;
    padding-top: 40px;
    box-sizing: border-box;
}

.post-header {
    margin-bottom: 1.25rem;
}

.post-cover-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.post-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 34px;
    font-weight: 500;
    margin-bottom: 0.375rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
    overflow-wrap: break-word;
    word-break: break-word;
    color: #e2e2e1;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    color: #585857;
    font-size: 11px;
}

.post-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #585857;
    cursor: default;
    border-bottom: 1px dotted #8a8a89;
    text-decoration: none;
    position: relative;
    border-bottom-color: #666;
}

.post-date::after {
    content: attr(data-full-date);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    background: #f5f5f5;
    color: #333;
}

.post-date::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 2px;
    border: 5px solid transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    border-top-color: #f5f5f5;
}

.post-date:hover::after,
.post-date:hover::before {
    opacity: 1;
}

.post-tag {
    font-family: 'JetBrains Mono', monospace;
    color: #585857;
    font-size: 11px;
}

.post-content {
    line-height: 1.7;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 400;
    overflow-wrap: break-word;
    word-break: break-word;
    color: #d4d4d3;
}

.post-content h1 {
    margin-top: 2.25rem;
    margin-bottom: 0.625rem;
    color: #1a1a1a;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
}

.post-content h2 {
    margin-top: 2.25rem;
    margin-bottom: 0.625rem;
    color: #1a1a1a;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
}

.post-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.post-content p {
    margin-bottom: 0.875rem;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1rem;
    padding-left: 20px;
}

.post-content li {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.post-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: text-decoration-color 0.15s;
    text-decoration-color: #262624;
    color: rgb(163, 163, 163);
}

.post-content a:hover {
    text-decoration-color: #8a8a89;
}

.post-content strong {
    font-weight: 600;
    color: #e2e2e1;
}

.post-content code {
    border: 1px solid #e6e6e3;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: #141414;
    border-color: #1e1e1c;
    color: #b8b8b7;
}

.post-content pre {
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    background: #2a2a2a;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: rgb(163, 163, 163);
}

.post-content blockquote {
    border-left: 3px solid #e5e5e5;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    border-left-color: #404040;
    color: rgb(163, 163, 163);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1.5rem 0;
}

.post-content hr {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 2rem 0;
    border-top-color: #404040;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgb(115, 115, 115);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color 0.2s;
    font-size: clamp(0.75rem, 1.2vw + 0.4rem, 0.9rem);
}

.back-link:hover {
    color: var(--main-text-color);
}

.loading {
    text-align: center;
    padding: 3rem;
    color: rgb(115, 115, 115);
}

.error {
    text-align: center;
    padding: 3rem;
}

.error h2 {
    color: #d32f2f;
    margin-bottom: 1rem;
}

.error p {
    color: rgb(115, 115, 115);
}

.post-date, .post-tag {
    color: #585857;
}

.post-content h1, .post-content h2, .post-content h3 {
    color: #e2e2e1;
}

/* Search highlight styles */
.search-highlight {
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
    background-color: rgba(255, 193, 7, 0.6);
    color: #fff;
    animation: highlight-fade-out-dark 3s ease-in-out forwards;
}

@keyframes highlight-fade-out {
    0% {
        background-color: rgba(255, 235, 59, 0.7);
    }
    30% {
        background-color: rgba(255, 235, 59, 1);
    }
    60% {
        background-color: rgba(255, 235, 59, 0.7);
    }
    100% {
        background-color: rgba(255, 235, 59, 0);
    }
}

@keyframes highlight-fade-out-dark {
    0% {
        background-color: rgba(255, 193, 7, 0.6);
    }
    30% {
        background-color: rgba(255, 193, 7, 0.9);
    }
    60% {
        background-color: rgba(255, 193, 7, 0.6);
    }
    100% {
        background-color: rgba(255, 193, 7, 0);
    }
}

/* Mobile Layout */
@media (max-width: 768px) {
    .back-link {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .post-title {
        font-size: 28px;
        letter-spacing: -0.01em;
    }

    .post-meta {
        flex-direction: row;
        justify-content: space-between;
        font-size: 11px;
        gap: 0.5rem;
    }

    .post-tag {
        font-size: 11px;
    }

    .post-content {
        font-size: 14px;
        line-height: 1.7;
    }

    .post-content h1,
    .post-content h2 {
        font-size: 16px;
    }

    .post-content h3 {
        font-size: 14px;
    }

    .post-content pre {
        padding: 0.75rem;
        font-size: 0.85rem;
        border-radius: 4px;
    }

    .post-content blockquote {
        margin: 1rem 0;
        padding-left: 0.75rem;
    }

    .post-content img {
        margin: 1rem 0;
        border-radius: 4px;
    }

    .post-content ul,
    .post-content ol {
        padding-left: 1.25rem;
    }
}

/* Small phones */
@media (max-width: 375px) {
    .post-container {
        padding: 20px 16px 40px 16px;
    }

    .post-title {
        font-size: 26px;
    }

    .post-content {
        font-size: 14px;
    }
}
