/*
Theme Name: dds_cracksjet.com
Author: Иван Петров
Description: Образовательный онлайн-журнал и база знаний о цифровых профессиях, продуктивности и безопасной работе с технологиями.
Version: 1.1
Text Domain: cjet
*/

/* === Base === */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: #1A2238;
    background: #F5F7FB;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: #2E6BFF; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: #0F1E3D; line-height: 1.25; margin: 0 0 0.6em; font-weight: 700; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
hr { border: 0; height: 1px; background: #E6E9F0; margin: 2em 0; }

/* === Container === */
.shell { width: min(92%, 1180px); margin-inline: auto; }

/* === Header === */
.site-header {
    background: #FFFFFF;
    border-bottom: 1px solid #E6E9F0;
    padding: 18px 0;
}
.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 auto;
}
.brand-logo, .brand-logo svg {
    display: block;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
}
.brand-text { min-width: 0; }
.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0F1E3D;
    margin: 0;
    line-height: 1.2;
}
.brand-name a { color: inherit; text-decoration: none; }
.brand-desc {
    font-size: 0.82rem;
    color: #5A6477;
    margin: 2px 0 0;
    display: block;
    max-width: 520px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Nav */
.main-nav { flex: 0 0 auto; }
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid #D7DCE6;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.95rem;
    cursor: pointer;
    color: #0F1E3D;
}
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.nav-menu a {
    display: inline-block;
    padding: 8px 14px;
    color: #0F1E3D;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-menu a:hover { background: #EEF2FB; color: #2E6BFF; text-decoration: none; }
.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a {
    background: #0F1E3D;
    color: #FFFFFF;
}

/* === Layout === */
.site-main { padding: 36px 0 56px; }
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67%) minmax(0, 27%);
    gap: 6%;
    align-items: start;
}
.layout-single .content-area { width: 85%; margin-inline: auto; }
.layout-single { display: block; }

@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 36px; }
    .layout-single .content-area { width: 100%; }
}

