/* Dazibao Theme - Main Styles */

:root {
    --color-text: #000;
    --color-bg: #fff;
    --color-accent: #dc143c;
    --color-border: #ddd;
    --color-light-bg: #f9f9f9;
    --transition: all 0.3s ease;
}

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

html, body {
    min-height: 100%;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg);
    background-repeat: repeat;
    background-attachment: scroll;
    background-size: auto;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ──────────────────────────── JOURNAL BANNER ──────────────────────────── */

.journal-banner {
    padding: 0;
    border-bottom: 3px solid var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    background-color: var(--color-bg);
    background-attachment: fixed;
    background-size: cover;
    background-position: 0 0;
}

.journal-title {
    font-size: clamp(2.5rem, 8vw, 7rem);
    font-weight: 900;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 12px;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    line-height: 1.1;
    padding: 0;
}

/* ──────────────────────────── HEADLINE OVERLAY ──────────────────────────── */

.headline-overlay {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
}

.volume-number {
    display: inline;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--color-accent);
}

/* ──────────────────────────── MAIN LAYOUT (TWO COLUMNS) ──────────────────────────── */

.main-layout {
    display: flex;
    flex: 1;
    gap: 0;
    overflow: visible;
    position: relative;
    padding-top: calc(var(--banner-height, 80px) + 10px);
    margin-left: 35%;
}

/* LEFT COLUMN: STICKY IMAGE ONLY */
.left-column {
    width: 35%;
    flex-shrink: 0;
    overflow: hidden;
    z-index: 20;
    margin-top: calc(var(--banner-height, 40px) / -2);
    position: fixed;
    left: 0;
    top: 80px;
    height: calc(100vh - 80px);
}
}

/* RIGHT COLUMN: ARTICLES */
.right-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: visible;
    margin-left: 0;
    position: relative;
    z-index: 5;
}

/* ──────────────────────────── SIDEBAR (STICKY IMAGE) ──────────────────────────── */

.sidebar {
    width: 100%;
    height: 100%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
}

.sidebar-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-accent), #ff6b6b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

/* ──────────────────────────── VOLUME HEADER ──────────────────────────── */

.volume-header {
    padding: 24px 30px 0 30px;
    flex-shrink: 0;
    position: relative;
    overflow: visible;
}

.volume-title {
    font-size: 3.6rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 20px;
    line-height: 0.8;
}

.volume-title .color-alternate {
    color: var(--color-alternate, ForestGreen);
}

.verified-image {
    position: absolute;
    max-width: 150px;
    height: auto;
    opacity: 0.6;
    z-index: 5;
    pointer-events: none;
}

.download-link {
    display: inline-block;
    text-decoration: none;
}

.download-image {
    position: absolute;
    max-width: 150px;
    height: auto;
    opacity: 0.8;
    z-index: 9;
    pointer-events: auto;
    cursor: pointer;
}

.volume-header .subtitle {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    font-weight: 500;
}

/* ──────────────────────────── ARTICLES CONTAINER ──────────────────────────── */

.articles-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.article-item {
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition);
}

.article-item:first-of-type {
    margin-top: -24px;
}

.article-item:last-child {
    border-bottom: none;
}

/* ARTICLE HEADER (ALWAYS VISIBLE, CLICKABLE) */
.article-header {
    cursor: pointer;
    padding: 20px 30px;
    transition: var(--transition);
    user-select: none;
}

.editorial-item .article-header {
    padding-top: 0;
}

.article-header:hover {
    background: rgba(220, 20, 60, 0.05);
}

.article-item.expanded .article-header {
    background: rgba(220, 20, 60, 0.15);
    border-left: 4px solid var(--color-accent);
    padding-left: 26px;
}

.article-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 8px;
    line-height: 1.3;
}

.article-title.color-alternate {
    color: var(--color-alternate, ForestGreen);
}

.article-excerpt {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: opacity var(--transition);
    position: relative;
    padding-bottom: 30px;
}

.article-item.expanded .article-excerpt {
    display: none;
}

.read-more-badge {
    display: block;
    position: absolute;
    bottom: 0;
    right: 0;
    margin: 0;
    padding: 4px 12px;
    background-color: transparent;
    color: var(--color-accent);
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--color-accent);
    border-radius: 12px;
    white-space: nowrap;
    opacity: 1 !important;
}

