/* Website Styles - Responsive Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+TC:wght@400;500;700&display=swap');

/* ===== CSS Variables ===== */
:root {
    /* style palette */
    --primary-color: #0f172a; /* accent only */
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --text-dark: #111827;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --buy-color: #16a34a;
    --sell-color: #dc2626;
    --truth-blue: #2563eb;
    --muted-bg: #f3f4f6;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Inter, 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #f6f7f9;
}

/* ===== Header ===== */
.main-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem var(--spacing-lg);
    text-align: center;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-header .header-logo {
    max-height: 90px;
    width: auto;
    display: block;
    padding: 8px 16px;
}

/* ===== Main Container ===== */
#posts-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    padding-top: calc(100px + var(--spacing-lg)); /* Account for fixed header (100px) + spacing */
}

/* ===== Post Card ===== */
.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    margin-bottom: var(--spacing-lg);
    overflow: visible;
    transition: all 0.3s ease;
}

/* Date Container */
.date-container {
    background: var(--muted-bg);
    color: var(--text-dark);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    overflow: hidden;
    min-width: 0;
    border-bottom: 1px solid var(--border-color);
}

.dates-right {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 0.25rem;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    align-content: center;
}

.time-ago-tag {
    color: #0f172a;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.analysis-date,
.current-date {
    text-align: left;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: visible;
    box-sizing: border-box;
    display: block;
}

.current-date-time {
    font-family: inherit;
    display: inline;
    white-space: nowrap;
}

.post-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Hidden posts for lazy loading */
.hidden-post {
    display: none;
}

/* Fade-in animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Header Vote Wrapper (Post Header + Meta Content Cell + Vote Cell) ===== */
.header-vote-wrapper {
    display: grid;
    grid-template-columns: 2fr 2fr;
    grid-template-rows: auto 370px;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    align-items: stretch;
    overflow: visible;
}

/* ===== Post Header (Stock/Options Section) ===== */
.post-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    padding: 0;
    background-color: #ffffff;
    grid-row: 1;
    grid-column: 1;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-light);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Summary Cards (Stock/Options) */
.summary-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.summary-card.empty {
    opacity: 0.6;
}

.card-ticker {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
    letter-spacing: 0.5px;
}

.card-action {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid var(--border-color);
}

/* HK-safe card actions: 正面/上行=green, 負面/下行=red, 中性=yellow */
.card-action-positive {
    color: var(--buy-color);
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}

.card-action-negative {
    color: var(--sell-color);
    background-color: #fef2f2;
    border-color: #fecaca;
}

.card-action-neutral {
    color: #92400e;
    background-color: #fef3c7;
    border-color: #fbbf24;
}

.card-action-upward {
    color: var(--buy-color);
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}

.card-action-downward {
    color: var(--sell-color);
    background-color: #fef2f2;
    border-color: #fecaca;
}

.card-empty {
    font-size: 2rem;
    font-weight: 300;
    color: #999;
}

/* Options Timeline Indicator */
.option-timeline {
    margin-top: var(--spacing-sm);
    width: 100%;
    padding: 0.5rem 0;
}

.timeline-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
    text-align: center;
}

