/*
Theme Name: LYNX Blog
Theme URI: https://www.lynxseo.com
Author: LYNX SEO
Description: Custom blog theme matching lynxseo.com
Version: 1.0
*/

/* ── Reset & Base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary-red: #ed3631;
    --dark-bg: #0a0e1a;
    --darker-bg: #050810;
    --card-bg: #111827;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Mono', monospace;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Animated background — matches main site */
body::before {
    content: '';
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(237,54,49,.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(139,92,246,.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(237,54,49,.08) 0%, transparent 60%);
    pointer-events: none; z-index: 0;
    animation: aurora 15s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,.03) 2px, rgba(255,255,255,.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255,255,255,.03) 2px, rgba(255,255,255,.03) 4px);
    pointer-events: none; z-index: 0; opacity: .4;
}

@keyframes aurora {
    0%,100% { opacity: 1; transform: scale(1) translateY(0); }
    33%      { opacity: .8; transform: scale(1.05) translateY(-10px); }
    66%      { opacity: .9; transform: scale(.98) translateY(5px); }
}

section, header, footer, main { position: relative; z-index: 1; }
h1,h2,h3 { font-family: 'Krona One', sans-serif; font-weight: 400; }
a { color: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ── Header / Nav ── */
.header {
    position: fixed; top: 0; left: 0; right: 0;
    background-color: rgba(10,14,26,.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: box-shadow .3s ease;
}

.nav {
    max-width: 1200px; margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex; justify-content: space-between; align-items: center;
}

.nav-logo { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.logo-img  { width: 35px; height: 35px; }
.logo-text { font-family: 'Krona One', sans-serif; font-size: 1.25rem; color: var(--primary-red); }

.nav-links { display: flex; list-style: none; gap: 2rem; align-items: center; }
.nav-links a { color: var(--text-primary); text-decoration: none; font-size: .9rem; transition: color .3s ease; }
.nav-links a:hover { color: var(--primary-red); }

.cta-button { background-color: var(--primary-red); padding: .6rem 1.5rem; border-radius: 4px; color: white !important; }
.cta-button:hover { background-color: #d42e29 !important; }

.mobile-menu-toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: .5rem;
}
.mobile-menu-toggle span { width: 25px; height: 2px; background-color: var(--text-primary); transition: all .3s ease; }
.mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(7px,7px); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(7px,-7px); }

/* ── Blog Index ── */
.blog-index {
    padding: 8rem 2rem 6rem;
    max-width: 1200px;
    margin: 0 auto;
}

.blog-index-header {
    margin-bottom: 4rem;
}

.blog-index-header h1 {
    font-size: 3rem;
    color: var(--primary-red);
    margin-bottom: 1rem;
}

.blog-index-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.post-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 1px solid rgba(237,54,49,.1);
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(237,54,49,.2);
}

.post-card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.post-card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.post-card:hover .post-card-thumb img { transform: scale(1.04); }

.post-card-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--card-bg) 100%);
    display: flex; align-items: center; justify-content: center;
}

.post-card-thumb-placeholder .lynx-mark {
    font-family: 'Krona One', sans-serif;
    font-size: 2rem;
    color: rgba(237,54,49,.3);
    letter-spacing: .2em;
}

.post-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }

.post-card-category {
    display: inline-block;
    background-color: var(--primary-red);
    color: white;
    padding: .3rem .85rem;
    border-radius: 20px;
    font-size: .78rem;
    text-decoration: none;
    margin-bottom: 1rem;
    transition: background-color .3s ease;
}
.post-card-category:hover { background-color: #d42e29; }

.post-card-title {
    font-size: 1.15rem;
    line-height: 1.3;
    margin-bottom: .75rem;
    color: var(--text-primary);
}

.post-card-title a { text-decoration: none; color: inherit; }
.post-card-title a:hover { color: var(--primary-red); }

.post-card-excerpt {
    color: var(--text-secondary);
    font-size: .9rem;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1.25rem;
}

.post-card-meta {
    display: flex;
    gap: 1rem;
    font-size: .8rem;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255,255,255,.07);
    padding-top: 1rem;
    flex-wrap: wrap;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: .75rem;
    margin-top: 4rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: .6rem 1.1rem;
    background-color: var(--card-bg);
    border: 1px solid rgba(237,54,49,.2);
    border-radius: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .9rem;
    transition: all .3s ease;
}

