/*
Theme Name: SimfoDigital_9686
Theme URI: https://simfosoft.ru
Author: Илья Корнеев
Author URI: https://simfosoft.ru
Description: Тема для информационного блога про IT-образование, цифровые навыки и маршруты входа в индустрию.
Version: 1.1
Text Domain: simfodigital_9686
*/

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-main: #F9F6F0;
    --text-main: #1E2A2E;
    --accent-blue: #2B5F8A;
    --accent-terra: #C4684A;
    --accent-terra-dark: #A24F34;
    --card-bg: #E8EDF2;
    --card-bg-alpha: rgba(232, 237, 242, 0.85);
    --border-light: #D5DAE0;
    --bg-white: #FFFFFF;
    --font-heading: 'PT Serif', 'Georgia', serif;
    --font-body: 'Manrope', 'Segoe UI', sans-serif;
    --line-height: 1.65;
    --radius: 8px;
    --transition: 0.25s ease;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: var(--line-height);
    color: var(--text-main);
    background-color: var(--bg-main);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent-blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-terra); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-main);
    line-height: 1.3;
    margin: 0 0 0.6em;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

ul, ol { margin: 0 0 1em 1.5em; }

table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; }
th, td { border: 1px solid var(--border-light); padding: 0.6em 0.9em; text-align: left; }
th { background: var(--card-bg); font-weight: 600; }

blockquote {
    border-left: 4px solid var(--accent-blue);
    padding: 0.8em 1.2em;
    margin: 0 0 1.5em;
    background: var(--card-bg-alpha);
    font-style: italic;
}

/* === LAYOUT === */
.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.site-main-content { flex: 1; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 85%; margin: 0 auto; padding: 0 20px; }

.content-with-sidebar {
    display: flex;
    gap: 4%;
    align-items: flex-start;
}
.content-primary { flex: 0 0 67%; min-width: 0; }
.sidebar-area { flex: 0 0 27%; min-width: 0; }
.content-full { max-width: 85%; margin: 0 auto; }

/* === WAVE DECORATION === */
.wave-line {
    display: block;
    width: 100%;
    height: 12px;
    overflow: hidden;
}
.wave-line svg { width: 100%; height: 12px; }

/* === HEADER === */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: 0;
}
.site-header .wave-line { height: 4px; }
.site-header .wave-line svg { height: 4px; }

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}
.brand-block { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.brand-logo { max-height: 48px; width: auto; display: block; }
.brand-logo-placeholder {
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    background: var(--accent-blue); border-radius: var(--radius); flex-shrink: 0;
}
.brand-logo-placeholder svg { width: 28px; height: 28px; }
.brand-text .brand-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}
.brand-text .brand-desc {
    font-size: 0.78rem;
    color: #6B7B8D;
    line-height: 1.35;
    max-width: 340px;
}

/* NAV */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
}
.main-nav li { position: relative; }
.main-nav a {
    display: block;
    padding: 0.55em 1.1em;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    background: var(--card-bg);
    color: var(--accent-blue);
}

/* Sub menus */
.main-nav ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    z-index: 100;
    flex-direction: column;
    padding: 0.4em 0;
}
.main-nav li:hover > ul { display: flex; }

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    margin: 5px 0;
    transition: var(--transition);
}

/* === BUTTONS === */
.btn-primary {
    display: inline-block;
    background: var(--accent-terra);
    color: #fff;
    padding: 0.7em 1.6em 0.7em 1.3em;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
    clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px);
    text-align: center;
}
.btn-primary:hover {
    background: var(--accent-terra-dark);
    color: #fff;
    box-shadow: 0 4px 16px rgba(196,104,74,0.3);
}

.btn-secondary {
    display: inline-block;
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.93rem;
    border: none;
    border-bottom: 2px solid var(--accent-blue);
    padding: 0.3em 0;
    background: none;
    cursor: pointer;
    transition: border-color var(--transition), padding var(--transition);
}
.btn-secondary:hover {
    border-bottom-color: var(--accent-terra);
    color: var(--accent-terra);
    padding-left: 2px;
}

