/* ═══════════════════════════════════════════════════════════════════════════
   blog.css — PurpleClear Blog Reader UI
   Brand tokens, typography, layout and component styles.
   NO Node.js, NO preprocessors, NO build step. Plain CSS only.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ──────────────────────────────────────────────────────────── */

:root {
    --purple:               #422186;
    --purple-dark:          #33004c;
    --purple-light:         #b19cbd;
    --purple-gradient-start:#7b2fa8;
    --purple-gradient-end:  #3d1166;
    --bg-light:             #f5f6fa;
    --bg-white:             #ffffff;
    --text-primary:         #333333;
    --text-muted:           #666666;
    --text-on-purple:       #ffffff;
    --border:               #e0e0e0;
    --red:                  #c0392b;
    --border-radius:        0;
    --sidebar-width:        300px;
    --content-max:          1100px;
    --font-brand:           "URW Gothic", Tahoma, sans-serif;
    --font-body:            Tahoma, Arial, sans-serif;
    --font-mono:            "Courier New", Courier, monospace;
}

/* ── RESET ──────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
    font-family: var(--font-body);
    background: linear-gradient(to top, #f5f6fa, #ffffff);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── TYPOGRAPHY ─────────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-brand);
    font-weight: 100;
    color: var(--purple-dark);
    line-height: 1.25;
}

/* ── HEADER ─────────────────────────────────────────────────────────────────── */

.site-header {
    background: var(--bg-white);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0px 4px 9px #42218616;
}

.site-header__inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
    height: 56px;
}

.site-logo {
    font-family: var(--font-brand);
    font-size: 22px;
    font-weight: 100;
    color: var(--purple-dark);
    white-space: nowrap;
    padding-top: 5px;
}

.site-logo span {
    color: var(--purple);
    font-weight: 400;
}

.site-nav {
    display: flex;
    gap: 0;
    list-style: none;
    flex: 1;
}

.site-nav li a {
    display: block;
    padding: 0 16px;
    line-height: 56px;
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-brand);
    font-weight: 200;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color .15s, background .15s;
}

.site-nav li a:hover,
.site-nav li a.active {
    color: var(--purple);
    background: var(--bg-light);
    text-decoration: none;
}

/* ── PINNED HERO ─────────────────────────────────────────────────────────────── */

.hero-pinned {
    background: linear-gradient(135deg, var(--purple-gradient-start), var(--purple-gradient-end));
    color: var(--text-on-purple);
    overflow: hidden;
}

.hero-pinned__inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: stretch;
    min-height: 300px;
}

.hero-pinned__text {
    flex: 1;
    padding: 40px 48px 40px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.hero-pinned__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.7;
    font-family: var(--font-brand);
}

.hero-pinned__title {
    font-family: var(--font-brand);
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 100;
    color: #fff;
    line-height: 1.2;
}

.hero-pinned__promo {
    font-size: 15px;
    opacity: 0.85;
    line-height: 1.55;
    max-width: 520px;
}

.hero-pinned__cta {
    display: inline-block;
    margin-top: 8px;
    padding: 12px 24px 10px 24px;
    background: rgba(40,20,70,0.85);
    color: #fff;
    font-size: 13px;
    font-family: var(--font-brand);
    letter-spacing: 0.06em;
    transition: background .2s;
    align-self: flex-start;
}

.hero-pinned__cta:hover { background: rgba(255,255,255,0.28); text-decoration: none; }

.hero-pinned__image {
    width: 420px;
    flex-shrink: 0;
    overflow: hidden;
}

.hero-pinned__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── MAIN LAYOUT ─────────────────────────────────────────────────────────────── */

.site-main {
    width: 100%;   /* ← add this */
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 32px 24px;
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 32px;
    align-items: start;
    flex: 1;
}

.site-content {
    max-width: 720px;
}

/* ── POST LIST ──────────────────────────────────────────────────────────────── */

.post-list { display: flex; flex-direction: column; gap: 0; }

.post-card {
    display: flex;
    gap: 20px;
    padding: 20px 0;
}

.post-card:first-child { padding-top: 0; }

.post-card__thumb {
    width: 140px;
    height: 100px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 5px;
    background: var(--bg-light);
}

.post-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

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

.post-card__body { flex: 1; min-width: 0; }

.post-card__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.post-card__category {
    display: inline-block;
    padding: 4px 10px 0px 10px;
    background: var(--purple);
    color: #fff;
    font-size: 10px;
    font-family: var(--font-brand);
    font-weight: 200;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.post-card__date {
    font-size: 12px;
    padding: 5px 0px 0px 0px;
    color: var(--text-muted);
    font-family: var(--font-brand);
}

.post-card__title {
    font-size: 18px;
    font-weight: 100;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.post-card__readmore {
    font-size: 12px;
    color: var(--purple);
    font-family: var(--font-brand);
    letter-spacing: 0.04em;
}

/* ── PAGINATION ─────────────────────────────────────────────────────────────── */

.pagination {
    display: flex;
    gap: 4px;
    margin-top: 28px;
    align-items: center;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 13px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: background .15s, color .15s;
}

.pagination a:hover { background: var(--bg-light); text-decoration: none; color: var(--purple); }
.pagination .current { background: var(--purple); color: #fff; border-color: var(--purple); }

/* ── SIDEBAR ────────────────────────────────────────────────────────────────── */

.sidebar { display: flex; flex-direction: column; gap: 24px; }

.widget-panel {
    background: var(--bg-white);
    border-left: 4px solid var(--purple);
    padding: 16px 20px 20px;
    box-shadow: 0px 4px 9px #42218616;
}

.widget-panel__title {
    font-family: var(--font-brand);
    font-size: 13px;
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--purple-dark);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* Search widget */
.search-form { display: flex; gap: 0; }

.search-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-right: none;
    font-size: 13px;
    font-family: var(--font-body);
    outline: none;
}

.search-form input:focus { border-color: var(--purple); }

.search-form button {
    padding: 8px 16px;
    background: var(--purple);
    color: #fff;
    border: none;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font-brand);
    font-weight: 200;
    letter-spacing: 0.06em;
    transition: opacity .15s;
}

.search-form button:hover { opacity: 0.85; }

/* Tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

.tag-cloud a {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid var(--purple-light);
    color: var(--purple);
    font-size: 11px;
    font-family: var(--font-brand);
    transition: background .15s, color .15s;
}

.tag-cloud a:hover {
    background: var(--purple);
    color: #fff;
    text-decoration: none;
    border-color: var(--purple);
}

/* Category list */
.category-list { list-style: none; }

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-primary);
    transition: color .15s;
}