.timeline-current {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    color: #333;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255,255,255,0.9);
    padding: 2px 6px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.timeline-target {
    color: #2196F3;
    font-weight: 700;
    font-size: 0.85rem;
}

.timeline-expiry {
    color: #FF5722;
    font-weight: 700;
    font-size: 0.85rem;
}

.timeline-end {
    color: #FF5722;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.timeline-bar {
    width: 100%;
    height: 6px;
    background: var(--muted-bg);
    border-radius: 999px;
    position: relative;
}

.timeline-indicator {
    position: absolute;
    top: -3px;
    left: 20%;
    width: 10px;
    height: 12px;
    background: #2563eb;
    border-radius: 3px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Truth Section (Right side) */
.header-right {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.truth-logo {
    text-align: center;
}

.truth-logo img {
    max-width: 150px;
    height: auto;
}

.post-meta {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    padding: var(--spacing-sm);
    background: #ffffff;
    border-radius: 6px;
    border-bottom: 1px solid var(--border-color);
}

.poster-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.meta-text {
    flex: 1;
}

.meta-date {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.meta-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-dark);
}

.meta-id {
    font-size: 0.9rem;
    color: var(--text-light);
}

.post-content {
    background: #ffffff;
    padding: var(--spacing-md);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.94rem;
    line-height: 1.65;
    max-height: 7.5em;
    overflow: hidden;
}

/* ===== Vote Cell ===== */
.vote-cell {
    grid-column: 1;
    grid-row: 2;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 370px;
    max-height: 370px;
    overflow: visible;
    box-sizing: border-box;
    position: relative;
}

/* ===== Meta Content Cell (combined truth-logo + post-meta + post-content) ===== */
.meta-content-cell {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #ffffff;
    border: 1px solid #5448ee;
    border-radius: 6px;
    overflow: hidden;
    grid-row: 1 / 3;
    grid-column: 2;
    align-self: start;
    min-height: 0;
    height: auto;
    max-height: 700px !important;
}

.meta-content-cell .truth-logo {
    text-align: center;
    padding: var(--spacing-sm);
    border-bottom: none;
}

.meta-content-cell .truth-logo img {
    max-width: 120px;
    height: auto;
}

.meta-content-cell .post-meta {
    margin-bottom: 0;
    border-bottom: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    padding: var(--spacing-sm);
}

/* ===== Language Tabs ===== */
.post-language-tabs {
    display: flex;
    gap: 0;
    border-bottom: none;
    background: transparent;
    padding: 0;
}

.lang-tab {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.lang-tab:hover {
    background: transparent;
    color: var(--text-dark);
}

.lang-tab.active {
    color: var(--primary-color);
    border-bottom-color: #5448ee;
    background: transparent;
    font-weight: 600;
}

.meta-content-cell .post-content {
    margin-top: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: none;
    flex: 0 1 auto;
    overflow-y: auto;
    min-height: 20px;
    max-height: 400px;
    padding: var(--spacing-sm);
}

/* ===== Post Body (Analysis sections - full width) ===== */
.post-body {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.analysis-section {
    padding: var(--spacing-lg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #ffffff;
}

/* Alternating gray backgrounds */
.section-gray-1 {
    background: linear-gradient(#ffffff,#ffffff) padding-box, linear-gradient(to bottom, #ffffff 0%, #f7f8fa 100%) border-box;
}

.section-gray-2 {
    background: linear-gradient(#ffffff,#ffffff) padding-box, linear-gradient(to bottom, #ffffff 0%, #f2f4f7 100%) border-box;
}

.analysis-section h3 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
    font-weight: 700;
}

.analysis-content {
    font-size: 0.95rem;
    line-height: 1.8;
}

/* Markdown rendering styles */
.analysis-content strong {
    font-weight: 700;
    color: var(--text-dark);
}

.analysis-content p {
    margin: 0.5rem 0;
}

.analysis-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.analysis-content li {
    margin: 0.3rem 0;
    line-height: 1.6;
}

.analysis-content br {
    display: block;
    margin: 0.3rem 0;
    content: "";
}

/* Action badges (BUY/SELL) in Stock Picks section */
.action-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-left: 0.25rem;
    vertical-align: middle;
    letter-spacing: 0.06em;
}

/* Expiry date badge in Options Picks section */
.expiry-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    background-color: #eef2ff;
    color: #3730a3;
    margin-left: 0.25rem;
    vertical-align: middle;
    letter-spacing: 0.02em;
}

/* Strike price badge in Options Picks section */
.strike-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    background-color: #fef3c7;
    color: #92400e;
    margin-left: 0.25rem;
    vertical-align: middle;
    letter-spacing: 0.02em;
}

/* HK-safe action badges - colors match vote buttons */
.action-badge.action-positive {
    color: var(--buy-color);
    border-color: var(--buy-color);
    background-color: #f0fdf4;
}

.action-badge.action-negative {
    color: var(--sell-color);
    border-color: var(--sell-color);
    background-color: #fef2f2;
}

.action-badge.action-neutral {
    color: #92400e;
    border-color: #fbbf24;
    background-color: #fef3c7;
}


/* ===== Loading & End Messages ===== */
.loading, .end-message {
    text-align: center;
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) auto;
    max-width: 600px;
}

.loading.hidden, .end-message.hidden {
    display: none;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-sm);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.end-message p {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ===== Footer ===== */
.main-footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.footer-disclaimer {
    max-width: 1200px;
    margin: 0 auto var(--spacing-md);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
}

.disclaimer-section {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-md);
}

.disclaimer-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.disclaimer-text {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-light);
    margin: 0;
}

.disclaimer-text strong {
    color: var(--text-dark);
    font-weight: 700;
}

.footer-copyright {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    color: var(--text-light);
}

.footer-copyright p {
    margin: 0.25rem 0;
}

/* ===== Vote Section ===== */
.vote-section {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-md) * 0.5);
    position: relative;
}

