/*
Theme Name: Linqin Blog
Theme URI: https://linqin.ai/blog
Author: Linqin
Author URI: https://linqin.ai
Description: Official Linqin.ai blog theme — matches the linqin.ai marketing site design.
Version: 1.0.0
License: Proprietary
Text Domain: linqin-blog
*/

/* ===== CSS Custom Properties ===== */
:root {
    --color-primary: #FF6B35;
    --color-primary-light: #FF7B4A;
    --color-primary-pale: #F08C7C;
    --color-navy: #1a1a2e;
    --color-navy-light: #2d2d5e;
    --color-bg: #FFF9F5;
    --color-bg-alt: #F8FAFC;
    --color-text: #1a1a2e;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;
    --color-border: rgba(0, 0, 0, 0.05);
    --color-card-border: rgba(0, 0, 0, 0.04);
    --font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    --radius-card: 24px;
    --radius-pill: 999px;
    --radius-btn: 14px;
    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.03);
    --shadow-card-hover: 0 24px 56px rgba(0, 0, 0, 0.08);
    --transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--color-bg);
    font-family: var(--font-family);
    color: var(--color-text);
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== Navigation ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 16px 24px;
    transition: padding 0.3s;
}

.site-header.scrolled {
    padding: 8px 24px;
}

.nav-container {
    max-width: 1152px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 8px 8px 8px 16px;
}

.nav-logo img {
    height: 36px;
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: var(--radius-pill);
}

.nav-link:hover {
    color: var(--color-navy);
}

.nav-link.active {
    background: var(--color-navy);
    color: #fff;
}

.btn-cta-nav {
    background: var(--color-navy);
    color: white;
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-cta-nav:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 20px rgba(26, 26, 46, 0.2);
}

.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

/* ===== Hero ===== */
.blog-hero {
    padding: 140px 24px 60px;
    background: linear-gradient(180deg, #FFF9F5 0%, #FFE8D6 50%, #FFF0E8 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 40px;
    right: 40px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(140px);
    background: rgba(255, 180, 130, 0.2);
    pointer-events: none;
}

.blog-hero .section-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    margin-bottom: 16px;
    background: rgba(255, 107, 53, 0.08);
    color: var(--color-primary);
}

.blog-hero h1 {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--color-navy);
}

.blog-hero h1 span {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light), var(--color-primary-pale));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-hero p {
    font-size: 18px;
    color: var(--color-text-secondary);
    font-weight: 500;
    max-width: 560px;
    margin: 0 auto;
}

/* ===== Post Grid ===== */
.posts-container {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: -40px;
    position: relative;
    z-index: 2;
}

.post-card {
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-card-hover);
}

.post-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.post-card-image-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #FFE8D6, #FFF0E8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-card-image-placeholder i {
    font-size: 32px;
    color: var(--color-primary);
    opacity: 0.3;
}

.post-card-body {
    padding: 28px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.post-card-category {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 107, 53, 0.08);
    color: var(--color-primary);
}

.post-card-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-navy);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-title a {
    color: inherit;
}

.post-card-title a:hover {
    color: var(--color-primary);
}

.post-card-excerpt {
    font-size: 14px;
    color: var(--color-text-secondary);
    font-weight: 500;
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.post-card-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-navy);
}

.post-card-author img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.post-card-read-more {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s;
}

.post-card-read-more:hover {
    gap: 8px;
}

/* Featured (first) post */
.post-card.featured {
    grid-column: 1 / -1;
}

.post-card.featured .post-card-image {
    height: 340px;
}

.post-card.featured .post-card-title {
    font-size: 28px;
}

/* ===== Single Post ===== */
.single-header {
    padding: 140px 24px 40px;
    background: linear-gradient(180deg, #FFF9F5 0%, #FFE8D6 50%, #FFF0E8 100%);
    text-align: center;
}

.single-header .post-category {
    margin-bottom: 16px;
}

.single-header h1 {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    line-height: 1.15;
    color: var(--color-navy);
    max-width: 780px;
    margin: 0 auto 20px;
}

.single-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.single-meta .author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.single-meta .author-info img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.single-meta .divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #cbd5e1;
}

.single-featured-image {
    max-width: 860px;
    margin: -20px auto 0;
    position: relative;
    z-index: 2;
    padding: 0 24px;
}

.single-featured-image img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
}

/* Article Body */
.article-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.article-body {
    font-size: 17px;
    line-height: 1.85;
    color: #334155;
    font-weight: 400;
}

.article-body h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-navy);
    margin: 48px 0 16px;
    line-height: 1.3;
}

.article-body h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-navy);
    margin: 36px 0 12px;
    line-height: 1.3;
}

.article-body h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-navy);
    margin: 28px 0 10px;
}

.article-body p {
    margin-bottom: 20px;
}

.article-body a {
    color: var(--color-primary);
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 107, 53, 0.3);
}

.article-body a:hover {
    border-bottom-color: var(--color-primary);
}

.article-body strong {
    color: var(--color-navy);
    font-weight: 700;
}

.article-body blockquote {
    margin: 32px 0;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(255, 249, 245, 0.9), rgba(255, 232, 214, 0.6));
    border-left: 4px solid var(--color-primary);
    border-radius: 0 16px 16px 0;
    font-style: italic;
    color: #475569;
    font-size: 18px;
}

