/* =====================================================
   Forgeveil — minimal Ghost theme
   ===================================================== */

:root {
    --accent: #e63946;
    --accent-strong: #ff4d5e;
    --bg: #0b0d12;
    --bg-soft: #131620;
    --bg-elev: #1a1e2a;
    --text: #eef0f4;
    --text-soft: #9aa0ad;
    --line: #232735;
    --maxw: 1280px;
    --narrow: 760px;
    --radius: 14px;
    --shadow: 0 8px 24px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.25);
    --serif: 'Fraunces', 'Iowan Old Style', 'Georgia', serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--sans);
    color: var(--text);
    background: var(--bg);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container-narrow { width: 100%; max-width: var(--narrow); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(11,13,18,.82);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow .3s, background .3s;
}
.site-header.is-scrolled {
    box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(0,0,0,.4);
}
.site-header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px; padding: 18px 24px; max-width: var(--maxw); margin: 0 auto;
}
.site-brand { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.site-title {
    font-family: var(--serif); font-weight: 800; font-size: 22px; letter-spacing: -.01em;
    color: var(--accent);
}
.site-title:hover { color: var(--accent-strong); }
.site-logo img { max-height: 36px; width: auto; }
.site-description {
    margin: 0; color: var(--text-soft); font-size: 13px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 40ch;
}
.site-nav { display: flex; align-items: center; gap: 10px; }
.nav-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; gap: 22px;
}
.nav-item a {
    font-size: 14px; font-weight: 500; color: var(--text-soft);
    position: relative; padding: 6px 0;
}
.nav-item a:hover { color: var(--accent); }
.nav-item.is-current a { color: var(--text); }
.nav-item.is-current a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0;
    height: 2px; background: var(--accent); border-radius: 2px;
}
.nav-toggle {
    display: none; background: none; border: 0; cursor: pointer;
    width: 36px; height: 36px; padding: 0; flex-direction: column;
    justify-content: center; align-items: center; gap: 5px;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s; }
.mobile-menu {
    border-top: 1px solid var(--line); background: var(--bg);
}
.mobile-menu ul { list-style: none; margin: 0; padding: 8px 24px 16px; }
.mobile-menu li a { display: block; padding: 12px 0; font-weight: 500; border-bottom: 1px solid var(--line); }

/* ---------- Archive headers (tag/author pages) ---------- */
.hero-bg {
    position: absolute; inset: 0; background-size: cover; background-position: center;
}
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 60%, rgba(0,0,0,.75) 100%);
}
.hero-inner { position: relative; padding: 80px 24px 64px; width: 100%; max-width: var(--maxw); margin: 0 auto; }
.hero-eyebrow {
    text-transform: uppercase; letter-spacing: .18em; font-size: 12px;
    margin: 0 0 14px; opacity: .85;
}
.hero-title {
    font-family: var(--serif); font-weight: 800;
    font-size: clamp(40px, 6vw, 72px); line-height: 1.04;
    margin: 0; letter-spacing: -.02em;
}
.hero-sub { font-size: 18px; max-width: 60ch; margin: 18px 0 0; opacity: .9; }

/* ---------- Feed ---------- */
.feed-section { padding: 56px 24px 96px; }
.feed-heading {
    font-family: var(--serif); font-weight: 700; font-size: 22px;
    margin: 56px 0 24px; padding-bottom: 12px;
    border-bottom: 1px solid var(--line); letter-spacing: -.01em;
}

