/*
Theme Name: dds_oraclewhitepapers.com
Theme URI: https://oraclewhitepapers.com
Author: Алексей Воронов
Author URI: https://oraclewhitepapers.com
Description: Русскоязычный образовательный портал и база знаний по корпоративным IT-системам
Version: 1.1
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: dds_owp
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

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

:root {
    --bg-primary: #0F1117;
    --bg-content: #1A1D26;
    --bg-code: #0B0D12;
    --text-primary: #E8EDF2;
    --text-secondary: #8A91A8;
    --accent: #E6820A;
    --accent-hover: #B35F00;
    --accent-faint: rgba(230, 130, 10, 0.05);
    --border-subtle: rgba(138, 145, 168, 0.15);
    --code-text: #D4D4D4;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --gap: 1.5rem;
    --container-width: 1280px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

body > * { position: relative; z-index: 1; }

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin: 0 0 0.75em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1em; line-height: 1.7; }

ul, ol { margin: 0 0 1em 1.5em; }
li { margin-bottom: 0.3em; }

blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.75em 1.25em;
    margin: 1em 0;
    background: var(--accent-faint);
    color: var(--text-secondary);
    font-style: italic;
}

hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 2em 0;
}

/* ========== TABLES ========== */
table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
th, td {
    border: 1px solid var(--border-subtle);
    padding: 0.6em 1em;
    text-align: left;
}
th {
    background: rgba(230, 130, 10, 0.08);
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--accent);
}
td { background: var(--bg-content); }

/* ========== CODE BLOCKS ========== */
pre {
    background: var(--bg-code);
    color: var(--code-text);
    padding: 1.25em 1.5em;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.88em;
    line-height: 1.6;
    margin: 1.25em 0;
    position: relative;
    border: 1px solid var(--border-subtle);
}
code {
    font-family: var(--font-mono);
    font-size: 0.88em;
}
:not(pre) > code {
    background: rgba(230, 130, 10, 0.1);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    color: var(--accent);
}

pre .copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--bg-content);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
pre:hover .copy-code-btn { opacity: 1; }
pre .copy-code-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ========== CONTAINER ========== */
.site-container { width: 90%; max-width: var(--container-width); margin: 0 auto; }
.wide-container { width: 85%; max-width: var(--container-width); margin: 0 auto; }

/* ========== HEADER ========== */
.site-header {
    background: var(--bg-content);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.75rem 0;
    flex-wrap: wrap;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    flex-shrink: 0;
}
.header-brand:hover { color: var(--text-primary); }
.brand-logo { height: 42px; width: auto; display: block; }
.brand-placeholder-svg { height: 42px; width: 42px; display: block; }
.brand-text { display: flex; flex-direction: column; gap: 0.1rem; }
.brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: 1.25;
}
.brand-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.3;
    max-width: 360px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Engineer mode toggle */
.engineer-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}
.engineer-toggle input[type="checkbox"] { display: none; }
.toggle-track {
    width: 36px;
    height: 20px;
    background: var(--border-subtle);
    border-radius: 10px;
    position: relative;
    transition: background 0.25s;
}
.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: transform 0.25s, background 0.25s;
}
.engineer-toggle input:checked + .toggle-track { background: var(--accent); }
.engineer-toggle input:checked + .toggle-track::after {
    transform: translateX(16px);
    background: #fff;
}

/* Nav */
.main-nav { display: flex; align-items: center; }
.main-nav .nav-list {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
}
.main-nav .nav-list li a {
    display: block;
    padding: 0.5em 1em;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
    font-family: var(--font-heading);
    font-weight: 500;
}
.main-nav .nav-list li a:hover,
.main-nav .nav-list li.current-menu-item a {
    color: var(--accent);
    background: rgba(230, 130, 10, 0.06);
}

/* Burger */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.4em 0.6em;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
}

/* ========== BREADCRUMBS ========== */
.breadcrumbs-bar {
    padding: 0.75rem 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-primary);
}
.breadcrumbs-bar a { color: var(--text-secondary); }
.breadcrumbs-bar a:hover { color: var(--accent); }
.breadcrumbs-sep { margin: 0 0.4em; opacity: 0.5; }

/* ========== MAIN LAYOUT ========== */
.site-main { flex: 1; padding: 2rem 0; }

.content-with-sidebar {
    display: flex;
    gap: 3%;
    align-items: flex-start;
}
.content-area { flex: 0 0 67%; min-width: 0; }
.sidebar-area { flex: 0 0 27%; min-width: 0; }
.content-full { width: 85%; max-width: var(--container-width); margin: 0 auto; }