.category-list a:hover { color: var(--purple); text-decoration: none; font-weight: bold; }

.category-list .count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 1px 7px;
}

/* ── SINGLE POST ────────────────────────────────────────────────────────────── */

.post-single { max-width: var(--content-max); margin: 0 auto; padding: 32px 24px; }

.post-single__header { margin-bottom: 32px; }

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

.post-single__title {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 100;
    color: var(--purple-dark);
    line-height: 1.2;
    margin-bottom: 16px;
}

.post-single__featured {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    margin-bottom: 32px;
}

/* Post content typography */
.post-content { font-size: 16px; line-height: 1.75; color: var(--text-primary); }
.post-content h2 { font-size: 24px; font-weight: 100; margin: 36px 0 12px; }
.post-content h3 { font-size: 20px; font-weight: 200; margin: 28px 0 10px; }
.post-content p  { margin-bottom: 18px; }
.post-content ul, .post-content ol { padding-left: 24px; margin-bottom: 18px; }
.post-content li { margin-bottom: 6px; }
.post-content blockquote {
    border-left: 4px solid var(--purple);
    padding: 12px 20px;
    margin: 24px 0;
    background: var(--bg-light);
    color: var(--text-muted);
    font-style: italic;
}

.post-content code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-light);
    padding: 2px 6px;
    border: 1px solid var(--border);
}

.post-content pre {
    background: var(--purple-dark);
    color: #f0e8f8;
    padding: 20px 24px;
    overflow-x: auto;
    margin: 24px 0;
    border-left: 4px solid var(--purple);
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: 13px;
}

.post-content img {
    max-width: 100%;
    margin: 24px auto;
}

/* ── TECH STACK ("Built with technologies I love") ──────────────────────────── */

.tech-stack {
    border-top: 1px solid var(--border);
    background: linear-gradient(135deg, var(--purple-gradient-start), var(--purple-gradient-end));
    padding: 48px 24px;
    margin-top: 48px;
}

.tech-stack__inner {
    max-width: var(--content-max);
    margin: 0 auto;
}

.tech-stack__heading {
    font-family: var(--font-brand);
    font-weight: 200;
    color: #fff;
    font-size: 26px;
    margin: 0 0 6px;
}

.tech-stack__subtitle {
    color: #fff;
    font-size: 14px;
    margin: 0 0 28px;
}

.tech-stack__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.tech-card {
    position: relative;
    display: block;
    background: var(--bg-white);
    border: 1px solid var(--border);
    padding: 20px 22px;
    color: var(--text-primary);
    transition: border-color .15s, transform .15s, box-shadow .15s;
}

.tech-card:hover {
    border-color: var(--purple-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 0, 76, 0.08);
    text-decoration: none;
}

.tech-card__icon { font-size: 30px; display: block; line-height: 1; }

.tech-card__name {
    display: block;
    margin-top: 12px;
    font-family: var(--font-brand);
    font-weight: 400;
    font-size: 19px;
    color: var(--purple-dark);
}

.tech-card__org {
    display: block;
    font-size: 12px;
    color: var(--purple);
    margin-top: 2px;
}

.tech-card__desc {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.tech-card__arrow {
    position: absolute;
    top: 20px;
    right: 22px;
    color: var(--purple-light);
    font-size: 18px;
    transition: transform .15s, color .15s;
}

.tech-card:hover .tech-card__arrow { color: var(--purple); transform: translateX(3px); }

/* ── FOOTER ─────────────────────────────────────────────────────────────────── */

.site-footer {
    background: var(--purple-dark);
    color: rgba(255,255,255,0.55);
    font-size: 12px;
    font-family: var(--font-brand);
    font-weight: 200;
    padding: 20px 24px;
}

.site-footer__inner {
    max-width: var(--content-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.site-footer__links { display: flex; gap: 20px; }

.site-footer a { color: rgba(255,255,255,0.55); transition: color .15s; }
.site-footer a:hover { color: rgba(255,255,255,0.9); text-decoration: none; }

/* ── SEARCH RESULTS PAGE ────────────────────────────────────────────────────── */

.search-results__heading {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.search-results__heading em { color: var(--purple); font-style: normal; font-weight: 400; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .site-main { grid-template-columns: 1fr; }
    .hero-pinned__image { display: none; }
    .hero-pinned__text { padding: 32px 24px; }
    .post-card__thumb { width: 100px; height: 80px; }
    .site-header__inner { padding: 0 16px; }
    .tech-stack__grid { grid-template-columns: 1fr; }
}
