/* ===== BLOG STYLES ===== */

/* Blog Hero */
.blog-hero {
    padding: 140px 0 40px;
    margin-bottom: 40px;
}

.blog-hero-title {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(36px, 5.5vw, 60px);
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-hero-subtitle {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.7;
    max-width: 560px;
    margin-bottom: 32px;
}

/* Blog Controls - Search & Filter */
.blog-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 18px;
    max-width: 420px;
    transition: border-color 0.3s;
}

.blog-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 71, 255, 0.1);
}

.blog-search svg {
    color: var(--muted);
    flex-shrink: 0;
}

.blog-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    width: 100%;
}

.blog-search input::placeholder {
    color: var(--muted);
}

.blog-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    font-family: 'Syne', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: #3a3a55;
    color: var(--text);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-color: transparent;
    color: #fff;
}

/* Featured Post */
.featured-post {
    margin-bottom: 48px;
}

.featured-card {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    background: linear-gradient(135deg, var(--surface) 0%, #14141f 100%);
    border: 1px solid #3a2a6a;
    border-radius: 20px;
    padding: 40px;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
}

.featured-card:hover {
    border-color: #5a3a9a;
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(108, 71, 255, 0.12);
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #6c47ff22, #6c47ff44);
    border: 1px solid #6c47ff55;
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 20px;
    /* Fix: span full grid width so content+visual sit properly below */
    grid-column: 1 / -1;
    width: fit-content;
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.featured-title {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(22px, 3vw, 30px);
    line-height: 1.2;
    margin-bottom: 14px;
    color: var(--text);
    transition: color 0.3s;
}

.featured-card:hover .featured-title {
    color: #fff;
}

.featured-excerpt {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 20px;
}

.featured-author {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.featured-read-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    margin-left: auto;
    letter-spacing: 0.03em;
    transition: gap 0.3s;
}

.featured-card:hover .featured-read-link {
    gap: 10px;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.author-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.featured-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(108, 71, 255, 0.05) 0%, rgba(0, 212, 170, 0.03) 100%);
    border-radius: 16px;
    border: 1px solid rgba(108, 71, 255, 0.12);
    padding: 20px;
    min-height: 180px;
}

.featured-icon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: 100%;
}

.featured-icon-grid span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    font-size: 28px;
    transition: all 0.3s;
    animation: iconFloat 5s ease-in-out infinite;
}

/* Individual brand-color backgrounds + staggered float */
.featured-icon-grid span:nth-child(1) {
    background: rgba(108, 71, 255, 0.12);
    border: 1px solid rgba(108, 71, 255, 0.25);
    animation-delay: 0s;
}

.featured-icon-grid span:nth-child(2) {
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.22);
    animation-delay: -1.25s;
}

.featured-icon-grid span:nth-child(3) {
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.22);
    animation-delay: -2.5s;
}

.featured-icon-grid span:nth-child(4) {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    animation-delay: -3.75s;
}

.featured-card:hover .featured-icon-grid span {
    transform: scale(1.06) translateY(-4px);
}

.featured-card:hover .featured-icon-grid span:nth-child(1) {
    background: rgba(108, 71, 255, 0.2);
    border-color: rgba(108, 71, 255, 0.4);
    box-shadow: 0 8px 24px rgba(108, 71, 255, 0.2);
}

.featured-card:hover .featured-icon-grid span:nth-child(2) {
    background: rgba(255, 107, 53, 0.18);
    border-color: rgba(255, 107, 53, 0.35);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.15);
}

.featured-card:hover .featured-icon-grid span:nth-child(3) {
    background: rgba(0, 212, 170, 0.18);
    border-color: rgba(0, 212, 170, 0.35);
    box-shadow: 0 8px 24px rgba(0, 212, 170, 0.15);
}

.featured-card:hover .featured-icon-grid span:nth-child(4) {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.32);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.12);
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* Blog Category Tags */
.blog-category {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.blog-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--muted);
}

.blog-read-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--muted);
}

.blog-read-time::before {
    content: '·';
    margin-right: 8px;
}

/* Blog Grid */
.blog-grid-section {
    margin-bottom: 80px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Blog Card */
.blog-card {
    transition: transform 0.3s, opacity 0.3s;
}

.blog-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.blog-card-link:hover {
    border-color: #3a3a55;
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(108, 71, 255, 0.1);
}

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

.blog-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.blog-card-icon {
    font-size: 28px;
}

.blog-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--text);
    transition: color 0.3s;
}

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

.blog-card-excerpt {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.7;
    flex: 1;
    margin-bottom: 16px;
}

