/* Bukvomiks Blog — shared stylesheet
 * Reuses brand palette from /index.html
 * Optimized for long-form reading, audience 40-75
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #F5F0E6;
    --bg-secondary: #EDE8DC;
    --bg-white: #FFFFFF;
    --text-primary: #2D2A26;
    --text-secondary: #6B6560;
    --text-tertiary: #9A958E;
    --accent-gold: #E8B923;
    --accent-gold-dark: #D4A520;
    --accent-green: #4CAF50;
    --accent-blue: #3B82F6;
    --accent-coral: #E87B4C;
    --card-border: #D4CFC5;
    --shadow-sm: 0 2px 8px rgba(45, 42, 38, 0.08);
    --shadow-md: 0 4px 16px rgba(45, 42, 38, 0.12);
    --shadow-lg: 0 8px 32px rgba(45, 42, 38, 0.16);
    --radius: 12px;
    --radius-lg: 20px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.75;
    color: var(--text-primary);
    background: var(--bg-primary);
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header (shared with landing) */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(245, 240, 230, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    padding: 16px 0;
    border-bottom: 1px solid var(--card-border);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
}

.logo-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 20px;
}

nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color .2s;
}
nav a:hover, nav a.active { color: var(--text-primary); }

.nav-cta {
    background: var(--accent-gold);
    color: var(--text-primary) !important;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 600;
}

/* Main */
main { padding-top: 90px; }

/* Blog index hero */
.blog-hero {
    padding: 60px 0 40px;
    text-align: center;
}
.blog-hero h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.15;
    margin-bottom: 16px;
}
.blog-hero p {
    color: var(--text-secondary);
    font-size: 19px;
    max-width: 640px;
    margin: 0 auto;
}

/* Pillar filters */
.pillar-filters {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 32px 0 48px;
}
.pillar-filter {
    background: var(--bg-white);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
}
.pillar-filter:hover { border-color: var(--text-primary); color: var(--text-primary); }
.pillar-filter.active {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-primary);
}

/* Article grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 80px;
}

.article-card {
    background: var(--bg-white);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.article-card.coming-soon {
    opacity: .55;
    pointer-events: none;
}

.article-card-cover {
    height: 180px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.article-card-cover.pillar-A { background: linear-gradient(135deg, #E8B923 0%, #D4A520 100%); }
.article-card-cover.pillar-B { background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%); }
.article-card-cover.pillar-C { background: linear-gradient(135deg, #3B82F6 0%, #1E40AF 100%); }
.article-card-cover.pillar-D { background: linear-gradient(135deg, #E87B4C 0%, #C85A2B 100%); }
.article-card-cover.pillar-E { background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%); }

.article-card-pillar {
    background: rgba(255,255,255,.9);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: 6px;
}

.article-card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-card-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 12px;
}

.article-card-excerpt {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.55;
    flex: 1;
}

.article-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Article page */
.article {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 20px 80px;
}

.article-breadcrumbs {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}
.article-breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}
.article-breadcrumbs a:hover { color: var(--text-primary); }

