/* ==========================================================================
   Gentle Future — Ghost Theme
   Reports and round-ups from the warm frontier
   Fonts: Inter (headings/body) + JetBrains Mono (meta/supporting)
   Palette: White bg, near-black text, warm orange accent
   ========================================================================== */

/* ---------- Reset & Variables ---------- */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

    --color-bg: #FAFAF8;
    --color-surface: #FFFFFF;
    --color-text: #1A1A1A;
    --color-text-secondary: #6B6B6B;
    --color-text-tertiary: #999999;
    --color-accent: #D4762C;
    --color-accent-light: #F0D9C4;
    --color-border: #E5E5E2;
    --color-border-light: #F0F0ED;

    --content-width: 720px;
    --wide-width: 1200px;
    --full-width: 100%;

    --gap: 24px;
    --gap-lg: 48px;
    --gap-xl: 72px;

    --radius: 2px;
}

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

html {
    font-size: 62.5%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 1.7rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

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

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

.gh-head-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--wide-width);
    margin: 0 auto;
    padding: 16px var(--gap);
    gap: var(--gap);
}

.gh-head-logo {
    display: flex;
    align-items: center;
}

.gh-head-logo img {
    max-height: 28px;
    width: auto;
}

.gh-head-logo-text {
    font-family: var(--font-sans);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.gh-head-nav {
    flex: 1;
}

.gh-head-menu {
    display: flex;
    align-items: center;
    gap: var(--gap);
}

.gh-head-menu .nav {
    display: flex;
    list-style: none;
    gap: var(--gap);
}

.gh-head-menu .nav a {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    transition: color 0.2s;
}

.gh-head-menu .nav a:hover {
    color: var(--color-text);
}

.gh-head-meta {
    flex-shrink: 0;
}

.gh-head-date {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--color-text-tertiary);
    letter-spacing: 0.03em;
}

.gh-head-date-day {
    display: none;
}

@media (min-width: 768px) {
    .gh-head-date-day {
        display: inline;
    }
    .gh-head-date-day::after {
        content: ' · ';
    }
}

/* ---------- Hero Banner ---------- */
.gh-hero {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.gh-hero-img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    object-position: center;
}

.gh-hero-fallback {
    background: linear-gradient(135deg, #3D4F6F 0%, #6B7FA0 50%, #A8B4C8 100%);
    padding: var(--gap-xl) var(--gap);
    text-align: center;
    color: white;
}

.gh-hero-title {
    font-family: var(--font-sans);
    font-size: 5.6rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.gh-hero-tagline {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 300;
    letter-spacing: 0.04em;
    opacity: 0.8;
}

/* ---------- Canvas (Content Wrapper) ---------- */
.gh-canvas {
    max-width: var(--wide-width);
    margin: 0 auto;
    padding: var(--gap-lg) var(--gap);
}

/* ---------- Featured Article ---------- */
.gh-featured {
    margin-bottom: var(--gap-xl);
    padding-bottom: var(--gap-xl);
    border-bottom: 1px solid var(--color-border);
}

.gh-featured-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-lg);
}

@media (min-width: 768px) {
    .gh-featured-grid {
        grid-template-columns: 3fr 2fr;
        align-items: start;
    }
}

.gh-featured-image-link {
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
}

.gh-featured-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gh-featured-image-link:hover .gh-featured-image {
    transform: scale(1.02);
}

.gh-featured-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 8px;
}

.gh-featured-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gh-featured-tag {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-accent);
    background: var(--color-accent-light);
    padding: 3px 8px;
    border-radius: var(--radius);
}

.gh-featured-date {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--color-text-tertiary);
    letter-spacing: 0.03em;
}

.gh-featured-title {
    font-family: var(--font-sans);
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.gh-featured-title a:hover {
    color: var(--color-accent);
}

.gh-featured-excerpt {
    font-size: 1.6rem;
    line-height: 1.55;
    color: var(--color-text-secondary);
}

.gh-featured-read {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s, gap 0.2s;
}

.gh-featured-read:hover {
    color: var(--color-accent);
    gap: 12px;
}

.gh-arrow {
    font-size: 1.4rem;
    transition: transform 0.2s;
}

/* ---------- Grid Section ---------- */
.gh-grid {
    margin-bottom: var(--gap-xl);
}

.gh-grid-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: var(--gap-lg);
}

.gh-grid-label {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-tertiary);
    flex-shrink: 0;
}

