/* ==========================================================================
   bretthunt.com Ghost Theme
   Verde palette — white base, sage green, deep teal, burnt orange
   Space Grotesk + Inter typography
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
    --bh-bg: #FFFFFF;
    --bh-bg-subtle: #F5F7F2;
    --bh-teal: #2B6B6E;
    --bh-sage: #8B9A71;
    --bh-orange: #E85D26;
    --bh-light-sage: #D4DACA;
    --bh-text-primary: #2D2D2D;
    --bh-text-muted: #8B9A71;
    --bh-border: #D4DACA;
    --bh-font-heading: 'Space Grotesk', sans-serif;
    --bh-font-body: 'Inter', sans-serif;
    --bh-content-width: 720px;
    --bh-wide-width: 1200px;
}

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

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

body {
    font-family: var(--bh-font-body);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--bh-text-primary);
    background: var(--bh-bg) !important;
}

/* Override Ghost default backgrounds */
.gh-viewport,
.site-content,
.gh-outer,
.gh-inner,
[data-footer],
body > div {
    background: transparent !important;
}

a {
    color: var(--bh-orange);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #C94D1E;
}

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

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--bh-font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--bh-teal);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* ---------- Layout ---------- */
.container {
    max-width: var(--bh-wide-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: var(--bh-content-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-main {
    min-height: calc(100vh - 160px);
}

/* ---------- Header ---------- */
.site-header {
    background: var(--bh-teal);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--bh-wide-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 64px;
    gap: 2rem;
}

.site-logo {
    text-decoration: none;
    flex-shrink: 0;
}

.logo-text {
    font-family: var(--bh-font-heading);
    font-weight: 700;
    font-size: 1.375rem;
    color: #FFFFFF;
    border-bottom: 3px solid var(--bh-orange);
    padding-bottom: 2px;
}

.site-logo:hover .logo-text {
    color: var(--bh-light-sage);
}

/* Nav */
.site-nav {
    flex: 1;
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    font-family: var(--bh-font-heading);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--bh-light-sage);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover,
.site-nav .nav-current a {
    color: #FFFFFF;
    border-bottom-color: var(--bh-orange);
}

.header-social {
    flex-shrink: 0;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #FFFFFF;
    transition: transform 0.3s, opacity 0.3s;
}

/* ---------- Hero ---------- */
.hero {
    padding: 6rem 1.5rem 4rem;
    text-align: center;
    background: var(--bh-teal);
    color: #FFFFFF;
}

.hero-inner {
    max-width: 680px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1.25rem;
    line-height: 1.15;
    color: #FFFFFF;
}

.hero-subtitle {
    font-size: 1.1875rem;
    color: var(--bh-light-sage);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    font-family: var(--bh-font-heading);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    transition: background 0.2s, transform 0.15s;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--bh-orange);
    color: #FFFFFF;
}

.btn-primary:hover {
    background: #C94D1E;
    color: #FFFFFF;
    transform: translateY(-1px);
}

/* ---------- Section Titles ---------- */
.section-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bh-border);
}

/* ---------- Posts Section ---------- */
.posts-section {
    padding: 4rem 0;
}

/* ---------- Post Grid ---------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.post-card {
    background: var(--bh-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--bh-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(43, 107, 110, 0.12);
}

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

.post-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

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

.post-card:hover .post-card-image img {
    transform: scale(1.03);
}

.post-card-content {
    padding: 1.25rem;
}

.post-card-tag {
    display: inline-block;
    font-family: var(--bh-font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bh-sage);
    margin-bottom: 0.5rem;
}

.post-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.post-card-excerpt {
    font-size: 0.9375rem;
    color: var(--bh-text-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.post-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--bh-text-muted);
}

/* ---------- Single Post ---------- */
.post-header {
    padding: 4rem 0 2rem;
    text-align: center;
}

.post-tag {
    display: inline-block;
    font-family: var(--bh-font-heading);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bh-sage);
    margin-bottom: 1rem;
}

.post-title {
    font-size: 2.75rem;
    margin-bottom: 1rem;
    line-height: 1.15;
}

.post-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    color: var(--bh-text-muted);
    font-size: 0.9375rem;
}

.post-feature-image {
    max-width: 960px;
    margin: 0 auto 3rem;
    border-radius: 8px;
    overflow: hidden;
}

.post-feature-image figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--bh-text-muted);
    padding: 0.75rem 1rem 0;
}

/* Post Content */
.post-content {
    padding-bottom: 3rem;
}

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

.post-content h2 {
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.post-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

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

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

.post-content li strong {
    color: var(--bh-text-primary);
}

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

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

.post-content strong {
    font-weight: 600;
}

/* Code Blocks */
.post-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    background: var(--bh-bg-subtle);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

.post-content pre {
    background: var(--bh-bg-subtle);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--bh-border);
}

