/*
Theme Name: dds_leptigen-meridian.ru
Author: Анна Соколова
Description: Информационный портал о превентивной медицине и нутрициологии.
Version: 1.1
Text Domain: dds_leptigen-meridian
*/

/* ============ RESET / BASE ============ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
    font-size: 17px;
    line-height: 1.65;
    color: #1E2A3E;
    background: #F9F8F6;
    overflow-x: hidden;
}

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

a {
    color: #B85C4B;
    text-decoration: none;
    border-bottom: 1px solid rgba(184, 92, 75, 0.25);
    transition: color .15s ease, border-color .15s ease;
}
a:hover {
    color: #8E3F30;
    border-bottom-color: #8E3F30;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
    color: #1E2A3E;
    line-height: 1.25;
    margin: 1.4em 0 0.5em;
    font-weight: 600;
}
h1 { font-size: 2.05rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.32rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

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

blockquote {
    margin: 1.4em 0;
    padding: 1em 1.2em 1em 1.4em;
    border-left: 3px solid #B85C4B;
    background: #F5E9D8;
    font-style: italic;
    color: #2C3548;
}
blockquote cite {
    display: block;
    margin-top: 0.6em;
    font-size: 0.85em;
    color: #5A6478;
    font-style: normal;
}

code, pre {
    font-family: "JetBrains Mono", Consolas, Menlo, monospace;
    font-size: 0.92em;
    background: #EFEDE8;
    color: #1E2A3E;
}
code { padding: 0.1em 0.35em; border-radius: 3px; }
pre {
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid #DCE3E8;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    border: 1px solid #DCE3E8;
}
th, td {
    border: 1px solid #DCE3E8;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}
th {
    background: #EFEDE8;
    font-family: "Inter", sans-serif;
    font-weight: 600;
}

hr {
    border: none;
    border-top: 1px dashed #DCE3E8;
    margin: 2em 0;
}

::selection { background: #B85C4B; color: #fff; }

html { scroll-behavior: smooth; }

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

/* ============ BUTTONS ============ */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 40px;
    background: #B85C4B;
    color: #fff;
    font-family: "Inter", sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid #B85C4B;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease, color .18s ease;
}
.btn:hover {
    background: #8E3F30;
    border-color: #8E3F30;
    color: #fff;
    transform: translateY(-1px);
}
.btn--ghost {
    background: transparent;
    color: #3A7B70;
    border: 1px solid #3A7B70;
}
.btn--ghost:hover {
    background: #3A7B70;
    color: #fff;
    border-color: #3A7B70;
    transform: translateY(-1px);
}

/* ============ HEADER ============ */
.site-header {
    background: #F9F8F6;
    border-bottom: 1px solid #DCE3E8;
    padding: 22px 0;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 360px;
}
.brand a {
    border: 0;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand-logo,
.brand-logo-fallback {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    display: block;
}
.brand-text { min-width: 0; }
.brand-name {
    font-family: "Inter", sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1E2A3E;
    line-height: 1.25;
    margin: 0;
    /* Заголовок сайта — не обрезаем, но позволяем переносить */
}
.brand-desc {
    font-size: 0.82rem;
    color: #5A6478;
    line-height: 1.45;
    margin-top: 4px;
    max-width: 540px;
}

.site-nav { flex: 0 1 auto; }
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid #DCE3E8;
    border-radius: 40px;
    padding: 8px 16px;
    font-family: "Inter", sans-serif;
    font-size: 0.9rem;
    color: #1E2A3E;
    cursor: pointer;
}
.primary-menu {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.primary-menu a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 40px;
    color: #1E2A3E;
    border: 0;
    font-family: "Inter", sans-serif;
    font-size: 0.95rem;
    transition: background .15s ease, color .15s ease;
}
.primary-menu a:hover,
.primary-menu .current-menu-item > a {
    background: #1E2A3E;
    color: #F9F8F6;
}

/* ============ LAYOUT ============ */
.site-content { padding: 32px 0 56px; }

.layout-with-sidebar {
    display: flex;
    gap: 4%;
    align-items: flex-start;
}
.layout-with-sidebar .main-area {
    flex: 0 0 67%;
    min-width: 0;
}
.layout-with-sidebar .sidebar-area {
    flex: 0 0 27%;
    min-width: 0;
}

.layout-no-sidebar .main-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

