/* ==========================================
   EEHARDWARE — screen.css  v1.1.0
   Minimal Ghost theme — Casper-compliant
   ========================================== */

/* ---- Variables ---- */
:root {
    --white:        #ffffff;
    --bg:           #fafafa;
    --border:       #e8e8e8;
    --border-light: #f2f2f2;
    --text:         #1a1a1a;
    --text-2:       #555;
    --text-3:       #999;
    --header-h:     52px;
    --max-w:        1120px;
    --sidebar-w:    240px;
    --content-w:    760px;
    --gap:          32px;

    --font:       'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-serif: 'Noto Serif SC', 'SimSun', Georgia, serif;
    --font-mono:  'JetBrains Mono', 'Consolas', monospace;
    --radius:     6px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { font-size: 15px; scroll-behavior: smooth; }
body  { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.8; -webkit-font-smoothing: antialiased; }
a     { color: inherit; text-decoration: none; }
img   { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: var(--font); }

/* =============================================
   HEADER
   ============================================= */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
}
.header-inner {
    max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
    height: 100%; display: flex; align-items: center;
}

.site-logo { flex-shrink: 0; margin-right: 28px; }
.logo-img   { height: 28px; width: auto; }
.logo-text  {
    font-size: 16px; font-weight: 500; color: var(--text);
    letter-spacing: 0.04em; text-transform: uppercase;
}

.site-nav { flex: 1; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav ul { display: flex; height: var(--header-h); }
.site-nav ul li a {
    display: flex; align-items: center; height: 100%;
    padding: 0 12px; font-size: 13px; color: var(--text-2);
    border-bottom: 2px solid transparent; white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.site-nav ul li a:hover          { color: var(--text); }
.site-nav ul li.nav-current a   { color: var(--text); font-weight: 500; border-bottom-color: var(--text); }

.header-actions { flex-shrink: 0; display: flex; align-items: center; margin-left: 12px; }
.header-btn {
    background: none; border: none; padding: 7px; display: flex; align-items: center;
    color: var(--text-3); border-radius: 4px; transition: color 0.15s;
}
.header-btn:hover { color: var(--text); }

/* =============================================
   LAYOUT
   ============================================= */
.layout {
    max-width: var(--max-w); margin: 0 auto; padding: 32px 24px;
    display: grid; grid-template-columns: 1fr var(--sidebar-w);
    gap: var(--gap); align-items: start;
}
.content-area { min-width: 0; }

/* Full-width (no sidebar) */
.layout-full {
    max-width: var(--content-w); margin: 0 auto; padding: 36px 24px;
}

/* =============================================
   POST FEED
   ============================================= */
.post-feed { display: flex; flex-direction: column; }

.post-card {
    display: grid; grid-template-columns: 1fr auto;
    gap: 20px; align-items: start;
    padding: 22px 0; border-bottom: 1px solid var(--border);
}
.post-card:first-child { padding-top: 0; }
.post-card:last-child  { border-bottom: none; }

.post-card-tags {
    font-size: 11px; color: var(--text-3); text-transform: uppercase;
    letter-spacing: 0.05em; margin-bottom: 8px;
}
.post-card-tags a { color: var(--text-3); transition: color 0.15s; }
.post-card-tags a:hover { color: var(--text); }

.post-card-title { font-size: 15px; font-weight: 500; line-height: 1.45; margin-bottom: 8px; }
.post-card-title a { color: var(--text); transition: color 0.15s; }
.post-card-title a:hover { text-decoration: underline; text-underline-offset: 2px; }

.post-card-excerpt {
    font-size: 13px; color: var(--text-2); line-height: 1.75;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.post-card-meta {
    display: flex; align-items: center; gap: 8px; margin-top: 12px;
    font-size: 11.5px; color: var(--text-3);
}
.meta-dot { width: 2px; height: 2px; border-radius: 50%; background: var(--border); flex-shrink: 0; }

.post-card-thumb {
    width: 112px; height: 76px; flex-shrink: 0;
    border-radius: var(--radius); overflow: hidden; display: block;
}
.post-card-thumb img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s;
}
.post-card:hover .post-card-thumb img { transform: scale(1.04); }

/* =============================================
   FEATURED POST (home.hbs)
   ============================================= */
.post-featured {
    display: grid; grid-template-columns: 1fr 1fr;
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; margin-bottom: 32px; background: var(--white);
}
.post-featured-thumb { display: block; overflow: hidden; }
.post-featured-thumb img {
    width: 100%; height: 100%; min-height: 240px; object-fit: cover;
    transition: transform 0.4s;
}
.post-featured:hover .post-featured-thumb img { transform: scale(1.03); }
.post-featured-body {
    padding: 28px; display: flex; flex-direction: column; gap: 10px;
}
.post-featured-badge {
    display: inline-block; font-size: 10px; font-weight: 500;
    letter-spacing: 0.06em; text-transform: uppercase;
    border: 1px solid var(--border); border-radius: 20px;
    padding: 2px 10px; color: var(--text-3); width: fit-content;
}
.post-featured-title { font-size: 1.25rem; font-weight: 500; line-height: 1.4; }
.post-featured-title a { color: var(--text); transition: color 0.15s; }
.post-featured-title a:hover { text-decoration: underline; text-underline-offset: 2px; }
.post-featured-excerpt { font-size: 13px; color: var(--text-2); line-height: 1.75; flex: 1; }

/* =============================================
   POST META
   ============================================= */
.post-meta {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--text-3); flex-wrap: wrap;
}
.meta-author { display: flex; align-items: center; gap: 6px; }
.meta-author a { color: var(--text-2); transition: color 0.15s; }
.meta-author a:hover { color: var(--text); }
.meta-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 28px 0 0; font-size: 13px;
}
.pagination-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text-2); background: var(--white); transition: all 0.15s;
}
.pagination-btn:hover { border-color: var(--text); color: var(--text); }
.pagination-info { font-size: 12px; color: var(--text-3); }

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    position: sticky; top: calc(var(--header-h) + 16px);
    display: flex; flex-direction: column; gap: 26px;
}