.vote-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    position: relative;
    width: 100%;
}

.vote-question {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-top: calc(var(--spacing-xs) * -0.5);
    margin-bottom: var(--spacing-xs);
    line-height: 1.5;
}

/* Color keywords: 股票 (green), 期權 (blue/purple) */
.vote-keyword-stock {
    color: var(--buy-color);
    font-weight: 700;
}

.vote-keyword-options {
    color: #2563eb; /* truth-blue */
    font-weight: 700;
}

.vote-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.vote-button {
    flex: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    padding: 0.5rem var(--spacing-sm);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    min-height: 50px;
    gap: 0;
}

.vote-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.vote-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vote-positive {
    border-color: var(--buy-color);
    background-color: #f0fdf4;
}

.vote-positive:hover:not(:disabled) {
    border-color: var(--buy-color);
    background-color: #dcfce7;
}

.vote-negative {
    border-color: var(--sell-color);
    background-color: #fef2f2;
}

.vote-negative:hover:not(:disabled) {
    border-color: var(--sell-color);
    background-color: #fee2e2;
}

.vote-option-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0;
    white-space: nowrap;
}

.vote-positive .vote-option-text {
    color: var(--buy-color);
}

.vote-negative .vote-option-text {
    color: var(--sell-color);
}

.vote-count {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-left: 0.5rem;
    white-space: nowrap;
}

.vote-percentage {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    margin-left: 0.5rem;
    white-space: nowrap;
}

.vote-total {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    margin-top: var(--spacing-xs);
}

/* Vote success indicator */
.vote-success-indicator {
    position: absolute;
    right: -75px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: #9ca3af;
    white-space: nowrap;
    z-index: 10;
    transform: translateY(-50%);
    pointer-events: none;
}

.vote-success-indicator svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ===== No Posts Message ===== */
.no-posts {
    text-align: center;
    padding: var(--spacing-lg);
    font-size: 1.2rem;
    color: var(--text-light);
}

