/*
Theme Name: dds_lebedevaolly.ru
Theme URI: https://lebedevaolly.ru
Author: Зайцев Степан
Author URI: https://lebedevaolly.ru
Description: Тема для блога о создании сайтов, веб-разработке и практических шагах по запуску интернет-проектов.
Version: 1.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dds_lebedevaolly-ru
*/

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Merriweather', Georgia, 'Times New Roman', serif;
    font-size: 17px;
    line-height: 1.7;
    color: #1E2A32;
    background-color: #F9F7F5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    color: #1E2A32;
    font-weight: 700;
    line-height: 1.3;
    margin: 1.4em 0 0.6em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

a { color: #1E6F5C; text-decoration: none; transition: color .2s ease; }
a:hover { color: #155A4A; }

/* Links inside article — dashed amber underline on hover */
.entry-content a:not(.read-more):not(.btn-amber):hover {
    text-decoration: underline;
    text-decoration-style: dashed;
    text-decoration-color: #E6A017;
    text-underline-offset: 4px;
}

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

code, pre {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.92em;
}

code {
    background: #F0EBE2;
    color: #1E6F5C;
    padding: 0.1em 0.4em;
    border-radius: 4px;
}

pre {
    background: #2B2B2B;
    color: #C4D7B5;
    padding: 1.1em 1.3em;
    border-radius: 8px;
    overflow-x: auto;
    line-height: 1.55;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
}

blockquote {
    margin: 1.4em 0;
    padding: 0.6em 1em 0.6em 1.4em;
    border-left: 4px solid #E6A017;
    color: #4A5560;
    font-style: italic;
    font-size: 1.05em;
    position: relative;
}

blockquote::before {
    content: "“";
    position: absolute;
    left: 0.45em;
    top: -0.1em;
    font-size: 2.4em;
    color: #C9C2B6;
    font-family: Georgia, serif;
    line-height: 1;
}

blockquote p { margin: 0 0 0.5em; }
blockquote p:last-child { margin: 0; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    border: 1px solid #E5E0D8;
}

th, td {
    border: 1px solid #E5E0D8;
    padding: 0.7em 0.9em;
    text-align: left;
}

th {
    background: #F0EBE2;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

ul, ol { padding-left: 1.5em; }
li { margin-bottom: 0.4em; }

hr { border: 0; border-top: 1px solid #E5E0D8; margin: 2em 0; }

/* Image passe-partout in articles */
.entry-content img {
    border: 6px solid #FFFFFF;
    box-shadow: 0 2px 12px rgba(30, 42, 50, 0.08);
    border-radius: 2px;
    display: block;
    margin: 1em auto;
}

/* ---------- Layout ---------- */
.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main { flex: 1; padding: 32px 0 56px; }

/* Reading progress bar */
.read-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: #E6A017;
    z-index: 9999;
    transition: width .08s linear;
}

/* ---------- Header ---------- */
.site-header {
    background: #FFFFFF;
    border-bottom: 1px solid #E5E0D8;
}

.site-header .wrap {
    display: flex;
    align-items: center;
    gap: 28px;
    padding-top: 18px;
    padding-bottom: 18px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    width: 48px;
    height: 48px;
    display: block;
    flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }

.brand-name {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #1E2A32;
}

.brand-desc {
    font-size: 0.82rem;
    color: #6B7480;
    margin-top: 2px;
}

.primary-nav { margin-left: auto; }

.primary-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.primary-nav li { margin: 0; }

.primary-nav a {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #1E6F5C;
    border-radius: 20px;
    color: #1E6F5C;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    transition: all .2s ease;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a {
    background: #1E6F5C;
    color: #FFFFFF;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid #1E6F5C;
    border-radius: 6px;
    padding: 6px 12px;
    color: #1E6F5C;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    font-size: 0.9rem;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
    font-size: 0.86rem;
    color: #6B7480;
    margin: 0 0 22px;
    font-family: 'Inter', sans-serif;
}

.breadcrumbs a { color: #1E6F5C; }
.breadcrumbs .sep { margin: 0 6px; color: #B5AC9E; }

/* ---------- Content layout (with/without sidebar) ---------- */
.layout {
    display: flex;
    gap: 36px;
    align-items: flex-start;
}

.layout .content { flex: 0 0 67%; min-width: 0; }
.layout .sidebar { flex: 0 0 27%; min-width: 0; }

.content-wide { width: 85%; max-width: 100%; margin: 0 auto; }

.content-full { width: 100%; }

/* ---------- Cards ---------- */
.card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.card-list--horizontal {
    grid-template-columns: 1fr;
}

.card {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid #E5E0D8;
    border-radius: 10px;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 42, 50, 0.08);
}

.card-list--horizontal .card {
    flex-direction: row;
}

.card-thumb-wrap {
    overflow: hidden;
    background: #F0EBE2;
}

.card-list:not(.card-list--horizontal) .card-thumb-wrap a {
    display: block;
}

.card-list:not(.card-list--horizontal) .card-thumb-wrap img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

/* Horizontal card: absolute-positioned anchor pattern (A10) */
.card-list--horizontal .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
}

.card-list--horizontal .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

.card-list--horizontal .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1E6F5C 0%, #155A4A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
}

.card-list--horizontal .card-thumb-placeholder {
    height: 100%;
    aspect-ratio: auto;
}

.card-body {
    flex: 1;
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
}

.card-meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    color: #6B7480;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-meta a { color: #1E6F5C; }

.card-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.18rem;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.35;
}

.card-title a { color: #1E2A32; }
.card-title a:hover { color: #1E6F5C; }

.card-excerpt { color: #4A5560; font-size: 0.96rem; margin-bottom: 14px; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-excerpt p:last-child { margin: 0; }

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

.read-more {
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1E6F5C;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 0;
    padding: 0;
}

.read-more::after {
    content: "→";
    transition: transform .2s ease;
    display: inline-block;
}

.read-more:hover {
    text-decoration: underline;
    text-decoration-color: #E6A017;
    text-underline-offset: 4px;
}

.read-more:hover::after { transform: translateX(4px); }

/* ---------- Buttons ---------- */
.btn-primary {
    display: inline-block;
    background: linear-gradient(180deg, #20785F 0%, #1E6F5C 100%);
    color: #FFFFFF;
    padding: 11px 22px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border: 0;
    cursor: pointer;
    transition: background .2s ease;
    text-decoration: none;
}

.btn-primary:hover { background: #155A4A; color: #FFFFFF; }

.btn-amber {
    display: inline-block;
    background: #E6A017;
    color: #1E2A32;
    padding: 11px 22px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    text-decoration: none;
}

.btn-amber:hover { background: #CF8E10; color: #1E2A32; }

/* ---------- Front page hero/topic blocks ---------- */
.topic-block {
    background: #FFFFFF;
    border: 1px solid #E5E0D8;
    border-radius: 12px;
    padding: 32px 34px;
    margin-bottom: 28px;
}

.topic-block h2 {
    margin-top: 0;
    color: #1E6F5C;
}

.topic-block .topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
    margin-top: 22px;
}

.topic-block .topic-grid > div {
    background: #F9F7F5;
    border-radius: 8px;
    padding: 18px 20px;
}

.topic-block .topic-grid h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: #1E2A32;
}

.topic-block .topic-grid p {
    margin: 0;
    font-size: 0.95rem;
    color: #4A5560;
}

.topic-block .step-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 22px;
    counter-reset: step;
}

.topic-block .step-row > div {
    flex: 1 1 200px;
    background: #F9F7F5;
    border-left: 3px solid #1E6F5C;
    border-radius: 4px;
    padding: 14px 16px;
    counter-increment: step;
    position: relative;
}

.topic-block .step-row > div::before {
    content: counter(step) ".";
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #E6A017;
    margin-right: 4px;
}

.topic-block .step-row h3 {
    display: inline;
    margin: 0;
    font-size: 1rem;
    color: #1E2A32;
}

.topic-block .step-row p {
    margin: 6px 0 0;
    font-size: 0.92rem;
    color: #4A5560;
}

.section-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.6rem;
    margin: 36px 0 22px;
}

.section-title-bar {
    display: inline-block;
    border-bottom: 3px solid #E6A017;
    padding-bottom: 4px;
}

/* ---------- Sidebar widgets ---------- */
.sidebar .widget {
    background: #FFFFFF;
    border: 1px solid #E5E0D8;
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 20px;
}

.sidebar .widget-title {
    margin: 0 0 14px;
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    color: #1E6F5C;
    border-bottom: 2px solid #E5E0D8;
    padding-bottom: 8px;
}

.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed #E5E0D8; }
.sidebar li:last-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.sidebar li a { color: #1E2A32; }
.sidebar li a:hover { color: #1E6F5C; }

/* ---------- Single article ---------- */
.entry-header { margin-bottom: 22px; }

.entry-title {
    font-size: 2.1rem;
    margin: 0 0 12px;
}

.entry-meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    color: #6B7480;
}

.entry-meta a { color: #1E6F5C; }
.entry-meta .sep { margin: 0 6px; color: #B5AC9E; }

.entry-thumbnail {
    margin: 0 0 26px;
    border-radius: 10px;
    overflow: hidden;
}

.entry-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    border: 0;
    box-shadow: none;
}

.entry-content > p:first-child { font-size: 1.06rem; color: #2B3640; }

.entry-tags {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #E5E0D8;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

.entry-tags a {
    display: inline-block;
    background: #F0EBE2;
    color: #1E6F5C;
    padding: 4px 12px;
    border-radius: 14px;
    margin: 0 4px 4px 0;
    font-size: 0.84rem;
}

.entry-tags a:hover { background: #E5E0D8; }

/* ---------- Pagination ---------- */
.pagination {
    margin: 36px 0 0;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    background: #FFFFFF;
    border: 1px solid #E5E0D8;
    border-radius: 6px;
    color: #1E2A32;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all .2s ease;
}

.pagination .page-numbers:hover { background: #F0EBE2; border-color: #1E6F5C; }
.pagination .page-numbers.current {
    background: #1E6F5C;
    color: #FFFFFF;
    border-color: #1E6F5C;
}

.pagination .dots { background: none; border: 0; }

/* ---------- Comments ---------- */
.comments-area {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid #E5E0D8;
}

.comments-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.4rem;
    margin: 0 0 20px;
}

.comment-list { list-style: none; padding: 0; margin: 0 0 28px; }
.comment-list .children { list-style: none; padding-left: 30px; margin-top: 14px; }

.comment-body {
    background: #FFFFFF;
    border: 1px solid #E5E0D8;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 14px;
}

.comment-author {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-author img {
    border-radius: 50%;
}

.comment-meta {
    font-size: 0.82rem;
    color: #6B7480;
    margin-bottom: 10px;
}

.comment-reply-link {
    font-family: 'Inter', sans-serif;
    font-size: 0.86rem;
    color: #1E6F5C;
}

#respond { margin-top: 28px; }

.comment-form label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #4A5560;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E5E0D8;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    background: #FFFFFF;
    color: #1E2A32;
    margin-bottom: 14px;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: 0;
    border-color: #1E6F5C;
    box-shadow: 0 0 0 3px rgba(30, 111, 92, 0.15);
}

.comment-form .form-submit input { cursor: pointer; }

/* ---------- Search form ---------- */
.search-form {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #E5E0D8;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    background: #FFFFFF;
    color: #1E2A32;
}

.search-form input[type="search"]:focus {
    outline: 0;
    border-color: #1E6F5C;
}

.search-form button {
    background: #1E6F5C;
    color: #FFFFFF;
    border: 0;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.search-form button:hover { background: #155A4A; }

/* ---------- 404 ---------- */
.error-404 {
    text-align: center;
    padding: 40px 0;
}

.error-404 .num {
    font-family: 'Inter', sans-serif;
    font-size: 6rem;
    font-weight: 800;
    color: #1E6F5C;
    line-height: 1;
    margin: 0;
}

.error-404 .search-form {
    max-width: 460px;
    margin: 22px auto 18px;
}

/* ---------- Footer ---------- */
.site-footer {
    background: #1E2A32;
    color: #C9D0D6;
    padding: 40px 0 0;
    margin-top: 48px;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 30px;
}

.footer-col .widget-title {
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2D3A44;
}

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #C9D0D6; }
.footer-col a:hover { color: #E6A017; }

.complexity-calc {
    background: #25333D;
    border-radius: 10px;
    padding: 22px 24px;
    margin: 8px 0 30px;
}

.complexity-calc h3 {
    color: #FFFFFF;
    margin: 0 0 6px;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
}

.complexity-calc .calc-hint {
    font-size: 0.86rem;
    color: #94A0AB;
    margin: 0 0 16px;
}

.calc-row {
    display: grid;
    grid-template-columns: 110px 1fr 60px;
    gap: 14px;
    align-items: center;
    margin-bottom: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
}

.calc-row label { color: #C9D0D6; }

.calc-row input[type="range"] {
    width: 100%;
    accent-color: #E6A017;
}

.calc-row .calc-val {
    text-align: right;
    color: #E6A017;
    font-weight: 600;
}

.calc-result {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #34424D;
    font-family: 'Inter', sans-serif;
    color: #FFFFFF;
}

.calc-result strong {
    color: #E6A017;
    font-size: 1.2rem;
}

.site-info {
    border-top: 1px solid #2D3A44;
    padding: 18px 0;
    text-align: center;
    font-size: 0.88rem;
    color: #94A0AB;
    font-family: 'Inter', sans-serif;
}

/* ---------- Cookie banner ---------- */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 9000;
    background: #FFFFFF;
    border: 1px solid #E5E0D8;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(30, 42, 50, 0.18);
    padding: 16px 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    max-width: 720px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
}

.cookie-banner p {
    margin: 0;
    flex: 1;
    min-width: 220px;
    color: #4A5560;
    background: none;
}

.cookie-banner button {
    background: #1E6F5C;
    color: #FFFFFF;
    border: 0;
    padding: 9px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
}

.cookie-banner button:hover { background: #155A4A; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .layout { flex-direction: column; }
    .layout .content,
    .layout .sidebar { flex: 0 0 100%; width: 100%; }
    .content-wide { width: 100%; }

    .footer-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1, .entry-title { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }

    .site-header .wrap { gap: 14px; }
    .nav-toggle { display: inline-block; margin-left: auto; }

    .primary-nav {
        display: none;
        flex-basis: 100%;
        margin-left: 0;
    }

    .primary-nav.is-open { display: block; }

    .primary-nav ul {
        flex-direction: column;
        gap: 8px;
    }

    .primary-nav a { display: block; }

    .topic-block { padding: 22px 20px; }

    .footer-cols { grid-template-columns: 1fr; gap: 24px; }

    .card-list--horizontal .card { flex-direction: column; }

    .card-list--horizontal .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }

    .card-list--horizontal .card-thumb-wrap a {
        position: static;
    }

    .card-list--horizontal .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .calc-row {
        grid-template-columns: 90px 1fr 50px;
        font-size: 0.86rem;
    }

    .cookie-banner {
        left: 8px;
        right: 8px;
        bottom: 8px;
        padding: 14px 16px;
    }
}
