/*
Theme Name: dds_koollemon.ru
Author: Мария Кузнецова
Description: Информационная тема для образовательной платформы Kool Lemon — японский минимализм с винтажным акцентом.
Version: 1.1
Text Domain: klemon
*/

/* ============================ ПЕРЕМЕННЫЕ ============================ */
:root {
    --bg:          #F9F7FC;
    --bg-alt:      #F0EBF5;
    --bg-sidebar:  #EDE6F2;
    --bg-footer:   #2A1F33;
    --text:        #1C1520;
    --accent:      #B8733D;
    --gold:        #E8C872;
    --muted:       #8A7D94;
    --shadow:      #CAB8D4;
    --grid-line:   #E6DFEB;
    --head-font:   "PT Sans Narrow", "Roboto Condensed", "Arial Narrow", "Segoe UI", sans-serif;
    --body-font:   "PT Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --shell:       1180px;
}

/* ============================ СБРОС ============================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--body-font);
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'%3E%3Ccircle cx='90' cy='320' r='150' fill='%23E8C872' opacity='0.08'/%3E%3C/svg%3E"),
        repeating-linear-gradient(45deg, var(--grid-line) 0, var(--grid-line) 0.5px, transparent 0.5px, transparent 40px),
        repeating-linear-gradient(-45deg, var(--grid-line) 0, var(--grid-line) 0.5px, transparent 0.5px, transparent 40px);
    background-attachment: fixed, fixed, fixed;
    background-repeat: no-repeat, repeat, repeat;
    background-position: left bottom, top left, top left;
    overflow-x: hidden;
}

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

a { color: var(--accent); text-decoration: none; }

.shell {
    width: min(92%, var(--shell));
    margin-inline: auto;
}

/* ============================ ТИПОГРАФИКА ============================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--head-font);
    color: var(--text);
    line-height: 1.15;
    font-weight: 700;
    margin: 0 0 0.6em;
}

h1 { font-size: 3.8rem; letter-spacing: 0.06em; }
h2 { font-size: 2.3rem; letter-spacing: 0.03em; }
h3 { font-size: 1.5rem; letter-spacing: 0.02em; }

p { margin: 0 0 1.1em; }

.entry-content a,
.widget-text a,
.comment-content a {
    border-bottom: 1px dotted var(--accent);
    transition: transform .15s ease, border-bottom-style .15s ease;
    display: inline-block;
}
.entry-content a:hover,
.comment-content a:hover {
    border-bottom-style: solid;
    transform: translateY(-1px);
}

/* Заголовки секций — декоративная линия + печать */
.section-head {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.section-head::before {
    content: "";
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), var(--accent));
    flex: 0 0 60px;
}
.section-head h2 { margin: 0; }
.hanko {
    display: inline-block;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 2px solid var(--accent);
    border-radius: 3px;
    position: relative;
}
.hanko::before,
.hanko::after {
    content: "";
    position: absolute;
    background: var(--accent);
    left: 7px; right: 7px;
    height: 2px;
}
.hanko::before { top: 10px; }
.hanko::after  { top: 18px; box-shadow: 0 6px 0 var(--accent); }

/* ============================ КНОПКИ ============================ */
.btn {
    display: inline-block;
    font-family: var(--head-font);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.95rem;
    padding: 0.7em 1.6em;
    border-radius: 4px;
    background: var(--accent);
    color: var(--bg);
    border: 1px solid var(--accent);
    cursor: pointer;
    transition: transform .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(0.9); transform: translateY(2px); }

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--gold);
    border-bottom-right-radius: 0;
    position: relative;
}
.btn-outline::after {
    content: "";
    position: absolute;
    right: 0; bottom: 0;
    width: 6px; height: 6px;
    background: var(--bg);
    transform: rotate(45deg) translate(3px, 3px);
}
.btn-outline:hover {
    background: var(--gold);
    color: var(--text);
    filter: none;
}