/* ============ BREADCRUMBS ============ */
.breadcrumbs {
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
    color: #5A6478;
    margin: 0 0 22px;
    padding: 10px 14px;
    background: #F5F3EE;
    border-radius: 6px;
}
.breadcrumbs a {
    color: #3A7B70;
    border: 0;
}
.breadcrumbs a:hover { color: #B85C4B; }
.breadcrumbs .sep { margin: 0 6px; color: #B85C4B; }

/* ============ POST CARDS ============ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}
.card-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #DCE3E8;
    border-radius: 12px;
    overflow: hidden;
    min-width: 0;
}
.card-thumb {
    width: 100%;
    display: block;
}
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
    min-width: 0;
}
.card-meta {
    font-family: "Inter", sans-serif;
    font-size: 0.78rem;
    color: #5A6478;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.card-title {
    margin: 0 0 8px;
    font-size: 1.18rem;
    line-height: 1.3;
}
.card-title a {
    color: #1E2A3E;
    border: 0;
}
.card-title a:hover { color: #B85C4B; }
.card-excerpt { color: #2C3548; font-size: 0.95rem; }
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}
.card-footer {
    margin-top: auto;
    padding-top: 14px;
}

/* Horizontal "digest" card on home / single-feature */
.card-feature {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: #fff;
    border: 1px solid #DCE3E8;
    border-radius: 12px;
    overflow: hidden;
    min-width: 0;
}
.card-feature .card-thumb-wrap {
    flex: 0 0 320px;
    position: relative;
    overflow: hidden;
    background: #F5E9D8;
}
.card-feature .card-thumb-wrap a {
    display: block;
    position: absolute;
    inset: 0;
    border: 0;
}
.card-feature .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-feature .card-body {
    flex: 1;
    min-width: 0;
    padding: 24px 28px;
}

/* ============ HEXAGON THUMBNAILS (signature element) ============ */
.hex-frame {
    position: relative;
    width: 180px;
    aspect-ratio: 1 / 1.1547;
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    margin: 0 auto;
    overflow: hidden;
    background: #DCE3E8;
}
.hex-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hex-frame--lg { width: 260px; }
.hex-frame--placeholder {
    background: linear-gradient(135deg, #3A7B70 0%, #1E2A3E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #F9F8F6;
}

/* ============ SINGLE POST ============ */
.entry-header {
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px dashed #DCE3E8;
}
.entry-title {
    margin: 0 0 10px;
    font-size: 2.1rem;
}
.entry-meta {
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
    color: #5A6478;
}
.entry-meta a { color: #3A7B70; border: 0; }
.entry-meta a:hover { color: #B85C4B; }

.entry-content img,
.entry-content figure {
    margin: 1.4em 0;
    border-radius: 8px;
}

.entry-footer {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px dashed #DCE3E8;
    font-family: "Inter", sans-serif;
    font-size: 0.88rem;
    color: #5A6478;
}
.entry-footer .tag-list a {
    display: inline-block;
    padding: 4px 12px;
    margin: 0 4px 4px 0;
    background: #EFEDE8;
    color: #3A7B70;
    border-radius: 40px;
    border: 0;
    font-size: 0.82rem;
}
.entry-footer .tag-list a:hover { background: #3A7B70; color: #fff; }

/* ============ SIDEBAR ============ */
.sidebar-area .widget {
    background: #fff;
    border: 1px solid #DCE3E8;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 22px;
    color: #1E2A3E;
}
.sidebar-area .widget-title {
    font-family: "Inter", sans-serif;
    margin: 0 0 14px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1E2A3E;
    padding-bottom: 10px;
    border-bottom: 2px solid #B85C4B;
}
.sidebar-area .widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-area .widget li {
    padding: 8px 0;
    border-bottom: 1px dashed #DCE3E8;
    font-size: 0.94rem;
}
.sidebar-area .widget li:last-child { border-bottom: 0; }
.sidebar-area .widget a {
    color: #1E2A3E;
    border: 0;
}
.sidebar-area .widget a:hover { color: #B85C4B; }
.sidebar-area .widget .post-date,
.sidebar-area .widget .rss-date {
    display: block;
    font-size: 0.78rem;
    color: #5A6478;
    margin-top: 2px;
}

/* ============ FOOTER ============ */
.site-footer {
    background: #1E2A3E;
    color: #D9DCE3;
    padding: 48px 0 22px;
    margin-top: 56px;
    border-top: 4px solid #3A7B70;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    margin-bottom: 36px;
}
.footer-col .widget { margin-bottom: 20px; }
.footer-col .widget:last-child { margin-bottom: 0; }
.footer-col .widget-title {
    font-family: "Inter", sans-serif;
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: #F5E9D8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 8px;
    border-bottom: 1px solid #3A7B70;
}
.footer-col .widget,
.footer-col .widget p,
.footer-col .widget li {
    color: #D9DCE3;
    font-size: 0.93rem;
}
.footer-col .widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col .widget li {
    padding: 6px 0;
    border-bottom: 1px dashed rgba(220, 227, 232, 0.18);
}
.footer-col .widget li:last-child { border-bottom: 0; }
.footer-col .widget a {
    color: #F5E9D8;
    border: 0;
}
.footer-col .widget a:hover { color: #B85C4B; }
.footer-col .widget .post-date {
    display: block;
    font-size: 0.78rem;
    color: #8A93A4;
}
.site-info {
    border-top: 1px solid rgba(220, 227, 232, 0.18);
    padding-top: 20px;
    font-size: 0.85rem;
    color: #8A93A4;
    text-align: center;
}

/* ============ PAGINATION ============ */
.pagination {
    margin: 32px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.pagination .page-numbers {
    display: inline-block;
    min-width: 40px;
    padding: 8px 14px;
    text-align: center;
    border: 1px solid #DCE3E8;
    border-radius: 40px;
    color: #1E2A3E;
    background: #fff;
    font-family: "Inter", sans-serif;
    font-size: 0.92rem;
    border-bottom: 1px solid #DCE3E8;
}
.pagination a.page-numbers:hover {
    background: #3A7B70;
    color: #fff;
    border-color: #3A7B70;
}
.pagination .page-numbers.current {
    background: #1E2A3E;
    color: #fff;
    border-color: #1E2A3E;
}

/* ============ COMMENTS ============ */
.comments-area {
    margin-top: 40px;
    padding-top: 26px;
    border-top: 1px dashed #DCE3E8;
}
.comments-title {
    font-size: 1.35rem;
    margin: 0 0 18px;
}
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 26px;
}
.comment-list .children {
    list-style: none;
    padding-left: 20px;
    margin-top: 12px;
}
.comment-body {
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid #DCE3E8;
    border-radius: 8px;
}
.comment-meta {
    font-family: "Inter", sans-serif;
    font-size: 0.82rem;
    color: #5A6478;
    margin-bottom: 6px;
}
.comment-author { color: #1E2A3E; font-weight: 600; }
.comment-reply-link {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 12px;
    border-radius: 40px;
    background: #F5E9D8;
    color: #B85C4B;
    border: 0;
    font-family: "Inter", sans-serif;
    font-size: 0.82rem;
}
.comment-reply-link:hover { background: #B85C4B; color: #fff; }
.comment-form p { margin: 0 0 14px; }
.comment-form label {
    display: block;
    font-family: "Inter", sans-serif;
    font-size: 0.88rem;
    margin-bottom: 4px;
    color: #1E2A3E;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 1rem;
    border: 1px solid #DCE3E8;
    border-radius: 8px;
    background: #fff;
    color: #1E2A3E;
}
.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #3A7B70;
}
.comment-form .submit {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 40px;
    background: #B85C4B;
    color: #fff;
    border: 1px solid #B85C4B;
    font-family: "Inter", sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}
.comment-form .submit:hover {
    background: #8E3F30;
    border-color: #8E3F30;
    transform: translateY(-1px);
}

/* ============ SEARCH FORM ============ */
.search-form {
    display: flex;
    gap: 6px;
    align-items: stretch;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 9px 14px;
    border: 1px solid #DCE3E8;
    border-radius: 40px;
    background: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    color: #1E2A3E;
}
.search-form .search-field:focus {
    outline: none;
    border-color: #3A7B70;
}
.search-form .search-submit {
    padding: 9px 20px;
    border-radius: 40px;
    background: #3A7B70;
    color: #fff;
    border: 1px solid #3A7B70;
    font-family: "Inter", sans-serif;
    cursor: pointer;
    font-size: 0.92rem;
    transition: background .18s ease;
}
.search-form .search-submit:hover {
    background: #2C5C53;
    border-color: #2C5C53;
}

/* ============ FRONT PAGE ============ */
.home-section {
    margin: 0 0 56px;
}
.home-section .section-head {
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px dashed #DCE3E8;
}
.home-section .section-head h2 {
    margin: 0 0 6px;
    font-size: 1.55rem;
}
.home-section .section-head .lead {
    margin: 0;
    color: #5A6478;
    font-size: 1rem;
}

.digest-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 22px;
}
.digest-card {
    background: #fff;
    border: 1px solid #DCE3E8;
    border-radius: 12px;
    padding: 22px;
    min-width: 0;
}
.digest-card h3 {
    margin: 14px 0 6px;
    font-size: 1.1rem;
}
.digest-card .meta {
    font-family: "Inter", sans-serif;
    font-size: 0.78rem;
    color: #3A7B70;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.digest-card .icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #F5E9D8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #B85C4B;
}

.timeline-strip {
    background: #FFFCF6;
    border: 1px dashed #B85C4B;
    border-radius: 10px;
    padding: 22px 26px;
}
.timeline-strip .strip-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-family: "Inter", sans-serif;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #B85C4B;
}
.timeline-strip .strip-head svg { flex: 0 0 auto; }
.timeline-strip table { margin: 0; border: 0; }
.timeline-strip th,
.timeline-strip td {
    border: 0;
    border-bottom: 1px solid #DCE3E8;
    padding: 10px 6px;
    background: transparent;
}
.timeline-strip th { background: transparent; color: #3A7B70; font-size: 0.82rem; }

.tape-block {
    position: relative;
    background: #FFFCF6;
    padding: 24px 26px 24px 38px;
    border-radius: 6px;
}
.tape-block::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: #B85C4B;
    transform: rotate(-1.5deg);
    transform-origin: top center;
}
.tape-block h3 { margin-top: 0; }

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

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: #1E2A3E;
    color: #F9F8F6;
    border-radius: 10px;
    border: 1px solid #3A7B70;
    font-size: 0.92rem;
    max-width: 760px;
    margin: 0 auto;
}
.cookie-banner p {
    margin: 0;
    flex: 1 1 240px;
    min-width: 0;
}
.cookie-banner a {
    color: #F5E9D8;
    border-bottom: 1px solid rgba(245, 233, 216, 0.4);
}
.cookie-banner a:hover { color: #fff; }
.cookie-accept {
    padding: 8px 20px;
    border-radius: 40px;
    background: #B85C4B;
    color: #fff;
    border: 1px solid #B85C4B;
    font-family: "Inter", sans-serif;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}
.cookie-accept:hover {
    background: #8E3F30;
    border-color: #8E3F30;
    transform: translateY(-1px);
}

/* ============ 404 ============ */
.error-404 {
    text-align: center;
    padding: 40px 20px 20px;
}
.error-404 .big {
    font-family: "Inter", sans-serif;
    font-size: 4.5rem;
    font-weight: 700;
    margin: 0;
    color: #B85C4B;
    letter-spacing: 0.02em;
}
.error-404 h1 {
    margin: 6px 0 14px;
    font-size: 1.6rem;
}
.error-404 .search-form { max-width: 460px; margin: 20px auto; }

/* ============ ICONS ============ */
.icn {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
    flex: 0 0 auto;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
    body { font-size: 16px; }
    h1 { font-size: 1.85rem; }
    h2 { font-size: 1.5rem; }

    .layout-with-sidebar { flex-direction: column; gap: 30px; }
    .layout-with-sidebar .main-area,
    .layout-with-sidebar .sidebar-area { flex: none; width: 100%; }

    .layout-no-sidebar .main-area { width: 100%; }

    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .digest-grid { grid-template-columns: 1fr 1fr; }
    .footer-cols { grid-template-columns: 1fr 1fr; gap: 26px; }

    .card-feature { flex-direction: column; }
    .card-feature .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
        aspect-ratio: 16 / 9;
    }
    .card-feature .card-thumb-wrap a { position: static; }
    .card-feature .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 600px) {
    .header-inner { gap: 16px; }
    .brand { flex: 1 1 100%; }
    .brand-desc { display: none; }
    .site-nav { flex: 1 1 100%; }
    .menu-toggle { display: inline-block; }
    .primary-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 10px;
    }
    .primary-menu.is-open { display: flex; }
    .primary-menu li {
        border-bottom: 1px dashed #DCE3E8;
    }
    .primary-menu a {
        display: block;
        padding: 12px 14px;
        border-radius: 0;
    }

    .card-grid { grid-template-columns: 1fr; }
    .digest-grid { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr; gap: 22px; }

    .hex-frame { width: 140px; }
    .hex-frame--lg { width: 180px; }

    .entry-title { font-size: 1.6rem; }
    .cookie-banner { left: 8px; right: 8px; bottom: 8px; padding: 12px 14px; }
}
