/*
Theme Name: Okartinkah Visual Finance
Theme URI: https://okartinkah.ru
Author: Senior WP Developer
Description: Лёгкая, адаптивная и SEO-дружественная тема для образовательного журнала о финансовой грамотности. Сложные финансовые темы — понятно, наглядно и по делу.
Version: 1.0.0
Text Domain: okartinkah
*/

:root {
    --color-graphite: #172033;
    --color-background: #F7F4EE;
    --color-white: #FFFFFF;
    --color-blue: #3B82F6;
    --color-mint: #A7E8D0;
    --color-yellow: #F8D66D;
    --color-coral: #F28B72;
    --color-muted: #687386;
    --color-border: #E6E9EF;
    --color-text: #334155;
    
    --font-main: 'Manrope', 'Inter', Arial, Helvetica, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace, Consolas;
}

/* Общий Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--font-main);
    background-color: var(--color-background);
    color: var(--color-text);
    font-size: 18px;
    line-height: 1.8;
}

main {
    flex: 1;
    padding: 40px 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Скрытая ссылка для доступности (Skip to content) */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-blue);
    color: var(--color-white);
    padding: 8px;
    z-index: 100;
}
.skip-link:focus { top: 0; }

a { color: var(--color-blue); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin-left: 20px; margin-bottom: 20px; }

h1, h2, h3, h4 { color: var(--color-graphite); font-weight: 700; margin-bottom: 20px; line-height: 1.3; }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-top: 40px; }
p { margin-bottom: 20px; }

/* Кнопки */
.btn {
    display: inline-block;
    background: var(--color-blue);
    color: var(--color-white);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    text-align: center;
    border: none;
    cursor: pointer;
}
.btn.btn-outline {
    background: transparent;
    color: var(--color-blue);
    border: 2px solid var(--color-blue);
}
.btn:hover { background: #2563EB; color: var(--color-white); opacity: 1; }
.btn.btn-outline:hover { background: var(--color-blue); color: var(--color-white); }

/* Шапка (Header) */
.site-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 20px;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-branding { display: flex; flex-direction: column; }
.site-title { font-size: 1.5rem; color: var(--color-graphite); margin: 0; }
.site-title a { color: var(--color-graphite); }
.site-description { font-size: 12px; color: var(--color-muted); }

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
}
.main-navigation a { color: var(--color-graphite); font-weight: 700; }
.main-navigation a:hover { color: var(--color-blue); }

.menu-toggle { display: none; background: transparent; border: none; font-size: 1.5rem; cursor: pointer; color: var(--color-graphite); }
.header-search button { background: transparent; border: none; font-size: 1.2rem; cursor: pointer; color: var(--color-graphite); }

