/*
Theme Name: dds_art-plastica.ru
Theme URI: https://art-plastica.ru/
Author: Екатерина Веснина
Author URI: https://art-plastica.ru/
Description: Тема для информационно-консультационного портала о гормональном здоровье, метаболизме и естественной нормализации веса. Тёплая, спокойная и доказательная эстетика без агрессивного маркетинга.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: apr
*/

/* ==================================================================
   1. Переменные
   ================================================================== */
:root {
    --bg: #F9F6F0;
    --surface: #E8EDE9;
    --surface-deep: #DFE6E0;
    --text: #2C3A2F;
    --text-soft: #5A6B5E;
    --accent: #C87A5A;
    --accent-dark: #A55E42;
    --sage: #7A9B85;
    --berry: #B1625A;
    --line: #D4D9CF;
    --footer-bg: #25312A;
    --footer-text: #D9E2D8;
    --footer-soft: #9DAE9F;

    --font-head: 'Montserrat', 'Trebuchet MS', sans-serif;
    --font-body: 'Spectral', 'PT Serif', Georgia, serif;
    --font-mono: 'Roboto Mono', 'Courier New', monospace;
    --font-hand: 'Caveat', 'Comic Sans MS', cursive;

    --shadow-soft: 0 8px 28px rgba(44, 58, 47, 0.10);
    --radius: 18px;
}

/* ==================================================================
   2. Сброс и база
   ================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--sage);
    color: #fff;
}

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

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

a:hover {
    color: var(--accent-dark);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    color: var(--text);
    line-height: 1.25;
    letter-spacing: 0.01em;
    margin: 0 0 0.6em;
    font-weight: 700;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }

p {
    margin: 0 0 1.1em;
}

ul, ol {
    margin: 0 0 1.1em;
    padding-left: 1.4em;
}

blockquote {
    margin: 1.6em 0;
    padding: 1.4em 1.6em;
    background: #F3EBD9;
    border-left: 4px solid var(--accent);
    border-radius: 6px 16px 16px 6px;
    font-family: var(--font-hand);
    font-size: 1.4rem;
    line-height: 1.5;
    color: var(--text);
}

code, pre {
    font-family: var(--font-mono);
    font-size: 0.92em;
}

pre {
    background: var(--surface);
    padding: 1em 1.2em;
    border-radius: 10px;
    overflow-x: auto;
}

/* Цифры и данные */
.num,
.post-meta time,
.comment-date {
    font-family: var(--font-mono);
}

/* ==================================================================
   3. Контейнер ширины
   ================================================================== */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

/* ==================================================================
   4. Раскладки контента
   ================================================================== */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67%) minmax(0, 27%);
    justify-content: space-between;
    gap: 2.4rem;
    margin: 2.6rem 0 3.4rem;
}

.layout-single {
    display: block;
    margin: 2.6rem 0 3.4rem;
}

.layout-single .content-area {
    display: block;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

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

/* ==================================================================
   5. Кнопки и ссылки-действия
   ================================================================== */
.btn {
    display: inline-block;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.92rem;
    font-variant: small-caps;
    letter-spacing: 0.04em;
    color: #fff;
    background: var(--accent);
    padding: 0.72em 1.7em;
    border: 1px solid transparent;
    /* Капсула: левая сторона круглая, правая чуть плоская */
    border-radius: 40px 14px 14px 40px;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    background: var(--accent-dark);
    color: #fff;
    box-shadow: 0 6px 18px rgba(165, 94, 66, 0.32);
    border-color: #fff;
}

.link-more {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
    border-bottom: 1px solid var(--line);
    padding: 0.25em 0.1em;
    transition: border-color 0.2s ease, padding 0.2s ease;
}

.link-more::after {
    content: '→';
    color: var(--accent);
    transition: transform 0.2s ease;
}

.link-more:hover {
    color: var(--text);
    border: 1px solid var(--accent);
    border-radius: 30px;
    padding: 0.25em 0.9em;
}

.link-more:hover::after {
    transform: translateX(3px);
}

/* ==================================================================
   6. Шапка
   ================================================================== */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.5rem 0 1.2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.brand-logo,
.brand-mark {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    display: block;
}

.brand-mark {
    color: var(--accent);
}

.brand-text {
    min-width: 0;
}

.site-title {
    font-family: var(--font-head);
    font-size: 1.04rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.site-title a {
    color: var(--text);
}

.site-tagline {
    margin: 0.3rem 0 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-soft);
}

/* Навигация */
.main-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.nav-toggle {
    display: none;
    margin: 0.7rem 0;
    background: var(--accent);
    color: #fff;
    border: none;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.55em 1.2em;
    border-radius: 40px 14px 14px 40px;
    cursor: pointer;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.6rem;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    color: var(--text);
    padding: 0.95rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.nav-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu[hidden] {
    display: none !important;
}

@media (max-width: 960px) {
    .nav-toggle {
        display: inline-block;
    }
    .nav-menu {
        flex-direction: column;
        gap: 0;
        padding-bottom: 0.6rem;
    }
    .nav-menu a {
        padding: 0.7rem 0;
        border-bottom: 1px solid var(--line);
    }
}

/* ==================================================================
   7. Хлебные крошки
   ================================================================== */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-soft);
    padding: 1.1rem 0 0;
    line-height: 1.6;
}