.pagination a:hover,
.pagination span.current {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
}

/* ── Single Post ── */
.blog-post {
    padding: 8rem 2rem 4rem;
    max-width: 900px;
    margin: 0 auto;
}

.breadcrumb {
    margin-bottom: 2rem;
    font-size: .9rem;
}
.breadcrumb a { color: var(--text-secondary); text-decoration: none; transition: color .3s ease; }
.breadcrumb a:hover { color: var(--primary-red); }
.breadcrumb span { color: var(--text-secondary); margin: 0 .5rem; }

.post-header { margin-bottom: 3rem; }

.post-category {
    display: inline-block;
    background-color: var(--primary-red);
    color: white;
    padding: .4rem 1rem;
    border-radius: 20px;
    font-size: .85rem;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: background-color .3s ease;
}
.post-category:hover { background-color: #d42e29; }

.post-title {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--primary-red);
}

.post-meta {
    display: flex; gap: 1.5rem;
    color: var(--text-secondary);
    font-size: .9rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.post-excerpt {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.post-featured-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 3rem;
    border: 1px solid rgba(237,54,49,.2);
}
.post-featured-image img { width: 100%; height: auto; display: block; }

/* Post content — styles Gutenberg-off classic editor output */
.post-content { font-size: 1.05rem; line-height: 1.8; color: var(--text-primary); }
.post-content h2 { font-size: 2rem; color: var(--primary-red); margin: 3rem 0 1.5rem; }
.post-content h3 { font-size: 1.5rem; color: var(--text-primary); margin: 2rem 0 1rem; }
.post-content p  { margin-bottom: 1.5rem; color: var(--text-secondary); }
.post-content strong { color: var(--text-primary); }
.post-content a  { color: var(--primary-red); text-decoration: underline; }
.post-content ul,
.post-content ol { margin: 1.5rem 0; padding-left: 2rem; }
.post-content li { margin-bottom: .75rem; color: var(--text-secondary); }

.post-content blockquote {
    border-left: 4px solid var(--primary-red);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.post-content img {
    width: 100%; border-radius: 8px;
    margin: 2rem 0;
    border: 1px solid rgba(237,54,49,.2);
}

.post-content code {
    background-color: var(--card-bg);
    padding: .2rem .5rem;
    border-radius: 4px;
    font-family: 'DM Mono', monospace;
    font-size: .9em;
    color: var(--primary-red);
}

.post-content pre {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid rgba(237,54,49,.2);
}
.post-content pre code { background: none; padding: 0; color: var(--text-primary); }

/* Author bio */
.author-bio {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    margin: 4rem 0;
    display: flex;
    gap: 2rem;
    align-items: center;
    border: 1px solid rgba(237,54,49,.2);
}

.author-avatar {
    width: 100px; height: 100px;
    border-radius: 50%;
    border: 3px solid var(--primary-red);
    flex-shrink: 0;
    overflow: hidden;
}
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-info h3   { font-size: 1.25rem; margin-bottom: .5rem; }
.author-role      { color: var(--primary-red); font-size: .9rem; margin-bottom: .75rem; }
.author-description { color: var(--text-secondary); font-size: .95rem; line-height: 1.6; }

/* Post CTA */
.post-cta {
    background: linear-gradient(135deg, var(--primary-red) 0%, #d42e29 100%);
    padding: 3rem 2rem;
    border-radius: 8px;
    text-align: center;
    margin: 4rem 0;
}
.post-cta h3   { font-size: 1.75rem; margin-bottom: 1rem; color: white; }
.post-cta p    { color: rgba(255,255,255,.9); margin-bottom: 1.5rem; font-size: 1.05rem; }
.post-cta-button {
    display: inline-block;
    background-color: white;
    color: var(--primary-red);
    padding: 1rem 2.5rem;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1rem;
    transition: all .3s ease;
}
.post-cta-button:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,.3); }

/* Author socials */
.author-socials {
    display: flex;
    gap: .75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.author-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--dark-bg);
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid rgba(237,54,49,.2);
    transition: all .3s ease;
}