.article-body ul,
.article-body ol {
    margin: 16px 0 20px 24px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body img {
    border-radius: 16px;
    margin: 32px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.article-body pre {
    background: var(--color-navy);
    color: #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin: 28px 0;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.7;
}

.article-body code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.9em;
    color: var(--color-primary);
}

.article-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.article-body hr {
    border: none;
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 40px 0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.article-body th {
    background: var(--color-bg-alt);
    font-weight: 700;
    text-align: left;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--color-navy);
}

.article-body td {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    font-size: 15px;
}

/* Author Box */
.author-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-card);
    padding: 32px;
    margin: 48px 0;
    box-shadow: var(--shadow-card);
}

.author-box img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-box h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 4px;
}

.author-box p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Related Posts */
.related-posts {
    padding: 60px 24px 80px;
    background: var(--color-bg-alt);
}

.related-posts h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    color: var(--color-navy);
    margin-bottom: 40px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1152px;
    margin: 0 auto;
}

/* CTA Banner */
.blog-cta-banner {
    text-align: center;
    padding: 80px 24px;
}

.blog-cta-banner h2 {
    font-size: clamp(24px, 4vw, 44px);
    font-weight: 800;
    color: var(--color-navy);
    margin-bottom: 20px;
    line-height: 1.15;
}

.blog-cta-banner .btn-cta {
    display: inline-block;
    background: var(--color-navy);
    color: white;
    padding: 16px 40px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 16px;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(26, 26, 46, 0.15);
}

.blog-cta-banner .btn-cta:hover {
    background: var(--color-navy-light);
    box-shadow: 0 8px 30px rgba(26, 26, 46, 0.25);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.pagination a {
    background: #fff;
    color: var(--color-navy);
    border: 1px solid #e2e8f0;
}

.pagination a:hover {
    background: var(--color-navy);
    color: #fff;
    border-color: var(--color-navy);
}

.pagination .current {
    background: var(--color-navy);
    color: #fff;
}

/* ===== Sidebar ===== */
.sidebar-widget {
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-card);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.sidebar-widget h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-cta {
    background: var(--color-navy);
    border-radius: var(--radius-card);
    padding: 32px;
    text-align: center;
    color: #fff;
    margin-bottom: 24px;
}

.sidebar-cta h3 {
    color: #fff;
    border: none;
    padding: 0;
    margin-bottom: 8px;
    font-size: 20px;
}

.sidebar-cta p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 20px;
}

.sidebar-cta .btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 12px 28px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s;
}

.sidebar-cta .btn:hover {
    transform: scale(1.03);
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-family: var(--font-family);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-form input[type="search"]:focus {
    border-color: var(--color-primary);
}

.search-form button {
    background: var(--color-navy);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

/* ===== Comments ===== */
.comments-area {
    margin-top: 48px;
}

.comments-area h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-navy);
    margin-bottom: 24px;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment-list .comment {
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-author img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.comment-author .fn {
    font-weight: 700;
    color: var(--color-navy);
}

.comment-content p {
    font-size: 15px;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.comment-reply-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 8px;
    display: inline-block;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-family: var(--font-family);
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--color-primary);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form .submit {
    background: var(--color-navy);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-family);
}

.comment-form .submit:hover {
    background: var(--color-navy-light);
}

/* ===== 404 ===== */
.error-404 {
    text-align: center;
    padding: 180px 24px 100px;
    background: linear-gradient(180deg, #FFF9F5 0%, #FFE8D6 50%, #FFF0E8 100%);
}

.error-404 h1 {
    font-size: 120px;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-pale));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.error-404 h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-navy);
    margin: 16px 0 12px;
}

.error-404 p {
    color: var(--color-text-secondary);
    font-size: 16px;
    margin-bottom: 32px;
}

.error-404 .btn-back {
    display: inline-block;
    background: var(--color-navy);
    color: #fff;
    padding: 14px 36px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    transition: all 0.2s;
}

/* ===== Footer ===== */
.site-footer {
    padding: 40px 24px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
}

.footer-inner {
    max-width: 1152px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links {
    display: flex;
    gap: 32px;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--color-navy);
}

/* ===== Mobile Menu ===== */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    padding: 96px 32px 32px;
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu-close {
    position: absolute;
    top: 32px;
    right: 40px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.mobile-menu nav a {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-navy);
    transition: color 0.2s;
}

.mobile-menu nav a:hover {
    color: var(--color-primary);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.anim-fade {
    animation: fadeInUp 0.7s ease-out both;
}

.anim-delay-1 {
    animation-delay: 0.1s;
}

.anim-delay-2 {
    animation-delay: 0.2s;
}

.anim-delay-3 {
    animation-delay: 0.35s;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {

    .nav-links,
    .btn-cta-nav-desktop {
        display: none !important;
    }

    .nav-hamburger {
        display: block;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-card.featured .post-card-image {
        height: 240px;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1025px) {
    .mobile-menu {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .site-header {
        padding: 12px 16px;
    }

    .blog-hero {
        padding: 120px 16px 40px;
    }

    .blog-hero h1 {
        font-size: 28px;
    }

    .single-header h1 {
        font-size: 24px;
    }

    .article-body {
        font-size: 16px;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== WordPress Core Alignment ===== */
.alignleft {
    float: left;
    margin-right: 24px;
    margin-bottom: 16px;
}

.alignright {
    float: right;
    margin-left: 24px;
    margin-bottom: 16px;
}

.aligncenter {
    display: block;
    margin: 24px auto;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 13px;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 8px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 24px 0;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}