.blog-card-footer {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* No Results */
.blog-no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.blog-no-results h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.blog-no-results p {
    color: var(--muted);
    font-size: 14px;
}

/* Newsletter CTA */
.blog-newsletter {
    background: linear-gradient(135deg, var(--surface) 0%, #14141f 100%);
    border: 1px solid #3a2a6a;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 80px;
}

.newsletter-glow {
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(108, 71, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.newsletter-title {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(24px, 4vw, 36px);
    line-height: 1.2;
    margin-bottom: 14px;
    position: relative;
}

.newsletter-desc {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto 28px;
    position: relative;
}

.newsletter-form {
    display: flex;
    gap: 12px;
    max-width: 440px;
    margin: 0 auto;
    position: relative;
}

.newsletter-form input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text);
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.newsletter-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 71, 255, 0.1);
}

.newsletter-form input::placeholder {
    color: var(--muted);
}

.newsletter-note {
    font-size: 11px;
    color: var(--muted);
    margin-top: 12px;
    position: relative;
}

/* reading-progress and newsletter-success are handled below */

/* ===== BLOG POST PAGE STYLES ===== */

/* Post Header */
.post-header {
    padding: 140px 0 40px;
    max-width: 760px;
}

.post-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    transition: color 0.3s;
}

.post-back-link:hover {
    color: var(--accent);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.post-title {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.15;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.post-subtitle {
    font-size: 16px;
    color: var(--muted);
    line-height: 1.7;
    max-width: 640px;
    margin-bottom: 24px;
}

.post-author-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.post-author-info {
    flex: 1;
}

.post-author-info .author-name {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.post-author-info .author-role {
    font-size: 12px;
    color: var(--muted);
}

/* Post Content */
.post-content {
    max-width: 760px;
    padding: 40px 0 60px;
}

.post-content h2 {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(22px, 3vw, 30px);
    margin: 40px 0 16px;
    line-height: 1.3;
}

.post-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 32px 0 12px;
}

.post-content p {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.85;
    margin-bottom: 20px;
}

.post-content strong {
    color: var(--text);
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.3s;
}

.post-content a:hover {
    color: #8b5cf6;
}

.post-content ul,
.post-content ol {
    margin: 16px 0 20px 20px;
}

.post-content li {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 8px;
}

.post-content li strong {
    color: var(--text);
}

.post-content blockquote {
    margin: 24px 0;
    padding: 20px 24px;
    background: var(--surface);
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0;
    font-family: 'Instrument Serif', serif;
    font-size: 18px;
    color: var(--text);
    line-height: 1.6;
}

.post-content pre {
    margin: 20px 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
}

.post-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--accent3);
}

.post-content pre code {
    color: var(--text);
}

.post-content img {
    width: 100%;
    border-radius: 12px;
    margin: 24px 0;
    border: 1px solid var(--border);
}

/* Post callout box */
.post-callout {
    margin: 24px 0;
    padding: 20px 24px;
    background: linear-gradient(135deg, #6c47ff12, #6c47ff08);
    border: 1px solid #6c47ff33;
    border-radius: 14px;
}

.post-callout-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

.post-callout p {
    color: var(--muted);
    margin-bottom: 0;
}

/* Post CTA */
.post-cta {
    background: linear-gradient(135deg, var(--surface) 0%, #14141f 100%);
    border: 1px solid #3a2a6a;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin: 40px 0 60px;
    max-width: 760px;
}

.post-cta h3 {
    font-family: 'Instrument Serif', serif;
    font-size: 24px;
    margin-bottom: 12px;
}

.post-cta p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.7;
}

/* Share buttons */
.post-share {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    max-width: 760px;
    margin-bottom: 40px;
}

.post-share-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.share-btn:hover {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(108, 71, 255, 0.08);
    transform: translateY(-2px);
}

/* Related Posts */
.related-posts {
    margin-bottom: 80px;
}

.related-posts-title {
    font-family: 'Instrument Serif', serif;
    font-size: 24px;
    margin-bottom: 24px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ===== BLOG RESPONSIVE ===== */
@media (max-width: 768px) {
    .blog-hero {
        padding: 120px 0 30px;
    }

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

    .featured-card {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .featured-visual {
        display: none;
    }

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

    .newsletter-form {
        flex-direction: column;
    }

    .post-content {
        padding: 24px 0 40px;
    }

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

    .post-share {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .blog-filters {
        gap: 6px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* ===== READING PROGRESS BAR ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent3));
    z-index: 9999;
    border-radius: 0 2px 2px 0;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(108, 71, 255, 0.5);
}

/* ===== NEWSLETTER SUCCESS STATE ===== */
.newsletter-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    animation: fadeInUp 0.5s ease-out;
}

.newsletter-success-icon {
    font-size: 40px;
    animation: bounceIn 0.6s ease-out;
}

.newsletter-success-text {
    font-family: 'Instrument Serif', serif;
    font-size: 18px;
    color: var(--text);
    line-height: 1.5;
    margin: 0;
}

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

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

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}