/* ==========================================================================
   Eternal Odyssey Ghost Theme
   ========================================================================== */

:root {
    --color-bg: #F8F6F3;
    --color-bg-darker: #F0EDE8;
    --color-text: #2D2D2D;
    --color-text-secondary: #5A5A5A;
    --color-text-muted: #888888;
    --color-accent: #D4A574;
    --color-accent-hover: #C4905F;
    --color-primary: #1A3A32;
    --color-border: #E5E2DD;
    
    /* Dark theme for photo pages */
    --photo-bg: #1C1C1E;
    --photo-surface: #2C2C2E;
    --photo-text: #F5F5F7;
    --photo-muted: #98989D;
}

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

html {
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-weight: 500;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
}

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

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.5em;
}

p {
    margin: 0 0 1.5em;
}

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

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

.site-main {
    flex: 1;
    width: 100%;
}

.content-area {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 24px;
}

/* ==========================================================================
   Header - Light Theme (Default)
   ========================================================================== */

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

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

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

.site-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--color-text);
}

.feed-nav {
    display: flex;
    gap: 32px;
}

.feed-link {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding: 8px 0;
    position: relative;
    transition: color 0.2s ease;
}

.feed-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.25s ease;
}

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

.feed-link.active {
    color: var(--color-text);
}

.feed-link.active::after {
    width: 100%;
}

/* ==========================================================================
   Footer - Light Theme (Default)
   ========================================================================== */

.site-footer {
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.footer-inner {
    max-width: 680px;
    margin: 0 auto;
    padding: 16px 24px;
    text-align: center;
}

.footer-copy {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.back-link {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

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

/* ==========================================================================
   DARK THEME - Photo Post Pages
   Applied when body has .is-photo-post class
   ========================================================================== */

body.is-photo-post {
    background: var(--photo-bg);
    color: var(--photo-text);
}

body.is-photo-post .site-wrapper {
    background: var(--photo-bg);
}

body.is-photo-post .site-header {
    background: var(--photo-bg);
    border-bottom-color: var(--photo-surface);
}

body.is-photo-post .site-title {
    color: var(--photo-text);
}

body.is-photo-post .feed-link {
    color: var(--photo-muted);
}

body.is-photo-post .feed-link:hover {
    color: var(--photo-text);
}

body.is-photo-post .site-main {
    background: var(--photo-bg);
}

body.is-photo-post .site-footer {
    background: var(--photo-bg);
    border-top-color: var(--photo-surface);
}

body.is-photo-post .back-link {
    color: var(--photo-muted);
}

body.is-photo-post .back-link:hover {
    color: var(--photo-text);
}

/* ==========================================================================
   Photo Detail Layout
   ========================================================================== */

.photo-detail {
    min-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}

.photo-hero {
    margin: 0;
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.photo-hero img {
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.photo-info {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 24px;
    text-align: center;
}

.photo-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--photo-text);
    margin: 0 0 8px;
}

.photo-date {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--photo-muted);
    letter-spacing: 0.03em;
}

.photo-caption {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--photo-muted);
    margin-top: 24px;
    line-height: 1.6;
}

.photo-content {
    margin-top: 32px;
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(245, 245, 247, 0.85);
    text-align: left;
}

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

/* ==========================================================================
   Blog Feed
   ========================================================================== */

.blog-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 24px;
}

.blog-content .post {
    padding-bottom: 48px;
    margin-bottom: 48px;
    border-bottom: 1px solid var(--color-border);
}

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

.post-header {
    margin-bottom: 24px;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.35;
}

.post-title a {
    color: var(--color-text);
}

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

.post-date {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.post-image {
    margin: 24px 0;
}

.post-image img {
    border-radius: 4px;
}

.post-content {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.75;
}

.post-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content h2 {
    margin-top: 2em;
    font-size: 1.4rem;
    font-weight: 700;
}

.post-content h3 {
    margin-top: 1.5em;
    font-size: 1.2rem;
    font-weight: 600;
}

.post-content blockquote {
    margin: 1.5em 0;
    padding: 0 0 0 20px;
    border-left: 3px solid var(--color-accent);
    font-style: italic;
    color: var(--color-text-secondary);
}

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

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

.post-content pre {
    background: var(--color-bg-darker);
    padding: 16px 20px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    border: 1px solid var(--color-border);
}

.post-content code {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.88em;
    background: var(--color-bg-darker);
    padding: 2px 5px;
    border-radius: 3px;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-footer {
    margin-top: 24px;
}

.permalink {
    font-size: 1rem;
    color: var(--color-accent);
}

/* ==========================================================================
   Photography Grid
   ========================================================================== */

.photo-feed {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.photo-item {
    display: block;
    position: relative;
    overflow: hidden;
    background: var(--color-bg-darker);
    aspect-ratio: 1;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
    opacity: 0.9;
}

/* ==========================================================================
   Single Blog Post
   ========================================================================== */

.post-single {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 24px;
}

.post-single .post-header {
    text-align: center;
    margin-bottom: 32px;
}

.post-single .post-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text);
}

.post-meta {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    display: flex;
    justify-content: center;
    gap: 20px;
}

.post-single .post-content {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.8;
}

.post-single .post-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.tag-link {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 5px 12px;
    background: var(--color-bg-darker);
    border-radius: 20px;
    color: var(--color-text-secondary);
}

.tag-link:hover {
    background: var(--color-accent);
    color: #fff;
}

/* ==========================================================================
   Page
   ========================================================================== */

.page {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 24px;
}

.page-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
}