/* ============================ ШАПКА ============================ */
.site-header {
    background: rgba(249, 247, 252, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--grid-line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.1rem 0;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.brand-logo { display: block; max-height: 64px; width: auto; }
.brand-text { min-width: 0; }
.site-title {
    font-family: var(--head-font);
    font-size: 1.2rem;
    letter-spacing: 0.03em;
    margin: 0;
    line-height: 1.25;
    max-width: 520px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.site-title a { color: var(--text); }
.site-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0.2rem 0 0;
    max-width: 520px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Навигация */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.4rem;
    margin: 0; padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    font-family: var(--head-font);
    letter-spacing: 0.04em;
    font-size: 1.05rem;
    color: var(--text);
    padding-bottom: 3px;
    border-bottom: 2px solid transparent;
    transition: border-color .15s ease, color .15s ease;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    color: var(--accent);
    border-bottom-color: var(--gold);
}
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--accent);
    border-radius: 4px;
    color: var(--accent);
    font-size: 1.4rem;
    line-height: 1;
    padding: 0.3em 0.55em;
    cursor: pointer;
}

/* ============================ РАЗМЕТКА КОНТЕНТА ============================ */
.site-main { padding: 2.5rem 0 3.5rem; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67%) minmax(0, 27%);
    gap: 6%;
    align-items: start;
}
.layout-single {
    display: block;
}
.layout-single .content-area,
.no-sidebar .content-area { max-width: 85%; margin-inline: auto; }

.content-area { min-width: 0; }

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1.6rem;
}
.breadcrumbs a { color: var(--accent); }
.breadcrumbs .sep { color: var(--gold); margin: 0 0.2em; }

/* ============================ САЙДБАР ============================ */
.sidebar {
    background: var(--bg-sidebar);
    padding: 1.6rem 1.5rem;
    border-top: 3px solid var(--gold);
    min-width: 0;
}
.sidebar .widget { margin-bottom: 2rem; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title {
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 0.9rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--shadow);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin-bottom: 0.6rem; line-height: 1.4; }
.sidebar a { color: var(--text); }
.sidebar a:hover { color: var(--accent); }
.sidebar .post-date { color: var(--muted); font-size: 0.8rem; }

/* ============================ КАРТОЧКИ ЗАПИСЕЙ ============================ */
.cards-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0;
    border-bottom: 2px solid var(--accent);
    box-shadow: 4px 4px 0 var(--shadow);
    overflow: hidden;
    transition: box-shadow .18s ease, transform .18s ease, border .18s ease;
}
.card:hover {
    box-shadow: none;
    transform: translate(4px, 4px);
    border: 1px solid var(--accent);
}
.card-thumb-wrap {
    display: block;
    overflow: hidden;
}
.card-thumb-wrap img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    filter: sepia(0.28) saturate(1.05);
    transition: transform .3s ease;
}
.card:hover .card-thumb-wrap img { transform: scale(1.03); }
.card-body {
    flex: 1;
    padding: 1.4rem 1.5rem 1.6rem;
    display: flex;
    flex-direction: column;
}
.card-title { font-size: 1.4rem; margin: 0 0 0.5rem; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.8rem;
}
.card-excerpt { color: var(--text); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 0.9rem;
    align-self: flex-start;
}

/* ============================ ПАГИНАЦИЯ ============================ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2.5rem;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.8em;
    font-family: var(--head-font);
    border: 1px solid var(--shadow);
    background: #fff;
    color: var(--text);
    border-radius: 4px;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pagination a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.pagination .page-numbers.current {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}
.pagination .page-numbers.dots {
    border: none;
    background: none;
}

/* ============================ ЗАПИСЬ / СТРАНИЦА ============================ */
.entry-header { margin-bottom: 1.4rem; }
.entry-title { font-size: 2.6rem; }
.entry-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.entry-thumb { margin-bottom: 1.6rem; }
.entry-thumb img { width: 100%; display: block; border-radius: 0; filter: sepia(0.2); }
.entry-content { font-size: 1.05rem; }
.entry-content h2 { margin-top: 1.8rem; }
.entry-content h3 { margin-top: 1.4rem; }
.entry-content img { display: block; margin: 1.2rem 0; }
.entry-content blockquote {
    border-left: 6px solid var(--gold);
    background: var(--bg-alt);
    margin: 1.6rem 0;
    padding: 1.2rem 1.5rem;
    border-radius: 4px;
    font-style: italic;
}
.entry-content ul, .entry-content ol { padding-left: 1.4rem; }

