/*
Theme Name: dds_latinitycr.com
Author: Анна Соколова
Description: Тема для информационно-аналитического портала о цифровых сервисах в сфере недвижимости.
Version: 1.1
Text Domain: pthome
*/

:root {
    --bg: #F2F6FA;
    --bg-alt: #FFFFFF;
    --head-bg: #E8EEF4;
    --foot-bg: #1B2A3B;
    --text: #1E2A36;
    --accent: #D4A574;
    --accent-2: #6A8E9B;
    --muted: #8697A6;
    --line: #DCE4EC;
    --font-head: "Montserrat", "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-text: "Manrope", "PT Root UI", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* --- служебное: hidden всегда скрывает --- */
.cookie-banner[hidden],
.nav-list[hidden],
[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: var(--font-text);
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        repeating-linear-gradient(0deg, rgba(30, 42, 54, 0.05) 0 1px, transparent 1px 80px),
        repeating-linear-gradient(90deg, rgba(30, 42, 54, 0.05) 0 1px, transparent 1px 80px);
}

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

a { color: var(--accent-2); text-decoration: underline; text-decoration-color: currentColor; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

p { margin: 0 0 1.1em; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    color: var(--text);
    line-height: 1.25;
    font-weight: 700;
    margin: 1.8rem 0 0.9rem;
}

h1 { font-size: 3.2rem; letter-spacing: -0.01em; margin-top: 0; }
h2 { font-size: 1.85rem; letter-spacing: 0.01em; position: relative; padding-left: 12px; }
h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.18em;
    width: 2px;
    height: 1.5em;
    background: var(--accent);
}
h3 { font-size: 1.35rem; }
h4 { font-size: 1.12rem; }

blockquote {
    margin: 1.6rem 0;
    padding: 1.4rem 1.6rem;
    background: linear-gradient(135deg, #E8EEF4 0%, #DCE4EC 100%);
    border-left: 3px solid var(--accent);
    font-size: 1.05rem;
}
blockquote p:last-child { margin-bottom: 0; }

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

.layout-single { width: 85%; margin-left: auto; margin-right: auto; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 6%;
    align-items: start;
}
.layout-with-sidebar > * { min-width: 0; }

.site-main { padding: 3rem 0 4.5rem; }

/* --- кнопки --- */
.btn {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.72em 1.5em;
    border: 1px solid var(--accent);
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.btn:hover {
    border-color: var(--accent-2);
    background: rgba(106, 142, 155, 0.10);
    box-shadow: 0 2px 0 0 rgba(27, 42, 59, 0.18);
    text-decoration: none;
}
.btn-light { color: #F2F6FA; border-color: var(--accent); }
.btn-light:hover { color: #FFFFFF; background: rgba(212, 165, 116, 0.16); }

/* --- шапка --- */
.site-header {
    background: var(--head-bg);
    border-bottom: 1px solid var(--line);
    padding: 1.4rem 0;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.9rem; min-width: 0; text-decoration: none; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: auto; max-height: 54px; }
.brand svg.brand-mark { display: block; width: 48px; height: 48px; flex: 0 0 48px; }
.brand-text { min-width: 0; }
.brand-name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 46ch;
}
.brand-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 46ch;
}

.nav-toggle {
    display: none;
    font-family: var(--font-head);
    font-size: 0.9rem;
    padding: 0.55em 1em;
    border: 1px solid var(--accent-2);
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.main-nav .nav-list {
    display: flex;
    gap: 1.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--text);
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
}
.main-nav a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.main-nav .current-menu-item > a { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* --- хлебные крошки --- */
.crumbs {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 1.4rem 0 0;
}
.crumbs a { color: var(--muted); text-decoration-color: var(--line); }
.crumbs a:hover { color: var(--text); text-decoration-color: var(--accent); }
.crumbs .sep { color: var(--accent); padding: 0 0.35em; }

/* --- заголовок секции: двойная линия сверху --- */
.section-head { position: relative; padding-top: 22px; margin-bottom: 1.8rem; margin-left: 4%; }
.section-head::before { content: ""; position: absolute; top: 0; left: 0; width: 140px; height: 1px; background: var(--text); }
.section-head::after { content: ""; position: absolute; top: 6px; left: 0; width: 84px; height: 2px; background: var(--accent); }
.section-head h2 { margin: 0 0 0.4rem; }
.section-head p { margin: 0; color: var(--muted); font-size: 0.98rem; max-width: 68ch; }

/* --- главная: секции --- */
.front-section { padding: 5rem 0; }
.front-section.alt { background: var(--bg-alt); }
.fs-inner { width: 85%; margin-left: auto; margin-right: auto; }

/* hero */
.hero { position: relative; overflow: hidden; background: #16222F; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 320px;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%23D4A574' stroke-width='2'%3E%3Cpath d='M20 180 L20 90 L100 30 L180 90 L180 180'/%3E%3Cpath d='M60 180 L60 120 L140 120 L140 180'/%3E%3Cpath d='M100 120 L100 180'/%3E%3Cpath d='M100 55 A45 45 0 0 1 145 100 L145 118'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.15;
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, #1B2A3B 0%, rgba(27, 42, 59, 0.92) 38%, rgba(27, 42, 59, 0.35) 100%); }
.hero-inner { position: relative; padding: 6rem 0 5.5rem; }
.hero-box { width: 85%; margin-left: auto; margin-right: auto; }
.hero-text { max-width: 62ch; }
.hero-kicker {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.82rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    padding-top: 12px;
    border-top: 2px solid var(--accent);
    margin-bottom: 1.4rem;
}
.hero h1 { color: #FFFFFF; margin-bottom: 1.1rem; }
.hero p { color: #D7E0E8; font-size: 1.08rem; max-width: 56ch; }
.hero .btn-row { margin-top: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; }

/* статистика */
.stats-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 2.4rem;
}
.stat-item { padding: 1.4rem 1.2rem; background: linear-gradient(160deg, #E8EEF4 0%, #DCE4EC 100%); border-radius: 0; }
.stat-num {
    display: block;
    font-family: var(--font-head);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.1;
    padding-bottom: 0.35rem;
    border-bottom: 2px dashed var(--accent);
    margin-bottom: 0.7rem;
}
.stat-label { display: block; font-size: 0.9rem; color: var(--text); }

/* zigzag */
.zigzag-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
    gap: 3rem;
    align-items: center;
    padding: 2.6rem 0;
}
.zigzag-row + .zigzag-row { border-top: 1px dashed var(--line); }
.zigzag-row.mirror { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }
.zigzag-row.mirror .zz-text { order: 2; }
.zigzag-row.mirror .zz-art { order: 1; }
.zz-text h3 { margin-top: 0; }
.zz-text p:last-child { margin-bottom: 0; }
.zz-art svg { display: block; width: 100%; height: auto; }

/* глоссарий */
.gloss-item { padding: 1.6rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 2rem; }
.gloss-item:first-child { border-top: 1px solid var(--line); }
.gloss-term { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; margin: 0; }
.gloss-def { margin: 0; color: var(--text); }

/* последние записи на главной */
.latest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.8rem; }
.front-more { margin-top: 2.6rem; text-align: center; }

/* --- карточки записей --- */
.cards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.8rem; }
.no-sidebar .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
    transform: translateY(2px);
    box-shadow: inset 3px 0 0 0 var(--accent);
    border-color: var(--accent-2);
}
.card-thumb { width: 55%; }
.card-thumb a { display: block; }
.card-thumb img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.thumb-stub { display: block; }
.thumb-stub svg { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; }
.card-body { flex: 1; display: flex; flex-direction: column; padding: 1.3rem 1.4rem 1.5rem; min-width: 0; }
.card-title { font-family: var(--font-head); font-size: 1.15rem; line-height: 1.35; margin: 0 0 0.6rem; }
.card-title a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line); }
.card-title a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.card-excerpt { font-size: 0.95rem; color: var(--text); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-foot { margin-top: auto; padding-top: 1rem; }

.post-meta { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.7rem; display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }
.cat-chip {
    font-style: italic;
    font-size: 0.78rem;
    color: var(--accent-2);
    border: 1px solid var(--accent);
    border-radius: 0;
    padding: 0.15em 0.7em;
    background: transparent;
    text-decoration: none;
}
.cat-chip:hover { border-color: var(--accent-2); text-decoration: none; }

/* --- контент записи/страницы --- */
.entry-header { margin-bottom: 1.8rem; }
.entry-title { font-size: 2.4rem; margin: 0.6rem 0 0.8rem; }
.entry-thumb { margin-bottom: 1.8rem; }
.entry-thumb img { display: block; width: 100%; height: auto; }
.entry-content { font-size: 1.02rem; }
.entry-content h2 { margin-top: 2.2rem; }
.entry-content ul, .entry-content ol { padding-left: 1.2rem; }
.entry-content ul { list-style: none; padding-left: 0; }
.entry-content ul li { position: relative; padding-left: 1.5rem; margin-bottom: 0.5rem; }
.entry-content ul li::before { content: "›"; position: absolute; left: 0.2rem; top: -0.05em; color: var(--accent); font-weight: 700; font-size: 1.15rem; }
.entry-content img { display: block; height: auto; }
.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(--line); }
.entry-content th, .entry-content td { padding: 0.7rem 0.9rem; text-align: left; }
.entry-content th { background: var(--head-bg); font-family: var(--font-head); }

/* --- сайдбар --- */
.sidebar { background: var(--bg); box-shadow: inset 0 2px 10px rgba(30, 42, 54, 0.06); padding: 1.6rem 1.5rem; }
.sidebar .widget { margin-bottom: 2rem; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title { font-size: 1.1rem; margin: 0 0 1rem; color: var(--text); }
.sidebar .widget, .sidebar .widget p, .sidebar .widget li { color: var(--text); }
.sidebar .widget a { color: var(--text); text-decoration-color: var(--line); }
.sidebar .widget a:hover { color: var(--text); text-decoration-color: var(--accent); }
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { position: relative; padding-left: 1.2rem; margin-bottom: 0.75rem; font-size: 0.95rem; }
.sidebar .widget li::before { content: "›"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.sidebar .widget .post-date { display: block; font-size: 0.8rem; color: var(--muted); }

/* --- поиск --- */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
.search-form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.search-form .search-field {
    width: 100%;
    min-width: 0;
    padding: 0.7em 0.9em;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #FFFFFF;
    color: var(--text);
    font-family: var(--font-text);
    font-size: 0.95rem;
}
.search-form .search-field:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.search-form label { flex: 1 1 200px; margin: 0; }

/* --- пагинация --- */
.pager { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2.8rem; }
.pager .page-numbers {
    display: inline-block;
    min-width: 42px;
    text-align: center;
    padding: 0.5em 0.85em;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text);
    background: var(--bg-alt);
    text-decoration: none;
    font-family: var(--font-head);
    font-size: 0.92rem;
}
.pager a.page-numbers:hover { border-color: var(--accent-2); box-shadow: 0 2px 0 0 rgba(27, 42, 59, 0.15); }
.pager .page-numbers.current { border-color: var(--accent); background: var(--head-bg); font-weight: 700; }
.pager .page-numbers.dots { border-color: transparent; background: transparent; }

/* --- комментарии --- */
.comments-area { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.comment-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.comment-list .children { list-style: none; margin: 1rem 0 0 1.6rem; padding: 0; }
.comment-item { border: 1px solid var(--line); background: var(--bg-alt); padding: 1.1rem 1.3rem; margin-bottom: 1rem; }
.comment-head { font-family: var(--font-head); font-size: 0.92rem; margin-bottom: 0.5rem; }
.comment-author { font-weight: 700; }
.comment-date { color: var(--muted); font-size: 0.82rem; }
.comment-text p:last-child { margin-bottom: 0; }
.comment-reply { font-size: 0.85rem; margin-top: 0.6rem; }
.comment-form { display: block; }
.comment-form p { margin-bottom: 1rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 0.7em 0.9em;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-family: var(--font-text);
    font-size: 0.95rem;
    color: var(--text);
    background: #FFFFFF;
}
.comment-form .submit {
    font-family: var(--font-head);
    font-weight: 600;
    padding: 0.72em 1.5em;
    border: 1px solid var(--accent);
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}
.comment-form .submit:hover { border-color: var(--accent-2); background: rgba(106, 142, 155, 0.10); box-shadow: 0 2px 0 0 rgba(27, 42, 59, 0.18); }

/* --- 404 --- */
.error-box { padding: 2.5rem 2.2rem; background: linear-gradient(135deg, #E8EEF4 0%, #DCE4EC 100%); }
.error-box h1 { font-size: 2.6rem; }

/* --- подвал --- */
.site-footer { background: var(--foot-bg); color: #C7D2DC; padding: 3.5rem 0 2rem; margin-top: 2rem; }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.site-footer .widget-title { color: #FFFFFF; font-size: 1.05rem; margin: 0 0 1rem; }
.site-footer .widget, .site-footer .widget p, .site-footer .widget li { color: #C7D2DC; font-size: 0.94rem; }
.site-footer .widget a { color: #E6ECF2; text-decoration-color: rgba(230, 236, 242, 0.4); }
.site-footer .widget a:hover { color: #FFFFFF; text-decoration-color: var(--accent); }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li { position: relative; padding-left: 1.2rem; margin-bottom: 0.65rem; }
.site-footer .widget li::before { content: "›"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.site-footer .widget .post-date { display: block; font-size: 0.8rem; color: #93A5B3; }
.footer-bottom { margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid rgba(199, 210, 220, 0.2); font-size: 0.85rem; color: #93A5B3; }
.footer-bottom .foot-name { display: block; margin-top: 0.3rem; max-width: 90ch; }

/* --- cookie --- */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.4rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.6rem;
    background: var(--foot-bg);
    color: #D7E0E8;
    border-top: 2px solid var(--accent);
}
.cookie-banner p { margin: 0; font-size: 0.9rem; max-width: 80ch; }
.cookie-banner .btn { color: #F2F6FA; }

/* --- адаптив --- */
@media (max-width: 960px) {
    h1 { font-size: 2.4rem; }
    .entry-title { font-size: 2rem; }
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
    .layout-single { width: 100%; }
    .fs-inner, .hero-box { width: 100%; }
    .section-head { margin-left: 0; }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cards-grid, .no-sidebar .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .zigzag-row, .zigzag-row.mirror { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
    .zigzag-row.mirror .zz-text, .zigzag-row.mirror .zz-art { order: 0; }
    .zz-art { max-width: 300px; }
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nav-toggle { display: inline-block; }
    .main-nav { flex-basis: 100%; }
    .main-nav .nav-list { flex-direction: column; gap: 0.8rem; padding-top: 1rem; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.95rem; }
    h2 { font-size: 1.5rem; }
    .entry-title { font-size: 1.7rem; }
    .front-section { padding: 3.2rem 0; }
    .hero-inner { padding: 3.6rem 0 3.2rem; }
    .hero::after { width: 180px; height: 180px; }
    .stats-row { grid-template-columns: minmax(0, 1fr); }
    .stat-item { padding: 1.2rem 1.2rem; }
    .latest-grid, .cards-grid, .no-sidebar .cards-grid { grid-template-columns: minmax(0, 1fr); }
    .card-thumb { width: 100%; }
    .gloss-item { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
    .footer-cols { grid-template-columns: minmax(0, 1fr); }
    .error-box { padding: 1.8rem 1.4rem; }
    .blockquote, blockquote { padding: 1.2rem 1.2rem; }
    .sidebar { padding: 1.3rem 1.2rem; }
    .cookie-banner { padding: 1rem 1.2rem; }
}
