/*
Theme Name: Reporter Stories
Theme URI: https://reporterstories.org
Author: Reporter Stories
Description: Тема для Reporter Stories
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: reporterstories
*/

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Anonymous+Pro&family=Montserrat:wght@300;400;600&display=swap');

/* ============ Base ============ */

:root {
    --color-text: #1a1a1a;
    --color-text-secondary: #666;
    --color-link: #1a1a1a;
    --color-border: #e5e5e5;
    --color-bg: #fff;
    
    --font-logo: 'Anonymous Pro', monospace;
    --font-main: 'Montserrat', sans-serif;
    
    --width-content: 800px;
    --left-margin: 80px;
}

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

html {
    font-size: 18px;
    line-height: 1.6;
}

body {
    font-family: var(--font-main);
    font-weight: 400;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-link);
    text-decoration: none;
}

a:hover {
    opacity: 0.7;
}

/* ============ Layout ============ */

.site-container {
    max-width: var(--width-content);
    margin: 0;
    margin-left: var(--left-margin);
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============ Header ============ */

.site-header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.site-title {
    font-family: var(--font-logo);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0;
}

.site-title a {
    color: var(--color-text);
}

.site-description {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

/* ============ Feed ============ */

.post-feed {
    flex: 1;
}

.post-preview {
    border-bottom: 1px solid var(--color-border);
}

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

.post-preview a {
    display: block;
    padding: 1.5rem 0;
    transition: opacity 0.15s ease;
}

.post-preview a:hover {
    opacity: 0.7;
}

.post-preview-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.post-preview-excerpt {
    font-weight: 400;
}

.post-preview-date {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

/* ============ Single Post ============ */

.post-header {
    margin-bottom: 2.5rem;
}

.post-title {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.post-date {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* ============ Post Content ============ */

.post-content {
    font-family: var(--font-main);
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.75;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content h2 {
    font-family: var(--font-main);
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem;
}

.post-content h3 {
    font-family: var(--font-main);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
}

.post-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 0;
    display: block;
}

.post-content blockquote {
    margin: 1.5rem 0;
    padding-left: 1.25rem;
    border-left: 3px solid var(--color-border);
    color: var(--color-text-secondary);
    font-style: italic;
}

.post-content ul,
.post-content ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content pre {
    background: #f5f5f5;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2.5rem 0;
}

/* ============ Footnotes / Sideblock ============ */

.footnote {
    color: inherit;
    text-decoration: none !important;
    border: 1px solid #1a1a1a;
    padding: 2px 6px;
    position: relative;
    cursor: pointer;
    background: transparent;
}

.footnote::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 8px 8px 0;
    border-color: transparent #ff6f61 transparent transparent;
}

.footnote:hover {
    opacity: 1;
    background: rgba(0,0,0,0.03);
}

.sideblock {
    display: none;
    position: fixed;
    top: 50%;
    right: 40px;
    transform: translateY(-50%);
    max-width: 350px;
    width: 100%;
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #1a1a1a;
    padding: 1.5rem;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.sideblock.active {
    display: block;
}

.sideblock-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #fff;
}

.sideblock-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.85);
}

.sideblock-text p {
    margin-bottom: 0.5rem;
}

.sideblock-text p:last-child {
    margin-bottom: 0;
}

.sideblock-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 24px;
    height: 24px;
    cursor: pointer;
    opacity: 0.7;
}

.sideblock-close:hover {
    opacity: 1;
}

.sideblock-close::before,
.sideblock-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #fff;
}

.sideblock-close::before {
    transform: rotate(45deg);
}

.sideblock-close::after {
    transform: rotate(-45deg);
}

.sideblock-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 999;
}

.sideblock-overlay.active {
    display: block;
}

/* ============ Post Footer ============ */

.post-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.back-link {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

.back-link:hover {
    color: var(--color-text);
    opacity: 1;
}

/* ============ Site Footer ============ */

.site-footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    user-select: none;
}

/* ============ Page Navigation ============ */

.pagination {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
}

.pagination a {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

.pagination a:hover {
    color: var(--color-text);
    opacity: 1;
}

/* ============ 404 ============ */
.not-found {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.not-found h1 {
    font-family: var(--font-logo);
    font-size: 8rem;
    font-weight: 400;
    margin: 0;
    line-height: 1;
}

.not-found p {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin: 0.5rem 0 0 0;
}

.not-found-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    position: relative;
    left: -0.5em;
}

.not-found-link:hover {
    color: var(--color-text);
}

/* ============ Responsive ============ */

@media (max-width: 1200px) {
    .sideblock {
        right: 20px;
        max-width: 300px;
    }
}

@media (max-width: 900px) {
    :root {
        --left-margin: 40px;
    }
    
    .sideblock {
        top: auto;
        bottom: 20px;
        right: 20px;
        transform: none;
        max-width: 300px;
    }
}

@media (max-width: 600px) {
    html {
        font-size: 16px;
    }
    
    :root {
        --left-margin: 1rem;
    }
    
    .site-container {
        padding: 1.5rem 1rem;
    }
    
    .post-title {
        font-size: 1.6rem;
    }
    
    .post-preview-title {
        font-size: 1.1rem;
    }
    
    .sideblock {
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
        padding: 1.25rem;
    }
}

.wp-element-caption,
figcaption {
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
}

.error404 .site-header {
    border-bottom: none;
}

.error404 .site-footer {
    display: none;
}

.post-excerpt {
    font-weight: 400;
}