/* ==================== INNERPULSE BLOG CSS ==================== */
/* Uses CSS variables from innerpulse.css (:root)                */
/* All classes prefixed with ip- to avoid conflicts              */

/* ==================== LAYOUT ==================== */

.ip-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==================== BLOG HERO ==================== */

.ip-blog-hero {
    padding: 140px 0 48px;
    text-align: center;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
}

.ip-blog-hero__title {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 12px;
}

.ip-blog-hero__desc {
    font-size: 17px;
    color: #b4b4c7;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ==================== BLOG GRID ==================== */

.ip-blog-articles {
    padding: 48px 0 60px;
}

.ip-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* ==================== BLOG CARD ==================== */

.ip-blog-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: background 0.2s, border-color 0.2s, transform 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.ip-blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    opacity: 0;
    transition: opacity 0.25s;
}

.ip-blog-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.1);
}

.ip-blog-card:hover::before {
    opacity: 1;
}

.ip-blog-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.ip-blog-card__meta time {
    color: var(--text-dim);
    font-weight: 500;
}

.ip-blog-card__category {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-light);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ip-blog-card__title {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.ip-blog-card__title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.ip-blog-card__title a:hover {
    color: var(--accent-light);
}

.ip-blog-card .ip-blog-card__excerpt {
    font-size: 15px;
    color: #b4b4c7;
    line-height: 1.65;
    flex: 1;
}

.ip-blog-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-top: auto;
    padding-top: 8px;
    transition: gap 0.2s;
}

.ip-blog-card__link:hover {
    gap: 10px;
}

.ip-blog-card__link svg {
    width: 14px;
    height: 14px;
}

/* ==================== PAGINATION ==================== */

.ip-blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 0 80px;
}

.ip-blog-pagination__nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.ip-blog-pagination__nav:hover {
    color: var(--text);
    background: var(--bg-card);
}

.ip-blog-pagination__pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ip-blog-pagination__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.ip-blog-pagination__page:hover {
    color: var(--text);
    background: var(--bg-card);
}

.ip-blog-pagination__page.is-active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.ip-blog-pagination__ellipsis {
    color: var(--text-dim);
    padding: 0 4px;
    font-size: 14px;
}

/* ==================== BLOG EMPTY ==================== */

.ip-blog-empty {
    text-align: center;
    padding: 120px 0;
    color: var(--text-secondary);
    font-size: 16px;
}

/* ==================== ARTICLE HERO ==================== */

.ip-article-hero {
    padding: 120px 0 48px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.02) 60%, transparent 100%);
}

.ip-article-header {
    max-width: 720px;
}

.ip-article-header__back {
    display: inline-block;
    color: var(--accent-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    transition: opacity 0.2s;
}

.ip-article-header__back:hover {
    opacity: 0.8;
}

.ip-article-header__category {
    display: inline-block;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-light);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 16px;
}

.ip-article-header__title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 12px;
}

.ip-article-header__subtitle {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.ip-article-header .ip-article-header__subtitle {
    color: #b4b4c7;
}

.ip-article-header .ip-article-header__meta {
    color: #b4b4c7;
}

.ip-article-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: #b4b4c7;
}

.ip-article-header__meta > span,
.ip-article-header__meta > time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ip-article-header__meta svg {
    opacity: 0.6;
}

/* ==================== ARTICLE LAYOUT ==================== */

.ip-article-main {
    padding: 48px 0 80px;
}

.ip-article-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

.ip-article-layout--no-sidebar {
    justify-content: center;
}

/* ==================== ARTICLE SIDEBAR (right side) ==================== */

.ip-article-sidebar {
    width: 260px;
    flex-shrink: 0;
    align-self: flex-start;
    position: sticky;
    top: 80px;
}

