/* --- RESET & VARIABLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #faf9f6;        
    --text-main: #111111;      
    --text-muted: #6e6e6e;     
    --border-color: #e8e6e0;    
    
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'Courier Prime', monospace;
    --sans: 'DM Sans', sans-serif;
    --serif: 'DM Serif Display', serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- HEADER & MAIN NAVIGATION --- */
.site-header {
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(8px);
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.site-nav button {
    background: none;
    border: none;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: 2rem;
    font-family: var(--font-mono);
    transition: color 0.2s;
}

.site-nav button:hover, .site-nav button.active {
    color: var(--text-main);
    font-weight: 500;
}

/* --- MAIN LAYOUT --- */
.container-main {
    max-width: 1000px;
    margin: 1.5rem auto;
    padding: 0 2rem;
}

/* --- HOMEPAGE / INDEX --- */
.view-section {
    display: none;
}

.view-section.active-view {
    display: block;
}

.index-intro {
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.manifesto {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.5;
}

.journal-list {
    display: flex;
    flex-direction: column;
}

.journal-row {
    display: grid;
    grid-template-columns: 120px 1fr 100px;
    gap: 2rem;
    padding: 2.5rem 0;
    border-top: 1px solid var(--border-color);
    align-items: start;
}

.journal-row.visible-row {
    display: grid;
}

.journal-row:last-of-type {
    border-bottom: 1px solid var(--border-color);
}

.journal-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.journal-number {
    color: var(--text-main);
    font-weight: bold;
}

.journal-content {
    display: flex;
    flex-direction: column;
}

.journal-title {
    font-family: var(--font-serif);
    font-size: 1.85rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.journal-link {
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    transition: color 0.2s ease;
}

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

.journal-excerpt {
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 300;
    line-height: 1.85;
    color: var(--text-main);
    max-width: 680px;
    margin-bottom: 0.75rem;
}

.journal-author {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.journal-thumbnail {
    width: 100px;
    height: 100px;
    overflow: hidden;
    opacity: 0.3; 
    filter: grayscale(100%);
    transition: opacity 0.3s ease, filter 0.3s ease;
    border: 1px solid #878787;
}

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

.journal-row:hover .journal-thumbnail {
    opacity: 0.8;
    filter: grayscale(0%);
}

/* --- NAVIGATION BUTTONS (HOMEPAGE & IN-POST) --- */
.nav-simple-btn {
    background: none;
    border: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav-simple-btn:hover:not(:disabled) {
    color: var(--text-main);
}

.nav-simple-btn:disabled {
    visibility: hidden;
}

/* --- POST DETAIL PAGE (ESSAY VIEW) --- */
.essay-view {
    max-width: 720px;
    margin: 0 auto;
}

.btn-back {
    background: none;
    border: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.essay-header {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.essay-title-large {
    font-family: var(--font-serif);
    font-size: 2.6rem;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.essay-body {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    line-height: 1.85;
    color: #222;
}

.essay-body p {
    margin-bottom: 2rem;
    text-align: justify;
}

/* --- IN-POST NAVIGATION --- */
.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* --- ABOUT VIEW --- */
.about-view {
    max-width: 720px;
    margin: 0 auto;
}

/* --- MAIN FOOTER (For Home / Default Pages) --- */
.site-footer {
    max-width: 1200px;
    margin: 8rem auto 0 auto; 
    padding: 3rem 2rem;
    border-top: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- SPECIFIC POST PAGE FOOTER --- */
.post-page .site-footer {
    margin: -2rem auto 0 auto !important; 
}

.footer-container {
    display: flex;
    justify-content: space-between;
}

/* --- ARTICLE CONTAINER (POST DETAIL) --- */
.article-container {
    max-width: 760px;
    margin: 60px auto 80px;
    padding: 0 32px;
}

#content {
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 300;
    line-height: 1.85;
    color: var(--text-main);
}

#content img {
    width: 100%;
    height: auto;
}

#content blockquote {
    border-left: 1px solid var(--text-main);
    padding-left: 24px;
    margin: 36px 0;
    font-size: 17px;
    font-weight: 300;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.6;
}

#content p {
    margin-bottom: 18px;
}

#content h2 {
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.02em;
    margin: 40px 0 16px;
}

#content h3 {
    font-size: 15px;
    font-weight: 400;
    margin: 32px 0 12px;
}

#content ul, #content ol {
    margin: 24px 0;
    padding-left: 24px;
}

#content li {
    margin-bottom: 8px;
}

#content a {
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}

