/* ==========================================================================
   Jara Ghost Theme - screen.css
   Matches jara.money main site dark/gold design
   ========================================================================== */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

/* Variables
   ========================================================================== */

:root {
    --bg-deep: #0B0E17;
    --bg-card: #131722;
    --bg-card-hover: #1A1F2E;
    --bg-surface: #1E2333;
    --gold: #E8B931;
    --gold-dim: #D4901A;
    --gold-glow: rgba(245,166,35,0.15);
    --text-primary: #F2F0EB;
    --text-secondary: #A09E96;
    --text-muted: #6B6961;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --content-width: 720px;
    --container-width: 1200px;
}

/* Reset & Base
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-deep);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
}

a {
    color: var(--gold);
    text-decoration: none;
}

a:hover {
    color: var(--gold-dim);
    text-decoration: none;
}

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

/* Layout
   ========================================================================== */

.viewport {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.outer {
    padding-left: max(4vmin, 20px);
    padding-right: max(4vmin, 20px);
}

.inner {
    max-width: var(--container-width);
    margin: 0 auto;
    width: 100%;
}

/* Ghost Canvas - Content Width Grid
   ========================================================================== */

.gh-canvas {
    --gap: max(4vmin, 20px);
    --main: min(var(--content-width, 720px), 100% - var(--gap) * 2);
    --wide: minmax(0, calc((var(--container-width, 1200px) - var(--content-width, 720px)) / 2));
    --full: minmax(var(--gap), 1fr);

    display: grid;
    grid-template-columns:
        [full-start] var(--full)
        [wide-start] var(--wide)
        [main-start] var(--main) [main-end]
        var(--wide) [wide-end]
        var(--full) [full-end];
}

.gh-canvas > * {
    grid-column: main-start / main-end;
}

/* Koenig Editor Content Width Classes (required by Ghost)
   ========================================================================== */

.kg-width-wide,
.kg-content-wide > div {
    grid-column: wide-start / wide-end;
}

.kg-width-full {
    grid-column: full-start / full-end;
}

.kg-width-full img {
    width: 100%;
}

/* Header
   ========================================================================== */

.site-header {
    padding-top: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

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

.site-logo {
    display: flex;
    align-items: center;
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.site-logo:hover {
    color: var(--text-primary);
}

.site-logo img {
    max-height: 40px;
}

/* Nav — override Ghost's default <ul><li> output */
.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a {
    color: var(--text-secondary);
    font-size: 1.4rem;
    font-family: var(--font-body);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 10px;
    transition: color 0.2s, background 0.2s;
}

.site-nav a:hover {
    color: var(--text-primary);
    background: var(--bg-card);
    text-decoration: none;
}

/* CTA button in nav */
.site-nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gold);
    color: var(--bg-deep) !important;
    font-weight: 600;
    font-size: 1.4rem;
    padding: 8px 20px;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.2s;
}

.site-nav-cta:hover {
    background: var(--gold-dim);
    color: var(--bg-deep) !important;
    text-decoration: none;
}

/* Post Feed
   ========================================================================== */

.site-main {
    flex: 1;
    padding-top: 48px;
    padding-bottom: 48px;
}

.post-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
}

.post-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}

.post-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

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

.post-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card-image-link:hover .post-card-image {
    transform: scale(1.05);
}

.post-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-card-primary-tag a {
    color: var(--gold);
}

.post-card-featured {
    color: var(--gold);
    font-weight: 600;
}

.post-card-content-link {
    color: inherit;
    text-decoration: none;
}

.post-card-content-link:hover {
    text-decoration: none;
}