/* Таблицы */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--shadow);
}
.entry-content th, .entry-content td { padding: 0.6rem 0.8rem; text-align: left; }
.entry-content th { background: var(--bg-alt); font-family: var(--head-font); }

/* ============================ ГЛАВНАЯ ============================ */
.front-section { padding: 3.2rem 0; }
.front-section.alt {
    background: var(--bg-alt);
    background-image: repeating-linear-gradient(45deg, #D6CDDF 0, #D6CDDF 0.5px, transparent 0.5px, transparent 34px),
                      repeating-linear-gradient(-45deg, #D6CDDF 0, #D6CDDF 0.5px, transparent 0.5px, transparent 34px);
}
.front-intro { max-width: 85%; margin-inline: auto; }

/* Блок 1 — Hero */
.hero {
    position: relative;
    padding: 0;
    color: #fff;
    min-height: 460px;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(28,21,32,0.82) 0%, rgba(42,31,51,0.55) 55%, rgba(42,31,51,0.25) 100%);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
    padding: 3rem 0;
}
.hero-content h1 { color: #fff; margin-bottom: 1rem; }
.hero-lead {
    font-size: 1.15rem;
    color: #F0EBF5;
    margin-bottom: 1.8rem;
    max-width: 520px;
}
.hero-stamp {
    position: absolute;
    left: 0; bottom: 22px;
    z-index: 2;
    width: 78px; height: 78px;
    border: 2px solid var(--gold);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-family: var(--head-font);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    opacity: 0.85;
    transform: rotate(-6deg);
}

/* Блок 2 — Сетка направлений */
.directions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}
.direction-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-bottom: 2px solid var(--accent);
    box-shadow: 4px 4px 0 var(--shadow);
    overflow: hidden;
    transition: box-shadow .18s ease, transform .18s ease, border .18s ease;
}
.direction-card:hover {
    box-shadow: none;
    transform: translate(4px, 4px);
    border: 1px solid var(--accent);
}
.direction-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    filter: sepia(0.3) saturate(1.05);
}
.direction-body { padding: 1.3rem 1.4rem 1.6rem; flex: 1; }
.direction-body h3 { margin-bottom: 0.5rem; }
.direction-body p { margin: 0; color: var(--text); font-size: 0.98rem; }

/* Блок 3 — Цитата */
.quote-block {
    position: relative;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
    border-left: 6px solid var(--gold);
    padding: 2.6rem 2.8rem;
    border-radius: 4px;
    max-width: 85%;
    margin-inline: auto;
}
.quote-block .quote-text {
    font-family: var(--head-font);
    font-size: 2.2rem;
    line-height: 1.3;
    color: var(--text);
    margin: 0 0 1rem;
}
.quote-block .quote-author {
    text-align: right;
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0;
}

