/* ===== BLOG STYLES ===== */
/* Extends landing style.css — uses same variables and base styles */

/* ===== BLOG INDEX ===== */
.blog-index {
    padding-top: 120px;
    padding-bottom: 80px;
    min-height: 60vh;
}
.blog-index__header {
    text-align: center;
    margin-bottom: 48px;
}
.blog-index__title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 12px;
}
.blog-index__subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
}
.blog-index__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

/* ===== TAG FILTER BAR ===== */
.blog-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.blog-tags__btn {
    padding: 8px 20px;
    border-radius: 999px;
    border: 1.5px solid var(--gray-200, #e5e7eb);
    background: var(--white);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.blog-tags__btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}
.blog-tags__btn--active {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
}
.blog-tags__btn--active:hover {
    background: var(--blue-hover);
    border-color: var(--blue-hover);
    color: var(--white);
}
@media (max-width: 480px) {
    .blog-index { padding-top: 100px; padding-bottom: 48px; }
    .blog-index__title { font-size: 1.75rem; }
    .blog-index__grid { grid-template-columns: 1fr; gap: 16px; }
    .blog-tags { gap: 6px; }
    .blog-tags__btn { padding: 6px 14px; font-size: 0.8rem; }
}

/* ===== POST CARD ===== */
.post-card {
    display: block;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Hide cards that don't match the active tag filter */
.post-card.post-card--hidden {
    display: none;
}

.post-card__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gray-100);
}
.post-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: var(--gradient-hero);
}
.post-card__image--placeholder svg {
    width: 64px;
    height: 64px;
    opacity: 0.4;
    stroke: var(--white);
}
.post-card__body {
    padding: 20px;
}
.post-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.post-card__tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 4px;
    line-height: 1.4;
}
.post-card__tag--article {
    background: var(--blue-light, #eff6ff);
    color: var(--blue);
}
.post-card__tag--update {
    background: #ecfdf5;
    color: #059669;
}
.post-card__date {
    font-size: 0.8rem;
    color: var(--gray-500);
}
.post-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
    line-height: 1.3;
}
.post-card__desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== BLOG ARTICLE ===== */
.blog-article {
    padding-top: 100px;
    padding-bottom: 60px;
}
.blog-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.blog-breadcrumbs a {
    color: var(--blue);
    text-decoration: none;
}
.blog-breadcrumbs a:hover {
    text-decoration: underline;
}
.blog-breadcrumbs span:last-child {
    color: var(--text-secondary);
}

/* Article */
.article {
    max-width: 720px;
    margin: 0 auto;
}
.article__header {
    margin-bottom: 32px;
}
.article__hero {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 32px;
}
.article__title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.2;
    margin-bottom: 16px;
}
.article__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* Article content — markdown rendered */
.article__content {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text);
}
.article__content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-top: 40px;
    margin-bottom: 16px;
}
.article__content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-top: 32px;
    margin-bottom: 12px;
}
.article__content p {
    margin-bottom: 16px;
}
.article__content ul, .article__content ol {
    margin-bottom: 16px;
    padding-left: 24px;
    list-style: disc;
}
.article__content ol {
    list-style: decimal;
}
.article__content li {
    margin-bottom: 8px;
}
.article__content a {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.article__content a:hover {
    color: var(--blue-hover);
}
.article__content img {
    border-radius: var(--radius);
    margin: 24px 0;
    box-shadow: var(--shadow);
}
.article__content blockquote {
    border-left: 4px solid var(--blue);
    padding: 12px 20px;
    margin: 24px 0;
    background: var(--blue-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-secondary);
    font-style: italic;
}
.article__content code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.article__content pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 16px 20px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 24px 0;
}
.article__content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
}
.article__content strong {
    font-weight: 600;
}

/* Tables in article content */
.article__content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.95rem;
    overflow-x: auto;
    display: block;
}
.article__content thead {
    background: var(--gray-100);
}
.article__content th,
.article__content td {
    padding: 10px 14px;
    border: 1px solid var(--gray-200, #e5e7eb);
    text-align: left;
    white-space: normal;
}
.article__content th {
    font-weight: 600;
    color: var(--gray-900);
}
.article__content tbody tr:hover {
    background: var(--gray-50, #f9fafb);
}

/* Line numbers & copy hint for code blocks */
.article__content pre {
    position: relative;
}
.article__content pre code {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Article CTA */
.article__cta {
    max-width: 720px;
    margin: 48px auto 0;
}
.article__cta-inner {
    text-align: center;
    padding: 40px 32px;
    background: var(--gradient-hero);
    border-radius: var(--radius-lg);
    color: var(--white);
}
.article__cta-inner img {
    margin: 0 auto 16px;
    filter: brightness(10);
}
.article__cta-inner h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.article__cta-inner p {
    opacity: 0.9;
    margin-bottom: 20px;
}
.article__cta-inner .btn {
    background: var(--white);
    color: var(--blue);
}
.article__cta-inner .btn:hover {
    background: var(--gray-100);
}

/* ===== ACTIVE NAV ===== */
.header__nav--active {
    color: var(--blue) !important;
    font-weight: 600;
}

@media (max-width: 768px) {
    .article__title { font-size: 1.75rem; }
    .article__content { font-size: 1rem; }
    .article__cta-inner { padding: 32px 20px; }
}
@media (max-width: 480px) {
    .blog-article { padding-top: 80px; }
    .article__title { font-size: 1.5rem; }
}

/* ===== LANGUAGE TOGGLE (override for <a> tag) ===== */
a.lang-toggle {
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
}
