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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Georgia, serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f9f5f0;
    transition: all 0.3s ease;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    text-align: center;
    margin: 1.5em auto 0.8em;
    font-weight: normal;
    line-height: 1.3;
    max-width: 800px;
    padding: 0 20px;
}

.share-article-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: all 0.3s ease;
    vertical-align: middle;
    margin-left: 10px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.share-article-btn:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.share-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.share-toast.show {
    opacity: 1;
}

.journal-title a {
    text-decoration: none;
    color: inherit;
}

body.night-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.night-mode .share-article-btn {
    color: #fff;
}

.night-mode .share-article-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main container */
.editor-container {
    padding: 40px 20px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Header styles */
.journal-title {
    font-family: "Times New Roman", Times, serif;
    font-size: 3.5rem;
    margin: 0 auto 10px;
    line-height: 1.2;
    color: #000;
    font-weight: normal;
    border-bottom: 1px solid #888;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 850px;
}

.header-logo {
    width: clamp(45px, 10vw, 65px);
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

.night-mode .journal-title {
    color: #fff;
    border-bottom-color: #666;
}

.subtitle {
    font-style: italic;
    color: #555;
    font-size: 1.2rem;
    margin: 0 auto 30px;
    text-align: center;
    max-width: 600px;
}

.night-mode .subtitle {
    color: #aaa;
}

/* Journal Navigation */
.journal-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 0 auto 25px;
    border-bottom: 1px double #888;
    padding-bottom: 10px;
    max-width: 800px;
}

.night-mode .journal-nav {
    border-bottom-color: #444;
}

.nav-item {
    font-family: 'EB Garamond', serif;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: #8b0000;
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.8px;
    transition: all 0.3s ease;
    font-style: italic;
    text-transform: uppercase;
}

.night-mode .nav-item {
    color: #ffbaba;
}

.nav-item:hover {
    color: #500;
    transform: translateY(-1px);
}

.night-mode .nav-item:hover {
    color: #fff;
}

/* Dropcap */
.dropcap {
    float: left;
    font-size: 60px;
    line-height: 1;
    font-weight: bold;
    margin-right: 10px;
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    padding: 10px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.05);
    z-index: 100;
    transition: all 0.5s ease;
}

.night-mode .theme-toggle {
    background-color: rgba(255, 255, 255, 0.05);
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.night-mode .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-icon {
    transition: transform 0.5s ease, color 0.3s ease;
    color: #333;
}

.night-mode .theme-icon {
    transform: rotate(180deg);
    color: #fff;
}

/* Newspaper 4-column layout */
.newspaper-layout {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin: 40px 0;
}

/* Featured article */
.featured-article {
    grid-column: span 4;
    background: #fff;
    border-radius: 0px;
    padding: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    border: 0px solid #8b0000;
}

.night-mode .featured-article {
    background: #1a1a1a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: #ffbaba;
}

.featured-title {
    font-size: 2.5rem;
    color: #000;
    margin-bottom: 20px;
    margin-top: 5px;
    line-height: 1.2;
}

.night-mode .featured-title {
    color: #fff;
}

.featured-meta {
    color: #666;
    font-style: italic;
    margin-bottom: 25px;
}

.night-mode .featured-meta {
    color: #aaa;
}

.featured-excerpt {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.night-mode .featured-excerpt {
    color: #e0e0e0;
}

.read-featured-btn {
    display: inline-block;
    background: #8b0000;
    color: #fff;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.read-featured-btn:hover {
    background: #500;
    transform: translateY(-2px);
}

.night-mode .read-featured-btn {
    background: #ffbaba;
    color: #000;
}

.night-mode .read-featured-btn:hover {
    background: #fff;
}

/* Article cards in columns */
.article-card {
    background: #fff;
    border-radius: 0px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 0px solid rgba(0, 0, 0, 0.08);
    height: fit-content;
}

.night-mode .article-card {
    background: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.08);
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.night-mode .article-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.article-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 10px;
    line-height: 1.3;
}

.night-mode .article-card-title {
    color: #fff;
}

.article-card-date {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 12px;
    font-style: italic;
}

.night-mode .article-card-date {
    color: #aaa;
}

.article-card-excerpt {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
    margin-bottom: 15px;
}

.night-mode .article-card-excerpt {
    color: #ccc;
}

.read-more-btn {
    color: #8b0000;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    color: #500;
    text-decoration: underline;
}

.night-mode .read-more-btn {
    color: #ffbaba;
}

.night-mode .read-more-btn:hover {
    color: #fff;
}

/* Article image */
.article-image {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.night-mode .article-image {
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.article-image:hover {
    transform: scale(1.02);
}

.image-caption {
    text-align: center;
    font-style: italic;
    color: #666;
    margin-top: 8px;
    font-size: 0.9em;
}

.night-mode .image-caption {
    color: #aaa;
}

/* Article navigation */
.article-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.night-mode .article-nav {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.nav-article-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    font-family: Georgia, serif;
    transition: all 0.3s ease;
}

.night-mode .nav-article-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

.nav-article-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.night-mode .nav-article-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.back-to-journal {
    background: #8b0000;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-to-journal:hover {
    background: #500;
    transform: translateY(-2px);
}

.night-mode .back-to-journal {
    background: #ffbaba;
    color: #000;
}

.night-mode .back-to-journal:hover {
    background: #fff;
}

/* Responsive design */
@media (max-width: 1200px) {
    .newspaper-layout {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .featured-article {
        grid-column: span 3;
    }
}

@media (max-width: 900px) {
    .newspaper-layout {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .featured-article {
        grid-column: span 2;
        padding: 30px;
    }
    
    .featured-title {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .newspaper-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .featured-article {
        grid-column: span 1;
        padding: 20px;
    }
    
    .featured-title {
        font-size: 1.5rem;
    }
    
    .journal-title {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .journal-nav {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .editor-container {
        padding: 15px 10px;
    }
    
    .article-nav {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-article-btn, .back-to-journal {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}