.author-social-link:hover {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
    transform: translateY(-2px);
}

/* ── Footer ── */
.footer {
    background-color: var(--darker-bg);
    padding: 2rem;
    border-top: 1px solid rgba(237,54,49,.2);
}
.footer-content {
    display: flex; justify-content: space-between; align-items: center;
    max-width: 1200px; margin: 0 auto;
}
.footer-logo { display: flex; align-items: center; gap: .75rem; }
.footer-logo img { width: 30px; height: 30px; }
.footer-logo span { font-family: 'Krona One', sans-serif; color: var(--primary-red); }
.footer p { color: var(--text-secondary); font-size: .9rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .mobile-menu-toggle { display: flex; }

    .nav-links {
        position: fixed; top: 80px; left: 0; right: 0;
        background-color: var(--darker-bg);
        flex-direction: column;
        padding: 2rem; gap: 1.5rem;
        transform: translateX(-100%);
        transition: transform .3s ease;
        box-shadow: 0 10px 30px rgba(0,0,0,.5);
    }
    .nav-links.active  { transform: translateX(0); }
    .nav-links li      { width: 100%; text-align: center; }
    .nav-links a       { display: block; padding: .5rem; font-size: 1rem; }
    .cta-button        { width: 100%; }

    .blog-index-header h1 { font-size: 2rem; }
    .posts-grid { grid-template-columns: 1fr; }

    .post-title { font-size: 2rem; }
    .post-excerpt { font-size: 1.05rem; }
    .post-content { font-size: 1rem; }
    .post-content h2 { font-size: 1.5rem; }

    .author-bio { flex-direction: column; text-align: center; }
    .post-cta h3 { font-size: 1.5rem; }

    .footer-content { flex-direction: column; gap: 1rem; text-align: center; }
}

/* ── Post content tables ── */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: .95rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(237,54,49,.2);
}

.post-content thead {
    background-color: var(--darker-bg);
}

.post-content thead th {
    padding: .9rem 1.25rem;
    text-align: left;
    color: var(--primary-red);
    font-family: 'Krona One', sans-serif;
    font-size: .85rem;
    font-weight: 400;
    border-bottom: 1px solid rgba(237,54,49,.3);
    white-space: nowrap;
}

.post-content tbody tr {
    border-bottom: 1px solid rgba(255,255,255,.06);
    transition: background-color .2s ease;
}

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

.post-content tbody tr:hover {
    background-color: rgba(237,54,49,.05);
}

.post-content tbody td {
    padding: .85rem 1.25rem;
    color: var(--text-secondary);
    vertical-align: top;
}

.post-content tbody td:first-child {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .post-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ── Post image sizing fix ── */
.post-content img {
    width: auto;
    max-width: 100%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Masonry Grid Styles */
@media (min-width: 769px) {
    .posts-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: masonry;
        gap: 2rem;
        align-items: start;
    }

    .post-card {
        break-inside: avoid;
        display: flex;
        flex-direction: column;
    }
}

/* ── Table of contents ── */
.post-toc {
    background-color: var(--card-bg);
    border: 1px solid rgba(237,54,49,.2);
    border-radius: 8px;
    padding: 1.5rem 1.75rem;
    margin: 0 0 2.5rem;
}

.post-toc-title {
    font-family: 'Krona One', sans-serif;
    font-size: .95rem;
    color: var(--primary-red);
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid rgba(237,54,49,.2);
}

.post-toc ol {
    margin: 0;
    padding-left: 1.25rem;
}

.post-toc li {
    margin-bottom: .5rem;
    color: var(--text-secondary);
    font-size: .9rem;
}

.post-toc li:last-child {
    margin-bottom: 0;
}

.post-toc a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .2s ease;
}

.post-toc a:hover {
    color: var(--primary-red);
}