.chip {
    display: inline-block;
    padding: 0.35em 1em;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(232, 237, 242, 0.7);
    color: var(--text-main);
    transition: background var(--transition), color var(--transition);
    cursor: pointer;
    border: none;
}
.chip.active, .chip:hover {
    background: var(--accent-blue);
    color: #fff;
}

/* === CARDS === */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.8rem;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
    box-shadow: 0 8px 30px rgba(43,95,138,0.1);
    transform: translateY(-3px);
}

.card-thumb-wrap {
    position: relative;
    overflow: hidden;
}
.card-thumb-wrap a { display: block; }
.card-thumb-wrap img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Beginner label */
.card-label-beginner {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--bg-main);
    color: var(--accent-terra);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3em 0.8em 0.3em 0.6em;
    border-bottom-right-radius: var(--radius);
    box-shadow: 1px 1px 4px rgba(0,0,0,0.08);
    z-index: 2;
}
.card-label-beginner::after {
    content: '';
    position: absolute;
    right: -6px;
    bottom: 0;
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, var(--bg-main) 50%, transparent 50%);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.2em;
}
.card-meta {
    font-size: 0.8rem;
    color: #6B7B8D;
    margin-bottom: 0.5em;
    display: flex;
    gap: 0.8em;
    flex-wrap: wrap;
}
.card-meta a { color: var(--accent-blue); }
.card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    margin-bottom: 0.5em;
    line-height: 1.35;
}
.card-title a { color: var(--text-main); }
.card-title a:hover { color: var(--accent-blue); }

.card-excerpt { flex: 1; font-size: 0.92rem; color: #3D4F5F; line-height: 1.6; margin-bottom: 0.8em; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }

.card-footer { margin-top: auto; }

/* Horizontal card variant */
.card-horizontal {
    flex-direction: row;
}
.card-horizontal .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
}
.card-horizontal .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-horizontal .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: auto;
}

/* === BREADCRUMBS === */
.breadcrumbs {
    padding: 1em 0;
    font-size: 0.85rem;
    color: #6B7B8D;
}
.breadcrumbs a { color: var(--accent-blue); }
.breadcrumbs .sep { margin: 0 0.4em; color: #9EADB8; }

/* === PAGINATION === */
.pagination-wrap {
    display: flex;
    justify-content: center;
    gap: 0.4em;
    padding: 2em 0;
    flex-wrap: wrap;
}
.pagination-wrap a,
.pagination-wrap span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.7em;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-light);
    transition: all var(--transition);
}
.pagination-wrap a { color: var(--text-main); background: var(--bg-white); }
.pagination-wrap a:hover { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }
.pagination-wrap .current {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

/* === FRONT PAGE SECTIONS === */
.fp-section {
    padding: 3.5rem 0;
}
.fp-section:nth-child(even) {
    background: var(--card-bg-alpha);
}
.fp-section-title {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    text-align: center;
    margin-bottom: 0.3em;
    color: var(--text-main);
}
.fp-section-subtitle {
    text-align: center;
    color: #6B7B8D;
    font-size: 1rem;
    margin-bottom: 2em;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Timeline / route cards */
.timeline-routes {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
}
.route-card {
    flex: 0 0 320px;
    scroll-snap-align: start;
    border-radius: var(--radius);
    padding: 2em 1.5em;
    position: relative;
    overflow: hidden;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 220px;
    border: 1px solid var(--border-light);
}
.route-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--bg-main) 0%, var(--card-bg) 60%, rgba(43,95,138,0.15) 100%);
    z-index: 0;
}
.route-card > * { position: relative; z-index: 1; }
.route-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-blue);
    opacity: 0.25;
    line-height: 1;
    margin-bottom: 0.3em;
    font-family: var(--font-heading);
}
.route-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5em;
}
.route-card p { font-size: 0.92rem; color: #3D4F5F; flex: 1; }

/* Steps section */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    counter-reset: step-count;
}
.step-item {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.5em;
    border: 1px solid var(--border-light);
    position: relative;
    counter-increment: step-count;
}
.step-item::before {
    content: counter(step-count);
    position: absolute;
    top: -12px;
    left: 16px;
    width: 32px;
    height: 32px;
    background: var(--accent-blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Saratov accent block */
.saratov-block {
    border: 2px solid var(--accent-terra);
    border-radius: var(--radius);
    padding: 1.5em;
    background: linear-gradient(135deg, rgba(196,104,74,0.05), rgba(249,246,240,0.8));
    display: flex;
    align-items: flex-start;
    gap: 1em;
}
.saratov-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--accent-terra);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.saratov-icon svg { width: 24px; height: 24px; }

/* Columns section */
.info-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.info-col-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.8em;
    border: 1px solid var(--border-light);
}
.info-col-card h3 { color: var(--accent-blue); }

