/* ============================================
   GridTrace Corporate Blog Theme - style.css
   Version 1.0.0
   ============================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex: 1;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* ─── Navigation ────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.nav-logo-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text-heading);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-body);
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--color-bg-section);
    color: var(--color-primary);
}

.nav-link-app {
    background: var(--color-primary);
    color: #ffffff !important;
    font-weight: 600;
}

.nav-link-app:hover {
    background: #1e3a8a !important;
    color: #ffffff !important;
}

.nav-arrow {
    display: inline-block;
    transition: transform 0.15s ease;
}

.nav-link:hover .nav-arrow {
    transform: translateX(3px);
}

/* Mobile toggle */
.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text-heading);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-mobile-menu {
    display: none;
    flex-direction: column;
    padding: 0.75rem 1.5rem 1rem;
    border-top: 1px solid var(--color-border);
    background: #fff;
    gap: 0.25rem;
}

.nav-mobile-menu a {
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-heading);
    border-radius: 6px;
}

.nav-mobile-menu a:hover {
    background: var(--color-bg-section);
    color: var(--color-primary);
}

.nav-container.open ~ .nav-mobile-menu,
.site-header:has(.nav-container.open) .nav-mobile-menu {
    display: flex;
}

/* ─── Hero Banner ───────────────────────────── */
.hero-banner {
    background: var(--color-bg-section);
    border-bottom: 1px solid var(--color-border);
    padding: 4rem 1.5rem;
}

.hero-container {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    background: #dbeafe;
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--color-text-heading);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-body);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ─── Posts Section ─────────────────────────── */
.posts-section {
    padding: 3rem 1.5rem 5rem;
}

.posts-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
}

/* ─── Post Cards ────────────────────────────── */
.post-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.post-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.post-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    flex-shrink: 0;
}

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

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

.post-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-card-placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.7;
}

.post-card-content {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.6rem;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.post-card-tag {
    background: #dbeafe;
    color: var(--color-primary);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.post-card-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

.post-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text-heading);
    line-height: 1.35;
    letter-spacing: -0.01em;
    transition: color 0.15s ease;
}

.post-card:hover .post-card-title {
    color: var(--color-primary);
}

.post-card-excerpt {
    font-size: 0.875rem;
    color: var(--color-text-body);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.post-card-cta {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: auto;
}

.post-card-arrow {
    transition: transform 0.15s ease;
}

.post-card:hover .post-card-arrow {
    transform: translateX(3px);
}

/* ─── Pagination ────────────────────────────── */
.pagination {
    max-width: var(--max-width);
    margin: 3rem auto 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.pagination-btn {
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-primary);
    transition: var(--transition);
}

.pagination-btn:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--color-text-body);
}

/* ─── Single Post ───────────────────────────── */
.post-single {
    padding-bottom: 5rem;
}

.post-header {
    background: var(--color-bg-section);
    border-bottom: 1px solid var(--color-border);
    padding: 3.5rem 1.5rem;
}

.post-header-inner {
    max-width: var(--max-width-content);
    margin: 0 auto;
}

