/*
Theme Name: dds_agileshoppe.com
Author: Павел Романов
Description: Информационная тема для проекта о гибком управлении и рабочих процессах команд. Дизайн в стиле японского минимализма (Keshō).
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: agileshoppe
*/

:root {
    --bg: #F9F7F4;
    --bg-alt: #F2EFEA;
    --footer-bg: #1A1A1A;
    --sidebar-bg: #FFFFFF;
    --text: #2B2926;
    --accent: #C26B3A;
    --accent-2: #8F6B4F;
    --muted: #9A958E;
    --card-border: #E5E0D8;
    --radius-btn: 8px;
    --radius-card: 12px;
}

/* ---------- База ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background-color: var(--bg);
    background-image:
        radial-gradient(rgba(43,41,38,0.035) 1px, transparent 1px),
        radial-gradient(rgba(143,107,79,0.03) 1px, transparent 1px);
    background-size: 5px 5px, 7px 7px;
    background-position: 0 0, 2px 3px;
    color: var(--text);
    font-family: "Segoe UI", "Helvetica Neue", Arial, "PT Sans", system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Декоративный blob в правом нижнем углу */
.page-blob {
    position: fixed;
    right: -120px;
    bottom: -140px;
    width: 460px;
    height: 460px;
    z-index: 0;
    pointer-events: none;
    background: var(--accent);
    opacity: 0.05;
    border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%;
}

.site-header, .site-content, .site-footer { position: relative; z-index: 1; }

h1, h2, h3, h4 {
    font-family: "PT Sans Narrow", "Arial Narrow", "Segoe UI", sans-serif;
    line-height: 1.18;
    letter-spacing: 0.02em;
    color: var(--text);
    margin: 0 0 0.6em;
}

p { margin: 0 0 1.1em; }

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

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

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

.muted { color: var(--muted); }

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Ссылки в контенте: подчёркивание из центра ---------- */
.entry-content a,
.card-excerpt a,
.widget a {
    background-image: linear-gradient(var(--accent), var(--accent));
    background-repeat: no-repeat;
    background-position: 50% 100%;
    background-size: 0 1px;
    transition: background-size 0.28s ease, color 0.2s ease;
    padding-bottom: 1px;
}
.entry-content a:hover,
.card-excerpt a:hover,
.widget a:hover {
    background-size: 100% 1px;
    color: var(--accent);
}

/* ---------- Кнопки ---------- */
.btn {
    display: inline-block;
    font-family: "PT Sans Narrow", "Arial Narrow", sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    padding: 0.7em 1.5em;
    border: 2px solid var(--accent);
    border-radius: var(--radius-btn);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease;
}
.btn:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}
.btn-ghost {
    border: none;
    padding: 0.4em 0;
    color: var(--accent);
    position: relative;
}
.btn-ghost:hover {
    background: transparent;
    color: var(--accent-2);
    transform: none;
    text-decoration: underline;
}

/* ---------- Заголовки секций (со смещением + линия + «след») ---------- */
.sec-title {
    position: relative;
    font-size: 2.1rem;
    text-align: left;
    padding-bottom: 0.4rem;
    margin-bottom: 1.4rem;
}
.sec-title::first-letter { color: var(--accent); font-size: 1.18em; }
.sec-title::after {
    content: "";
    display: block;
    height: 2px;
    width: min(320px, 55%);
    background: var(--accent);
    margin-top: 0.6rem;
}

/* Приём «След» — 3 штриха справа от заголовка */
.kesho-mark {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 0.9em;
    margin-left: 0.5em;
    vertical-align: baseline;
}
.kesho-mark i {
    display: block;
    width: 2px;
    background: var(--accent-2);
}
.kesho-mark i:nth-child(1) { height: 0.55em; }
.kesho-mark i:nth-child(2) { height: 0.9em; }
.kesho-mark i:nth-child(3) { height: 0.4em; }