.widget-title {
    font-size: 10.5px; font-weight: 500; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 0.07em;
    padding-bottom: 10px; margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.sidebar-search-btn {
    display: flex; align-items: center; gap: 8px; width: 100%;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--white); padding: 8px 12px;
    font-size: 13px; font-family: var(--font); color: var(--text-3);
    transition: border-color 0.15s, color 0.15s; text-align: left;
}
.sidebar-search-btn:hover { border-color: var(--text-2); color: var(--text-2); }
.sidebar-search-btn span { flex: 1; }

.recent-list { display: flex; flex-direction: column; gap: 14px; }
.recent-item { display: flex; gap: 10px; align-items: flex-start; }
.recent-thumb {
    width: 44px; height: 44px; flex-shrink: 0;
    border-radius: 4px; overflow: hidden; display: block;
}
.recent-thumb img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.2s; }
.recent-thumb:hover img { opacity: 0.8; }
.recent-info { flex: 1; min-width: 0; }
.recent-title {
    font-size: 12.5px; color: var(--text); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    transition: color 0.15s;
}
.recent-title:hover { color: var(--text-2); }
.recent-date { font-size: 11px; color: var(--text-3); margin-top: 3px; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
    font-size: 11.5px; color: var(--text-2);
    border: 1px solid var(--border); border-radius: 20px;
    padding: 3px 10px; background: var(--white); transition: all 0.15s;
}
.tag-pill:hover { border-color: var(--text); color: var(--text); }

/* =============================================
   FULL POST
   ============================================= */
.post-full-header {
    padding-bottom: 24px; border-bottom: 1px solid var(--border); margin-bottom: 28px;
}
.post-full-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.post-full-title {
    font-family: var(--font-serif); font-size: 1.85rem; font-weight: 600;
    line-height: 1.35; margin-bottom: 16px;
}
.post-full-subtitle { font-size: 1.05rem; color: var(--text-2); margin-top: 10px; line-height: 1.6; }

.post-full-image { margin-bottom: 32px; border-radius: var(--radius); overflow: hidden; }
.post-full-image img { width: 100%; max-height: 520px; object-fit: cover; }
.post-full-image figcaption {
    font-size: 12px; color: var(--text-3); text-align: center;
    padding: 8px; background: var(--bg);
}

/* ---- Post content typography ---- */
.post-full-content { font-size: 15px; line-height: 1.9; color: var(--text); }

.post-full-content h2 { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; margin: 2.2rem 0 1rem; }
.post-full-content h3 { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.8rem; }
.post-full-content h4 { font-size: 1rem; font-weight: 500; margin: 1.8rem 0 0.6rem; }
.post-full-content p  { margin-bottom: 1.3rem; }

.post-full-content a {
    color: var(--text); text-decoration: underline;
    text-underline-offset: 2px; text-decoration-color: var(--border);
    transition: text-decoration-color 0.15s;
}
.post-full-content a:hover { text-decoration-color: var(--text); }

.post-full-content blockquote {
    border-left: 2px solid var(--border); padding: 10px 20px;
    margin: 1.8rem 0; color: var(--text-2); font-style: italic;
}
.post-full-content blockquote p:last-child { margin-bottom: 0; }