/* ===== Responsive Design - Mobile ===== */
@media (max-width: 768px) {
    /* Stack header sections vertically on mobile */
    .post-header {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    /* Stock and Options in separate rows, centered on mobile */
    .header-left,
    .header-center {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: var(--spacing-sm);
    }
    
    .header-left .section-title,
    .header-center .section-title {
        text-align: center;
    }
    
    .header-left .summary-card,
    .header-center .summary-card {
        margin: 0 auto;
        max-width: 300px;
    }
    
    /* Adjust typography */
    .main-header {
        height: 100px;
        padding: 0.5rem var(--spacing-sm);
    }
    
    .main-header .header-logo {
        max-height: 80px;
    }
    
    .card-ticker {
        font-size: 1.5rem;
    }
    
    .card-action {
        font-size: 0.9rem;
        padding: 0.2rem 0.8rem;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .summary-card {
        min-height: 100px;
        padding: var(--spacing-sm);
    }
    
    /* Adjust post content - larger height on mobile */
    .post-content {
        font-size: 0.9rem;
        max-height: 250px;
        overflow-y: auto;
    }
    
    /* Date container on mobile */
    .date-container {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }
    
    .time-ago-tag {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        margin-right: 0;
        min-width: fit-content;
    }
    
    .dates-right {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.3rem;
    }
    
    .analysis-date,
    .current-date {
        text-align: center !important;
        width: 100%;
    }
    
    /* Container padding */
    #posts-container {
        padding: var(--spacing-sm);
        padding-top: calc(100px + var(--spacing-sm)); /* Account for fixed header (100px) + spacing */
    }
    
    /* Header vote wrapper stacks on mobile */
    .header-vote-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }
    
    .post-header {
        grid-row: 1;
        grid-column: 1;
    }
    
    .meta-content-cell {
        grid-row: 2;
        grid-column: 1;
        max-height: none;
    }
    
    .meta-content-cell .post-content {
        max-height: 230px;
    }
    
    .vote-cell {
        grid-row: 3;
        grid-column: 1;
        min-height: 100px;
    }
    
    .post-body {
        padding: var(--spacing-sm);
    }
    
    .analysis-content {
        font-size: 0.85rem;
    }
    
    /* Truth logo smaller */
    .truth-logo img {
        max-width: 100px;
    }
    
    /* Poster icon smaller */
    .poster-icon {
        width: 50px;
        height: 50px;
    }
    
    /* Footer disclaimer stacks on mobile */
    .footer-disclaimer {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }
    
    .disclaimer-section {
        padding: var(--spacing-sm);
    }
    
    .disclaimer-title {
        font-size: 1rem;
    }
    
    .disclaimer-text {
        font-size: 0.8rem;
    }
    
    /* Options recommendations: Move expiry-badge to next row in mobile */
    .analysis-section.section-gray-2 .analysis-content p {
        /* Ensure paragraphs with expiry-badge can wrap */
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Force expiry-badge to next line in mobile, but keep inline with following text */
    .analysis-section.section-gray-2 .expiry-badge {
        display: inline-block;
        margin-top: 0.5rem;
        margin-left: 0;
        margin-bottom: 0;
        width: fit-content;
        line-height: 2;
        padding: 0.25rem 1rem;
        vertical-align: baseline;
    }
    
    /* Style strike-badge in mobile to match other badges */
    .analysis-section.section-gray-2 .strike-badge {
        display: inline-block;
        margin-left: 0.25rem;
        vertical-align: baseline;
    }
    
    /* Force line break before expiry-badge by making ::before block-level */
    .analysis-section.section-gray-2 .expiry-badge::before {
        content: '';
        display: block;
        width: 100%;
        height: 0;
        margin-bottom: -0.25rem;
    }
    
    /* Ensure parent paragraph allows wrapping and handles inline elements properly */
    .analysis-section.section-gray-2 .analysis-content p:has(.expiry-badge) {
        white-space: normal;
        line-height: 1.6;
    }
}

/* ===== Tablet Adjustments ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .post-header {
        grid-template-columns: 1fr 1fr 1.5fr;
    }
    
    #posts-container {
        padding: var(--spacing-md);
        padding-top: calc(100px + var(--spacing-md)); /* Account for fixed header (100px) + spacing */
    }
}