/* ---------- Showcase (Zoomit-style hero) ---------- */
.showcase { padding: 36px 24px 16px; }
.showcase-grid {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.showcase-list {
    display: flex; flex-direction: column;
    border-top: 1px solid var(--line);
}
.showcase-item {
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    align-items: center;
    transition: transform .25s ease;
}
.showcase-item:hover { transform: translateX(2px); }
.showcase-item:hover .showcase-item-title { color: var(--accent); }
.showcase-item-text { min-width: 0; }
.showcase-item-tag {
    display: inline-block;
    font-size: 11px; font-weight: 600; letter-spacing: .14em;
    text-transform: uppercase; color: var(--accent);
    margin-bottom: 6px;
}
.showcase-item-title {
    font-family: var(--serif); font-weight: 700;
    font-size: 16px; line-height: 1.35; letter-spacing: -.01em;
    margin: 0 0 6px;
    color: var(--text);
    transition: color .2s;
    display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
}
.showcase-item-meta {
    font-size: 12px; color: var(--text-soft);
    display: inline-flex; gap: 6px; align-items: center;
}
.showcase-item-thumb {
    width: 110px;
    border-radius: 8px; overflow: hidden;
    background: var(--bg-soft);
    align-self: center;
}
.showcase-item-thumb img { display: block; width: 100%; height: auto; transition: transform .5s; }
.showcase-item:hover .showcase-item-thumb img { transform: scale(1.05); }

.showcase-hero {
    display: flex; flex-direction: column; gap: 24px;
    min-width: 0;
}
.showcase-hero-image {
    display: block; overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-soft);
    box-shadow: var(--shadow);
}
.showcase-hero-image img {
    display: block; width: 100%; height: auto;
    transition: transform .8s ease;
}
.showcase-hero-image:hover img { transform: scale(1.03); }
.showcase-hero-body { padding: 0 4px; }
.showcase-hero-tag {
    display: inline-block;
    font-size: 12px; font-weight: 600; letter-spacing: .16em;
    text-transform: uppercase; color: var(--accent);
    margin-bottom: 14px;
}
.showcase-hero-title {
    font-family: var(--serif); font-weight: 800;
    font-size: clamp(28px, 3.4vw, 44px); line-height: 1.1;
    margin: 0 0 14px; letter-spacing: -.025em;
}
.showcase-hero-title a { transition: color .2s; }
.showcase-hero-title a:hover { color: var(--accent); }
.showcase-hero-excerpt {
    color: var(--text-soft); font-size: 17px;
    margin: 0 0 16px; line-height: 1.6;
}
.showcase-hero-meta {
    font-size: 13px; color: var(--text-soft);
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}

@media (max-width: 960px) {
    .showcase-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .showcase-hero { order: -1; }
}
@media (max-width: 520px) {
    .showcase-item { grid-template-columns: 1fr 90px; }
    .showcase-item-thumb { width: 90px; }
}