/* === SIDEBAR === */
.sidebar-area .widget {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.4em;
    margin-bottom: 1.5em;
    border: 1px solid var(--border-light);
}
.sidebar-area .widget-title,
.footer-widgets .widget-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    margin-bottom: 0.8em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--accent-blue);
}

.sidebar-area .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar-area .widget li {
    padding: 0.45em 0;
    border-bottom: 1px solid var(--border-light);
}
.sidebar-area .widget li:last-child { border-bottom: none; }

/* Steps widget in sidebar */
.sidebar-steps {
    counter-reset: sidebar-step;
}
.sidebar-step {
    display: flex;
    align-items: flex-start;
    gap: 0.8em;
    padding: 0.8em 0;
    border-bottom: 1px solid var(--border-light);
    counter-increment: sidebar-step;
}
.sidebar-step:last-child { border-bottom: none; }
.sidebar-step-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--accent-blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.sidebar-step-text { font-size: 0.9rem; line-height: 1.45; }
.sidebar-step-text a { font-weight: 500; }

/* === FOOTER === */
.site-footer {
    background: var(--text-main);
    color: #C8D2DB;
    padding: 0;
}
.site-footer .wave-line { height: 4px; }
.site-footer .wave-line svg path { fill: var(--accent-blue); opacity: 0.3; }

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 2.5rem 0;
}
.footer-widgets .widget-title {
    color: #fff;
    border-bottom-color: var(--accent-blue);
}
.footer-widgets a { color: #9EADB8; }
.footer-widgets a:hover { color: #fff; }
.footer-widgets ul { list-style: none; margin: 0; padding: 0; }
.footer-widgets li { padding: 0.35em 0; }
.footer-widgets p { font-size: 0.9rem; color: #9EADB8; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.2em 0;
    text-align: center;
    font-size: 0.85rem;
    color: #6B7B8D;
}

/* === COMMENTS === */
.comments-area { margin-top: 2.5em; }
.comments-title { margin-bottom: 1em; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment {
    padding: 1.2em 0;
    border-bottom: 1px solid var(--border-light);
}
.comment-author { font-weight: 600; margin-bottom: 0.3em; }
.comment-meta { font-size: 0.82rem; color: #6B7B8D; margin-bottom: 0.6em; }
.comment-respond { margin-top: 2em; }
.comment-form label { display: block; margin-bottom: 0.3em; font-weight: 500; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.6em 0.9em;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    margin-bottom: 1em;
    background: var(--bg-white);
    transition: border-color var(--transition);
}
.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--accent-blue);
    outline: none;
}
.comment-form .submit { 
    background: var(--accent-terra);
    color: #fff;
    border: none;
    padding: 0.7em 2em;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background var(--transition);
}
.comment-form .submit:hover { background: var(--accent-terra-dark); }

/* === SEARCH FORM === */
.search-form {
    display: flex;
    gap: 0;
    max-width: 480px;
}
.search-form .search-field {
    flex: 1;
    padding: 0.6em 1em;
    border: 1px solid var(--border-light);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--bg-white);
}
.search-form .search-field:focus { outline: none; border-color: var(--accent-blue); }
.search-form .search-submit {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    padding: 0.6em 1.2em;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}
.search-form .search-submit:hover { background: var(--accent-terra); }

/* === 404 === */
.error-404-wrap {
    text-align: center;
    padding: 4em 0;
}
.error-404-wrap h1 {
    font-size: 5rem;
    color: var(--accent-blue);
    opacity: 0.3;
    margin-bottom: 0;
}
.error-404-wrap h2 { margin-bottom: 0.5em; }
.error-404-wrap p { margin-bottom: 1.5em; color: #6B7B8D; }
.error-404-wrap .search-form { margin: 0 auto 1.5em; }

/* === COOKIE BANNER === */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--text-main);
    color: #C8D2DB;
    padding: 1em 1.5em;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5em;
    font-size: 0.9rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
.cookie-banner p { margin: 0; }
.cookie-banner .btn-primary { white-space: nowrap; }
.cookie-banner.hidden { display: none; }

/* === READING MODE === */
.reading-mode-toggle {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    z-index: 999;
    transition: all var(--transition);
}
.reading-mode-toggle:hover { border-color: var(--accent-blue); }
.reading-mode-toggle svg { width: 20px; height: 20px; fill: var(--text-main); }

body.reading-mode {
    font-size: 19px;
    background-color: #EDEAE4;
}
body.reading-mode .site-main-content {
    max-width: 720px;
    margin: 0 auto;
}

/* === SINGLE POST === */
.single-post-header { margin-bottom: 2em; }
.single-post-header h1 { margin-bottom: 0.3em; }
.single-post-meta {
    font-size: 0.85rem;
    color: #6B7B8D;
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
    margin-bottom: 1em;
}
.single-post-content { margin-bottom: 2em; }
.single-post-content img { border-radius: var(--radius); }

.post-tags { margin: 1.5em 0; display: flex; gap: 0.5em; flex-wrap: wrap; }
.post-tags a {
    display: inline-block;
    background: var(--card-bg);
    padding: 0.25em 0.8em;
    border-radius: 50px;
    font-size: 0.82rem;
}

/* Page content */
.page-content { margin-bottom: 2em; }

/* === RESPONSIVE === */
@media (max-width: 960px) {
    .header-inner { flex-wrap: wrap; gap: 0.8em; }
    .brand-text .brand-desc { display: none; }
    .footer-widgets { grid-template-columns: 1fr; gap: 1.5rem; }
    .content-with-sidebar { flex-direction: column; }
    .content-primary, .sidebar-area { flex: none; width: 100%; }
    .container-wide, .content-full { max-width: 95%; }
    .timeline-routes { flex-direction: column; }
    .route-card { flex: none; }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.45rem; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .header-inner { padding: 0.8rem 20px; }
    .main-nav { display: none; width: 100%; order: 3; }
    .main-nav.active { display: block; }
    .main-nav ul { flex-direction: column; }
    .main-nav ul ul { position: static; box-shadow: none; border: none; padding-left: 1em; }
    .mobile-menu-toggle { display: block; }
    .cards-grid { grid-template-columns: 1fr; }
    .card-horizontal { flex-direction: column; }
    .card-horizontal .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-horizontal .card-thumb-wrap a {
        position: static;
    }
    .card-horizontal .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .fp-section { padding: 2.5rem 0; }
    .cookie-banner { flex-direction: column; text-align: center; gap: 0.8em; }
    .steps-grid { grid-template-columns: 1fr; }
    .info-columns { grid-template-columns: 1fr; }
}