/* ========== SIDEBAR ========== */
.widget {
    background: var(--bg-content);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.widget-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}
.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.widget ul li {
    padding: 0.35em 0;
    border-bottom: 1px solid rgba(138, 145, 168, 0.08);
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a {
    color: var(--text-secondary);
    font-size: 0.88rem;
    transition: color 0.2s;
}
.widget ul li a:hover { color: var(--accent); }

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

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-content);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.25s, transform 0.25s;
}
.card:hover {
    border-color: rgba(230, 130, 10, 0.3);
    transform: translateY(-2px);
}

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

.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25em 0.6em;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    z-index: 2;
}
.card-badge.badge-original { background: #2D8F3E; color: #fff; }
.card-badge.badge-translation { background: #2D6BCF; color: #fff; }
.card-badge.badge-review { background: #9B59B6; color: #fff; }

.card-body {
    flex: 1;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2em 0.55em;
    border-radius: var(--radius-sm);
    background: rgba(230, 130, 10, 0.08);
    color: var(--accent);
    font-family: var(--font-heading);
}
.category-chip svg { width: 12px; height: 12px; }

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
}
.card-title a { color: var(--text-primary); }
.card-title a:hover { color: var(--accent); }

.card-excerpt {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
}
.card-meta svg { width: 14px; height: 14px; opacity: 0.6; }
.card-meta-item { display: flex; align-items: center; gap: 0.3em; }

.card-readmore {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.45em 1em;
    border-radius: var(--radius-md);
    transition: background 0.2s, color 0.2s;
    margin-top: 0.5rem;
    align-self: flex-start;
}
.card-readmore:hover {
    background: rgba(230, 130, 10, 0.15);
    color: var(--accent);
}

/* ========== FRONT PAGE SECTIONS ========== */
.section-block {
    padding: 3rem 0;
}
.section-block + .section-block {
    border-top: 1px solid var(--border-subtle);
}
.section-heading {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    position: relative;
    padding-left: 1rem;
}
.section-heading::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.15em;
    bottom: 0.15em;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--gap);
}
.feature-tile {
    background: var(--bg-content);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: border-color 0.25s;
}
.feature-tile:hover { border-color: rgba(230, 130, 10, 0.3); }
.feature-tile-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 1rem;
    color: var(--accent);
}
.feature-tile h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}
.feature-tile p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
}

.steps-row {
    display: flex;
    gap: var(--gap);
    flex-wrap: wrap;
}
.step-item {
    flex: 1 1 220px;
    background: var(--bg-content);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    padding-left: 3.5rem;
}
.step-number {
    position: absolute;
    left: 1rem;
    top: 1.5rem;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.6rem;
    color: rgba(230, 130, 10, 0.2);
    line-height: 1;
}

/* CLI-style entry requirements block */
.entry-requirements {
    background: var(--bg-code);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}
.entry-requirements .req-prompt {
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.entry-requirements .req-line {
    color: var(--text-secondary);
    padding-left: 1em;
    line-height: 1.8;
}
.entry-requirements .req-line span { color: var(--code-text); }

/* ========== TOC (dynamic table of contents) ========== */
.toc-panel {
    position: sticky;
    top: 1.5rem;
}
.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.toc-list li {
    border-left: 2px solid var(--border-subtle);
    padding: 0.3em 0 0.3em 0.85em;
    font-size: 0.82rem;
    transition: border-color 0.2s;
}
.toc-list li.toc-active {
    border-left-color: var(--accent);
}
.toc-list li a {
    color: var(--text-secondary);
    transition: color 0.2s;
}
.toc-list li.toc-active a { color: var(--accent); }
.toc-list li a:hover { color: var(--accent); }

/* ========== SINGLE ARTICLE ========== */
.article-header { margin-bottom: 2rem; }
.article-header h1 { font-size: 1.85rem; margin-bottom: 0.5rem; }
.article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.article-meta-bar svg { width: 14px; height: 14px; opacity: 0.6; }

.article-content h2,
.article-content h3,
.article-content h4 { margin-top: 1.75em; }
.article-content img {
    border-radius: var(--radius-md);
    margin: 1.5em 0;
    display: block;
}

/* Code language icons */
.code-block-wrap { position: relative; }
.code-lang-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    font-weight: 600;
    padding: 0.2em 0.6em;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ========== PAGINATION ========== */
.pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 2rem 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.6em;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-family: var(--font-heading);
    color: var(--text-secondary);
    transition: all 0.2s;
    text-decoration: none;
}
.pagination-wrap a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(230, 130, 10, 0.06);
}
.pagination-wrap .current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* ========== BUTTONS ========== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.65em 1.5em;
    background: linear-gradient(135deg, #E6820A, #C96500);
    color: #fff;
    font-weight: 600;
    font-family: var(--font-heading);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.92rem;
    transition: box-shadow 0.25s;
    text-decoration: none;
}
.btn-primary:hover {
    box-shadow: 0 0 20px rgba(230, 130, 10, 0.3);
    color: #fff;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.65em 1.5em;
    background: transparent;
    color: var(--accent);
    font-weight: 500;
    font-family: var(--font-heading);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.92rem;
    transition: background 0.25s;
    text-decoration: none;
}
.btn-secondary:hover {
    background: rgba(230, 130, 10, 0.15);
    color: var(--accent);
}