/* Блок 4 — Таймлайн */
.timeline {
    position: relative;
    max-width: 860px;
    margin-inline: auto;
    padding: 1rem 0;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0; bottom: 0;
    width: 0;
    border-left: 2px dashed var(--accent);
    transform: translateX(-50%);
}
.tl-item {
    position: relative;
    width: 50%;
    padding: 1rem 2.4rem;
    margin-bottom: 1.2rem;
}
.tl-item:nth-child(odd) { left: 0; text-align: right; }
.tl-item:nth-child(even) { left: 50%; text-align: left; }
.tl-item::before {
    content: "";
    position: absolute;
    top: 1.4rem;
    width: 16px; height: 16px;
    background: var(--accent);
    border: 3px solid var(--bg);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--gold);
}
.tl-item:nth-child(odd)::before  { right: -9px; }
.tl-item:nth-child(even)::before { left: -9px; }
.tl-item h3 { margin-bottom: 0.3rem; color: var(--accent); }
.tl-item p { margin: 0; color: var(--text); font-size: 0.98rem; }
.tl-caption {
    text-align: center;
    color: var(--muted);
    font-family: var(--head-font);
    letter-spacing: 0.2em;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

/* Заголовок последних записей */
.latest-head { text-align: left; }

/* ============================ ПОДВАЛ ============================ */
.site-footer {
    background: var(--bg-footer);
    color: #D8CFE0;
    padding: 3rem 0 1.6rem;
    margin-top: 3rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
}
.site-footer .widget-title {
    color: var(--gold);
    font-size: 1.15rem;
    margin-bottom: 1rem;
}
.site-footer .widget { color: #D8CFE0; }
.site-footer a { color: #E9DDF2; }
.site-footer a:hover { color: var(--gold); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.6rem; }
.site-footer .post-date { color: var(--muted); }
.footer-copy {
    text-align: center;
    margin-top: 2.4rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(232, 200, 114, 0.25);
    color: var(--muted);
    font-size: 0.85rem;
}

/* ============================ ФОРМА ПОИСКА ============================ */
.search-form {
    display: flex;
    gap: 0.5rem;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 0.6em 0.9em;
    border: 1px solid var(--shadow);
    border-radius: 4px;
    background: #fff;
    font-family: var(--body-font);
    font-size: 1rem;
}
.search-form button {
    font-family: var(--head-font);
    padding: 0 1.1em;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* ============================ КОММЕНТАРИИ ============================ */
.comments-area { margin-top: 3rem; }
.comments-title { font-size: 1.6rem; margin-bottom: 1.4rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 1.5rem; padding: 0; }
.comment-body {
    background: #fff;
    border-left: 3px solid var(--gold);
    padding: 1rem 1.3rem;
    margin-bottom: 1.2rem;
}
.comment-meta { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.comment-author { font-family: var(--head-font); font-weight: 700; }
.comment-date { color: var(--muted); font-size: 0.8rem; }
.comment-reply a { font-size: 0.85rem; color: var(--accent); }
.comment-respond {
    background: var(--bg-alt);
    padding: 1.6rem;
    border-radius: 4px;
    margin-top: 1.6rem;
}
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    padding: 0.6em 0.8em;
    border: 1px solid var(--shadow);
    border-radius: 4px;
    font-family: var(--body-font);
    margin-bottom: 0.9rem;
    background: #fff;
}

/* ============================ 404 ============================ */
.error-404 { text-align: center; padding: 2rem 0 3rem; }
.error-404 .err-code {
    font-family: var(--head-font);
    font-size: 6rem;
    color: var(--gold);
    letter-spacing: 0.1em;
    margin: 0;
}
.error-404 .search-form { max-width: 420px; margin: 1.6rem auto; }

/* ============================ COOKIE-БАННЕР ============================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--bg-footer);
    color: #E9DDF2;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    box-shadow: 0 -4px 20px rgba(28,21,32,0.25);
}
.cookie-banner p { margin: 0; font-size: 0.9rem; max-width: 760px; }
.cookie-banner a { color: var(--gold); }
.cookie-banner .btn { padding: 0.5em 1.4em; }

/* ============================ АДАПТИВ ============================ */
@media (max-width: 960px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2rem; }
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 2.5rem; }
    .layout-with-sidebar .content-area,
    .no-sidebar .content-area,
    .layout-single .content-area { max-width: 100%; }
    .directions { grid-template-columns: 1fr 1fr; }
    .footer-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 2.4rem; letter-spacing: 0.03em; }
    h2 { font-size: 1.7rem; }
    .entry-title { font-size: 2rem; }

    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0.4rem; }
    .header-inner { flex-wrap: wrap; }

    .front-intro,
    .front-section .shell > .directions { max-width: 100%; }
    .directions { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr; }

    .quote-block { max-width: 100%; padding: 1.8rem 1.4rem; }
    .quote-block .quote-text { font-size: 1.6rem; }

    .front-intro { max-width: 100%; }

    /* Таймлайн в один столбец */
    .timeline::before { left: 8px; transform: none; }
    .tl-item {
        width: 100%;
        left: 0 !important;
        text-align: left !important;
        padding: 0.6rem 0 0.6rem 2.4rem;
    }
    .tl-item::before { left: 0 !important; right: auto !important; }

    .hero { min-height: 380px; }
    .hero-content { padding: 2.2rem 0; }
    .hero-stamp { width: 60px; height: 60px; }
}
