/* ==========================================
   Jinyu Blog Styles — standalone, no Tailwind dependency
   ========================================== */

/* --- Archive Grid --- */
.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 0;
    padding: 0;
}
@media (min-width: 640px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .blog-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- Post Card --- */
.blog-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.blog-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.blog-card-thumb {
    display: block;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
}
.blog-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.blog-card:hover .blog-card-thumb img {
    transform: scale(1.05);
}
.blog-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.blog-card-cat {
    display: inline-block;
    padding: 2px 10px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
    width: fit-content;
    text-decoration: none;
}
.blog-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
    margin: 0 0 0.5rem;
    text-decoration: none;
}
.blog-card-title a {
    color: inherit;
    text-decoration: none;
}
.blog-card-title a:hover { color: #2563eb; }
.blog-card-excerpt {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #6b7280;
    margin: 0 0 1rem;
    flex: 1;
}
.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.75rem;
    color: #9ca3af;
}
.blog-card-footer a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}
.blog-card-footer a:hover { text-decoration: underline; }

/* --- Single Post --- */
.single-post-header {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.single-post-cats { margin-bottom: 1rem; }
.single-post-cats a {
    display: inline-block;
    padding: 2px 12px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 9999px;
    text-decoration: none;
    margin: 0 0.25rem;
}
.single-post-cats a:hover { background: #2563eb; color: #fff; }
.single-post-header h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.25;
    color: #111827;
    margin: 0 0 0.75rem;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 768px) {
    .single-post-header h1 { font-size: 2.5rem; }
}
.single-post-meta {
    font-size: 0.875rem;
    color: #9ca3af;
}
.single-post-meta span { margin: 0 0.5rem; }
.single-post-featured {
    max-width: 800px;
    margin: 2rem auto 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.single-post-featured img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Article Content (prose) --- */
.single-post-content {
    max-width: 720px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}
.single-post-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    color: #111827;
    margin: 2.5rem 0 1rem;
}
.single-post-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin: 2rem 0 0.75rem;
}
.single-post-content h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
}
.single-post-content p {
    margin: 0 0 1.25rem;
    line-height: 1.75;
    color: #374151;
    font-size: 1rem;
}
.single-post-content ul,
.single-post-content ol {
    margin: 0 0 1.25rem 1.5rem;
    line-height: 1.75;
    color: #374151;
}
.single-post-content ul { list-style-type: disc; }
.single-post-content ol { list-style-type: decimal; }
.single-post-content li { margin-bottom: 0.5rem; }
.single-post-content blockquote {
    border-left: 4px solid #2563eb;
    padding: 0.25rem 0 0.25rem 1.5rem;
    margin: 1.5rem 0;
    color: #6b7280;
    font-style: italic;
    background: #f9fafb;
    border-radius: 0 8px 8px 0;
}
.single-post-content a {
    color: #2563eb;
    text-decoration: underline;
}
.single-post-content a:hover { color: #1d4ed8; }
.single-post-content strong { font-weight: 700; color: #111827; }
.single-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
}
.single-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}
.single-post-content th,
.single-post-content td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    text-align: left;
}
.single-post-content th {
    background: #f9fafb;
    font-weight: 600;
}

/* --- Related Posts --- */
.related-posts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}
.related-posts h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 640px) {
    .related-grid { grid-template-columns: repeat(3, 1fr); }
}
.related-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s;
}
.related-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.related-card-thumb {
    height: 120px;
    overflow: hidden;
    background: #f3f4f6;
}
.related-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.related-card-body {
    padding: 1rem;
}
.related-card-body h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    line-height: 1.35;
}
.related-card-body p {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
}

/* --- Post Nav (prev/next) --- */
.post-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    gap: 1rem;
}
.post-nav a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
}
.post-nav a:hover { text-decoration: underline; }
.post-nav-label {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.25rem;
    font-weight: 400;
}

/* --- Pagination --- */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}
.blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
}
.blog-pagination .page-numbers:hover { background: #f9fafb; }
.blog-pagination .page-numbers.current {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* --- Tags --- */
.post-tags {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}
.post-tags-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-right: 0.5rem;
}
.post-tags a {
    display: inline-block;
    padding: 2px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 0.8125rem;
    color: #6b7280;
    text-decoration: none;
    margin: 0.25rem;
}
.post-tags a:hover { border-color: #2563eb; color: #2563eb; }

/* --- Search Form --- */
.blog-search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
}
.blog-search-form input[type="search"] {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
}
.blog-search-form button {
    padding: 0.625rem 1.25rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

/* --- Empty State --- */
.blog-empty {
    text-align: center;
    padding: 4rem 1.5rem;
}
.blog-empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.blog-empty h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.blog-empty p { color: #6b7280; }
.blog-empty a { color: #2563eb; text-decoration: underline; }
