/*
Theme Name: dds_littlefellow.ru
Author: Анна Соколова
Description: Тема для образовательного блог-сообщества Little Fellow.
Version: 1.1
Text Domain: lf
*/

/* === Reset & base === */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    color: #1e293b;
    background: #fafaf7;
    line-height: 1.6;
    font-size: 17px;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: #4338ca; text-decoration: none; transition: color .2s; }
a:hover { color: #f59e0b; }
h1, h2, h3, h4, h5, h6 { font-family: "Georgia", "Iowan Old Style", "Palatino Linotype", serif; line-height: 1.25; margin: 0 0 .6em; color: #0f172a; font-weight: 700; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.shell { width: min(92%, 1180px); margin-inline: auto; }

/* === Header === */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #ece9e3;
    padding: 18px 0;
}
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; min-width: 0; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { width: 54px; height: 54px; display: block; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
    font-family: "Georgia", serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #0f172a;
    line-height: 1.15;
    display: block;
    max-width: 540px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.brand-name a { color: inherit; }
.brand-tag {
    font-size: .82rem;
    color: #64748b;
    margin-top: 2px;
    max-width: 540px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid #d6d3cf;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.1rem;
    color: #0f172a;
}
.main-nav ul {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav li a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    color: #1e293b;
    font-weight: 500;
    font-size: .97rem;
    transition: background .2s, color .2s;
}
.main-nav li a:hover,
.main-nav .current-menu-item > a {
    background: #4338ca;
    color: #ffffff;
}

@media (max-width: 860px) {
    .nav-toggle { display: inline-block; }
    .main-nav { width: 100%; }
    .main-nav[hidden] { display: none !important; }
    .main-nav ul { flex-direction: column; gap: 4px; padding-top: 10px; }
    .main-nav li a { display: block; }
}

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

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

/* === Breadcrumbs === */
.breadcrumbs {
    font-size: .9rem;
    color: #64748b;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #ece9e3;
}
.breadcrumbs a { color: #4338ca; }
.breadcrumbs .sep { margin: 0 6px; color: #cbd5e1; }

/* === Cards === */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.card {
    background: #ffffff;
    border: 1px solid #ece9e3;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: 0 10px 30px rgba(15, 23, 42, .08); transform: translateY(-2px); }
.card-thumb-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #f1efe9;
}
.card-thumb-wrap a {
    display: block;
    position: absolute;
    inset: 0;
}
.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s;
}
.card:hover .card-thumb-wrap img { transform: scale(1.04); }
.card-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.card-title { font-size: 1.18rem; margin: 0 0 10px; line-height: 1.3; }
.card-title a { color: #0f172a; }
.card-title a:hover { color: #4338ca; }
.card-meta { font-size: .82rem; color: #64748b; margin-bottom: 10px; }
.card-meta a { color: #64748b; }
.card-excerpt { color: #334155; font-size: .97rem; margin-bottom: 14px; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-excerpt p:last-child { margin-bottom: 0; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    color: #4338ca;
    font-weight: 600;
    font-size: .94rem;
}
.card-more::after { content: " →"; transition: margin .2s; display: inline-block; }
.card-more:hover::after { margin-left: 4px; }

@media (max-width: 600px) {
    .card-thumb-wrap { aspect-ratio: 16 / 9; }
}

/* === Sidebar === */
.sidebar {
    background: #ffffff;
    border: 1px solid #ece9e3;
    border-radius: 14px;
    padding: 22px 22px 10px;
    min-width: 0;
}
.sidebar .widget { margin-bottom: 22px; color: #1e293b; }
.sidebar .widget:last-child { margin-bottom: 6px; }
.sidebar .widget-title {
    font-size: 1.05rem;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f59e0b;
    color: #0f172a;
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: 6px 0; border-bottom: 1px solid #f1efe9; }
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget a { color: #1e293b; }
.sidebar .widget a:hover { color: #4338ca; }
.sidebar .widget .post-date { display: block; font-size: .8rem; color: #64748b; margin-top: 2px; }

/* === Single content === */
.entry-header { margin-bottom: 22px; }
.entry-title { font-size: 2rem; margin-bottom: 10px; }
.entry-meta { font-size: .88rem; color: #64748b; }
.entry-content { font-size: 1.04rem; line-height: 1.75; min-width: 0; }
.entry-content h2 { margin-top: 1.8em; }
.entry-content h3 { margin-top: 1.4em; }
.entry-content img { border-radius: 10px; margin: 1em 0; }
.entry-content blockquote {
    margin: 1.4em 0;
    padding: 14px 20px;
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
    color: #1e293b;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
}
.entry-content table th,
.entry-content table td {
    border: 1px solid #ece9e3;
    padding: 10px 14px;
    text-align: left;
}
.entry-content table th { background: #f6f4ef; font-weight: 600; }
.entry-content code {
    background: #f1efe9;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: .92em;
    font-family: "SF Mono", Consolas, Menlo, monospace;
}
.entry-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px 18px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: .92rem;
}
.entry-content pre code { background: none; padding: 0; color: inherit; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; margin: 1em 0; }
.entry-content li { margin-bottom: .4em; }

/* === Pagination === */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 36px 0 0;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ece9e3;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    font-weight: 500;
    font-size: .95rem;
    transition: background .2s, color .2s, border-color .2s;
}
.pagination .page-numbers:hover {
    background: #4338ca;
    color: #ffffff;
    border-color: #4338ca;
}
.pagination .page-numbers.current {
    background: #4338ca;
    color: #ffffff;
    border-color: #4338ca;
}
.pagination .page-numbers.dots {
    border: none;
    background: none;
}

/* === Front page sections === */
.front-section { padding: 56px 0; }
.front-section + .front-section { border-top: 1px solid #ece9e3; }
.front-section .shell { width: min(85%, 1180px); }

.section-title {
    font-size: 1.9rem;
    margin-bottom: 8px;
    text-align: center;
}
.section-lead {
    text-align: center;
    color: #475569;
    max-width: 680px;
    margin: 0 auto 36px;
    font-size: 1.04rem;
}

/* Intro: text + illustration */
.intro-block { background: linear-gradient(135deg, #fdf6ec 0%, #fff 60%); }
.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 50px;
    align-items: center;
}
.intro-grid .text h1 { font-size: 2.3rem; line-height: 1.2; margin-bottom: 16px; }
.intro-grid .text .lead { font-size: 1.1rem; color: #334155; margin-bottom: 22px; }
.intro-grid .illu img,
.intro-grid .illu svg { width: 100%; height: auto; display: block; border-radius: 18px; }
.btn-primary {
    display: inline-block;
    background: #4338ca;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: .98rem;
    transition: background .2s, transform .2s;
}
.btn-primary:hover { background: #f59e0b; color: #ffffff; transform: translateY(-1px); }
@media (max-width: 800px) {
    .intro-grid { grid-template-columns: 1fr; gap: 30px; }
    .intro-grid .illu { order: -1; }
}

/* Directions: grid of cards */
.dir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}
.dir-card {
    background: #ffffff;
    border: 1px solid #ece9e3;
    border-radius: 14px;
    padding: 26px 22px;
    text-align: center;
    transition: box-shadow .2s, transform .2s, border-color .2s;
    min-width: 0;
}
.dir-card:hover { box-shadow: 0 10px 28px rgba(15,23,42,.08); transform: translateY(-3px); border-color: #f59e0b; }
.dir-card .icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #eef2ff;
    color: #4338ca;
}
.dir-card .icon svg { width: 28px; height: 28px; }
.dir-card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.dir-card p { font-size: .94rem; color: #475569; margin: 0; }

/* Latest posts section */
.latest-block { background: #f6f4ef; }

/* Steps */
.steps-block { background: #ffffff; }
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 26px;
    counter-reset: step;
}
.step {
    background: #ffffff;
    border: 1px solid #ece9e3;
    border-radius: 14px;
    padding: 26px 24px 22px;
    position: relative;
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    font-family: "Georgia", serif;
    font-size: 2.2rem;
    color: #f59e0b;
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
    line-height: 1;
}
.step h3 { font-size: 1.1rem; margin-bottom: 8px; }
.step p { font-size: .95rem; color: #475569; margin: 0; }

/* FAQ */
.faq-block { background: linear-gradient(180deg, #fdfaf3 0%, #fafaf7 100%); }
.faq-list { max-width: 820px; margin: 0 auto; }
.faq-item {
    background: #ffffff;
    border: 1px solid #ece9e3;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}
.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 16px 22px;
    font-weight: 600;
    color: #0f172a;
    font-size: 1.02rem;
    position: relative;
    padding-right: 50px;
    user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: #f59e0b;
    transition: transform .2s;
    line-height: 1;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item .answer {
    padding: 0 22px 18px;
    color: #475569;
    font-size: .98rem;
}
.faq-item .answer p:last-child { margin-bottom: 0; }

/* === Footer === */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 50px 0 22px;
    margin-top: 60px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 36px;
    margin-bottom: 36px;
}
.footer-grid .widget { color: #cbd5e1; }
.footer-grid .widget-title { color: #ffffff; font-size: 1.05rem; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid #f59e0b; }
.footer-grid .widget ul { list-style: none; margin: 0; padding: 0; }
.footer-grid .widget li { padding: 5px 0; }
.footer-grid .widget a { color: #cbd5e1; }
.footer-grid .widget a:hover { color: #f59e0b; }
.footer-grid .widget p { color: #cbd5e1; margin: 0 0 .6em; }
.footer-grid .widget .post-date { display: block; font-size: .8rem; color: #94a3b8; margin-top: 2px; }
.site-credit {
    border-top: 1px solid #1e293b;
    padding-top: 18px;
    text-align: center;
    font-size: .88rem;
    color: #94a3b8;
}

/* === Search form === */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 540px;
    margin: 18px 0;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid #d6d3cf;
    border-radius: 8px;
    font-size: .98rem;
    font-family: inherit;
    background: #ffffff;
}
.search-form input[type="search"]:focus { outline: 2px solid #4338ca; outline-offset: 1px; }
.search-form button {
    padding: 10px 18px;
    border: none;
    background: #4338ca;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: .95rem;
    transition: background .2s;
}
.search-form button:hover { background: #f59e0b; }

/* === Cookie banner === */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    background: #0f172a;
    color: #f1f5f9;
    padding: 16px 22px;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    z-index: 999;
    font-size: .95rem;
    max-width: 720px;
    margin-inline: auto;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; }
.cookie-banner a { color: #f59e0b; }
.cookie-banner button {
    background: #f59e0b;
    color: #0f172a;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: .92rem;
    transition: background .2s;
}
.cookie-banner button:hover { background: #fbbf24; }

/* === Comments === */
.comments-area { margin-top: 50px; padding-top: 30px; border-top: 1px solid #ece9e3; }
.comments-title { font-size: 1.4rem; margin-bottom: 20px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ol { list-style: none; padding-left: 30px; }
.comment-list .comment { background: #ffffff; border: 1px solid #ece9e3; border-radius: 10px; padding: 18px 22px; margin-bottom: 16px; }
.comment-meta { font-size: .88rem; color: #64748b; margin-bottom: 8px; }
.comment-meta .comment-author { font-weight: 600; color: #0f172a; }
.comment-body p { margin: 0 0 .6em; }
.comment-reply-link { color: #4338ca; font-size: .9rem; font-weight: 600; }
.comment-respond { margin-top: 30px; padding: 22px; background: #ffffff; border: 1px solid #ece9e3; border-radius: 12px; }
.comment-respond .comment-form input,
.comment-respond .comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d6d3cf;
    border-radius: 8px;
    font-family: inherit;
    font-size: .98rem;
    margin-bottom: 12px;
    background: #ffffff;
}
.comment-respond .comment-form textarea { min-height: 120px; resize: vertical; }
.comment-respond .form-submit input[type="submit"] {
    background: #4338ca;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: .98rem;
    width: auto;
    margin-bottom: 0;
    transition: background .2s;
}
.comment-respond .form-submit input[type="submit"]:hover { background: #f59e0b; }

/* === 404 === */
.error-404 {
    text-align: center;
    padding: 60px 20px;
}
.error-404 .big {
    font-family: "Georgia", serif;
    font-size: 6rem;
    color: #f59e0b;
    line-height: 1;
    margin-bottom: 14px;
}
.error-404 h1 { font-size: 1.6rem; margin-bottom: 16px; }
.error-404 p { color: #475569; margin-bottom: 24px; }

/* === Responsive tweaks === */
@media (max-width: 600px) {
    body { font-size: 16px; }
    h1, .entry-title { font-size: 1.7rem; }
    .section-title { font-size: 1.5rem; }
    .intro-grid .text h1 { font-size: 1.8rem; }
    .site-main { padding: 24px 0 40px; }
    .front-section { padding: 40px 0; }
    .cookie-banner { left: 8px; right: 8px; bottom: 8px; padding: 14px 16px; }
}