.post-card-title {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.post-card-excerpt p {
    margin: 0;
    font-size: 1.4rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Article (single post/page)
   ========================================================================== */

.article {
    padding: 48px 0;
}

.article-header {
    margin-bottom: 40px;
}

.article-tag {
    margin-bottom: 8px;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-tag a {
    color: var(--gold);
}

.article-title {
    margin: 0 0 16px;
    font-size: 4rem;
    line-height: 1.2;
    font-weight: 800;
    color: var(--text-primary);
}

.article-excerpt {
    margin: 0 0 24px;
    font-size: 2rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.article-byline {
    margin-bottom: 32px;
}

.article-byline-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    color: var(--text-muted);
}

.author-name {
    font-weight: 600;
    color: var(--text-secondary);
}

.article-image {
    margin: 0 0 32px;
}

.article-image img {
    width: 100%;
    border-radius: 12px;
}

.article-image figcaption {
    margin-top: 8px;
    font-size: 1.3rem;
    color: var(--text-muted);
    text-align: center;
}

/* Ghost Content Styles
   ========================================================================== */

.gh-content {
    font-size: 1.8rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.gh-content > * + * {
    margin-top: 2.4rem;
}

.gh-content h2 {
    font-size: 2.8rem;
    margin-top: 4.8rem;
    color: var(--text-primary);
}

.gh-content h3 {
    font-size: 2.2rem;
    margin-top: 4rem;
    color: var(--text-primary);
}

.gh-content h4 {
    font-size: 1.8rem;
    margin-top: 3.2rem;
    color: var(--text-primary);
}

.gh-content a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gh-content a:hover {
    color: var(--gold-dim);
}

.gh-content strong {
    color: var(--text-primary);
}

.gh-content blockquote {
    margin: 3.2rem 0;
    padding: 0 0 0 2rem;
    border-left: 3px solid var(--gold);
    font-style: italic;
    color: var(--text-secondary);
}

.gh-content pre {
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow-x: auto;
    font-size: 1.4rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.gh-content code {
    font-size: 0.9em;
    background: var(--bg-card);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: var(--gold);
}

.gh-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.gh-content figure {
    margin: 3.2rem 0;
}

.gh-content figcaption {
    margin-top: 8px;
    font-size: 1.3rem;
    color: var(--text-muted);
    text-align: center;
}

.gh-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4rem 0;
}

.gh-content ul, .gh-content ol {
    padding-left: 2rem;
}

.gh-content li + li {
    margin-top: 0.8rem;
}

/* Koenig Card Styles
   ========================================================================== */

.kg-card {
    margin: 3.2rem 0;
}

.kg-image-card img,
.kg-gallery-card img {
    border-radius: 8px;
}

.kg-embed-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kg-bookmark-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
}

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.kg-bookmark-content {
    flex: 1;
    padding: 20px;
}

.kg-bookmark-title {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

.kg-bookmark-description {
    margin-top: 8px;
    font-size: 1.4rem;
    color: var(--text-secondary);
    line-height: 1.4;
    max-height: 4.2em;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 1.3rem;
}

.kg-bookmark-icon {
    width: 22px;
    height: 22px;
}

.kg-bookmark-thumbnail {
    min-width: 160px;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kg-bookmark-author,
.kg-bookmark-publisher {
    font-size: 1.3rem;
    color: var(--text-muted);
}

.kg-bookmark-author::after {
    content: "\00b7";
    margin: 0 6px;
}

/* Gallery Card (required by Ghost) */

.kg-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

.kg-gallery-row {
    display: flex;
    gap: 0.75em;
}

.kg-gallery-image {
    flex: 1;
    min-width: 0;
}

.kg-gallery-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Comments
   ========================================================================== */

.article-comments {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

/* Pagination
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 40px 0 0;
    font-size: 1.4rem;
    color: var(--text-muted);
}

.pagination a {
    color: var(--gold);
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s;
}

.pagination a:hover {
    border-color: var(--gold);
    background: var(--gold-glow);
}

/* Footer
   ========================================================================== */

.site-footer {
    padding-top: 32px;
    padding-bottom: 32px;
    border-top: 1px solid var(--border);
}

.site-footer .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.copyright {
    font-size: 1.3rem;
    color: var(--text-muted);
}

.copyright a {
    color: var(--text-muted);
}

.copyright a:hover {
    color: var(--gold);
}

.site-footer-nav {
    display: flex;
    gap: 16px;
}

.site-footer-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 16px;
}

.site-footer-nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer-nav a {
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.site-footer-nav a:hover {
    color: var(--gold);
}

/* Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .article-title {
        font-size: 3rem;
    }

    .post-feed {
        grid-template-columns: 1fr;
    }

    .site-header-content {
        flex-direction: column;
        gap: 12px;
    }

    .site-footer .inner {
        flex-direction: column;
        text-align: center;
    }
}