/* ===== Print Styles ===== */
@media print {
    .main-header,
    .main-footer,
    .loading,
    .end-message {
        display: none;
    }
    
    .post-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===== Post Navigation Buttons ===== */
.post-navigation {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
}

.post-nav-button {
    position: fixed;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: all;
    color: var(--text-dark);
    padding: 0;
}

.post-nav-button:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.post-nav-button:active {
    transform: scale(0.95);
}

.post-nav-button.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.post-nav-button svg {
    width: 24px;
    height: 24px;
}

/* Desktop: Middle position */
@media (min-width: 769px) {
    .post-nav-prev {
        left: calc(50% - 70px);
        bottom: 40px;
        transform: translateX(-50%);
    }
    
    .post-nav-next {
        left: calc(50% + 70px);
        bottom: 40px;
        transform: translateX(-50%);
    }
}

/* Mobile: Bottom right */
@media (max-width: 768px) {
    .post-navigation {
        bottom: 20px;
        right: 20px;
    }
    
    .post-nav-prev {
        bottom: 20px;
        right: 90px;
    }
    
    .post-nav-next {
        bottom: 20px;
        right: 20px;
    }
    
    .post-nav-button {
        width: 48px;
        height: 48px;
    }
    
    .post-nav-button svg {
        width: 20px;
        height: 20px;
    }
}

/* Active post highlight (optional visual feedback) */
.post-card.active-post {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
}

/* Hide navigation when printing */
@media print {
    .post-navigation {
        display: none;
    }
}

/* ===== Landing Page Styles ===== */

/* Fixed Header for Landing Page */
.main-header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Hamburger Menu Icon */
.hamburger-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 43px;
    transition: all 0.3s ease;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 4px;
    background-color: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
    margin-bottom: 9px;
}

.hamburger-menu span:last-child {
    margin-bottom: 0;
}

.hamburger-menu.menu-active span:nth-child(1) {
    transform: rotate(45deg) translate(11px, 11px);
}

.hamburger-menu.menu-active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.menu-active span:nth-child(3) {
    transform: rotate(-45deg) translate(11px, -11px);
}

/* Sidebar Menu */
.sidebar-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    background-color: #ffffff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding-top: 100px;
    overflow-y: auto;
}

.sidebar-menu.menu-open {
    transform: translateX(0);
}

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

.menu-list li {
    border-bottom: 1px solid var(--border-color);
}

.menu-link {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.menu-link:hover {
    background-color: var(--muted-bg);
}

.menu-link:active {
    background-color: #e5e7eb;
}

/* Menu Overlay (for mobile and desktop) */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.overlay-active {
    opacity: 1;
    visibility: visible;
}

/* Landing Page Main Content */
.landing-main {
    margin-top: 100px; /* Account for fixed header */
    padding: 2rem;
    min-height: calc(100vh - 100px);
}

/* Category Grid */
.category-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.category-block {
    display: block;
    text-decoration: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 300px;
}

.category-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.category-block-single {
    grid-column: 1 / -1;
    max-width: 50%;
    margin: 0 auto;
}

.category-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.category-title-overlay {
    background-color: rgba(211, 211, 211, 0.8);
    padding: 0.75rem 1.5rem;
    margin: 1rem;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.category-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Responsive Design for Landing Page */
@media (max-width: 768px) {
    .hamburger-menu {
        top: 15px;
        left: 15px;
        width: 37px;
        height: 43px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        z-index: 1001;
    }
    
    .hamburger-menu span {
        display: block;
        width: 100%;
        height: 4px;
        background-color: var(--text-dark);
        margin-bottom: 9px;
    }
    
    .hamburger-menu span:last-child {
        margin-bottom: 0;
    }
    
    .sidebar-menu {
        width: 220px;
    }
    
    .landing-main {
        padding: 1rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .category-block {
        height: 250px;
    }
    
    .category-block-single {
        max-width: 100%;
    }
    
    .category-title {
        font-size: 1.25rem;
    }
    
    .category-title-overlay {
        padding: 0.5rem 1rem;
        margin: 0.75rem;
    }
}

@media (min-width: 769px) {
    /* Desktop: menu hidden by default, overlays content when open */
    .sidebar-menu {
        transform: translateX(-100%);
    }
    
    /* Menu overlays content, no margin adjustment needed */
    .landing-main {
        margin-left: 0;
    }
}