/* ---------- Шапка ---------- */
.site-header {
    background: transparent;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--card-border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.brand-link { display: flex; align-items: center; gap: 0.8rem; color: var(--text); }
.brand-logo { max-height: 56px; width: auto; display: block; }
.brand-mark { display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
    font-family: "PT Sans Narrow", "Arial Narrow", sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.15;
    text-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.brand-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.3; }

.primary-nav .nav-list {
    display: flex;
    gap: 1.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.primary-nav .nav-list a {
    color: var(--text);
    position: relative;
    padding-bottom: 3px;
    background-image: linear-gradient(var(--accent), var(--accent));
    background-repeat: no-repeat;
    background-position: 50% 100%;
    background-size: 0 1px;
    transition: background-size 0.28s ease, color 0.2s ease;
}
.primary-nav .nav-list a:hover,
.primary-nav .current-menu-item > a {
    color: var(--accent);
    background-size: 100% 1px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.nav-toggle span {
    width: 26px; height: 2px;
    background: var(--text);
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Раскладки ---------- */
.site-content { padding: 2.6rem 0 3.4rem; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 3rem;
    align-items: start;
}
.layout-single .content-area {
    max-width: 860px;
    margin-inline: auto;
}
.content-area { min-width: 0; }

/* ---------- Хлебные крошки ---------- */
.crumbs {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1.6rem;
}
.crumbs a { color: var(--accent-2); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--muted); margin: 0 0.35em; }

/* ---------- Карточки записей ---------- */
.post-list { display: flex; flex-direction: column; gap: 1.6rem; }

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    background: transparent;
    transition: background 0.25s ease;
}
.card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.25s ease;
}
.card:hover { background: var(--bg-alt); }
.card:hover::before { transform: scaleY(1); }

/* Горизонтальная карточка (список) */
.card-row { flex-direction: row; align-items: stretch; }
.card-row .card-thumb-wrap {
    flex: 0 0 260px;
    position: relative;
    overflow: hidden;
}
.card-row .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-row .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    min-width: 0;
    padding: 1.4rem 1.6rem;
}
.card-title { font-size: 1.4rem; margin-bottom: 0.4rem; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-meta {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.7rem;
}
.card-excerpt { color: var(--text); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }

/* Карточка-сетка (главная, «пятно» сверху) */
.latest-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.6rem;
}
.card-grid { flex-direction: column; }
.card-grid .card-thumb-grid { padding: 1rem 1rem 0; }
.card-grid .card-thumb-grid a { display: block; overflow: hidden; border-radius: 10px; }
.card-grid .card-thumb-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

/* ---------- Пагинация ---------- */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2.4rem;
    justify-content: center;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6em;
    padding: 0.4em 0.75em;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-btn);
    color: var(--text);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.pager a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.pager .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pager .page-numbers.dots { border: none; }

/* ---------- Записи / страницы ---------- */
.single-article, .entry-content { min-width: 0; }
.single-meta { color: var(--accent); font-weight: 700; margin-bottom: 1.2rem; }
.single-thumb { margin: 0 0 1.6rem; }
.single-thumb img { width: 100%; border-radius: var(--radius-card); display: block; }
.entry-content h2 { font-size: 1.7rem; margin-top: 1.6rem; }
.entry-content h3 { font-size: 1.35rem; margin-top: 1.3rem; }
.entry-content img { border-radius: 8px; }

.entry-content blockquote {
    margin: 1.6rem 0;
    padding: 0.6rem 1.4rem;
    border-left: 8px solid var(--accent);
    border-radius: 2px 10px 10px 2px;
    background: var(--bg-alt);
    filter: none;
    box-shadow: -2px 0 6px rgba(194,107,58,0.18);
    font-style: italic;
    color: var(--text);
}

.single-tags { margin-top: 1.6rem; font-size: 0.9rem; color: var(--muted); }
.tags-label { font-weight: 700; }
.page-links { margin-top: 1.2rem; }

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

/* ---------- Сайдбар ---------- */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--sidebar-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.6rem;
    color: var(--text);
}
.sidebar .widget-title {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 0.9rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--accent);
}
.sidebar .widget a { color: var(--text); }
.sidebar .widget a:hover { color: var(--accent); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 0.35em 0; border-bottom: 1px dashed var(--card-border); }
.sidebar li:last-child { border-bottom: none; }
.sidebar .post-date { color: var(--muted); font-size: 0.8rem; }

/* ---------- Поиск ---------- */
.search-form { display: flex; gap: 0.6rem; margin: 1.2rem 0; flex-wrap: wrap; }
.search-field {
    flex: 1;
    min-width: 0;
    padding: 0.6em 0.9em;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-btn);
    background: #fff;
    color: var(--text);
    font-size: 1rem;
}

/* ---------- Комментарии ---------- */
.comments-area { margin-top: 2.6rem; padding-top: 1.6rem; border-top: 1px solid var(--card-border); }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin-left: 1.4rem; }
.comment-body {
    padding: 1rem 1.2rem;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    margin-bottom: 1rem;
}
.comment-author { font-weight: 700; }
.comment-date { color: var(--accent); font-weight: 700; margin-left: 0.4em; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.6em 0.8em;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-btn);
    background: #fff;
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

/* ===========================================================
   ГЛАВНАЯ
   =========================================================== */
.front { overflow: hidden; }
.front > section { padding: 3.4rem 0; position: relative; }

/* Разделитель-точка между секциями */
.front > section + section::before {
    content: "";
    position: absolute;
    top: -0.6rem;
    left: 50%;
    transform: translateX(-50%);
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
}
/* Асимметричный «срезанный край» */
.front > section::after {
    content: "";
    position: absolute;
    left: 0; right: 40%;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(143,107,79,0.18));
}

/* --- Блок 1: Hero --- */
.fs-hero {
    padding: 0;
    background-size: cover;
    background-position: center;
}
.fs-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 5rem 0;
    min-width: 0;
}
.fs-hero-text { flex: 1; min-width: 0; max-width: 640px; }
.fs-hero h1 {
    font-size: 3.8rem;
    line-height: 1.12;
    margin-bottom: 0.6em;
}
.fs-hero-lead { font-size: 1.2rem; color: var(--text); margin-bottom: 1.6rem; max-width: 34em; }
.fs-hero-mark { flex: 0 0 auto; }
.fs-hero-mark svg { display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06)); }