.article-meta {
    font-size: 0.75rem;
    color: #999;
    font-weight: 500;
}

/* ARTICLE CONTENT (HIDDEN BY DEFAULT, SHOWN WHEN EXPANDED) */
.article-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 30px;
    transition: max-height var(--transition), padding var(--transition);
}

.article-item.expanded .article-content {
    max-height: 2000px;
    padding: 20px 30px;
}

/* ──────────────────────────── ARTICLE BODY ──────────────────────────── */

.article-content h1,
.article-content h2,
.article-content h3 {
    color: var(--color-accent);
    margin-top: 16px;
    margin-bottom: 12px;
    line-height: 1.2;
}

.article-content h1 {
    font-size: 1.5rem;
    margin-top: 0;
}

.article-content h2 {
    font-size: 1.3rem;
}

.article-content h3 {
    font-size: 1.1rem;
}

.article-content p {
    margin-bottom: 12px;
    line-height: 1.7;
    font-size: 0.95rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 16px 0;
    border-radius: 4px;
}

.article-content ul,
.article-content ol {
    margin: 12px 0 12px 24px;
}

.article-content li {
    margin-bottom: 6px;
}

.article-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding-left: 16px;
    margin: 12px 0;
    color: #666;
    font-style: italic;
}

.article-content code {
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.article-content pre {
    background: rgba(0,0,0,0.08);
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 12px 0;
    font-size: 0.85rem;
}

/* ──────────────────────────── FOOTER ──────────────────────────── */

.footer {
    border-top: 2px solid var(--color-border);
    padding: 24px 40px;
    flex-shrink: 0;
}

.issue-selector {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.selector-label {
    font-weight: 600;
    color: var(--color-text);
}

.volume-dropdown {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.volume-dropdown:hover {
    border-color: var(--color-accent);
}

.volume-dropdown:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.read-volume-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.read-volume-btn:hover {
    background: var(--color-accent);
    color: white;
}

.read-volume-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.meta {
    font-size: 0.85rem;
    color: #999;
}

/* LOGO OVERLAY */
.logo-overlay {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    pointer-events: auto;
}

.logo-image {
    max-width: 100px;
    height: auto;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.logo-image:hover {
    opacity: 1;
}

/* ──────────────────────────── ANIMATIONS ──────────────────────────── */

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

/* ──────────────────────────── SCROLLBARS ──────────────────────────── */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* ──────────────────────────── RESPONSIVE ──────────────────────────── */

@media (max-width: 1200px) {
    .left-column {
        width: 40%;
    }

    .journal-title {
        font-size: 2.8rem;
        letter-spacing: 6px;
    }
}

@media (max-width: 1024px) {
    .journal-title {
        font-size: 2.2rem;
        letter-spacing: 4px;
    }

    .left-column {
        width: 45%;
    }

    .article-header {
        padding: 16px 24px;
    }

    .article-content {
        padding: 0 24px;
    }

    .article-item.expanded .article-content {
        padding: 16px 24px;
    }
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }

    .left-column {
        width: 100%;
        height: 300px;
        border-right: none;
        border-bottom: 2px solid var(--color-border);
    }

    .journal-banner {
        padding: 20px;
    }

    .journal-title {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }

    .volume-header {
        padding: 20px;
    }

    .volume-title {
        font-size: 1.4rem;
    }

    .article-header {
        padding: 16px 20px;
    }

    .article-content {
        padding: 0 20px;
    }

    .article-item.expanded .article-content {
        padding: 16px 20px;
    }

    .footer {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .journal-banner {
        padding: 16px;
    }

    .journal-title {
        font-size: 1.4rem;
        letter-spacing: 2px;
    }

    .left-column {
        height: 250px;
    }

    .volume-title {
        font-size: 1.2rem;
    }

    .article-title {
        font-size: 1rem;
    }

    .article-excerpt {
        font-size: 0.8rem;
    }

    .article-header {
        padding: 12px 16px;
    }

    .article-content {
        padding: 0 16px;
    }

    .article-item.expanded .article-content {
        padding: 12px 16px;
    }

    .footer {
        padding: 12px;
    }

    .issue-selector {
        flex-direction: column;
        align-items: flex-start;
    }
}

.cover-phrase-overlay {
    position: fixed;
    max-width: 300px;
    height: auto;
    opacity: 0.7;
    z-index: 15;
    pointer-events: none;
}