.article-pillar-tag {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 20px;
}
.pillar-A { background: #FDF3C4; color: #8A6D05; }
.pillar-B { background: #D4EED4; color: #1B5E20; }
.pillar-C { background: #DBE9FE; color: #1E3A8A; }
.pillar-D { background: #FCDCC5; color: #8A3B1A; }
.pillar-E { background: #E2D4FC; color: #4C1D95; }

.article h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(28px, 4.5vw, 42px);
    line-height: 1.2;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 40px;
}
.article-author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 18px;
}
.article-author-info .name { font-weight: 600; font-size: 15px; }
.article-author-info .meta { font-size: 13px; color: var(--text-tertiary); }

.article-lead {
    font-size: 20px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 32px;
    padding: 20px 24px;
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-gold);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.article-body h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 28px;
    line-height: 1.25;
    margin: 48px 0 20px;
    letter-spacing: -0.01em;
}
.article-body h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.3;
    margin: 32px 0 12px;
}

.article-body p {
    margin-bottom: 20px;
    font-size: 18px;
    line-height: 1.75;
}

.article-body ul, .article-body ol {
    margin: 0 0 24px 20px;
    padding-left: 16px;
}
.article-body li {
    margin-bottom: 10px;
    font-size: 18px;
    line-height: 1.7;
}

.article-body a {
    color: var(--accent-blue);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.article-body a:hover { text-decoration-thickness: 2px; }

.article-body strong { font-weight: 700; color: var(--text-primary); }
.article-body em { font-style: italic; }

.article-body blockquote {
    margin: 32px 0;
    padding: 20px 28px;
    border-left: 4px solid var(--accent-gold);
    background: var(--bg-secondary);
    font-size: 19px;
    font-style: italic;
    color: var(--text-secondary);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    font-size: 16px;
}
.article-body table th,
.article-body table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}
.article-body table th {
    background: var(--bg-secondary);
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
}
.article-body table tr:last-child td { border-bottom: none; }

/* Callouts */
.callout {
    margin: 32px 0;
    padding: 20px 24px;
    border-radius: var(--radius);
    background: var(--bg-white);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-sm);
}
.callout-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.callout.callout-science { border-left: 4px solid var(--accent-blue); }
.callout.callout-warning { border-left: 4px solid var(--accent-coral); }
.callout.callout-tip { border-left: 4px solid var(--accent-green); }

.callout p { font-size: 16px; margin-bottom: 8px; }
.callout p:last-child { margin-bottom: 0; }

/* CTA block (install app) */
.article-cta {
    margin: 48px 0;
    padding: 36px 32px;
    background: linear-gradient(135deg, #2D2A26 0%, #3B3732 100%);
    color: var(--bg-primary);
    border-radius: var(--radius-lg);
    text-align: center;
}
.article-cta-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 26px;
    line-height: 1.25;
    margin-bottom: 10px;
}
.article-cta-subtitle {
    color: #C9C2B8;
    font-size: 16px;
    margin-bottom: 24px;
}

.store-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: transform .15s;
}
.store-btn:hover { transform: scale(1.03); }
.store-btn svg { width: 28px; height: 28px; fill: currentColor; }
.store-btn-text { text-align: left; line-height: 1.1; }
.store-btn-small { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; }
.store-btn-big { font-size: 17px; font-family: 'Montserrat', sans-serif; font-weight: 700; }

/* References */
.references {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--card-border);
}
.references h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    margin-bottom: 16px;
}
.references ol { margin-left: 20px; }
.references li {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.references a { color: var(--text-secondary); word-break: break-word; }

/* Related */
.related {
    margin-top: 56px;
}
.related h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    margin-bottom: 24px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.related-card {
    background: var(--bg-white);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform .2s, box-shadow .2s;
}
.related-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.related-card-pillar {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}
.related-card-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.35;
}

/* Footer (shared) */
footer {
    background: var(--text-primary);
    color: var(--bg-secondary);
    padding: 40px 0;
    margin-top: 80px;
    text-align: center;
}
footer a {
    color: var(--bg-secondary);
    text-decoration: none;
    margin: 0 12px;
    font-size: 15px;
}
footer a:hover { text-decoration: underline; }
footer .copyright {
    margin-top: 20px;
    font-size: 13px;
    color: #7E7770;
}

/* Mobile */
@media (max-width: 720px) {
    body { font-size: 17px; }
    nav { gap: 16px; }
    nav a:not(.nav-cta) { display: none; }
    .article { padding: 0 20px 60px; }
    .article-body h2 { font-size: 24px; }
    .article-body h3 { font-size: 19px; }
    .article-body p, .article-body li { font-size: 17px; }
    .article-cta { padding: 28px 20px; }
    .article-cta-title { font-size: 22px; }
}