/* --- Блок 2: Шаги (кандзи-нумераторы) --- */
.fs-steps { background: var(--bg-alt); }
.steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2.6rem; }
.step { display: flex; gap: 1.6rem; align-items: flex-start; min-width: 0; }
.step-num {
    font-family: serif;
    font-size: 3.4rem;
    line-height: 1;
    color: var(--accent);
    flex: 0 0 auto;
    width: 1.4em;
    text-align: center;
}
.step-body { min-width: 0; }
.step-body h3 { font-size: 1.4rem; margin-bottom: 0.3em; }
.step-body p { margin: 0; }

/* --- Последние записи --- */
.fs-latest { }

/* --- Блок 3: Цитата-плакат --- */
.fs-quote { }
.quote-poster {
    max-width: 760px;
    margin-inline: auto;
    text-align: center;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
    border-radius: var(--radius-card);
    padding: 3rem 2.6rem;
    border-left: 8px solid var(--accent);
    box-shadow: -3px 0 8px rgba(194,107,58,0.15);
}
.quote-poster p {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 32px;
    line-height: 1.4;
    font-style: italic;
    margin: 0 0 1rem;
}
.quote-poster cite {
    font-style: normal;
    font-weight: 700;
    color: var(--accent-2);
    font-size: 1rem;
}

/* --- Блок 4: Таймлайн (зигзаг, квадраты 45°) --- */
.tl { position: relative; padding: 1rem 0; }
.tl::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    border-left: 2px dashed var(--accent);
}
.tl-item { position: relative; width: 50%; padding: 1rem 2.4rem; box-sizing: border-box; }
.tl-left { left: 0; text-align: right; }
.tl-right { left: 50%; text-align: left; }
.tl-item::before {
    content: "";
    position: absolute;
    top: 1.6rem;
    width: 14px;
    height: 14px;
    background: var(--accent);
    transform: rotate(45deg);
}
.tl-left::before { right: -7px; }
.tl-right::before { left: -7px; }
.tl-card {
    display: inline-block;
    text-align: left;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    padding: 1.2rem 1.4rem;
    max-width: 30em;
    min-width: 0;
}
.tl-when { color: var(--accent); font-weight: 700; font-size: 0.85rem; display: block; margin-bottom: 0.3rem; }
.tl-card h3 { font-size: 1.25rem; margin-bottom: 0.3em; }
.tl-card p { margin: 0; }

/* ---------- Подвал ---------- */
.site-footer { background: var(--footer-bg); color: #d9d4cd; padding: 3rem 0 1.6rem; }
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.4rem;
}
.footer-col { min-width: 0; }
.site-footer .widget { color: #d9d4cd; margin-bottom: 1rem; }
.site-footer .widget-title {
    color: #fff;
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--accent);
}
.site-footer .widget a { color: #e8e3db; }
.site-footer .widget a:hover { color: var(--accent); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 0.3em 0; }
.footer-bottom { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,0.12); }
.copyright { color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ---------- Cookie-баннер ---------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    padding: 1rem 1.4rem;
    background: rgba(26,26,26,0.97);
    color: #f0ece5;
    border-top: 2px solid var(--accent);
}
.cookie-text { margin: 0; font-size: 0.9rem; max-width: 60em; }
.cookie-banner .btn { border-color: var(--accent); color: #fff; }
.cookie-banner .btn:hover { background: var(--accent); color: #fff; }

/* ---------- 404 ---------- */
.error-404 { padding: 1rem 0 2rem; }

/* ===========================================================
   АДАПТИВ
   =========================================================== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 2.2rem; }
    .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fs-hero h1 { font-size: 3rem; }
    .fs-hero-mark { display: none; }
    .fs-hero-inner { padding: 3.6rem 0; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .primary-nav .nav-list { flex-direction: column; gap: 0.9rem; margin-top: 1rem; }

    .sec-title { font-size: 1.7rem; }
    .fs-hero h1 { font-size: 2.3rem; }
    .front > section { padding: 2.4rem 0; }

    .footer-cols { grid-template-columns: 1fr; gap: 1.8rem; }
    .latest-grid { grid-template-columns: 1fr; }

    /* Карточка-список -> вертикально */
    .card-row { flex-direction: column; }
    .card-row .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-row .card-thumb-wrap a { position: static; }
    .card-row .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .quote-poster { padding: 1.8rem 1.4rem; }
    .quote-poster p { font-size: 24px; }

    /* Таймлайн -> одноколоночный */
    .tl::before { left: 7px; }
    .tl-item { width: 100%; left: 0 !important; padding: 0.8rem 0 0.8rem 2.4rem; text-align: left; }
    .tl-item::before { left: 0 !important; right: auto !important; top: 1.4rem; }

    .step { gap: 1rem; }
    .step-num { font-size: 2.6rem; }

    .cookie-banner { flex-direction: column; text-align: center; }
}