.gh-grid-line {
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.gh-grid-feed {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 640px) {
    .gh-grid-feed {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .gh-grid-feed {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---------- Card ---------- */
.gh-card {
    display: flex;
    flex-direction: column;
    padding: var(--gap);
    border-bottom: 1px solid var(--color-border-light);
    transition: background 0.2s;
}

@media (min-width: 640px) {
    .gh-card {
        border-right: 1px solid var(--color-border-light);
    }

    .gh-card:nth-child(2n) {
        border-right: none;
    }
}

@media (min-width: 1024px) {
    .gh-card:nth-child(2n) {
        border-right: 1px solid var(--color-border-light);
    }
    .gh-card:nth-child(3n) {
        border-right: none;
    }
}

.gh-card:hover {
    background: var(--color-surface);
}

.gh-card-image-link {
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.gh-card-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gh-card-image-link:hover .gh-card-image {
    transform: scale(1.03);
}

.gh-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.gh-card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    letter-spacing: 0.03em;
}

.gh-card-tag {
    color: var(--color-accent);
    font-weight: 500;
    text-transform: uppercase;
}

.gh-card-meta-sep {
    color: var(--color-border);
    margin: 0 2px;
}

.gh-card-date {
    color: var(--color-text-tertiary);
}

.gh-card-title {
    font-family: var(--font-sans);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

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

.gh-card-read {
    margin-top: auto;
    padding-top: 8px;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--color-text-tertiary);
    transition: color 0.2s;
}

.gh-card-read:hover {
    color: var(--color-accent);
}

/* ---------- Pagination ---------- */
.gh-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--gap);
    padding: var(--gap-lg) 0;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    letter-spacing: 0.03em;
}

.gh-pagination a {
    color: var(--color-text-secondary);
    transition: color 0.2s;
}

.gh-pagination a:hover {
    color: var(--color-accent);
}

.gh-pagination-num {
    color: var(--color-text-tertiary);
}

/* ---------- Post / Article ---------- */
.gh-article {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--gap-xl) var(--gap);
}

.gh-article-header {
    margin-bottom: var(--gap-lg);
}

.gh-article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-family: var(--font-mono);
    font-size: 1.15rem;
    letter-spacing: 0.03em;
}

.gh-article-tag {
    color: var(--color-accent);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.gh-article-meta-sep {
    color: var(--color-border);
}

.gh-article-date {
    color: var(--color-text-tertiary);
}

.gh-article-title {
    font-family: var(--font-sans);
    font-size: 4.2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.gh-article-excerpt {
    font-size: 2rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
    font-weight: 400;
}

/* Feature Image (wide) */
.gh-article-feature {
    max-width: var(--wide-width);
    margin: 0 auto var(--gap-lg);
    padding: 0 var(--gap);
}

.gh-article-feature img {
    width: 100%;
    border-radius: var(--radius);
}

/* Article Body */
.gh-content {
    font-size: 1.8rem;
    line-height: 1.7;
}

.gh-content > * {
    margin-bottom: 1.5em;
}

.gh-content > *:last-child {
    margin-bottom: 0;
}

.gh-content h2 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-top: 2em;
    margin-bottom: 0.6em;
}

.gh-content h3 {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin-top: 1.8em;
    margin-bottom: 0.5em;
}

.gh-content h4 {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

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

.gh-content a:hover {
    text-decoration-thickness: 2px;
}

.gh-content strong {
    font-weight: 700;
}

.gh-content em {
    font-style: italic;
}

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

.gh-content ul,
.gh-content ol {
    padding-left: 1.5em;
}

.gh-content li {
    margin-bottom: 0.5em;
}

.gh-content code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--color-border-light);
    padding: 2px 6px;
    border-radius: var(--radius);
}

.gh-content pre {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    background: var(--color-text);
    color: var(--color-bg);
    padding: var(--gap);
    border-radius: var(--radius);
    overflow-x: auto;
}

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

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

/* Images in content — wide */
.gh-content .kg-image-card,
.gh-content .kg-gallery-card {
    margin-left: calc(50% - 50vw + var(--gap));
    margin-right: calc(50% - 50vw + var(--gap));
    max-width: calc(100vw - var(--gap) * 2);
}

@media (min-width: 1024px) {
    .gh-content .kg-image-card,
    .gh-content .kg-gallery-card {
        margin-left: calc((var(--content-width) - var(--wide-width)) / 2);
        margin-right: calc((var(--content-width) - var(--wide-width)) / 2);
        max-width: var(--wide-width);
    }
}

.gh-content .kg-image-card img {
    border-radius: var(--radius);
}

.gh-content .kg-image-card figcaption {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    color: var(--color-text-tertiary);
    text-align: center;
    margin-top: 12px;
    letter-spacing: 0.02em;
}

/* ---------- Author / Byline at bottom ---------- */
.gh-article-footer {
    max-width: var(--content-width);
    margin: var(--gap-xl) auto 0;
    padding: var(--gap-lg) var(--gap);
    border-top: 1px solid var(--color-border);
}

.gh-author-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gh-author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.gh-author-name {
    font-weight: 700;
    font-size: 1.5rem;
}

