/* Toneeq's Telegraph - Clean CSS v2 */

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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background-color: #f4f1e8;
    color: #1a1a1a;
    line-height: 1.6;
    padding: 10px;
}

/* === CONTAINER === */
.newspaper {
    max-width: 95%;
    margin: 20px auto;
    background: #ffffff;
    box-shadow: 0 0 30px rgba(0,0,0,0.15);
    padding: 30px;
    border: 1px solid #d4d4d4;
}

/* === HEADER === */
.masthead {
    text-align: center;
    border-bottom: 4px double #1a1a1a;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.header-decoration {
    font-size: 1.2em;
    color: #666;
    margin: 10px 0;
    letter-spacing: 10px;
}

.newspaper-title {
    font-size: 3.5em;
    font-weight: bold;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 15px 0;
}

.date {
    font-size: 1em;
    font-style: italic;
    margin: 10px 0;
    color: #444;
}

.motto {
    font-size: 0.85em;
    font-style: italic;
    color: #666;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    padding: 8px 0;
    margin-top: 12px;
}

/* Шапка и подвал - неселектируемые */
.masthead,
footer {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

/* === MUSIC PLAYER === */
.music-player {
    background: #f9f9f9;
    border: 3px double #1a1a1a;
    padding: 15px;
    margin-bottom: 25px;
    text-align: center;
    min-height: 180px;
}

.music-player h3 {
    font-size: 1.1em;
    margin-bottom: 10px;
}

#audio-player {
    width: 100%;
    max-width: 500px;
    margin: 10px auto;
    display: block;
    height: 35px;
}

#now-playing {
    font-weight: bold;
    margin: 10px 0;
    min-height: 1.5em;
}

.playlist {
    margin-top: 20px;
    max-height: 250px;
    overflow-y: auto;
    text-align: left;
}

.playlist.open {
    max-height: 300px;
}

.playlist-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0 10px 0;
    flex-wrap: wrap;
}

.playlist-btn {
    background: #666;
    color: #fff;
    border: none;
    padding: 6px 12px;
    font-size: 0.85em;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.2s;
}

.playlist-btn:hover {
    background: #444;
}

.playlist-btn.active {
    background: #1a1a1a;
}

.playlist-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.playlist-item:hover {
    background: #f5f5f5;
}

.playlist-item.active {
    background: #e8e8e8;
    font-weight: bold;
}

/* === CONTENT GRID === */
.content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

/* === COMMON STYLES FOR BOTH COLUMNS === */
.main-article,
.sidebar {
    padding-bottom: 0px;
    padding-left: 10px; 
    border: 2px solid #d4d4d4;
}

/* === MAIN ARTICLE (LEFT) === */
.main-article {
    border-right: 2px solid #d4d4d4;
    padding-right: 30px;
}

.main-article h2 {
    font-size: 2.2em;
    border-bottom: 3px solid #1a1a1a;
    padding-bottom: 12px;
    margin-bottom: 20px;
    direction: rtl;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.channel-icon {
    width: auto;
    height: 1.2em;
    border-radius: 50%;
}

/* === COMMON SCROLLABLE AREA === */
.article-content,
.sidebar-box {
    font-size: 1.1em;
    padding: 20px;
    padding-bottom: 20px;
    overflow-y: auto;
    scroll-behavior: smooth;
    margin-bottom: 15px;
}

/* Левый блок - короче из-за заголовка */
.article-content {
    text-align: justify;
    min-height: 75vh;
    max-height: 75vh;
}

/* Правый блок - выше, нет заголовка */
.sidebar-box {
    min-height: 90vh;
    max-height: 90vh;
}
.article-content {
    text-align: justify;
}

/* === SIDEBAR SPECIFIC === */
/* .sidebar { */
/*    padding-left: 10px; */
/*} */

.sidebar-box {
/*    border: 2px solid #d4d4d4; */
    background: #fafafa;
    font-size: 0.95em;
}

.sidebar-box h3 {
    display: none;
}

/* === SCROLLBAR STYLES === */
.article-content::-webkit-scrollbar,
.sidebar-box::-webkit-scrollbar {
    width: 10px;
}

.article-content::-webkit-scrollbar-track,
.sidebar-box::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.article-content::-webkit-scrollbar-thumb,
.sidebar-box::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.article-content::-webkit-scrollbar-thumb:hover,
.sidebar-box::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* === POSTS === */
.post-item {
    margin-bottom: 30px;
    padding: 0 15px 20px 15px;
    border-bottom: 2px solid #ddd;
}

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

.post-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin: 15px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.post-text {
    margin-bottom: 15px;
}

.post-text p {
    margin-bottom: 10px;
}

.post-text a {
    color: #0066cc;
    text-decoration: underline;
    word-break: break-word;
}

.post-text a:hover {
    color: #004499;
}

.post-text a:visited {
    color: #551a8b;
}

.post-meta {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
    margin-top: 10px;
    border-top: 1px dotted #ccc;
    padding-top: 8px;
}

/* === SIDEBAR POSTS === */
.sidebar-post {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.sidebar-post:last-child {
    border-bottom: none;
}

.sidebar-image {
    width: 100%;
    height: auto;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.sidebar-text {
    font-size: 0.9em;
}

.sidebar-text p {
    margin-bottom: 8px;
}

.sidebar-content {
    line-height: 1.7;
}

/* === HIDDEN ELEMENTS === */
.update-button-wrapper,
.refresh-btn,
.update-status {
    display: none;
}

/* === UTILITY === */
.loading {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 30px;
}

.error {
    background: #ffe6e6;
    border: 1px solid #cc0000;
    color: #cc0000;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.timestamp {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
    margin-top: 10px;
    display: none; 
}

/* === FOOTER === */
footer {
    text-align: center;
    border-top: 2px solid #1a1a1a;
    padding-top: 15px;
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .newspaper {
        padding: 15px;
    }
    
    .newspaper-title {
        font-size: 2.5em;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .main-article {
        border-right: none;
        padding-right: 0;
    }
    
    .article-content,
    .sidebar-box {
        max-height: 600px;
    }
}