.post-full-content pre {
    background: #111; color: #e5e5e5;
    padding: 18px 20px; border-radius: var(--radius);
    overflow-x: auto; margin: 1.8rem 0;
    font-family: var(--font-mono); font-size: 13px; line-height: 1.65;
}
.post-full-content code {
    font-family: var(--font-mono); font-size: 0.875em;
    background: #f4f4f4; padding: 2px 5px; border-radius: 3px;
}
.post-full-content pre code { background: none; padding: 0; color: inherit; }

.post-full-content img   { max-width: 100%; border-radius: var(--radius); margin: 1.5rem auto; }
.post-full-content ul    { list-style: disc; padding-left: 1.4rem; margin-bottom: 1.3rem; }
.post-full-content ol    { list-style: decimal; padding-left: 1.4rem; margin-bottom: 1.3rem; }
.post-full-content li    { margin-bottom: 0.4rem; }
.post-full-content hr    { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.post-full-content table { width: 100%; border-collapse: collapse; margin: 1.8rem 0; font-size: 13.5px; }
.post-full-content th, .post-full-content td { padding: 9px 14px; border: 1px solid var(--border); text-align: left; }
.post-full-content th    { background: var(--bg); font-weight: 500; }

/* =============================================
   GHOST EDITOR CARDS — kg-width-wide / kg-width-full
   Required by Ghost gscan validator
   ============================================= */
.post-full-content .kg-image-card         { margin: 1.8rem 0; }
.post-full-content .kg-image-card img     { width: 100%; border-radius: var(--radius); margin: 0; }
.post-full-content .kg-image-card figcaption { font-size: 12px; color: var(--text-3); text-align: center; padding: 8px 0; }

/* Wide breakout — extends beyond text column */
.post-full-content .kg-width-wide {
    position: relative;
    width: 85vw;
    max-width: 1100px;
    margin-left: calc(50% - 42.5vw);
    margin-right: calc(50% - 42.5vw);
}

/* Full breakout — 100vw edge-to-edge */
.post-full-content .kg-width-full {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
}
.post-full-content .kg-width-full img { border-radius: 0; }
.post-full-content .kg-width-full figcaption { max-width: var(--max-w); margin: 0 auto; padding: 8px 24px; font-size: 12px; color: var(--text-3); }

/* Gallery card */
.post-full-content .kg-gallery-container { margin: 1.8rem 0; }
.post-full-content .kg-gallery-row       { display: flex; gap: 6px; margin-bottom: 6px; }
.post-full-content .kg-gallery-image     { flex: 1; overflow: hidden; border-radius: 4px; }
.post-full-content .kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; margin: 0; }

/* Embed card */
.post-full-content .kg-embed-card { margin: 1.8rem 0; }
.post-full-content .kg-embed-card iframe { width: 100%; }

/* Bookmark card */
.post-full-content .kg-bookmark-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; margin: 1.8rem 0; display: block;
    transition: border-color 0.15s;
}
.post-full-content .kg-bookmark-card:hover { border-color: var(--text-2); }
.post-full-content .kg-bookmark-container { display: flex; }
.post-full-content .kg-bookmark-content   { flex: 1; padding: 16px; }
.post-full-content .kg-bookmark-title     { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.post-full-content .kg-bookmark-description { font-size: 12px; color: var(--text-2); margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-full-content .kg-bookmark-metadata  { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-3); }
.post-full-content .kg-bookmark-icon      { width: 16px; height: 16px; }
.post-full-content .kg-bookmark-thumbnail { width: 140px; flex-shrink: 0; }
.post-full-content .kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; margin: 0; }

/* Callout card */
.post-full-content .kg-callout-card {
    display: flex; gap: 12px; padding: 16px;
    background: var(--bg); border-radius: var(--radius);
    margin: 1.8rem 0; border-left: 3px solid var(--border);
}
.post-full-content .kg-callout-emoji { font-size: 1.2rem; flex-shrink: 0; }

/* Video card */
.post-full-content .kg-video-card { margin: 1.8rem 0; border-radius: var(--radius); overflow: hidden; }
.post-full-content .kg-video-card video { width: 100%; display: block; }

/* Audio card */
.post-full-content .kg-audio-card { margin: 1.8rem 0; }
.post-full-content .kg-audio-card audio { width: 100%; }