.breadcrumbs a {
    color: var(--text-soft);
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.breadcrumbs .sep {
    color: var(--sage);
    margin: 0 0.15em;
}

.breadcrumbs span:last-child {
    color: var(--text);
}

/* ==================================================================
   8. Главная страница
   ================================================================== */
.home-section {
    padding: 3rem 0;
}

.home-section + .home-section {
    border-top: 1px solid var(--line);
}

.section-head {
    margin-bottom: 1.8rem;
}

.section-kicker {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.hero {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 3rem 2.4rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.3rem;
    margin-bottom: 0.6rem;
}

.hero p {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-soft);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.6rem;
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.8rem 1.6rem;
}

.feature-card .feature-icon {
    width: 52px;
    height: 52px;
    color: var(--accent);
    margin-bottom: 0.8rem;
}

.feature-card h3 {
    margin-bottom: 0.4rem;
}

.feature-card p {
    color: var(--text-soft);
    font-size: 0.96rem;
    margin: 0;
}

@media (max-width: 760px) {
    .feature-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Карусель «Не диета, а настройка» */
.tuner {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2.6rem 2rem;
    text-align: center;
}

.tuner-track {
    position: relative;
    min-height: 180px;
}

.tuner-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.tuner-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
}

.tuner-slide .tuner-icon {
    width: 48px;
    height: 48px;
    color: var(--sage);
    margin-bottom: 0.8rem;
}

.tuner-slide blockquote {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 1.7rem;
    max-width: 560px;
}

.tuner-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.4rem;
}

.tuner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--sage);
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.tuner-dot.is-active {
    background: var(--accent);
    border-color: var(--accent);
}

/* ==================================================================
   9. Карточки записей
   ================================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.7rem;
}

.layout-with-sidebar .card-grid,
.archive-list .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 760px) {
    .card-grid,
    .layout-with-sidebar .card-grid,
    .archive-list .card-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 0;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(44, 58, 47, 0.16);
}

.card-thumb {
    display: block;
}

.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Заглушка-иконография для записей без миниатюры */
.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background: var(--surface-deep);
}

.card-icon svg {
    width: 72px;
    height: 72px;
    color: var(--accent);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.4rem 1.5rem 1.6rem;
    min-width: 0;
}

/* «Тег метаболического типа» вместо даты */
.card-tag {
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 30px;
    padding: 0.22em 0.8em;
    margin-bottom: 0.7rem;
}

.card-tag:hover {
    background: var(--accent);
    color: #fff;
}

.card-title {
    font-size: 1.18rem;
    margin: 0 0 0.5rem;
}

.card-title a {
    color: var(--text);
}

.card-title a:hover {
    color: var(--accent);
}

.card-excerpt {
    color: var(--text-soft);
    font-size: 0.96rem;
}

.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-body .link-more {
    margin-top: auto;
    align-self: flex-start;
}

/* ==================================================================
   10. Записи и страницы
   ================================================================== */
.entry {
    background: var(--bg);
}

.entry-header {
    margin-bottom: 1.4rem;
}

.entry-title {
    font-size: 2rem;
}

.entry-meta {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
}

.entry-meta a {
    color: var(--sage);
}

.entry-thumb {
    margin: 0 0 1.6rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.entry-thumb img {
    display: block;
    width: 100%;
}

.entry-content {
    font-size: 1.04rem;
}

.entry-content img {
    border-radius: 10px;
}

.entry-content h2,
.entry-content h3 {
    margin-top: 1.6em;
}

.entry-footer {
    margin-top: 1.8rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
    font-size: 0.88rem;
    color: var(--text-soft);
}

.entry-footer a {
    color: var(--sage);
}

/* Таблицы в контенте */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
}

.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
}

.entry-content th,
.entry-content td {
    padding: 0.6em 0.85em;
    text-align: left;
}

.entry-content th {
    background: var(--surface);
    font-family: var(--font-head);
}

/* ==================================================================
   11. Сайдбар и виджеты
   ================================================================== */
.sidebar {
    min-width: 0;
}

.widget {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.6rem;
    /* Светлый фон сайдбара — тёмный текст */
    color: var(--text);
}

.widget a {
    color: var(--accent);
}

.widget a:hover {
    color: var(--accent-dark);
}

.widget-title {
    font-size: 1.05rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    color: var(--text);
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget ul li {
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget .post-date,
.widget .rss-date {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--text-soft);
}

/* ==================================================================
   12. Пагинация
   ================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 2.4rem 0 1rem;
}

.pagination .page-numbers {
    display: inline-block;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    padding: 0.5em 0.95em;
    border-radius: 10px;
    transition: background 0.2s ease, color 0.2s ease;
}

.pagination a.page-numbers:hover {
    background: var(--sage);
    color: #fff;
}

.pagination .page-numbers.current {
    background: var(--accent);
    color: #fff;
}

.pagination .page-numbers.dots {
    background: none;
}

/* ==================================================================
   13. Комментарии
   ================================================================== */
.comments-area {
    margin-top: 2.6rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--line);
}