.ip-article-sidebar__sticky {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ==================== TABLE OF CONTENTS ==================== */

.ip-article-toc {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.ip-article-toc__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.ip-article-toc__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    margin: 0;
}

.ip-article-toc__link {
    display: block;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 500;
    color: #b4b4c7;
    text-decoration: none;
    transition: color 0.2s;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ip-article-toc__link:hover {
    color: var(--text);
}

.ip-article-toc__link.is-active {
    color: var(--accent-light);
}

/* ==================== ARTICLE CTA BOX ==================== */

.ip-article-cta {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
}

.ip-article-cta__logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.ip-article-cta__headline {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.ip-article-cta .ip-article-cta__text {
    font-size: 13px;
    color: #b4b4c7;
    line-height: 1.5;
    margin-bottom: 16px;
}

.ip-article-cta__button {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.ip-article-cta__button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

/* ==================== ARTICLE CONTENT ==================== */

.ip-article-content {
    flex: 1;
    min-width: 0;
    max-width: 720px;
}

.ip-article-content--full-width {
    max-width: 720px;
}

/* ==================== PROSE TYPOGRAPHY ==================== */

.ip-prose {
    font-size: 16px;
    line-height: 1.75;
    color: #d5d5e2;
}

.ip-prose h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 48px;
    margin-bottom: 16px;
    color: var(--text);
    line-height: 1.3;
}

.ip-prose h3 {
    font-size: 19px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.35;
}

.ip-prose p {
    margin-bottom: 16px;
    color: #d5d5e2;
}

.ip-prose a {
    color: var(--accent-light);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(129, 140, 248, 0.4);
    transition: text-decoration-color 0.2s;
}

.ip-prose a:hover {
    text-decoration-color: var(--accent-light);
}

.ip-prose strong {
    font-weight: 600;
    color: var(--text);
}

.ip-prose ul,
.ip-prose ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.ip-prose li {
    margin-bottom: 6px;
    color: #d5d5e2;
}

.ip-prose li::marker {
    color: var(--accent-light);
}

.ip-prose blockquote {
    border-left: 3px solid var(--accent);
    padding: 16px 20px;
    margin: 24px 0;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: #b4b4c7;
    font-style: italic;
}

.ip-prose blockquote p:last-child {
    margin-bottom: 0;
}

.ip-prose code {
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--accent-light);
}

.ip-prose pre {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    overflow-x: auto;
    margin: 24px 0;
}

.ip-prose pre code {
    background: none;
    padding: 0;
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
}

.ip-prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 24px 0;
}

.ip-prose figure.float-right,
.ip-prose img.float-right {
    float: right;
    max-width: 240px;
    margin: 0 0 20px 28px;
}

.ip-prose figure.float-left,
.ip-prose img.float-left {
    float: left;
    max-width: 240px;
    margin: 0 28px 20px 0;
}

.ip-prose figure.float-right img,
.ip-prose figure.float-left img {
    margin: 0;
}

@media (max-width: 640px) {
    .ip-prose figure.float-right,
    .ip-prose figure.float-left,
    .ip-prose img.float-right,
    .ip-prose img.float-left {
        float: none;
        max-width: 280px;
        margin: 20px auto;
        display: block;
    }
}

.ip-prose hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

.ip-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
}

.ip-prose th,
.ip-prose td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.ip-prose th {
    background: var(--bg-elevated);
    font-weight: 600;
    color: var(--text);
}

.ip-prose td {
    color: #b4b4c7;
}

/* ==================== ARTICLE TAGS ==================== */

.ip-article-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.ip-article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ip-article-tags__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
}

.ip-article-tags__tag {
    display: inline-block;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
}

/* ==================== RELATED POSTS ==================== */

.ip-article-related {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid var(--border);
}

.ip-article-related__title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 24px;
}

.ip-article-related__list {
    display: grid;
    gap: 16px;
}

.ip-article-related__item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.ip-article-related__item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateX(4px);
}

.ip-article-related__item-content {
    flex: 1;
    min-width: 0;
}

.ip-article-related__item-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 4px;
}

.ip-article-related__item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

.ip-article-related__item-excerpt {
    font-size: 14px;
    color: #b4b4c7;
    margin-top: 4px;
    line-height: 1.5;
}

.ip-article-related__item-arrow {
    flex-shrink: 0;
    color: var(--text-dim);
    transition: color 0.2s, transform 0.2s;
}

.ip-article-related__item:hover .ip-article-related__item-arrow {
    color: var(--accent-light);
    transform: translateX(4px);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 900px) {
    .ip-article-layout {
        flex-direction: column;
    }

    .ip-article-sidebar {
        width: 100%;
    }

    .ip-article-sidebar__sticky {
        position: static;
    }

    .ip-article-toc {
        display: none;
    }

    .ip-article-content {
        max-width: 100%;
    }

    .ip-article-header__title {
        font-size: clamp(24px, 5vw, 34px);
    }

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

    .ip-blog-grid {
        grid-template-columns: 1fr;
    }

    .ip-blog-card {
        padding: 24px;
    }
}

@media (max-width: 640px) {
    .ip-article-header__meta {
        flex-direction: column;
        gap: 8px;
    }

    .ip-blog-pagination {
        gap: 4px;
    }

    .ip-blog-pagination__nav span {
        display: none;
    }
}