/* File card */
.post-full-content .kg-file-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px; margin: 1.8rem 0; display: flex;
    align-items: center; justify-content: space-between; gap: 12px;
}
.post-full-content .kg-file-card-title   { font-size: 14px; font-weight: 500; }
.post-full-content .kg-file-card-caption { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Button card */
.post-full-content .kg-button-card { text-align: center; margin: 1.8rem 0; }
.post-full-content .kg-btn {
    display: inline-block; padding: 10px 24px;
    border: 1px solid var(--text); border-radius: var(--radius);
    font-size: 14px; font-weight: 500; color: var(--text);
    transition: background 0.15s, color 0.15s;
}
.post-full-content .kg-btn:hover { background: var(--text); color: var(--white); }

/* NFT card fallback */
.post-full-content .kg-nft-card { margin: 1.8rem 0; }

/* Toggle card */
.post-full-content .kg-toggle-card { margin: 1.8rem 0; border: 1px solid var(--border); border-radius: var(--radius); }
.post-full-content .kg-toggle-heading { padding: 12px 16px; font-weight: 500; cursor: pointer; }
.post-full-content .kg-toggle-content { padding: 0 16px 12px; }

/* ---- Post footer ---- */
.post-full-footer {
    margin-top: 36px; padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 20px;
}
.post-full-footer-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.footer-label { font-size: 11.5px; color: var(--text-3); }

.post-full-author-card {
    display: flex; gap: 16px; align-items: flex-start;
    padding: 20px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--white);
}
.author-card-img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-card-name { font-size: 14px; font-weight: 500; color: var(--text); }
.author-card-bio  { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.6; }

/* ---- Post navigation ---- */
.post-nav {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 12px; margin-top: 32px;
}
.post-nav-item {
    display: flex; flex-direction: column; gap: 4px;
    padding: 14px 16px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--white);
    transition: border-color 0.15s;
}
.post-nav-item:hover { border-color: var(--text-2); }
.post-nav-label {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--text-3);
}
.post-nav-title {
    font-size: 13px; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.post-nav-next { text-align: right; }
.post-nav-next .post-nav-label { justify-content: flex-end; }

.post-comments { margin-top: 32px; }

/* =============================================
   ARCHIVE (tag / author)
   ============================================= */
.archive-header { padding-bottom: 24px; margin-bottom: 0; border-bottom: 1px solid var(--border); }
.archive-cover  { height: 120px; background-size: cover; background-position: center; border-radius: var(--radius); margin-bottom: 16px; }
.archive-label  { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.archive-title  { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; }
.archive-desc   { font-size: 13.5px; color: var(--text-2); margin-top: 8px; }
.archive-count  { font-size: 12px; color: var(--text-3); margin-top: 8px; }

.author-profile { display: flex; align-items: center; gap: 16px; }
.author-profile-img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-website { font-size: 12px; color: var(--text-3); margin-top: 6px; display: inline-block; }
.author-website:hover { color: var(--text); }

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 20px; padding: 18px 24px;
}
.footer-inner {
    max-width: var(--max-w); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
}
.footer-copy, .footer-ghost { font-size: 12px; color: var(--text-3); }
.footer-copy a, .footer-ghost a { color: var(--text-3); transition: color 0.15s; }
.footer-copy a:hover, .footer-ghost a:hover { color: var(--text); }
.footer-nav ul { display: flex; gap: 16px; }
.footer-nav ul li a { font-size: 12px; color: var(--text-3); transition: color 0.15s; }
.footer-nav ul li a:hover { color: var(--text); }

/* =============================================
   ERROR PAGE
   ============================================= */
.error-page { max-width: 400px; margin: 100px auto; padding: 0 24px; text-align: center; }
.error-code  { font-family: var(--font-serif); font-size: 5rem; font-weight: 600; color: var(--border); line-height: 1; }
.error-msg   { font-size: 1rem; color: var(--text-2); margin: 16px 0 28px; }
.error-link  { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 860px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
}

@media (max-width: 640px) {
    .layout { padding: 20px 16px; }
    .layout-full { padding: 24px 16px; }
    .header-inner { padding: 0 16px; }
    .site-nav ul li a { padding: 0 9px; font-size: 12px; }

    .post-card { grid-template-columns: 1fr; }
    .post-card-thumb { width: 100%; height: 160px; }

    .post-featured { grid-template-columns: 1fr; }
    .post-featured-thumb img { min-height: 180px; }

    .post-full-title { font-size: 1.45rem; }
    .post-nav { grid-template-columns: 1fr; }
    .sidebar { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; text-align: center; }

    /* Wide/full cards fall back on mobile */
    .post-full-content .kg-width-wide,
    .post-full-content .kg-width-full {
        width: 100%; margin-left: 0; margin-right: 0;
    }
}

@media (max-width: 420px) {
    .site-nav ul li a { padding: 0 7px; font-size: 11.5px; }
}

/* page label in post-card */
.post-card-page-label {
    font-size: 10.5px; color: var(--text-3); text-transform: uppercase;
    letter-spacing: 0.05em; border: 1px solid var(--border-light);
    border-radius: 20px; padding: 1px 8px;
}
