/* ==========================================================================
   wroolie-v2 — Personal site for Eric Wroolie
   Monochrome. Bold. No fluff.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design Tokens
   -------------------------------------------------------------------------- */

:root {
    --bg: #111111;
    --bg-raised: #1a1a1a;
    --bg-card: #1e1e1e;
    --text-primary: #f0f0f0;
    --text-secondary: #888888;
    --text-heading: #ffffff;
    --text-link: #ffffff;
    --text-link-hover: #cccccc;
    --font-heading: "Space Grotesk", sans-serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --content-width: 700px;
    --site-width: 1200px;
    --header-height: 72px;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

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

a:focus-visible {
    outline: 2px solid var(--text-secondary);
    outline-offset: 3px;
    border-radius: 2px;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.2;
}

/* --------------------------------------------------------------------------
   Hide ALL Ghost Membership / Portal / Newsletter UI
   -------------------------------------------------------------------------- */

.gh-portal-triggerbtn-container,
.gh-portal-triggerbtn-iframe,
#ghost-portal-root,
.footer-cta,
.gh-subscribe-form,
.gh-signup,
.gh-signin,
.gh-head-actions,
.gh-head-btn,
.nav-sign-in,
.nav-subscribe,
.gh-notification,
.gh-members-subscribe,
.gh-post-upgrade-cta,
.gh-signup-cta,
.kg-signup-card,
[data-portal],
iframe[title="portal-trigger"],
.gh-search {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    pointer-events: none !important;
}

/* --------------------------------------------------------------------------
   Site Header
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 0 24px;
}

.site-wordmark {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-heading);
    letter-spacing: -0.02em;
    white-space: nowrap;
    text-decoration: none;
}

.site-wordmark:hover {
    color: var(--text-heading);
    opacity: 0.9;
}

.site-nav {
    display: flex;
    align-items: center;
}

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

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

.site-nav a {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

/* --------------------------------------------------------------------------
   Hero Section (Homepage)
   -------------------------------------------------------------------------- */

.hero {
    padding: 64px 24px 48px;
    margin-bottom: 16px;
}

.hero-inner {
    display: flex;
    align-items: center;
    gap: 48px;
    max-width: var(--site-width);
    margin: 0 auto;
}

.hero-photo {
    flex-shrink: 0;
}

.hero-photo img {
    width: 340px;
    height: 420px;
    object-fit: cover;
    object-position: center top;
    border-radius: 6px;
    filter: grayscale(15%);
}

.hero-text {
    flex: 1;
    min-width: 0;
}

.hero-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-style: normal;
    font-size: 4rem;
    line-height: 1.05;
    color: var(--text-heading);
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.hero-tagline {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.hero-social {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-social a {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.hero-social a:hover {
    color: var(--text-heading);
}

.hero-social-sep {
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   Post Feed
   -------------------------------------------------------------------------- */

.post-feed-container {
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.post-feed {
    max-width: 820px;
}

/* --------------------------------------------------------------------------
   Post Card (loop partial)
   -------------------------------------------------------------------------- */

.post-card {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.post-card:last-child {
    border-bottom: none;
}

.post-card-link {
    display: block;
    padding: 24px 0;
    text-decoration: none;
    transition: background-color 0.15s ease;
    border-radius: 4px;
}

.post-card-link:hover {
    color: inherit;
}

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

.post-card-content {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.post-card-text {
    flex: 1;
    min-width: 0;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.post-card-meta time {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-meta-sep {
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.75rem;
}

.post-card-tag {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.post-card-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.625rem;
    line-height: 1.25;
    color: var(--text-heading);
    margin-bottom: 8px;
    transition: color 0.15s ease;
    letter-spacing: -0.02em;
}

.post-card-excerpt {
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.post-card-reading-time {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.post-card-thumbnail {
    flex-shrink: 0;
    width: 160px;
    height: 110px;
    border-radius: 4px;
    overflow: hidden;
}

.post-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.pagination {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pagination-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 820px;
}

.pagination-link {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-primary);
    text-decoration: none;
}

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

.pagination-disabled {
    color: rgba(255, 255, 255, 0.2);
}

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

/* --------------------------------------------------------------------------
   Post Full (Single Post)
   -------------------------------------------------------------------------- */

.post-full {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.post-full-header {
    margin-bottom: 40px;
}

.post-full-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.5rem;
    line-height: 1.15;
    color: var(--text-heading);
    letter-spacing: -0.025em;
    margin-bottom: 16px;
}

.post-full-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meta-sep {
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.75rem;
}

.post-tag {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 400;
}

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

/* Feature Image */

.post-full-image {
    margin-bottom: 40px;
    border-radius: 6px;
    overflow: hidden;
}

.post-full-image img {
    width: 100%;
    border-radius: 6px;
}

.post-full-image figcaption {
    margin-top: 12px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: center;
}

/* --------------------------------------------------------------------------
   Post Content — Typography
   -------------------------------------------------------------------------- */

.post-full-content {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
}

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

.post-full-content h2 {
    font-size: 1.75rem;
    margin-top: 2.5em;
    margin-bottom: 0.75em;
    letter-spacing: -0.02em;
}

.post-full-content h3 {
    font-size: 1.375rem;
    margin-top: 2em;
    margin-bottom: 0.6em;
    letter-spacing: -0.01em;
}

.post-full-content h4 {
    font-size: 1.125rem;
    margin-top: 1.75em;
    margin-bottom: 0.5em;
}

.post-full-content a {
    color: var(--text-heading);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    transition: text-decoration-color 0.15s ease;
}

.post-full-content a:hover {
    text-decoration-color: var(--text-heading);
}

.post-full-content strong {
    font-weight: 500;
    color: var(--text-heading);
}

.post-full-content em {
    font-style: italic;
}

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

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

.post-full-content li::marker {
    color: var(--text-secondary);
}

.post-full-content blockquote {
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    margin: 1.5em 0;
    padding: 0.5em 0 0.5em 1.5em;
    font-style: italic;
    color: var(--text-secondary);
}

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

.post-full-content pre {
    background-color: var(--bg-raised);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 1.25em;
    margin-bottom: 1.5em;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
}

.post-full-content code {
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
    font-size: 0.875em;
    background-color: var(--bg-raised);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

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

.post-full-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 2.5em 0;
}

.post-full-content figure {
    margin: 2em 0;
}

.post-full-content figcaption {
    margin-top: 0.75em;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: center;
}

.post-full-content img {
    border-radius: 6px;
}

.post-full-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
}

.post-full-content th,
.post-full-content td {
    padding: 0.75em 1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    font-size: 0.9375rem;
}

.post-full-content th {
    font-weight: 500;
    color: var(--text-heading);
}

/* Ghost-specific content classes — wide and full images */
.post-full-content .kg-width-wide {
    margin-left: -80px;
    margin-right: -80px;
    max-width: calc(var(--content-width) + 160px);
}

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

.post-full-content .kg-width-wide img,
.post-full-content .kg-width-full img {
    width: 100%;
}

/* Ghost bookmark card */
.post-full-content .kg-bookmark-card {
    background: var(--bg-raised);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    margin-bottom: 1.5em;
    overflow: hidden;
}

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

.post-full-content .kg-bookmark-content {
    flex: 1;
    padding: 1.25em;
}

.post-full-content .kg-bookmark-title {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-heading);
    margin-bottom: 0.5em;
}

.post-full-content .kg-bookmark-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-full-content .kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0.75em;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

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

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

.post-full-content .kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* Ghost gallery */
.post-full-content .kg-gallery-container {
    margin-bottom: 1.5em;
}

.post-full-content .kg-gallery-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.post-full-content .kg-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --------------------------------------------------------------------------
   Author Card (Post Footer)
   -------------------------------------------------------------------------- */

.post-full-footer {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

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

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

.author-card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-heading);
}

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

.author-more {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.author-more:hover {
    color: var(--text-heading);
}

/* --------------------------------------------------------------------------
   Post Navigation (Prev/Next)
   -------------------------------------------------------------------------- */

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.post-nav-link {
    text-decoration: none;
    flex: 1;
}

.post-nav-prev {
    text-align: left;
}

.post-nav-next {
    text-align: right;
}

.post-nav-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.15s ease;
    line-height: 1.4;
}

.post-nav-link:hover .post-nav-label {
    color: var(--text-heading);
}

/* --------------------------------------------------------------------------
   Page (Static Pages — About, Now)
   -------------------------------------------------------------------------- */

.page-full .post-full-header {
    margin-bottom: 32px;
}

/* --------------------------------------------------------------------------
   Tag Archive
   -------------------------------------------------------------------------- */

.tag-archive {
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 48px 24px 64px;
}

.tag-header {
    margin-bottom: 32px;
    max-width: 820px;
}

.tag-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2rem;
    color: var(--text-heading);
    letter-spacing: -0.02em;
}

.tag-description {
    margin-top: 8px;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.tag-archive .post-feed {
    max-width: 820px;
}

.tag-archive .pagination {
    max-width: 820px;
}

/* --------------------------------------------------------------------------
   Error Page
   -------------------------------------------------------------------------- */

.error-page {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 120px 24px;
    text-align: center;
}

.error-code {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 8rem;
    color: var(--text-heading);
    line-height: 1;
    margin-bottom: 16px;
    letter-spacing: -0.04em;
}

.error-message {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.error-link {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
}

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

/* --------------------------------------------------------------------------
   Site Footer
   -------------------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 32px 24px;
}

.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    max-width: var(--site-width);
    margin: 0 auto;
    font-size: 0.875rem;
}

.footer-copy {
    color: var(--text-secondary);
}

.footer-sep {
    color: rgba(255, 255, 255, 0.15);
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
}

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

/* --------------------------------------------------------------------------
   Ghost Content Overrides
   (Ghost injects default styles that can fight the theme)
   -------------------------------------------------------------------------- */

.gh-content {
    font-size: inherit;
    line-height: inherit;
}

/* Kill any accent colours Ghost might inject */
body {
    --ghost-accent-color: #ffffff !important;
}

.gh-head-brand,
.gh-head-menu,
.gh-foot {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Selection
   -------------------------------------------------------------------------- */

::selection {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--text-heading);
}

/* --------------------------------------------------------------------------
   Responsive — Tablet (768px)
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .hero {
        padding: 40px 20px 36px;
    }

    .hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 32px;
    }

    .hero-photo img {
        width: 280px;
        height: 350px;
    }

    .hero-name {
        font-size: 2.75rem;
    }

    .hero-tagline {
        font-size: 1.125rem;
    }

    .hero-social {
        justify-content: center;
    }

    .post-feed-container {
        padding: 24px 20px 48px;
    }

    .post-card-link {
        padding: 20px 0;
    }

    .post-card-content {
        flex-direction: column-reverse;
        gap: 16px;
    }

    .post-card-thumbnail {
        width: 100%;
        height: 180px;
    }

    .post-card-title {
        font-size: 1.3125rem;
    }

    .post-full {
        padding: 32px 20px 60px;
    }

    .post-full-title {
        font-size: 2rem;
    }

    .post-full-content {
        font-size: 1.0625rem;
        line-height: 1.75;
    }

    .post-full-content .kg-width-wide {
        margin-left: -20px;
        margin-right: -20px;
        max-width: calc(100% + 40px);
    }

    .pagination-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .post-nav {
        flex-direction: column;
        gap: 16px;
    }

    .post-nav-next {
        text-align: left;
    }

    .tag-archive {
        padding: 32px 20px 48px;
    }

    .tag-name {
        font-size: 1.75rem;
    }

    .error-code {
        font-size: 5rem;
    }

    .site-header-inner {
        padding: 0 20px;
    }
}

/* --------------------------------------------------------------------------
   Responsive — Mobile (480px)
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
    .site-wordmark {
        font-size: 1.25rem;
    }

    .site-nav ul {
        gap: 20px;
    }

    .nav-link {
        font-size: 0.875rem;
    }

    .hero {
        padding: 32px 16px 28px;
    }

    .hero-photo img {
        width: 240px;
        height: 300px;
    }

    .hero-name {
        font-size: 2.25rem;
    }

    .hero-tagline {
        font-size: 1rem;
    }

    .post-feed-container {
        padding: 20px 16px 40px;
    }

    .post-card-link {
        padding: 16px 0;
    }

    .post-card-title {
        font-size: 1.1875rem;
    }

    .post-card-excerpt {
        font-size: 0.875rem;
    }

    .post-full {
        padding: 24px 16px 48px;
    }

    .post-full-title {
        font-size: 1.75rem;
    }

    .post-full-content {
        font-size: 1rem;
    }

    .post-full-content .kg-width-wide,
    .post-full-content .kg-width-full {
        margin-left: -16px;
        margin-right: -16px;
    }

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

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

    .author-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

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

    .tag-archive {
        padding: 24px 16px 40px;
    }

    .site-footer-inner {
        font-size: 0.8125rem;
    }

    .error-code {
        font-size: 4rem;
    }
}

/* --------------------------------------------------------------------------
   Responsive — Large Desktop (1200px+)
   -------------------------------------------------------------------------- */

@media (min-width: 1200px) {
    .hero-name {
        font-size: 4.5rem;
    }

    .hero-photo img {
        width: 380px;
        height: 470px;
    }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */

@media print {
    body {
        background: #fff;
        color: #111;
    }

    .site-header,
    .site-footer,
    .hero,
    .pagination,
    .post-nav,
    .author-card {
        display: none;
    }

    .post-full {
        max-width: 100%;
        padding: 0;
    }

    .post-full-title {
        color: #111;
    }

    .post-full-content {
        color: #333;
        font-size: 12pt;
        line-height: 1.6;
    }

    .post-full-content a {
        color: #111;
        text-decoration: underline;
    }
}