/* ========== COMMENTS ========== */
.comments-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}
.comments-section h2 { font-size: 1.35rem; margin-bottom: 1.5rem; }

.comment-item {
    padding: 1.25rem;
    background: var(--bg-content);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}
.comment-item .comment-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}
.comment-item .comment-author { font-weight: 600; color: var(--text-primary); }
.comment-item .comment-date { color: var(--text-secondary); }
.comment-item .comment-body p { margin: 0 0 0.5em; }

.comment-item .children {
    margin-left: 1.5rem;
    margin-top: 1rem;
    list-style: none;
    padding: 0;
}

.comment-respond { margin-top: 2rem; }
.comment-respond label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    padding: 0.65em 0.85em;
    background: var(--bg-code);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}
.comment-respond input:focus,
.comment-respond textarea:focus {
    border-color: var(--accent);
    outline: none;
}
.comment-respond textarea { min-height: 120px; resize: vertical; }
.comment-respond .submit { margin-top: 0.5rem; }

/* ========== SEARCH FORM ========== */
.search-form {
    display: flex;
    gap: 0;
    max-width: 480px;
}
.search-form .search-field {
    flex: 1;
    padding: 0.65em 1em;
    background: var(--bg-code);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-body);
}
.search-form .search-field:focus { border-color: var(--accent); outline: none; }
.search-form .search-submit {
    padding: 0.65em 1.25em;
    background: linear-gradient(135deg, #E6820A, #C96500);
    color: #fff;
    border: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: box-shadow 0.25s;
}
.search-form .search-submit:hover { box-shadow: 0 0 15px rgba(230, 130, 10, 0.3); }

/* ========== FOOTER ========== */
.site-footer {
    background: var(--bg-content);
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
}
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 2.5rem 0;
}
.footer-column .widget {
    background: transparent;
    border: none;
    padding: 0;
}
.footer-bottom {
    border-top: 1px solid var(--border-subtle);
    padding: 1.25rem 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ========== COOKIE BANNER ========== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-content);
    border-top: 1px solid var(--border-subtle);
    padding: 1rem 0;
    z-index: 9999;
    display: none;
}
.cookie-banner.is-visible { display: block; }
.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.cookie-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
}

/* ========== 404 ========== */
.page-404 { text-align: center; padding: 4rem 0; }
.page-404 h1 { font-size: 5rem; color: var(--accent); margin-bottom: 0.25em; }
.page-404 p { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 1.5rem; }
.page-404 .search-form { margin: 0 auto 1.5rem; }

/* ========== ENGINEER MODE ========== */
body.engineer-mode img:not(.brand-logo):not(.brand-placeholder-svg),
body.engineer-mode .card-thumb-wrap,
body.engineer-mode figure { display: none !important; }
body.engineer-mode .card { border-left: 3px solid var(--accent); }

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
    .header-inner { flex-wrap: wrap; }
    .brand-desc { display: none; }
    .content-with-sidebar { flex-direction: column; }
    .content-area, .sidebar-area { flex: none; width: 100%; }
    .footer-widgets { grid-template-columns: 1fr; }
    .wide-container, .content-full { width: 92%; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }
    .section-heading { font-size: 1.3rem; }
    .posts-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .nav-toggle { display: inline-flex; }
    .main-nav {
        display: none;
        width: 100%;
        order: 10;
    }
    .main-nav.is-open { display: flex; }
    .main-nav .nav-list { flex-direction: column; width: 100%; }
    .main-nav .nav-list li a { padding: 0.65em 0; }
    .header-actions { margin-left: auto; }
    .engineer-toggle .toggle-label-text { display: none; }
    .posts-grid { grid-template-columns: 1fr; }
    .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-thumb-wrap a { position: static; }
    .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .steps-row { flex-direction: column; }
    .feature-grid { grid-template-columns: 1fr; }
    .content-full, .wide-container { width: 95%; }
    h1 { font-size: 1.4rem; }
    .page-404 h1 { font-size: 3rem; }
}