.gh-author-bio {
    font-size: 1.4rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* ---------- Tag / Author Index ---------- */
.gh-tag-header {
    max-width: var(--wide-width);
    margin: 0 auto;
    padding: var(--gap-xl) var(--gap) var(--gap);
}

.gh-tag-name {
    font-family: var(--font-sans);
    font-size: 3.6rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.gh-tag-description {
    font-size: 1.7rem;
    color: var(--color-text-secondary);
    margin-top: 8px;
    max-width: var(--content-width);
}

/* ---------- Page (static pages) ---------- */
.gh-page {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--gap-xl) var(--gap);
}

.gh-page-title {
    font-family: var(--font-sans);
    font-size: 4.2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: var(--gap-lg);
}

/* ---------- Footer ---------- */
.gh-foot {
    border-top: 1px solid var(--color-border);
    margin-top: var(--gap-xl);
}

.gh-foot-inner {
    max-width: var(--wide-width);
    margin: 0 auto;
    padding: var(--gap-lg) var(--gap);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
}

.gh-foot-brand {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.gh-foot-tagline {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--color-text-tertiary);
    display: block;
    margin-top: 4px;
    letter-spacing: 0.03em;
}

.gh-foot-nav .nav {
    display: flex;
    list-style: none;
    gap: var(--gap);
}

.gh-foot-nav .nav a {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.03em;
}

.gh-foot-nav .nav a:hover {
    color: var(--color-text);
}

.gh-foot-copy {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--color-text-tertiary);
    letter-spacing: 0.03em;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
    .gh-featured-title {
        font-size: 2.4rem;
    }

    .gh-article-title {
        font-size: 3rem;
    }

    .gh-hero-title {
        font-size: 3.6rem;
    }

    .gh-head-nav {
        display: none;
    }

    .gh-foot-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* ---------- Subscribe / Email Signup ---------- */
.gh-subscribe {
    background: var(--color-border-light);
    padding: var(--gap-xl) var(--gap);
    text-align: center;
    margin: var(--gap-xl) 0;
    border-radius: var(--radius);
}

.gh-subscribe-title {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.gh-subscribe-description {
    font-size: 1.5rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--gap);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.gh-subscribe-form {
    display: flex;
    max-width: 420px;
    margin: 0 auto;
    gap: 8px;
}

.gh-subscribe-input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 1.3rem;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    outline: none;
}

.gh-subscribe-input:focus {
    border-color: var(--color-accent);
}

.gh-subscribe-btn {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 24px;
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

.gh-subscribe-btn:hover {
    background: var(--color-accent);
}

/* ---------- Decorative Paper-Craft Motifs ---------- */
.gh-motifs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.gh-motif {
    position: absolute;
    opacity: 0.12;
    filter: saturate(0.6);
    transition: opacity 0.6s ease;
}

/* Sun — top right, peeking in from the corner */
.gh-motif-sun {
    width: 180px;
    top: 80px;
    right: -30px;
    opacity: 0.14;
    transform: rotate(-12deg);
}

/* Cloud 1 — upper left margin */
.gh-motif-cloud1 {
    width: 200px;
    top: 320px;
    left: -40px;
    opacity: 0.1;
    transform: rotate(5deg);
}

/* Cloud 2 — right side, lower */
.gh-motif-cloud2 {
    width: 160px;
    top: 65vh;
    right: -20px;
    opacity: 0.08;
    transform: rotate(-3deg);
}

/* Jellyfish — left margin, mid-page */
.gh-motif-jelly {
    width: 140px;
    top: 50vh;
    left: 20px;
    opacity: 0.1;
    transform: rotate(8deg);
}

/* Crab — bottom right, near footer */
.gh-motif-crab {
    width: 130px;
    bottom: 120px;
    right: 40px;
    opacity: 0.1;
    transform: rotate(-5deg) scaleX(-1);
}

/* Sheep — right side, upper-mid */
.gh-motif-sheep {
    width: 150px;
    top: 38vh;
    right: 30px;
    opacity: 0.09;
    transform: rotate(3deg);
}

/* Increase opacity on homepage for more decorative feel */
.home-template .gh-motif {
    opacity: 0.16;
}

.home-template .gh-motif-sun {
    opacity: 0.2;
}

/* Hide motifs on narrow screens — they'd overlap content */
@media (max-width: 1280px) {
    .gh-motif {
        opacity: 0.06;
    }
}

@media (max-width: 1024px) {
    .gh-motifs {
        display: none;
    }
}

/* ---------- Utility ---------- */
.kg-width-wide img {
    max-width: var(--wide-width);
}

.kg-width-full img {
    max-width: var(--full-width);
}

/* ---------- Social Links (Footer) ---------- */
.gh-foot-social {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.03em;
    margin-right: 16px;
    transition: color 0.2s;
}

.gh-foot-social:hover {
    color: var(--color-accent);
}