/* Post grid */
.post-feed {
    display: grid; gap: 36px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 960px) {
    .post-feed { grid-template-columns: repeat(2, 1fr); }
    .featured-post { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .post-feed { grid-template-columns: 1fr; gap: 32px; }
}

.post-card { display: flex; flex-direction: column; }
.post-card-image-link {
    display: block; overflow: hidden; border-radius: var(--radius);
    background: var(--bg-soft); margin-bottom: 16px;
}
.post-card-image {
    display: block; width: 100%; height: auto;
    transition: transform .5s ease;
}
.post-card-image-link:hover .post-card-image { transform: scale(1.04); }
.post-card-tags {
    display: flex; flex-wrap: wrap; gap: 6px 14px;
    margin-bottom: 10px;
}
.post-card-tag {
    display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .16em;
    text-transform: uppercase; color: var(--accent-strong);
    transition: color .2s;
}
.post-card-tag:hover { color: var(--accent); }
.post-card-title {
    font-family: var(--serif); font-weight: 700;
    font-size: 22px; line-height: 1.22; letter-spacing: -.015em;
    margin: 0 0 10px;
}
.post-card-title a { transition: color .2s; }
.post-card-title a:hover { color: var(--accent-strong); }
.post-card-excerpt { color: var(--text-soft); margin: 0 0 12px; font-size: 15px; }
.post-card-meta {
    font-size: 13px; color: var(--text-soft); display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.post-card-meta .dot { opacity: .6; }

/* ---------- Single post ---------- */
.post-header { padding: 72px 24px 28px; text-align: left; }
.post-tag {
    display: inline-block; font-size: 12px; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
    transition: color .2s;
}
.post-tag:hover { color: var(--accent-strong); }
.post-title {
    font-family: var(--serif); font-weight: 800;
    font-size: clamp(34px, 5vw, 60px); line-height: 1.08;
    margin: 0 0 18px; letter-spacing: -.02em;
}
.post-subtitle { font-size: 20px; color: var(--text-soft); margin: 0 0 24px; line-height: 1.5; }
.post-meta {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    font-size: 14px; color: var(--text-soft);
    padding-bottom: 24px; border-bottom: 1px solid var(--line);
}
.post-author { display: inline-flex; align-items: center; gap: 8px; }
.author-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

.post-feature {
    margin: 32px auto 40px; max-width: 1280px; padding: 0 24px;
    display: flex; flex-direction: column; align-items: center;
}
.post-feature img {
    width: 100%; height: auto; object-fit: unset;
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.post-feature figcaption { font-size: 13px; color: var(--text-soft); margin-top: 10px; text-align: center; }

.post-content { font-size: 18px; line-height: 1.75; padding-top: 8px; }
.post-content > * + * { margin-top: 1.2em; }
.post-content h2, .post-content h3, .post-content h4 {
    font-family: var(--serif); font-weight: 700; letter-spacing: -.01em;
    margin-top: 2em; margin-bottom: .5em; line-height: 1.25;
}
.post-content h2 { font-size: 30px; }
.post-content h3 { font-size: 24px; }
.post-content h4 { font-size: 20px; }
.post-content p { margin: 0; }
.post-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-content blockquote {
    margin: 1.5em 0; padding: 4px 0 4px 24px;
    border-left: 3px solid var(--accent);
    font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--text);
}
.post-content code {
    background: var(--bg-soft); padding: 2px 6px; border-radius: 4px;
    font-size: .9em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.post-content pre {
    background: #0e0e10; color: #eaeaea; padding: 18px 20px;
    border-radius: var(--radius); overflow: auto; font-size: 14px; line-height: 1.55;
}
.post-content pre code { background: transparent; padding: 0; color: inherit; }
.post-content img, .post-content .kg-image { border-radius: var(--radius); }
.post-content figure { margin: 1.4em 0; }
.post-content figcaption { font-size: 13px; color: var(--text-soft); text-align: center; margin-top: 8px; }
.post-content hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content li + li { margin-top: .4em; }

/* Ghost cards */
.kg-width-wide  { max-width: 1040px; margin-left: auto; margin-right: auto; }
.kg-width-full  { max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); border-radius: 0; }
.kg-width-full img { border-radius: 0; }
.kg-bookmark-card {
    display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
    text-decoration: none !important; color: inherit;
}
.kg-bookmark-content { padding: 20px; flex: 1; }
.kg-bookmark-thumbnail img { width: 200px; height: 100%; object-fit: cover; }
.kg-callout-card { padding: 18px 20px; border-radius: var(--radius); background: var(--bg-soft); }

/* Post footer */
.post-footer { padding: 40px 24px 72px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.tag-pill {
    font-size: 13px; color: var(--text-soft);
    padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
}
.tag-pill:hover { color: var(--accent); border-color: var(--accent); }
.author-card {
    display: flex; gap: 16px; align-items: center;
    padding: 20px; background: var(--bg-soft); border-radius: var(--radius);
    margin-top: 16px;
}
.author-card-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.author-card h4 { margin: 0 0 4px; font-size: 16px; }
.author-card p { margin: 0; color: var(--text-soft); font-size: 14px; }

/* Related */
.related-section { padding: 48px 24px 96px; border-top: 1px solid var(--line); }

/* Archive headers */
.archive-header { position: relative; min-height: 38vh; display: flex; align-items: flex-end; color: #fff; background: var(--accent); overflow: hidden; }
.archive-header .hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.archive-header .hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.2), rgba(0,0,0,.7)); }
.archive-count { margin-top: 14px; font-size: 14px; opacity: .85; letter-spacing: .04em; }
.author-hero { display: flex; flex-direction: column; align-items: flex-start; }
.author-hero-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 16px; border: 3px solid rgba(255,255,255,.4); }

/* Pagination */
.pagination {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line);
    font-size: 14px; color: var(--text-soft);
}
.pagination a {
    padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px;
    font-weight: 500;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }

/* Error */
.error-section { text-align: center; padding: 120px 24px; }
.error-code { font-family: var(--serif); font-size: 96px; margin: 0; font-weight: 800; color: var(--accent); }
.error-title { font-family: var(--serif); font-size: 32px; margin: 8px 0 12px; }
.error-text { color: var(--text-soft); margin: 0 0 28px; }
.btn {
    display: inline-block; padding: 12px 22px; border-radius: 999px;
    background: var(--accent); color: #fff; font-weight: 600;
}
.btn:hover { color: #fff; opacity: .9; }

/* Footer base */
.site-footer {
    border-top: 1px solid var(--line); background: var(--bg-soft);
    padding: 64px 0 36px; margin-top: 64px;
}
.footer-title { font-family: var(--serif); font-weight: 800; font-size: 22px; color: var(--text); }
.footer-text { color: var(--text-soft); margin: 6px 0 0; font-size: 14px; }

@media (max-width: 720px) {
    .site-description { display: none; }
    .nav-list { display: none; }
    .nav-toggle { display: inline-flex; }
    .post-feature { padding: 0 16px; }
}

/* ---------- Nav actions (search / subscribe) ---------- */
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    transition: color .2s, border-color .2s, background .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); background: var(--bg-soft); }