/* Первый экран (Hero) */
.hero-section {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 60px;
    background: var(--color-white);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.hero-content { flex: 1; }
.hero-content p { font-size: 1.2rem; color: var(--color-muted); }
.hero-actions { display: flex; gap: 16px; margin-top: 30px; }

/* Декоративный блок CSS (схемы) */
.hero-visual {
    flex: 1;
    position: relative;
    height: 300px;
    background: var(--color-background);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
}
.deco-card { padding: 15px 30px; border-radius: 12px; font-weight: 700; text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.deco-card.mint { background: var(--color-mint); color: var(--color-graphite); transform: translateX(-40px); }
.deco-card.coral { background: var(--color-coral); color: var(--color-white); transform: translateX(40px); }
.deco-card.yellow { background: var(--color-yellow); color: var(--color-graphite); }
.deco-arrow { font-size: 2rem; color: var(--color-blue); }

/* Категории */
.home-categories { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; margin-bottom: 60px; }
.category-card { background: var(--color-white); padding: 20px; border-radius: 12px; text-align: center; font-weight: 700; border: 1px solid var(--color-border); box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.category-card:nth-child(1) { border-top: 4px solid var(--color-blue); }
.category-card:nth-child(2) { border-top: 4px solid var(--color-mint); }
.category-card:nth-child(3) { border-top: 4px solid var(--color-yellow); }
.category-card:nth-child(4) { border-top: 4px solid var(--color-coral); }
.category-card:nth-child(5) { border-top: 4px solid var(--color-graphite); }

/* Избранный пост */
.featured-post-block { background: var(--color-white); padding: 40px; border-radius: 24px; display: flex; gap: 40px; margin-bottom: 60px; border-left: 8px solid var(--color-yellow); }
.featured-content { flex: 1; }
.featured-label { font-size: 14px; text-transform: uppercase; color: var(--color-muted); font-weight: 700; margin-bottom: 10px; display: block; }
.featured-image { flex: 1; border-radius: 12px; overflow: hidden; }

/* Сетка постов */
.post-grid { display: grid; grid-template-columns: 1fr; gap: 30px; margin-bottom: 40px; }
@media(min-width: 768px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }

/* Карточка статьи */
.article-card {
    background: var(--color-white);
    border-radius: 18px;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 6px rgba(0,0,0,0.03);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}
.article-card:hover { transform: translateY(-4px); box-shadow: 0 8px 16px rgba(0,0,0,0.08); }
.card-header { padding: 20px 20px 0; border-top: 4px solid var(--color-blue); }
.card-meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--color-muted); margin-bottom: 10px; }
.card-type { font-family: var(--font-mono); font-weight: bold; background: var(--color-background); padding: 2px 8px; border-radius: 4px; }
.card-title { font-size: 1.4rem; margin-bottom: 15px; }
.card-title a { color: var(--color-graphite); }
.card-body { padding: 0 20px 20px; flex: 1; }
.card-body p { font-size: 16px; color: var(--color-text); margin-bottom: 10px; line-height: 1.6; }
.card-footer { padding: 20px; background: #fafafa; border-top: 1px solid var(--color-border); margin-top: auto; }
.card-read-more { font-weight: 700; color: var(--color-blue); }
.card-thumbnail img { width: 100%; height: 200px; object-fit: cover; }

/* Single */
.single-container { display: flex; gap: 40px; }
.single-content { flex: 1; max-width: 780px; }
.single-sidebar { width: 300px; display: none; }
@media(min-width: 1024px) { .single-sidebar { display: block; } }
.breadcrumbs { font-size: 14px; color: var(--color-muted); margin-bottom: 20px; }
.breadcrumbs a { color: var(--color-muted); text-decoration: underline; }
.post-main-idea { background: var(--color-mint); padding: 20px; border-radius: 12px; margin: 30px 0; font-weight: 700; color: var(--color-graphite); }
.content-area table { width: 100%; border-collapse: collapse; margin-bottom: 20px; display: block; overflow-x: auto; }
.content-area th, .content-area td { border: 1px solid var(--color-border); padding: 10px; }

/* 404 */
.error-404 { text-align: center; padding: 60px 20px; }
.error-404 h1 { font-size: 6rem; color: var(--color-coral); font-family: var(--font-mono); }
.broken-graph { display: flex; justify-content: center; align-items: flex-end; gap: 10px; height: 100px; margin: 40px 0; }
.bar { width: 40px; background: var(--color-blue); border-radius: 4px 4px 0 0; }
.bar-1 { height: 40px; } .bar-2 { height: 70px; } .bar-3.broken { height: 30px; background: var(--color-coral); transform: rotate(15deg) translateY(10px); } .bar-4 { height: 90px; }

/* Пагинация */
.pagination { margin-top: 40px; display: flex; gap: 10px; justify-content: center; }
.page-numbers { padding: 10px 15px; background: var(--color-white); border: 1px solid var(--color-border); border-radius: 8px; color: var(--color-graphite); font-weight: 700; }
.page-numbers.current { background: var(--color-blue); color: var(--color-white); border-color: var(--color-blue); }

/* Подвал (Footer) */
.site-footer { background: var(--color-graphite); color: var(--color-white); padding: 60px 20px 20px; margin-top: auto; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 40px; margin-bottom: 40px; }
@media(min-width: 768px) { .footer-inner { grid-template-columns: repeat(3, 1fr); } }
.footer-widget h3 { color: var(--color-white); margin-bottom: 20px; font-size: 1.2rem; }
.footer-widget ul { list-style: none; margin-left: 0; }
.footer-widget a { color: var(--color-muted); }
.footer-widget a:hover { color: var(--color-white); }
.footer-widget p { color: var(--color-muted); font-size: 14px; }
.site-info { text-align: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; font-size: 14px; color: var(--color-muted); }

/* Адаптив (Mobile) */
@media (max-width: 767px) {
    .menu-toggle { display: block; }
    .main-navigation { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--color-white); padding: 20px; border-bottom: 1px solid var(--color-border); z-index: 99; }
    .main-navigation.toggled { display: block; }
    .main-navigation ul { flex-direction: column; }
    .hero-section { flex-direction: column; padding: 20px; text-align: center; }
    .hero-actions { flex-direction: column; }
    .hero-visual { width: 100%; }
    .featured-post-block { flex-direction: column; padding: 20px; }
    h1 { font-size: 2rem; }
}
