/* Diana Theme - Minimalistic Ghost Theme */

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

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

body {
    background-color: var(--bg-color, #103d2a);
    color: var(--text-color, #b87333);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.7;
}

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

/* Header */
.site-header {
    padding: 2rem 1.5rem;
    position: sticky;
    top: 0;
    background-color: var(--bg-color, #103d2a);
    z-index: 100;
    transition: transform 0.3s ease;
    will-change: transform;
}

@media (max-width: 899px) {
    .site-header.is-hidden {
        transform: translateY(-100%);
    }
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

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

.site-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Navigation */
.site-nav {
    width: 100%;
}

.site-nav .nav,
.site-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
}

.site-nav .nav li a,
.site-nav li a {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.5rem 0;
    position: relative;
}

.site-nav li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--text-color, #b87333);
    transition: width 0.3s ease;
}

.site-nav li a:hover::after,
.site-nav li.nav-current a::after {
    width: 100%;
}

.site-nav li a:hover {
    opacity: 1;
}

/* Subscribe button (theme-native Portal trigger) */
.site-subscribe {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--text-color, #b87333);
    color: var(--text-color, #b87333);
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
}

.site-subscribe-icon {
    flex-shrink: 0;
    display: block;
}

.site-subscribe:hover {
    background-color: var(--text-color, #b87333);
    color: var(--bg-color, #103d2a);
    opacity: 1;
}

/* Main Content */
.site-main {
    flex: 1;
    padding: 2rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Home intro sentence */
.home-intro {
    max-width: 760px;
    margin: 0 auto 2.5rem;
    padding: 0 1rem;
    text-align: center;
    font-size: 1.125rem;
    line-height: 1.6;
    opacity: 0.85;
}

@media (max-width: 899px) {
    .home-intro {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
}

/* Tag Hero Grid (home page) */
.tag-hero-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tag-hero {
    position: relative;
    display: block;
    height: 62vh;
    min-height: 380px;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.25);
}

.tag-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.tag-hero:hover img {
    transform: scale(1.04);
}

.tag-hero:hover {
    opacity: 1;
}

.tag-hero-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2rem 1.75rem 1.75rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 55%, rgba(0, 0, 0, 0) 100%);
    color: #fff;
}

.tag-hero-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.2;
}

.tag-hero-description {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* Post Grid - CSS columns masonry */
.post-grid {
    column-count: 4;
    column-gap: 24px;
    margin: 0 auto;
}

/* Post Card */
.post-card {
    break-inside: avoid;
    margin-bottom: 24px;
    display: block;
    transition: transform 0.3s ease;
}

.post-card:hover {
    transform: translateY(-4px);
}

.post-card-link {
    display: block;
}

.post-card-image {
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

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

.post-card-content {
    padding: 1rem 0;
}

.post-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.375rem;
}

.post-card-excerpt {
    font-size: 0.8125rem;
    opacity: 0.7;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.post-card-meta {
    font-size: 0.6875rem;
    opacity: 0.5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.post-card-tag {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Tag Archive Header */
.tag-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 3rem;
}

.tag-header-image {
    margin-bottom: 1.5rem;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.tag-header-image img {
    max-height: 40vh;
    width: auto;
}

.tag-header-title {
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.tag-header-description {
    font-size: 1rem;
    opacity: 0.75;
    line-height: 1.6;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination a {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pagination-info {
    font-size: 0.875rem;
    opacity: 0.6;
}

/* Single Post */
.post-full {
    max-width: 720px;
    margin: 0 auto;
}

.post-header {
    text-align: center;
    margin-bottom: 2rem;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.post-meta {
    font-size: 0.875rem;
    opacity: 0.7;
}

.meta-separator {
    margin: 0 0.5rem;
}

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

.post-feature-image figcaption {
    font-size: 0.8125rem;
    text-align: center;
    opacity: 0.6;
    padding: 0.75rem;
}

.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin: 2rem 0 1rem;
    line-height: 1.3;
}

.post-content h2 {
    font-size: 1.75rem;
}

.post-content h3 {
    font-size: 1.375rem;
}

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

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

.post-content img {
    margin: 2rem 0;
}

/* Koenig Editor Width Classes */
.kg-width-wide {
    position: relative;
    width: 85vw;
    min-width: 100%;
    margin-left: calc(50% - 42.5vw);
    margin-right: calc(50% - 42.5vw);
}

.kg-width-full {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

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

.post-content blockquote {
    border-left: 3px solid var(--text-color, #b87333);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    opacity: 0.9;
}

.post-content pre {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    overflow-x: auto;
    margin: 2rem 0;
    font-size: 0.875rem;
}

.post-content code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

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

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

.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.post-tags .tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.375rem 0.75rem;
    background-color: rgba(0, 0, 0, 0.2);
}

/* Page Template */
.page {
    max-width: 720px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.page-feature-image {
    margin-bottom: 2rem;
    overflow: hidden;
}

.page-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

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

/* Footer */
.site-footer {
    padding: 2rem 1.5rem;
    text-align: center;
}

.footer-inner {
    font-size: 0.8125rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.site-footer-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
}

.site-footer-nav li a {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    opacity: 0.75;
}

.site-footer-nav li a:hover {
    opacity: 1;
}

.site-footer-copy {
    opacity: 0.5;
}

/* Error Page */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.error-message {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.7;
}

.error-link {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.5rem;
    border: 1px solid currentColor;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.error-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    opacity: 1;
}

/* Responsive */
@media (max-width: 1199px) {
    .post-grid {
        column-count: 3;
    }
}

@media (max-width: 899px) {
    .post-grid {
        column-count: 2;
    }

    .tag-hero-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        scroll-snap-type: y mandatory;
    }

    .tag-hero {
        height: 72vh;
        min-height: 0;
        scroll-snap-align: start;
    }

    .tag-hero-title {
        font-size: 1.75rem;
    }

    .tag-hero-description {
        font-size: 0.95rem;
    }

    .header-inner {
        flex-direction: column;
    }
}

@media (min-width: 900px) {
    .header-inner {
        flex-direction: row;
        justify-content: space-between;
    }

    .site-nav {
        width: auto;
    }
}

@media (max-width: 599px) {
    .post-grid {
        column-count: 1;
    }

    .post-title,
    .page-title {
        font-size: 1.875rem;
    }

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