.comment-list {
    list-style: none;
    margin: 1.4rem 0;
    padding: 0;
}

.comment-list .children {
    list-style: none;
    margin: 0;
    padding-left: 1.6rem;
}

.comment-inner {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    margin-bottom: 1rem;
}

.comment-head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}

.comment-avatar img {
    border-radius: 50%;
    display: block;
}

.comment-author {
    display: block;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.95rem;
}

.comment-date {
    font-size: 0.76rem;
    color: var(--text-soft);
}

.comment-text {
    font-size: 0.98rem;
}

.comment-await {
    font-size: 0.82rem;
    color: var(--berry);
}

.comment-reply-link {
    font-family: var(--font-head);
    font-size: 0.82rem;
    font-weight: 600;
}

.comment-respond {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.6rem;
    margin-top: 1.4rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.6em 0.8em;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    margin-top: 0.3rem;
}

.comment-form label {
    font-family: var(--font-head);
    font-size: 0.88rem;
    font-weight: 600;
}

.comment-form p {
    margin-bottom: 0.9rem;
}

/* ==================================================================
   14. Форма поиска
   ================================================================== */
.search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.search-form .search-field {
    flex: 1;
    min-width: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.6em 0.9em;
    border: 1px solid var(--line);
    border-radius: 40px 14px 14px 40px;
    background: var(--bg);
    color: var(--text);
}

.search-form .search-submit {
    font-family: var(--font-head);
    font-weight: 600;
    font-variant: small-caps;
    color: #fff;
    background: var(--accent);
    border: none;
    padding: 0.6em 1.4em;
    border-radius: 14px 40px 40px 14px;
    cursor: pointer;
}

.search-form .search-submit:hover {
    background: var(--accent-dark);
}

/* ==================================================================
   15. Подвал
   ================================================================== */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    margin-top: 3rem;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    padding: 3rem 0 2rem;
}

@media (max-width: 760px) {
    .footer-cols {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Тёмный фон подвала — светлый текст виджетов */
.site-footer .widget {
    background: none;
    padding: 0;
    margin: 0;
    color: var(--footer-text);
}

.site-footer .widget-title {
    color: #fff;
    border-bottom-color: var(--accent);
}

.site-footer .widget a {
    color: var(--footer-text);
}

.site-footer .widget a:hover {
    color: var(--accent);
}

.site-footer .widget ul li {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.site-footer .widget .post-date,
.site-footer .widget .rss-date {
    color: var(--footer-soft);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1.6rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-copy {
    font-size: 0.84rem;
    color: var(--footer-soft);
    margin: 0;
}

/* Анимированная SVG-схема метаболизма */
.metabolism {
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
}

.metabolism .pulse {
    transform-origin: center;
    animation: apr-pulse 4s ease-in-out infinite;
}

.metabolism .orbit {
    transform-origin: center;
    animation: apr-orbit 4s linear infinite;
}

@keyframes apr-pulse {
    0%, 100% { transform: scale(0.86); opacity: 0.55; }
    50%      { transform: scale(1.04); opacity: 1; }
}

@keyframes apr-orbit {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .metabolism .pulse,
    .metabolism .orbit {
        animation: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ==================================================================
   16. Cookie-баннер
   ================================================================== */
.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 1rem 0;
    box-shadow: 0 -8px 24px rgba(44, 58, 47, 0.22);
}

.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.cookie-text {
    margin: 0;
    font-size: 0.88rem;
    flex: 1 1 220px;
    min-width: 0;
}

.cookie-text a {
    color: var(--accent);
}

.cookie-accept {
    flex: 0 0 auto;
    font-family: var(--font-head);
    font-weight: 600;
    font-variant: small-caps;
    color: #fff;
    background: var(--accent);
    border: 1px solid transparent;
    padding: 0.6em 1.6em;
    border-radius: 40px 14px 14px 40px;
    cursor: pointer;
}

.cookie-accept:hover {
    background: var(--accent-dark);
    border-color: #fff;
}

/* ==================================================================
   17. 404 и служебные блоки
   ================================================================== */
.page-404 {
    text-align: center;
    padding: 2rem 0;
}

.page-404 .code-404 {
    font-family: var(--font-mono);
    font-size: 4.4rem;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.page-404 .search-form {
    max-width: 440px;
    margin: 1.6rem auto;
}

.no-results {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
}

.page-intro {
    margin: 1.4rem 0 1.8rem;
}

.page-intro h1 {
    margin-bottom: 0.3rem;
}

.page-intro p {
    color: var(--text-soft);
    margin: 0;
}

/* Внешние ссылки на исследования */
.entry-content a[target="_blank"]::after {
    content: ' ↗';
    color: var(--sage);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.entry-content a[target="_blank"]:hover::after {
    opacity: 1;
}

/* Утилиты */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.site-main {
    padding-bottom: 1rem;
}
