/* _starter theme — uses CSS custom properties injected from site settings */

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body, 'Inter', sans-serif);
    color: var(--text, #1a1a2e);
    background: var(--bg, #ffffff);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary, #007bff); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent, #ff6b35); }

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading, 'Inter', sans-serif);
    color: var(--heading, #0f0f23);
    line-height: 1.3;
    font-weight: 700;
}
h1 { font-size: 2.5rem; margin-bottom: 0.75rem; }
h2 { font-size: 1.75rem; margin-bottom: 0.6rem; }
h3 { font-size: 1.35rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1.25rem; }

/* ===== Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Header / Nav ===== */
.site-header {
    background: var(--bg, #ffffff);
    border-bottom: 1px solid var(--border, #e8e8ef);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.95);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-brand {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--heading, #0f0f23);
}
.site-brand:hover { color: var(--primary, #007bff); }

.site-nav { display: flex; gap: 24px; align-items: center; }
.site-nav a {
    color: var(--text-muted, #6b7280);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}
.site-nav a:hover, .site-nav a.active {
    color: var(--primary, #007bff);
}

/* ===== Hero ===== */
.hero {
    padding: 80px 0 60px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary, #007bff) 0%, var(--accent, #ff6b35) 100%);
    color: #ffffff;
}
.hero h1 {
    color: #ffffff;
    font-size: 3rem;
    margin-bottom: 16px;
}
.hero .tagline {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}
.hero-cta {
    display: inline-block;
    margin-top: 24px;
    padding: 14px 36px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s, border-color 0.2s;
}
.hero-cta:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.6);
    color: #fff;
}
.btn-cta {
    display: inline-block;
    padding: 12px 32px;
    background: var(--primary, #007bff);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-cta:hover {
    background: var(--accent, #ff6b35);
    color: #fff;
}

/* ===== Post Cards Grid ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
    padding: 48px 0;
}

.post-card {
    background: var(--bg, #ffffff);
    border: 1px solid var(--border, #e8e8ef);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.post-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--border, #e8e8ef);
}
.post-card-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary, #007bff) 0%, var(--secondary, #6c757d) 100%);
    opacity: 0.15;
}

.post-card-body { padding: 20px; }

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 10px;
}

.post-card-category {
    background: var(--primary, #007bff);
    color: #ffffff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.post-card-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
    line-height: 1.4;
}
.post-card-title a { color: var(--heading, #0f0f23); }
.post-card-title a:hover { color: var(--primary, #007bff); }

.post-card-excerpt {
    color: var(--text-muted, #6b7280);
    font-size: 0.9rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-image-link {
    display: block;
    overflow: hidden;
}

.post-card-category-wrap {
    margin-bottom: 8px;
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border, #e8e8ef);
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
}

.post-card-author {
    display: flex;
    align-items: center;
    gap: 6px;
}
.post-card-author a {
    color: var(--text, #1a1a2e);
    font-weight: 500;
}
.post-card-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary, #007bff);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}
.post-card-meta-right {
    display: flex;
    align-items: center;
    gap: 6px;
}
.post-card-dot {
    opacity: 0.5;
}

/* ===== Single Post ===== */
.post-header {
    padding: 48px 0 32px;
    text-align: center;
}
.post-header h1 {
    font-size: 2.5rem;
    max-width: 800px;
    margin: 0 auto 16px;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-muted, #6b7280);
    font-size: 0.9rem;
    flex-wrap: wrap;
}
.post-meta .separator { color: var(--border, #e8e8ef); }

.post-meta-author {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.post-meta-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary, #007bff);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}
.post-meta-author a { color: var(--heading, #0f0f23); font-weight: 600; }

.post-header-categories {
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.post-content {
    padding: 0 0 48px;
    font-size: 1.05rem;
    line-height: 1.8;
}
.post-content h2 { margin-top: 2rem; margin-bottom: 1rem; }
.post-content h3 { margin-top: 1.5rem; margin-bottom: 0.75rem; }
.post-content ul, .post-content ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.post-content li { margin-bottom: 0.5rem; }
.post-content blockquote {
    border-left: 4px solid var(--primary, #007bff);
    padding: 16px 24px;
    margin: 1.5rem 0;
    background: rgba(0,0,0,0.02);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}
.post-content pre {
    background: #1a1a2e;
    color: #e8e8ef;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}
.post-content code {
    background: rgba(0,0,0,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.post-content pre code { background: none; padding: 0; }
.post-content img {
    border-radius: 8px;
    margin: 1.5rem auto;
}

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0;
    padding-top: 24px;
    border-top: 1px solid var(--border, #e8e8ef);
}
.post-tags a {
    background: rgba(0,0,0,0.04);
    color: var(--text-muted, #6b7280);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: background 0.2s, color 0.2s;
}
.post-tags a:hover {
    background: var(--primary, #007bff);
    color: #ffffff;
}

/* Author Box */
.author-box {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: rgba(0,0,0,0.02);
    border-radius: 12px;
    margin: 32px 0;
}
.author-box-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary, #007bff);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}
.author-box-info h4 { margin-bottom: 4px; font-size: 1rem; }
.author-box-info p { color: var(--text-muted, #6b7280); font-size: 0.9rem; margin-bottom: 0; }

/* ===== Breadcrumbs ===== */
.breadcrumbs {
    padding: 16px 0;
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
}
.breadcrumbs a { color: var(--text-muted, #6b7280); }
.breadcrumbs a:hover { color: var(--primary, #007bff); }
.breadcrumbs .sep { margin: 0 8px; opacity: 0.5; }

/* ===== Category / Tag / Author Archive ===== */
.archive-header {
    padding: 48px 0 24px;
    text-align: center;
    border-bottom: 1px solid var(--border, #e8e8ef);
    margin-bottom: 32px;
}
.archive-header h1 { font-size: 2rem; }
.archive-header .count {
    color: var(--text-muted, #6b7280);
    font-size: 0.95rem;
    margin-top: 8px;
}

/* ===== Author Page ===== */
.author-profile {
    text-align: center;
    padding: 48px 0 32px;
}
.author-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--primary, #007bff);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 auto 16px;
}
.author-profile h1 { font-size: 2rem; margin-bottom: 8px; }
.author-profile .bio {
    color: var(--text-muted, #6b7280);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.6;
}

/* ===== About Page ===== */
.about-content {
    padding: 48px 0;
    font-size: 1.05rem;
    line-height: 1.8;
}
.about-content h2 { margin-top: 2rem; margin-bottom: 1rem; }
.about-content p { margin-bottom: 1.25rem; }

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 32px 0 48px;
}
.pagination a, .pagination span {
    padding: 8px 16px;
    border: 1px solid var(--border, #e8e8ef);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-muted, #6b7280);
    transition: all 0.2s;
}
.pagination a:hover {
    background: var(--primary, #007bff);
    color: #ffffff;
    border-color: var(--primary, #007bff);
}
.pagination .active {
    background: var(--primary, #007bff);
    color: #ffffff;
    border-color: var(--primary, #007bff);
}
.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ===== Section Heading ===== */
.section-heading {
    text-align: center;
    margin-bottom: 32px;
    padding-top: 16px;
}
.section-heading h2 {
    font-size: 1.75rem;
    position: relative;
    display: inline-block;
}
.section-heading h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent, #ff6b35);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid var(--border, #e8e8ef);
    padding: 32px 0;
    text-align: center;
    color: var(--text-muted, #6b7280);
    font-size: 0.85rem;
    margin-top: 48px;
}
.site-footer a { color: var(--text-muted, #6b7280); }
.site-footer a:hover { color: var(--primary, #007bff); }

/* ===== 404 ===== */
.not-found {
    text-align: center;
    padding: 120px 24px;
}
.not-found h1 { font-size: 6rem; color: var(--border, #e8e8ef); margin-bottom: 16px; }
.not-found p { font-size: 1.1rem; color: var(--text-muted, #6b7280); margin-bottom: 24px; }
.not-found a {
    display: inline-block;
    padding: 12px 32px;
    background: var(--primary, #007bff);
    color: #ffffff;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
}
.not-found a:hover { background: var(--accent, #ff6b35); color: #ffffff; }

/* ===== Related Posts ===== */
.related-posts {
    border-top: 1px solid var(--border, #e8e8ef);
    margin-top: 48px;
    padding-top: 16px;
}

/* ===== Table in Post Content ===== */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}
.post-content th, .post-content td {
    padding: 10px 14px;
    border: 1px solid var(--border, #e8e8ef);
    text-align: left;
}
.post-content th {
    background: rgba(0,0,0,0.03);
    font-weight: 600;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero { padding: 48px 0 40px; }
    .hero h1 { font-size: 2rem; }
    .posts-grid { grid-template-columns: 1fr; gap: 24px; }
    .post-header h1 { font-size: 1.75rem; }
    .site-nav { gap: 16px; }
    .author-box { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .site-header .container { flex-wrap: wrap; gap: 8px; }
    .hero h1 { font-size: 1.6rem; }
}