.btn-pill {
    display: inline-flex; align-items: center;
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff !important;
    font-size: 14px; font-weight: 600;
    border: 1px solid var(--accent);
    transition: opacity .2s, transform .2s;
}
.btn-pill:hover { opacity: .9; transform: translateY(-1px); }
.btn-pill.ghost {
    background: transparent;
    color: var(--text) !important;
    border-color: var(--line);
}
.btn-pill.ghost:hover { border-color: var(--accent); }

/* ---------- Badges ---------- */
.featured-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px;
    font-size: 11px; font-weight: 600;
    letter-spacing: .04em;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
}
.featured-badge.inline {
    margin-right: 6px;
    vertical-align: middle;
}
.featured-badge.floating {
    position: absolute; top: 12px; left: 12px;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.showcase-hero-image, .post-card-image-link { position: relative; }
.members-badge {
    position: absolute; top: 12px; right: 12px;
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,.6);
    color: #fff;
    backdrop-filter: blur(4px);
    z-index: 2;
}
.visibility-badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .12em;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--text-soft);
    border: 1px solid var(--line);
}
.post-header-meta {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    margin-bottom: 14px;
}

/* Inline featured marker on showcase list */
.showcase-item-text .featured-badge {
    padding: 2px 6px;
    font-size: 10px;
    margin-bottom: 6px;
}

/* ---------- Members CTA ---------- */
.members-cta {
    margin: 48px auto 0;
    padding: 36px 28px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
}
.members-cta h3 {
    font-family: var(--serif); font-size: 24px; font-weight: 700;
    margin: 0 0 10px; letter-spacing: -.01em;
}
.members-cta p { color: var(--text-soft); margin: 0 0 22px; }
.members-cta-actions { display: inline-flex; gap: 16px; flex-wrap: wrap; justify-content: center; align-items: center; }
.btn-link { color: var(--text-soft); font-size: 14px; }
.btn-link:hover { color: var(--accent); }

/* ---------- Footer (extended) ---------- */
.site-footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr;
    gap: 56px;
    align-items: start;
    padding: 0 24px;
}
.footer-brand { max-width: 360px; }
.footer-social {
    display: flex; gap: 12px; margin-top: 18px;
}
.footer-social a {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--line);
    color: var(--text-soft);
    transition: color .2s, border-color .2s, transform .2s;
}
.footer-social a:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}
.footer-nav {
    display: flex; gap: 56px;
}
.footer-nav-col h5 {
    font-size: 12px; text-transform: uppercase; letter-spacing: .14em;
    color: var(--text-soft); margin: 0 0 14px; font-weight: 600;
}
.footer-nav-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-nav-col a { font-size: 14px; color: var(--text); }
.footer-nav-col a:hover { color: var(--accent); }

.footer-subscribe h5 {
    font-size: 12px; text-transform: uppercase; letter-spacing: .14em;
    color: var(--text-soft); margin: 0 0 10px; font-weight: 600;
}
.footer-subscribe p { color: var(--text-soft); font-size: 14px; margin: 0 0 14px; }
.footer-subscribe-row {
    display: flex; gap: 8px;
}
.footer-subscribe-row input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--text);
    font-family: inherit; font-size: 14px;
    outline: none;
    transition: border-color .2s;
}
.footer-subscribe-row input:focus { border-color: var(--accent); }
.footer-subscribe .btn { padding: 10px 18px; }

.site-footer-bottom {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 13px;
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}

@media (max-width: 880px) {
    .site-footer-inner { grid-template-columns: 1fr; gap: 36px; }
    .footer-nav { gap: 36px; }
}
@media (max-width: 720px) {
    .nav-actions .btn-pill { display: none; }
    .footer-nav { flex-direction: column; gap: 24px; }
    .site-footer-bottom { justify-content: center; text-align: center; }
}

/* ---------- Accessibility: focus states ---------- */
:focus { outline: none; }
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}
.btn:focus-visible,
.btn-pill:focus-visible,
.icon-btn:focus-visible,
.pagination a:focus-visible,
.tag-pill:focus-visible {
    outline-offset: 3px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .showcase-item:hover,
    .btn-pill:hover,
    .footer-social a:hover,
    .post-card-image-link:hover .post-card-image,
    .showcase-hero-image:hover img,
    .showcase-item:hover .showcase-item-thumb img {
        transform: none !important;
    }
}