.post-header-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.post-tag-chip {
    display: inline-block;
    background: #dbeafe;
    color: var(--color-primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.post-date,
.post-reading-time {
    font-size: 0.85rem;
    color: #94a3b8;
}

.post-date::after {
    content: "·";
    margin-left: 0.75rem;
}

.post-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--color-text-heading);
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.post-excerpt {
    font-size: 1.1rem;
    color: var(--color-text-body);
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

/* Author */
.post-author {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.post-author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.post-author-avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.post-author-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.post-author-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-heading);
}

.post-author-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Featured Image */
.post-feature-image {
    max-width: var(--max-width-content);
    margin: 2.5rem auto 0;
    padding: 0 1.5rem;
}

.post-feature-image img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.post-feature-caption {
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 0.5rem;
}

/* Post Content */
.post-content-wrapper {
    max-width: var(--max-width-content);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 0;
}

.post-content.gh-content {
    color: var(--color-text-body);
    font-size: 1.05rem;
    line-height: 1.8;
}

.gh-content h1,
.gh-content h2,
.gh-content h3,
.gh-content h4,
.gh-content h5,
.gh-content h6 {
    color: var(--color-text-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-top: 2.25rem;
    margin-bottom: 0.85rem;
}

.gh-content h2 { font-size: 1.65rem; }
.gh-content h3 { font-size: 1.35rem; }
.gh-content h4 { font-size: 1.1rem; }

.gh-content p {
    margin-bottom: 1.4rem;
}

.gh-content a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.gh-content a:hover {
    color: var(--color-primary);
}

.gh-content strong {
    font-weight: 600;
    color: var(--color-text-heading);
}

.gh-content ul,
.gh-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.4rem;
}

.gh-content ul { list-style: disc; }
.gh-content ol { list-style: decimal; }

.gh-content li {
    margin-bottom: 0.45rem;
}

.gh-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: #f0f7ff;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--color-text-heading);
}

.gh-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.75rem 0;
    font-size: 0.875rem;
    line-height: 1.7;
}

.gh-content code {
    background: #f1f5f9;
    color: var(--color-primary);
    padding: 0.15em 0.45em;
    border-radius: 4px;
    font-size: 0.875em;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
}

.gh-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.gh-content img {
    border-radius: var(--radius);
    margin: 1.75rem auto;
    box-shadow: var(--shadow-sm);
}

.gh-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2.5rem 0;
}

.gh-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75rem 0;
    font-size: 0.9rem;
}

.gh-content th {
    background: var(--color-bg-section);
    color: var(--color-text-heading);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--color-border);
}

.gh-content td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.gh-content tr:hover td {
    background: #f8fafc;
}

/* Post Tags */
.post-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--color-border);
}

.post-tags-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-heading);
}

.post-tag-link {
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    background: var(--color-bg-section);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text-body);
    transition: var(--transition);
}

.post-tag-link:hover {
    background: #dbeafe;
    color: var(--color-primary);
    border-color: #bfdbfe;
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.post-nav-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.post-nav-item:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
}

.post-nav-next {
    text-align: right;
}

.post-nav-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.post-nav-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-heading);
    line-height: 1.4;
}

/* ─── Footer ────────────────────────────────── */
.site-footer {
    background: var(--color-footer-bg);
    color: #94a3b8;
    padding: 3.5rem 1.5rem 2rem;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.75fr 1fr 1fr 1fr;
    gap: 2rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid #334155;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.footer-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--color-accent);
    color: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.footer-logo-text {
    font-size: 1rem;
    font-weight: 700;
    color: #f1f5f9;
}

.footer-brand-desc {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #64748b;
    max-width: 280px;
}

.footer-heading {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f1f5f9;
    margin-bottom: 1rem;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    font-size: 0.875rem;
    color: #64748b;
    transition: color 0.15s ease;
    text-decoration: none;
}

.footer-links a:hover {
    color: #f1f5f9;
}

.footer-bottom {
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: #475569;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-made {
    font-size: 0.82rem;
}

/* ─── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
    .posts-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem 3rem;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-mobile-toggle {
        display: flex;
    }

    .nav-container.open .nav-links {
        display: none;
    }

    .hero-banner {
        padding: 2.5rem 1.25rem;
    }

    .posts-section {
        padding: 2rem 1.25rem 3rem;
    }

    .posts-container {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .post-header {
        padding: 2rem 1.25rem;
    }

    .post-content-wrapper {
        padding: 2rem 1.25rem 0;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }

    .post-nav-next {
        text-align: left;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-brand {
        grid-column: auto;
    }

    .footer-brand-desc {
        max-width: 100%;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

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

    .post-header-meta {
        gap: 0.5rem;
    }
}
