/* ============================================================
   MINIMAL THEME — screen.css
   System fonts · CSS variables · Mobile-first · Light/dark
   ============================================================ */

/* ---- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 18px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    background-color: var(--color-bg);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---- CSS Variables: Light mode ---------------------------- */
:root {
    --color-bg:           #ffffff;
    --color-text:         #1a1a1a;
    --color-muted:        #6b7280;
    --color-accent:       #2563eb;
    --color-accent-hover: #1d4ed8;
    --color-border:       #e5e7eb;
    --color-code-bg:      #f3f4f6;
    --color-header-bg:    #ffffff;
    --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro",
                 Menlo, Consolas, "DejaVu Sans Mono", monospace;
    --max-width: 720px;
    --gutter:    1.25rem;
}

/* ---- Dark mode (forced to light) -------------------------- */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg:           #ffffff;
        --color-text:         #1a1a1a;
        --color-muted:        #6b7280;
        --color-accent:       #2563eb;
        --color-accent-hover: #1d4ed8;
        --color-border:       #e5e7eb;
        --color-code-bg:      #f3f4f6;
        --color-header-bg:    #ffffff;
    }
}

/* ---- Layout container ------------------------------------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

/* ---- Header ----------------------------------------------- */
.site-header {
    background-color: var(--color-header-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-logo {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.site-logo img {
    display: block;
    height: 32px;
    width: auto;
}

/* Ghost renders navigation as <ul class="nav"> */
.site-nav .nav {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav .nav-current a {
    color: var(--color-text);
}

/* ---- Main ------------------------------------------------- */
.site-main {
    flex: 1;
    padding: 3rem 0;
}

/* ---- Post feed (index.hbs) -------------------------------- */
.site-description {
    color: var(--color-muted);
    font-size: 1rem;
    margin: 0 0 2.5rem;
}

.post-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.post-card {
    border-radius: 10px;
    border: 1px solid var(--color-border);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.post-card-link {
    display: block;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
}

.post-card article {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.post-card .post-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.post-card:hover .post-title {
    color: var(--color-accent);
}

.post-excerpt {
    font-size: 0.88rem;
    color: var(--color-muted);
    margin: 0;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-date {
    font-size: 0.78rem;
    color: var(--color-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    margin-top: 0.5rem;
}

/* ---- Pagination ------------------------------------------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2.5rem;
    gap: 1rem;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pagination a:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.page-number {
    color: var(--color-muted);
    font-size: 0.82rem;
    margin: 0 auto;
}

/* ---- Post / Page ------------------------------------------ */
.post-header {
    margin-bottom: 2rem;
}

.post-tag {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.post-tag:hover { color: var(--color-accent-hover); }

.post .post-title,
.page .post-title {
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    font-weight: 800;
    margin: 0 0 0.75rem;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--color-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-feature-image {
    margin: 0 0 2rem;
}

.post-feature-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

.post-feature-image figcaption {
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-muted);
    margin-top: 0.5rem;
}

/* ---- Post content (Ghost-generated HTML) ------------------ */
.post-content.gh-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    margin: 2rem 0 0.75rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
    font-family: inherit;
}

.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.25rem; }
.post-content h4 { font-size: 1.1rem; }

.post-content p { margin: 0 0 1.5rem; }

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

.post-content a:hover { color: var(--color-accent-hover); }

.post-content blockquote {
    margin: 1.5rem 0;
    padding: 0.5rem 0 0.5rem 1.25rem;
    border-left: 3px solid var(--color-accent);
    color: var(--color-muted);
    font-style: italic;
}

.post-content blockquote p:last-child { margin-bottom: 0; }

.post-content ul,
.post-content ol {
    padding-left: 1.5rem;
    margin: 0 0 1.5rem;
}

.post-content li { margin-bottom: 0.4rem; }

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    margin: 1.5rem auto;
}

.post-content figure { margin: 1.5rem 0; }

.post-content figcaption {
    text-align: center;
    font-size: 0.82rem;
    color: var(--color-muted);
    margin-top: 0.5rem;
}

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

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background-color: var(--color-code-bg);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

.post-content pre {
    background-color: var(--color-code-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

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

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.post-content th,
.post-content td {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--color-border);
    text-align: left;
}

.post-content th {
    background-color: var(--color-code-bg);
    font-weight: 600;
}

/* ---- Post footer ------------------------------------------ */
.post-footer {
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.back-link {
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s ease;
}

.back-link:hover { color: var(--color-text); }

/* ---- Footer ----------------------------------------------- */
.site-footer {
    padding: 1.5rem 0;
}

.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-footer .copyright,
.site-footer .powered-by {
    font-size: 0.82rem;
    color: var(--color-muted);
    margin: 0;
}

.site-footer a {
    color: var(--color-muted);
    text-decoration: none;
}

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

/* ---- Focus (accessibility) -------------------------------- */
a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ---- Koenig card layout classes (required by Ghost) ------- */
.kg-width-wide {
    margin-left: calc(var(--gutter) * -1.5);
    margin-right: calc(var(--gutter) * -1.5);
}

.kg-width-full {
    margin-left: calc(50% - 50vw + var(--gutter));
    margin-right: calc(50% - 50vw + var(--gutter));
}

.kg-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.kg-gallery-row {
    display: flex;
    gap: 0.5rem;
}

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

.kg-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
    margin: 0;
}

/* ---- Small screens ---------------------------------------- */
@media (max-width: 400px) {
    html { font-size: 16px; }
}