#content a:hover {
    border-bottom-color: var(--text-main);
}

#content figcaption {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* ── POST NAV (PREV/NEXT BELOW ARTICLE) ── */
.post-nav {
    display: flex; 
    justify-content: space-between;
    align-items: center; 
    margin-top: 64px;
    padding-top: 40px; 
    border-top: 1px solid var(--border-color);
}

.post-nav a {
    font-size: 12px; 
    font-weight: 300; 
    color: var(--text-muted);
    text-decoration: none;
}

.post-nav a:hover { 
    color: var(--text-main); 
}

/* ── HOMEPAGE PAGINATION (NUMBERS) ── */
.homepage-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 50px;
    margin-bottom: 50px;
    font-family: sans-serif;
    font-size: 15px;
}

.homepage-pagination a {
    text-decoration: none;
    color: #888;
    transition: color 0.2s ease;
}

.homepage-pagination .page-nav-trigger {
    color: #888;
}

.homepage-pagination .page-nav-trigger.disabled {
    color: #e0e0e0;
    pointer-events: none;
    cursor: default;
}

.homepage-pagination .page-number {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 34px;
    height: 34px;
    color: #555;
}

.homepage-pagination .page-number.active {
    color: #000;
    border: 1px solid #000;
    border-radius: 4px;
    font-weight: 500;
}

.homepage-pagination a:hover:not(.disabled):not(.active) {
    color: #000;
}

/* ========================================================
   CUSDIS COMMENT AREA CUSTOMIZATION (AADDII.COM)
======================================================== */

.comment-separator {
    border: 0;
    border-top: 1px solid #eeeeee; 
    margin: 40px 0 20px 0; 
}

.comment-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 25px;
    color: #111111;
}

/* --- FIX ABSOLUTE LIVE RESIZE & NO-SCROLL --- */
#cusdis_thread, 
.custom-cusdis-container {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important; 
    font-family: inherit !important; 
}

#cusdis_thread iframe,
.custom-cusdis-container iframe {
    display: block !important;
    width: 100% !important;
    min-height: max-content !important; 
    height: 100% !important; 
    overflow: hidden !important; 
    border: none !important;
}

iframe[src*="cusdis.com"] {
    scrollbar-width: none !important;
}
iframe[src*="cusdis.com"]::-webkit-scrollbar {
    display: none !important;
}

/* --- MEDIA QUERIES --- */
@media (max-width: 768px) {
    .journal-row {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 2rem 0;
    }
    .journal-meta { 
        flex-direction: row; 
        gap: 1rem; 
    }
    .journal-title { 
        font-size: 1.5rem; 
    }
    .journal-thumbnail { 
        display: none; 
    }
}

/* ========================================================
   MEDIUM.COM IMAGE ZOOM EFFECT STYLES
======================================================== */

.image-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(250, 249, 246, 0.96); 
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    cursor: zoom-out;
    transition: opacity 0.3s cubic-bezier(0.2, 0, 0.2, 1);
    will-change: opacity;
}

.image-zoom-overlay img.image-zoomed {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.05);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1);
    will-change: transform;
}

.image-zoom-overlay.active {
    opacity: 1;
}

.image-zoom-overlay.active img.image-zoomed {
    transform: scale(1);
}

.tr-caption-container {
    margin-top: 10px !important; 
    width: 100% !important;
}

.tr-caption {
    font-size: 0.85rem;      
    color: #777;               
    font-style: italic;      
    line-height: 1.4;        
    text-align: center;      
    padding: 5px 0;
}

/* Contact section */
.contact-section {
    margin-top: 1.5rem;
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    margin-bottom: 0.5rem;
}

.contact-list li a {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #ccc;
    transition: all 0.2s;
}

.contact-list li a:hover {
    color: #000;
    border-bottom: 1px solid #000;
}
