/* === Blog Styles (Sleek Modern Grid) === */

.blog-hero {
    text-align: center;
    padding: 80px 24px 40px;
    max-width: 800px;
    margin: 0 auto;
}

.blog-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.blog-hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Category Navigation */
.category-nav {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    margin: 0 auto 20px;
    max-width: 1152px;
    width: calc(100% - 40px);
    position: relative;
    z-index: 2;
}

/* Center on larger screens */
@media (min-width: 1200px) {
    .category-nav {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 20px;
    }
}

.quick-nav-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.quick-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.quick-nav-link {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(231, 210, 0, 0.1);
    border: 1px solid rgba(231, 210, 0, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.quick-nav-link:hover {
    background: rgba(231, 210, 0, 0.15);
    border-color: rgba(231, 210, 0, 0.4);
    transform: translateY(-1px);
}

.quick-nav-link.active {
    background: var(--primary-yellow);
    color: #000;
    border-color: var(--primary-yellow);
    box-shadow: 0 4px 15px rgba(231, 210, 0, 0.3);
}

/* Blog Search - uses search-component.css */

@media (max-width: 768px) {
    .category-nav {
        padding: 20px;
        margin-bottom: 8px;
    }

    .quick-nav-title {
        font-size: 0.8125rem;
    }

    .quick-nav-link {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .blog-search-container {
        margin: 0 20px 20px;
    }

    .blog-search-container .search-wrapper {
        max-width: 100%;
    }
}

/* iPad Portrait - Search box half width (right side) with Centered 20px gap logic */
@media only screen and (min-width: 768px) and (max-width: 1024px) {
    .blog-search-container {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
        max-width: 1152px !important;
        width: calc(100% - 40px) !important;
        margin: 0 auto 20px !important;
    }

    .blog-search-container .search-wrapper {
        grid-column: 2;
        /* Occupy the right half */
        max-width: none !important;
        width: 100% !important;
    }
}

.blog-grid {
    max-width: 1152px;
    width: calc(100% - 40px);
    margin: 0 auto;
    padding: 0 0 80px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    position: relative;
    z-index: 2;
}

.blog-grid .search-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

@keyframes templateAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* === Sleek Card Design === */
.blog-card {
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s;
    animation: templateAppear 0.4s ease-out;
    height: 100%;
    position: relative;
}

.blog-card:hover {
    transform: translateY(-4px);
    background: rgba(97, 85, 245, 0.09);
    border-color: rgba(97, 85, 245, 0.3);
    box-shadow: var(--shadow-md);
}

.blog-card:focus-visible {
    outline: 2px solid var(--primary-yellow);
    outline-offset: 4px;
    transform: translateY(-4px);
    background: rgba(97, 85, 245, 0.09);
    border-color: rgba(97, 85, 245, 0.3);
    border-radius: 20px;
}

/* Image Wrapper */
.blog-card-image-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #111;
}

.blog-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.blog-card:hover .blog-card-image {
    transform: scale(1.05);
}

.blog-card-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}

/* Tag Style */
.blog-card-tag {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(97, 85, 245);
    border-radius: 8px;
    color: var(--primary-yellow);
    font-size: 0.7rem;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    z-index: 2;
}

/* Content Area */
.blog-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.blog-card-divider {
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.blog-card-date {
    color: var(--primary-yellow);
    font-weight: 600;
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-excerpt {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer Section */
.blog-card-footer {
    padding-top: 16px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-card-author {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.blog-card-more {
    font-size: 0.813rem;
    color: #888;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.3s;
}

.blog-card:hover .blog-card-more {
    color: #fff;
}

.blog-card-more i {
    font-size: 0.625rem;
}

/* Responsive */
@media (max-width: 768px) {
    .blog-hero {
        padding: 80px 20px 30px;
    }

    .blog-hero h1 {
        font-size: 2.25rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px 0 60px;
    }

    .blog-pagination {
        padding: 31px 20px !important;
        gap: 8px !important;
    }

    .blog-pagination>div {
        flex: 1 !important;
        width: auto !important;
    }
}

/* Pagination */
.blog-pagination {
    max-width: 1200px;
    width: calc(100% - 40px);
    margin: -20px auto 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    padding: 31px 0;

    animation: templateAppear 0.4s ease-out;
    position: relative;
    z-index: 2;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(.disabled) {
    background: rgba(231, 210, 0, 0.1);
    border-color: var(--primary-yellow);
    color: var(--primary-yellow);
    transform: translateY(-2px);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-btn:focus-visible {
    outline: 2px solid var(--primary-yellow);
    outline-offset: 4px;
    border-radius: 8px;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    white-space: nowrap;
}


/* Single Post Page */
.post-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 24px 80px;
    position: relative;
    z-index: 2;
}

.post-header {
    margin-bottom: 40px;
}

.post-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.post-back:hover {
    color: var(--primary-yellow);
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.post-meta-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.post-author a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.post-author a:hover {
    color: #fff;
    border-bottom-color: var(--primary-yellow);
}

.post-date {
    color: var(--primary-yellow);
    font-weight: 600;
}

.post-title {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.post-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.post-hero-image {
    width: 100%;
    height: auto;
    border-radius: 20px;
    margin-bottom: 50px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
}

/* Post content formatting */
.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #ccc;
    position: relative;
    z-index: 2;
}

.post-content h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #fff;
    margin-top: 48px;
    margin-bottom: 16px;
}

.post-content h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: #fff;
    margin-top: 32px;
    margin-bottom: 12px;
}

.post-content p {
    margin-bottom: 24px;
}

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

.post-content ul,
.post-content ol {
    margin: 16px 0 24px 0;
    padding-left: 24px;
}

.post-content ul {
    list-style: disc;
}

.post-content ol {
    list-style: decimal;
}

.post-content li {
    margin-bottom: 10px;
}

.post-content strong {
    color: #fff;
}

.post-content .post-image {
    width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 40px 0;
}

/* Inline code */
.post-content code {
    background: rgba(231, 210, 0, 0.1);
    border: 1px solid rgba(231, 210, 0, 0.2);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.9em;
    color: var(--primary-yellow);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* Fenced code blocks */
.post-content pre {
    background: #111111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 24px 0;
    overflow-x: auto;
    position: relative;
    z-index: 1;
}

.copy-code-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
}

.post-content pre:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-yellow);
    border-color: rgba(231, 210, 0, 0.3);
}

.copy-code-btn.copied {
    color: #4CAF50;
    border-color: rgba(76, 175, 80, 0.3);
    background: rgba(76, 175, 80, 0.1);
}

.copy-code-btn svg {
    width: 16px;
    height: 16px;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    color: #e0e0e0;
    line-height: 1.6;
}

/* Blockquotes */
.post-content blockquote {
    border-left: 4px solid var(--primary-yellow);
    background: rgba(97, 85, 245, 0.15);
    margin: 24px 0;
    padding: 16px 24px;
    border-radius: 0 12px 12px 0;
    position: relative;
    z-index: 1;
}

.post-content blockquote p {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-style: italic;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Horizontal Rule */
.post-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(97, 85, 245, 0.6), transparent);
    margin: 48px 0;
}

/* Strikethrough */
.post-content del {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 255, 255, 0.4);
}

/* Tables */
.table-responsive {
    width: 100%;
    margin: 24px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.post-content .post-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    background: transparent;
    border: none;
    margin: 0;
    overflow: hidden;
}

.post-content .post-table thead {
    background: rgba(231, 210, 0, 0.1);
}

.post-content .post-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--primary-yellow);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid rgba(231, 210, 0, 0.2);
}

.post-content .post-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1rem;
    color: #ccc;
}

.post-content .post-table tbody tr:last-child td {
    border-bottom: none;
}

.post-content .post-table tbody tr:hover {
    background: rgba(97, 85, 245, 0.09);
}

.post-content .post-table td strong {
    color: #fff;
}

/* Table responsive wrapper for mobile */
@media (max-width: 768px) {
    .post-content .post-table {
        font-size: 0.875rem;
    }

    .post-content .post-table th,
    .post-content .post-table td {
        padding: 10px 12px;
    }
}

/* Post CTA */
.post-cta {
    margin-top: 80px;
    padding: 48px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 24px;
    text-align: center;
}

.post-cta h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.post-cta p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 1.1rem;
}

/* Embedded template styles now in preview.css */

@media (max-width: 768px) {
    .post-container {
        padding: 80px 20px 40px;
    }

    .post-title {
        font-size: 2.25rem;
    }
}