.post-content pre code {
    background: none;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Ghost Content Cards */
.kg-image-card,
.kg-gallery-card,
.kg-bookmark-card,
.kg-embed-card {
    margin: 2rem 0;
}

.kg-image-card img {
    border-radius: 6px;
}

.kg-image-card figcaption,
.kg-gallery-card figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--bh-text-muted);
    padding-top: 0.75rem;
}

.kg-bookmark-card {
    border: 1px solid var(--bh-border);
    border-radius: 6px;
    overflow: hidden;
}

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

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

.kg-bookmark-title {
    font-family: var(--bh-font-heading);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--bh-teal);
}

.kg-bookmark-description {
    font-size: 0.875rem;
    color: var(--bh-text-muted);
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--bh-text-muted);
}

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

.kg-bookmark-thumbnail {
    width: 160px;
    flex-shrink: 0;
}

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

/* Width modifiers */
.kg-width-wide {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

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

/* ---------- Post Footer ---------- */
.post-footer {
    padding: 2rem 0 4rem;
    border-top: 1px solid var(--bh-border);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tag-pill {
    display: inline-block;
    font-family: var(--bh-font-heading);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    background: var(--bh-bg-subtle);
    border: 1px solid var(--bh-border);
    border-radius: 100px;
    color: var(--bh-sage);
    transition: background 0.2s, color 0.2s;
}

.tag-pill:hover {
    background: var(--bh-orange);
    color: #FFFFFF;
    border-color: var(--bh-orange);
}

.author-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.5rem;
    background: var(--bh-bg-subtle);
    border-radius: 8px;
    border: 1px solid var(--bh-border);
}

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

.author-name {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.author-bio {
    font-size: 0.9375rem;
    color: var(--bh-text-muted);
    line-height: 1.5;
}

/* ---------- Related Posts ---------- */
.related-posts {
    padding: 4rem 0;
    background: var(--bh-bg-subtle);
    border-top: 1px solid var(--bh-border);
}

/* ---------- Tag / Author Archive ---------- */
.tag-header,
.author-header {
    text-align: center;
    padding: 4rem 0 2rem;
}

.tag-description,
.author-archive-bio {
    color: var(--bh-text-muted);
    font-size: 1.0625rem;
    max-width: 600px;
    margin: 0.75rem auto 0;
}

.author-archive-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
}

/* ---------- Pages ---------- */
.page-header {
    padding: 4rem 0 2rem;
}

.page-title {
    font-size: 2.5rem;
}

.page-content {
    padding-bottom: 4rem;
}

.page-content p {
    margin-bottom: 1.5rem;
}

.page-content h2 {
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.page-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

.page-content ul,
.page-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.page-content li {
    margin-bottom: 0.5rem;
}

.page-content strong {
    font-weight: 600;
}

/* ---------- Error Page ---------- */
.error-page {
    text-align: center;
    padding: 8rem 1.5rem;
}

.error-code {
    font-size: 8rem;
    font-family: var(--bh-font-heading);
    color: var(--bh-orange);
    line-height: 1;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.25rem;
    color: var(--bh-text-muted);
    margin-bottom: 2rem;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 3rem 0 1rem;
}

.pagination a {
    font-family: var(--bh-font-heading);
    font-weight: 500;
    font-size: 0.9375rem;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--bh-text-muted);
}

/* ---------- Social Links ---------- */
.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    color: var(--bh-light-sage);
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.social-link:hover {
    color: #FFFFFF;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--bh-border);
    padding: 2rem 0;
    background: var(--bh-bg-subtle);
}

.footer-inner {
    max-width: var(--bh-wide-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.footer-center ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.footer-center a {
    font-size: 0.875rem;
    color: var(--bh-text-muted);
}

.footer-center a:hover {
    color: var(--bh-teal);
}

.footer-right .social-link {
    color: var(--bh-text-muted);
}

.footer-right .social-link:hover {
    color: var(--bh-orange);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero { padding: 4rem 1.5rem 3rem; }
    .hero-title { font-size: 2.25rem; }
    .hero-subtitle { font-size: 1.0625rem; }
    .post-title { font-size: 2rem; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    .page-title { font-size: 2rem; }

    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bh-teal);
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        padding: 1rem 1.5rem;
    }

    .site-nav.is-open {
        display: block;
    }

    .site-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .site-nav a {
        display: block;
        padding: 0.75rem 0;
        border-bottom: none;
    }

    .header-social {
        display: none;
    }

    .footer-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

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

    .post-meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    .author-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .kg-bookmark-container {
        flex-direction: column;
    }

    .kg-bookmark-thumbnail {
        width: 100%;
        height: 160px;
    }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.75rem; }
    .post-title { font-size: 1.75rem; }
    .page-title { font-size: 1.75rem; }
    .post-card-content { padding: 1rem; }
}

/* ---------- Selection ---------- */
::selection {
    background: var(--bh-orange);
    color: #FFFFFF;
}

/* ---------- Focus ---------- */
:focus-visible {
    outline: 2px solid var(--bh-orange);
    outline-offset: 2px;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bh-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bh-light-sage);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bh-sage);
}