.page-content {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.8;
}

/* Tag Header */
.tag-header {
    text-align: center;
    margin-bottom: 48px;
}

.tag-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.tag-description {
    color: var(--color-text-secondary);
    font-weight: 500;
    max-width: 500px;
    margin: 0 auto;
}

/* ==========================================================================
   Error Page
   ========================================================================== */

.error-page {
    text-align: center;
    padding: 80px 24px;
}

.error-code {
    font-size: 5rem;
    font-weight: 300;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: 12px;
}

.error-message {
    color: var(--color-text-secondary);
    font-weight: 500;
    margin-bottom: 24px;
}

.error-link {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 10px 20px;
    border: 1px solid var(--color-accent);
    border-radius: 4px;
}

.error-link:hover {
    background: var(--color-accent);
    color: #fff;
}

/* No posts message */
.no-posts {
    text-align: center;
    color: var(--color-text-secondary);
    font-weight: 500;
    padding: 48px;
}

/* Infinite scroll trigger */
.infinite-scroll {
    height: 1px;
    visibility: hidden;
}

/* ==========================================================================
   Ghost Content Width Classes (Required)
   ========================================================================== */

.gh-content {
    position: relative;
}

.kg-width-wide {
    position: relative;
    width: calc(100vw - 40px);
    max-width: 1000px;
    left: 50%;
    transform: translateX(-50%);
}

.kg-width-full {
    position: relative;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
}

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

/* Ghost Cards */
.kg-image-card {
    margin: 1.5em 0;
}

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

.kg-image-card figcaption,
.post-image figcaption {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-top: 10px;
    font-style: italic;
}

.kg-bookmark-card {
    background: var(--color-bg-darker);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
    margin: 1.5em 0;
}

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

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

.kg-bookmark-title {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.95rem;
}

.kg-bookmark-description {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-bookmark-metadata {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-top: 10px;
}

.kg-bookmark-thumbnail {
    width: 160px;
    min-height: 140px;
    background-size: cover;
    background-position: center;
}

.kg-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 1.5em 0;
}

.kg-gallery-row {
    display: flex;
    gap: 10px;
}

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

.kg-callout-card {
    padding: 16px 20px;
    border-radius: 6px;
    display: flex;
    gap: 14px;
    margin: 1.5em 0;
    background: var(--color-bg-darker);
    border: 1px solid var(--color-border);
}

.kg-callout-emoji {
    font-size: 1.2rem;
}

.kg-callout-text {
    font-weight: 500;
}

.kg-button-card {
    margin: 1.5em 0;
}

.kg-btn {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 4px;
    display: inline-block;
}

.kg-btn-accent {
    background: var(--color-accent);
    color: #fff;
}

.kg-btn-accent:hover {
    background: var(--color-accent-hover);
    color: #fff;
}

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

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

@media (max-width: 768px) {
    html {
        font-size: 16px;
    }
    
    .header-inner {
        flex-direction: column;
        gap: 12px;
    }
    
    .feed-nav {
        gap: 24px;
    }
    
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
    
    .photo-hero {
        padding: 16px;
    }
    
    .photo-hero img {
        max-height: 60vh;
    }
    
    .photo-title {
        font-size: 1.3rem;
    }
    
    .post-single .post-title,
    .page-title {
        font-size: 1.6rem;
    }
    
    .kg-width-wide {
        width: 100vw;
        max-width: 100vw;
    }
    
    .kg-bookmark-container {
        flex-direction: column;
    }
    
    .kg-bookmark-thumbnail {
        width: 100%;
        height: 160px;
    }
}

@media (max-width: 480px) {
    .feed-nav {
        gap: 20px;
    }
    
    .feed-link {
        font-size: 0.75rem;
    }
    
    .photo-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3px;
    }
}