/* === Breadcrumbs === */
.breadcrumbs {
    font-size: 0.9rem;
    color: #5A6477;
    margin-bottom: 22px;
    padding: 10px 14px;
    background: #FFFFFF;
    border: 1px solid #E6E9F0;
    border-radius: 10px;
}
.breadcrumbs a { color: #2E6BFF; }
.breadcrumbs .sep { margin: 0 8px; color: #99A2B5; }

/* === Front page === */
.front-page .site-main { padding-top: 24px; }
.front-section { margin-bottom: 56px; }
.front-section:last-child { margin-bottom: 24px; }

/* Hero (Block 1: text + illustration) */
.hero {
    background: linear-gradient(135deg, #0F1E3D 0%, #1B3168 100%);
    color: #F2F5FC;
    border-radius: 18px;
    padding: 48px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 36px;
    align-items: center;
}
.hero h1 { color: #FFFFFF; font-size: 2.2rem; margin-bottom: 16px; }
.hero p { color: #C9D3E6; font-size: 1.05rem; margin-bottom: 22px; }
.hero-cta {
    display: inline-block;
    background: #00C2A8;
    color: #0F1E3D;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.15s ease, background 0.15s ease;
}
.hero-cta:hover { background: #19D6BC; text-decoration: none; transform: translateY(-1px); }
.hero-illustration { display: flex; justify-content: center; min-width: 0; }
.hero-illustration img { width: 100%; max-width: 380px; }

@media (max-width: 800px) {
    .hero { grid-template-columns: 1fr; padding: 32px 24px; gap: 24px; }
    .hero h1 { font-size: 1.7rem; }
    .hero-illustration img { max-width: 280px; }
}

/* Directions grid (Block 2) */
.section-title {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.7rem;
}
.section-lead {
    text-align: center;
    color: #5A6477;
    max-width: 680px;
    margin: 0 auto 28px;
}
.directions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
.direction-card {
    background: #FFFFFF;
    border: 1px solid #E6E9F0;
    border-radius: 14px;
    padding: 24px 22px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.direction-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(15, 30, 61, 0.08);
    border-color: #C7D2EA;
}
.direction-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: #EEF2FB;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.direction-icon img { width: 30px; height: 30px; display: block; }
.direction-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.direction-card p { color: #5A6477; font-size: 0.92rem; margin: 0; }

@media (max-width: 960px) { .directions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .directions { grid-template-columns: 1fr; } }

/* Latest posts on front */
.latest-posts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
@media (max-width: 960px) { .latest-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .latest-posts { grid-template-columns: 1fr; } }

/* Steps (Block 3) */
.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    counter-reset: step-counter;
}
.step {
    background: #FFFFFF;
    border: 1px solid #E6E9F0;
    border-radius: 14px;
    padding: 28px 24px;
    position: relative;
}
.step::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    top: -18px;
    left: 24px;
    width: 40px;
    height: 40px;
    background: #00C2A8;
    color: #0F1E3D;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 6px 14px rgba(0, 194, 168, 0.25);
}
.step h3 { font-size: 1.1rem; margin: 10px 0 8px; }
.step p { color: #5A6477; margin: 0; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

/* Facts (Block 4) */
.facts {
    background: #FFFFFF;
    border: 1px solid #E6E9F0;
    border-radius: 18px;
    padding: 40px 32px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
    text-align: center;
}
.fact-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2E6BFF;
    margin-bottom: 6px;
    display: block;
}
.fact-label {
    color: #5A6477;
    font-size: 0.95rem;
}
@media (max-width: 800px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* === Card (template-parts/content-card.php) === */
.card {
    background: #FFFFFF;
    border: 1px solid #E6E9F0;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    min-width: 0;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(15, 30, 61, 0.08);
    border-color: #C7D2EA;
}
.card-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #EEF2FB;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
}
.card-meta {
    font-size: 0.82rem;
    color: #99A2B5;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.card-title {
    font-size: 1.1rem;
    margin: 0 0 10px;
    line-height: 1.35;
}
.card-title a { color: #0F1E3D; }
.card-title a:hover { color: #2E6BFF; text-decoration: none; }
.card-excerpt {
    color: #5A6477;
    font-size: 0.95rem;
    margin-bottom: 14px;
    flex: 1;
}
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    align-self: flex-start;
    font-weight: 600;
    color: #2E6BFF;
}
.card-more:hover { text-decoration: underline; }

/* === Single post === */
.entry-header { margin-bottom: 24px; }
.entry-title { font-size: 2rem; margin-bottom: 8px; }
.entry-meta {
    color: #99A2B5;
    font-size: 0.9rem;
    margin-bottom: 16px;
}
.entry-thumbnail {
    margin: 0 0 24px;
    border-radius: 14px;
    overflow: hidden;
}
.entry-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 7;
    object-fit: cover;
}
.entry-content {
    background: #FFFFFF;
    border: 1px solid #E6E9F0;
    border-radius: 14px;
    padding: 32px;
    line-height: 1.75;
}
.entry-content img { border-radius: 10px; margin: 1em 0; }
.entry-content blockquote {
    border-left: 4px solid #00C2A8;
    margin: 1.4em 0;
    padding: 6px 0 6px 18px;
    color: #0F1E3D;
    font-style: italic;
    background: #F5F7FB;
}
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}
.entry-content table th,
.entry-content table td {
    border: 1px solid #D7DCE6;
    padding: 10px 14px;
    text-align: left;
}
.entry-content table th {
    background: #EEF2FB;
    font-weight: 600;
}

/* === Page === */
.page-content {
    background: #FFFFFF;
    border: 1px solid #E6E9F0;
    border-radius: 14px;
    padding: 32px;
}
.page-title { margin-bottom: 22px; }

/* === Blog/Archive listing === */
.posts-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    margin-bottom: 28px;
}
.posts-list .card { /* keep vertical layout for now */ }

.archive-header {
    margin-bottom: 22px;
}
.archive-title { margin-bottom: 6px; }
.archive-description { color: #5A6477; margin: 0; }

/* === Sidebar === */
.sidebar {
    min-width: 0;
}
.sidebar .widget {
    background: #FFFFFF;
    border: 1px solid #E6E9F0;
    border-radius: 14px;
    padding: 22px 22px;
    margin-bottom: 22px;
    color: #1A2238;
}
.sidebar .widget-title,
.sidebar .widget h2 {
    font-size: 1.05rem;
    margin: 0 0 14px;
    color: #0F1E3D;
    padding-bottom: 10px;
    border-bottom: 1px solid #E6E9F0;
}
.sidebar .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar .widget li {
    padding: 8px 0;
    border-bottom: 1px dashed #E6E9F0;
    color: #1A2238;
}
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget a { color: #1A2238; }
.sidebar .widget a:hover { color: #2E6BFF; }
.sidebar .widget .post-date { color: #99A2B5; font-size: 0.85rem; display: block; }

/* Search widget (if used) */
.sidebar .widget input[type="search"],
.sidebar .widget input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #D7DCE6;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #F5F7FB;
    color: #1A2238;
}

/* === Pagination === */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 32px 0 0;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    background: #FFFFFF;
    border: 1px solid #D7DCE6;
    border-radius: 8px;
    color: #0F1E3D;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pagination a.page-numbers:hover {
    background: #EEF2FB;
    border-color: #2E6BFF;
    color: #2E6BFF;
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: #0F1E3D;
    color: #FFFFFF;
    border-color: #0F1E3D;
}
.pagination .page-numbers.dots {
    background: transparent;
    border: 0;
    color: #99A2B5;
}

/* === Search form === */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 520px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid #D7DCE6;
    border-radius: 8px;
    background: #FFFFFF;
    color: #1A2238;
    font-size: 0.95rem;
}
.search-form .search-submit {
    padding: 10px 18px;
    background: #2E6BFF;
    color: #FFFFFF;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.search-form .search-submit:hover { background: #1E55E0; }

/* === 404 === */
.error-404 {
    background: #FFFFFF;
    border: 1px solid #E6E9F0;
    border-radius: 14px;
    padding: 48px 32px;
    text-align: center;
}
.error-404 h1 { font-size: 4rem; margin-bottom: 8px; color: #2E6BFF; }
.error-404 p { color: #5A6477; margin-bottom: 22px; }
.error-404 .search-form { margin: 0 auto 18px; }
.error-404 .back-home {
    display: inline-block;
    background: #0F1E3D;
    color: #FFFFFF;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
}
.error-404 .back-home:hover { background: #1B3168; text-decoration: none; }

/* === Comments === */
.comments-area {
    margin-top: 36px;
    background: #FFFFFF;
    border: 1px solid #E6E9F0;
    border-radius: 14px;
    padding: 28px;
}
.comments-title { margin-bottom: 18px; }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list li { margin-bottom: 18px; padding: 16px; background: #F5F7FB; border-radius: 10px; }
.comment-list .children { list-style: none; margin: 14px 0 0 22px; padding: 0; }
.comment-author { font-weight: 600; color: #0F1E3D; }
.comment-meta { font-size: 0.85rem; color: #99A2B5; margin-bottom: 8px; }
.comment-respond label { display: block; font-size: 0.9rem; margin-bottom: 4px; color: #0F1E3D; }
.comment-respond input,
.comment-respond textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #D7DCE6;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 12px;
    background: #FFFFFF;
    font-family: inherit;
}
.comment-respond .submit {
    background: #2E6BFF;
    color: #FFFFFF;
    border: 0;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* === Footer === */
.site-footer {
    background: #0F1E3D;
    color: #C9D3E6;
    padding: 48px 0 0;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    margin-bottom: 32px;
}
.footer-col { min-width: 0; }
.footer-col .widget,
.footer-col .widget_text,
.footer-col .widget_nav_menu { color: #C9D3E6; }
.footer-col .widget-title,
.footer-col h2 {
    font-size: 1.05rem;
    color: #FFFFFF;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #1F3568;
}
.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-col li { padding: 6px 0; }
.footer-col a { color: #C9D3E6; }
.footer-col a:hover { color: #00C2A8; }
.footer-col p { color: #C9D3E6; margin: 0 0 0.8em; }
.footer-bottom {
    border-top: 1px solid #1F3568;
    padding: 18px 0;
    text-align: center;
    color: #99A2B5;
    font-size: 0.88rem;
}

@media (max-width: 800px) { .footer-cols { grid-template-columns: 1fr; gap: 28px; } }

/* === Cookie banner === */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: min(720px, calc(100% - 32px));
    background: #0F1E3D;
    color: #F2F5FC;
    padding: 18px 22px;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 30, 61, 0.35);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: 0.92rem; }
.cookie-banner .cookie-accept {
    background: #00C2A8;
    color: #0F1E3D;
    border: 0;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
}
.cookie-banner .cookie-accept:hover { background: #19D6BC; }

/* === Mobile nav === */
@media (max-width: 800px) {
    .nav-toggle { display: inline-block; }
    .nav-menu {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: #FFFFFF;
        border-bottom: 1px solid #E6E9F0;
        padding: 12px 5%;
        flex-direction: column;
        gap: 4px;
        box-shadow: 0 12px 24px rgba(15, 30, 61, 0.08);
    }
    .main-nav.is-open .nav-menu { display: flex; }
    .site-header { position: relative; }
    .brand-desc { display: none; }
}
