/*
Theme Name: dds_ivansantiagobravo.com
Author: Иван Сантьяго Браво
Description: Информационная тема для портала о долгосрочных инвестициях в жилую недвижимость с аналитикой рынка и практическими рекомендациями.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: domvest
*/

/* =========================================================
   Переменные и базовый сброс
   ========================================================= */
:root{
    --ink:#16213a;
    --brand:#1f3a5f;
    --brand-deep:#13243b;
    --accent:#c08a2d;
    --accent-soft:#e7c989;
    --text:#28313f;
    --muted:#5d6776;
    --line:#e2e7ef;
    --soft:#f4f6fa;
    --soft-2:#eef2f8;
    --white:#ffffff;
    --footer-bg:#13223b;
    --footer-text:#cdd6e6;
    --footer-head:#ffffff;
    --radius:10px;
    --shadow:0 10px 30px rgba(19,34,59,.08);
    --maxw:1180px;
}

*{box-sizing:border-box;}

html{scroll-behavior:smooth;}

body{
    margin:0;
    font-family:"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
    color:var(--text);
    background:var(--white);
    line-height:1.65;
    font-size:17px;
    overflow-x:hidden;
}

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

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

h1,h2,h3,h4{color:var(--ink);line-height:1.25;font-weight:700;margin:0 0 .6em;}
h1{font-size:2.1rem;}
h2{font-size:1.7rem;}
h3{font-size:1.25rem;}
p{margin:0 0 1.1em;}

/* контейнер ширины — единственное место */
.shell{
    width:min(92%,var(--maxw));
    margin-inline:auto;
}

.site-main{display:block;padding-bottom:10px;}

/* =========================================================
   Шапка
   ========================================================= */
.site-header{
    background:var(--white);
    border-bottom:1px solid var(--line);
}
.header-inner{
    display:flex;
    align-items:center;
    gap:24px;
    padding:18px 0;
    flex-wrap:wrap;
}
.brand{
    display:flex;
    align-items:center;
    gap:14px;
    min-width:0;
    flex:1;
}
.brand-logo-link{display:inline-flex;flex:0 0 auto;}
.brand-logo{display:block;height:52px;width:auto;}
.brand-text{display:flex;flex-direction:column;min-width:0;}
.brand-name{
    font-weight:700;
    color:var(--ink);
    font-size:1.02rem;
    line-height:1.3;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
}
.brand-desc{
    color:var(--muted);
    font-size:.82rem;
    line-height:1.4;
    margin-top:3px;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
}

/* навигация */
.primary-nav{margin-left:auto;}
.primary-nav .menu{
    list-style:none;
    margin:0;padding:0;
    display:flex;
    gap:6px;
    flex-wrap:wrap;
}
.primary-nav .menu a{
    display:block;
    padding:9px 14px;
    color:var(--ink);
    font-weight:600;
    border-radius:6px;
    font-size:.96rem;
}
.primary-nav .menu a:hover,
.primary-nav .menu .current-menu-item>a{
    background:var(--soft-2);
    color:var(--brand);
}

.nav-toggle{
    display:none;
    flex-direction:column;
    gap:5px;
    width:44px;height:40px;
    padding:9px;
    background:var(--soft);
    border:1px solid var(--line);
    border-radius:8px;
    cursor:pointer;
    margin-left:auto;
}
.nav-toggle span{display:block;height:2px;width:100%;background:var(--ink);border-radius:2px;}

/* =========================================================
   Хлебные крошки
   ========================================================= */
.breadcrumbs{background:var(--soft);border-bottom:1px solid var(--line);}
.breadcrumbs-inner{padding:12px 0;font-size:.9rem;color:var(--muted);}
.breadcrumbs a{color:var(--brand);}
.breadcrumbs .sep{color:var(--muted);margin:0 4px;}
.breadcrumbs span{color:var(--muted);}

/* =========================================================
   Раскладки контента
   ========================================================= */
.layout{padding:40px 0;}
.layout-with-sidebar{
    display:grid;
    grid-template-columns:minmax(0,67fr) minmax(0,27fr);
    gap:40px;
    align-items:start;
}
.layout-single{display:block;}
.content-area{min-width:0;}

/* =========================================================
   Секции главной (full-bleed фон + внутренний .shell)
   ========================================================= */
.home-section{padding:64px 0;}
.home-section--soft{background:var(--soft);}
.home-section--deep{background:var(--brand-deep);color:#dfe6f1;}
.home-section--deep h2,
.home-section--deep h3{color:#fff;}
.section-head{margin-bottom:34px;max-width:760px;}
.section-head .eyebrow{
    display:inline-block;
    color:var(--accent);
    font-weight:700;
    letter-spacing:.08em;
    text-transform:uppercase;
    font-size:.78rem;
    margin-bottom:10px;
}

/* блок: текст + иллюстрация */
.split{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:48px;
    align-items:center;
}
.split--reverse .split-media{order:-1;}
.split-media img{
    display:block;
    width:100%;
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}
.split-text{min-width:0;}
.split-text .lead{font-size:1.12rem;color:var(--ink);}

/* блок: сетка карточек-преимуществ */
.feature-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:24px;
}
.feature{
    background:var(--white);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:26px 22px;
    min-width:0;
}
.feature .feature-icon{
    width:46px;height:46px;
    display:flex;align-items:center;justify-content:center;
    background:var(--soft-2);
    border-radius:10px;
    margin-bottom:16px;
    color:var(--brand);
}
.feature h3{font-size:1.08rem;margin-bottom:8px;}
.feature p{color:var(--muted);font-size:.96rem;margin:0;}

/* блок: пошаговый */
.steps{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:22px;
    counter-reset:step;
}
.step{
    position:relative;
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.14);
    border-radius:var(--radius);
    padding:26px 22px 22px;
    min-width:0;
}
.home-section--deep .step p{color:#c4cfe0;margin:0;font-size:.95rem;}
.step .step-num{
    display:inline-flex;
    align-items:center;justify-content:center;
    width:40px;height:40px;
    border-radius:50%;
    background:var(--accent);
    color:#1c1303;
    font-weight:800;
    margin-bottom:14px;
}
.step h3{font-size:1.05rem;}

/* блок: FAQ */
.faq{max-width:840px;}
.faq details{
    background:var(--white);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:0;
    margin-bottom:14px;
    overflow:hidden;
}
.faq summary{
    cursor:pointer;
    list-style:none;
    padding:18px 22px;
    font-weight:600;
    color:var(--ink);
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:center;
}
.faq summary::-webkit-details-marker{display:none;}
.faq summary::after{content:"+";color:var(--accent);font-size:1.4rem;line-height:1;}
.faq details[open] summary::after{content:"–";}
.faq .faq-body{padding:0 22px 18px;color:var(--muted);}
.faq .faq-body p{margin:0;}

/* последние записи на главной */
.latest-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:28px;
}
.home-cta{margin-top:30px;}

/* =========================================================
   Карточка записи
   ========================================================= */
.card{
    display:flex;
    flex-direction:column;
    background:var(--white);
    border:1px solid var(--line);
    border-radius:var(--radius);
    overflow:hidden;
    min-width:0;
    transition:box-shadow .2s ease,transform .2s ease;
}
.card:hover{box-shadow:var(--shadow);transform:translateY(-3px);}
.card-thumb{display:block;}
.card-thumb img{
    display:block;
    width:100%;
    aspect-ratio:16/10;
    object-fit:cover;
}
.card-thumb--placeholder{
    aspect-ratio:16/10;
    background:linear-gradient(135deg,var(--brand) 0%,var(--brand-deep) 100%);
    display:flex;align-items:center;justify-content:center;
}
.card-thumb--placeholder span{color:var(--accent-soft);font-weight:700;letter-spacing:.05em;font-size:.85rem;}
.card-body{
    flex:1;
    display:flex;
    flex-direction:column;
    padding:20px 22px 22px;
    min-width:0;
}
.card .entry-meta{font-size:.82rem;color:var(--muted);margin-bottom:8px;}
.card .entry-meta a{color:var(--accent);}
.card-title{font-size:1.16rem;margin:0 0 10px;}
.card-title a{color:var(--ink);}
.card-title a:hover{color:var(--brand);}
.card-excerpt{color:var(--muted);font-size:.96rem;flex:1;}
.card-excerpt p{margin:0 0 .5em;background:none;}
.card-more{
    margin-top:14px;
    align-self:flex-start;
    font-weight:600;
    color:var(--brand);
}
.card-more:hover{color:var(--accent);}

/* =========================================================
   Запись / страница
   ========================================================= */
.entry{background:var(--white);}
.entry-header{margin-bottom:24px;}
.entry-title{font-size:2rem;margin-bottom:10px;}
.entry-thumb{margin:0 0 26px;border-radius:var(--radius);overflow:hidden;}
.entry-thumb img{display:block;width:100%;height:auto;}
.entry-content{font-size:1.04rem;}
.entry-content img{border-radius:var(--radius);}
.entry-content h2,.entry-content h3{margin-top:1.4em;}
.entry-content ul,.entry-content ol{padding-left:1.3em;}
.entry-content blockquote{
    margin:1.4em 0;
    padding:14px 22px;
    border-left:4px solid var(--accent);
    background:var(--soft);
    color:var(--ink);
}

/* таблицы */
table{border-collapse:collapse;width:100%;margin:1.4em 0;}
table,th,td{border:1px solid var(--line);}
th,td{padding:10px 12px;text-align:left;}
th{background:var(--soft-2);color:var(--ink);}

/* =========================================================
   Сайдбар и виджеты
   ========================================================= */
.sidebar{min-width:0;}
.sidebar .widget{
    background:var(--soft);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:22px;
    margin-bottom:24px;
    color:var(--text);
}
.sidebar .widget-title{
    font-size:1.05rem;
    color:var(--ink);
    margin-bottom:14px;
    padding-bottom:10px;
    border-bottom:2px solid var(--accent);
}
.sidebar .widget ul{list-style:none;margin:0;padding:0;}
.sidebar .widget li{padding:8px 0;border-bottom:1px solid var(--line);}
.sidebar .widget li:last-child{border-bottom:none;}
.sidebar .widget a{color:var(--brand);}
.sidebar .widget a:hover{color:var(--accent);}
.sidebar .widget .post-date{display:block;color:var(--muted);font-size:.8rem;}

/* =========================================================
   Пагинация
   ========================================================= */
.pagination{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:40px 0 10px;
    justify-content:center;
}
.pagination .page-numbers{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:42px;
    height:42px;
    padding:0 12px;
    border:1px solid var(--line);
    border-radius:8px;
    color:var(--brand);
    font-weight:600;
    background:var(--white);
}
.pagination a.page-numbers:hover{border-color:var(--accent);color:var(--accent);}
.pagination .page-numbers.current{
    background:var(--brand);
    border-color:var(--brand);
    color:#fff;
}
.pagination .page-numbers.dots{border:none;background:none;}

/* =========================================================
   Комментарии
   ========================================================= */
.comments-area{margin-top:46px;padding-top:30px;border-top:1px solid var(--line);}
.comments-title,.comment-reply-title{font-size:1.3rem;margin-bottom:20px;}
.comment-list{list-style:none;margin:0;padding:0;}
.comment-list .children{list-style:none;margin:0 0 0 28px;padding:0;}
.comment-body{
    padding:18px 20px;
    border:1px solid var(--line);
    border-radius:var(--radius);
    margin-bottom:18px;
    background:var(--white);
}
.comment-meta{display:flex;align-items:center;gap:12px;margin-bottom:10px;}
.comment-avatar img{border-radius:50%;display:block;}
.comment-author{font-weight:700;color:var(--ink);}
.comment-date{display:block;font-size:.8rem;color:var(--muted);}
.comment-awaiting{color:var(--accent);font-style:italic;}
.comment-reply a{font-weight:600;font-size:.9rem;}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea{
    width:100%;
    padding:11px 14px;
    border:1px solid var(--line);
    border-radius:8px;
    font:inherit;
    background:var(--white);
    color:var(--text);
}
.comment-form label{display:block;font-weight:600;margin-bottom:6px;}
.comment-form p{margin-bottom:16px;}
.form-submit input,
.comment-form .submit{
    background:var(--brand);
    color:#fff;
    border:none;
    padding:12px 26px;
    border-radius:8px;
    font-weight:700;
    cursor:pointer;
}
.form-submit input:hover{background:var(--accent);}

/* =========================================================
   Форма поиска
   ========================================================= */
.search-form{display:flex;gap:8px;}
.search-form .search-field{
    flex:1;
    min-width:0;
    padding:11px 14px;
    border:1px solid var(--line);
    border-radius:8px;
    font:inherit;
    background:var(--white);
    color:var(--text);
}
.search-form .search-submit{
    background:var(--brand);
    color:#fff;
    border:none;
    padding:0 20px;
    border-radius:8px;
    font-weight:700;
    cursor:pointer;
}
.search-form .search-submit:hover{background:var(--accent);}

/* =========================================================
   404
   ========================================================= */
.error-404{text-align:center;padding:60px 0;}
.error-404 .code{font-size:5rem;font-weight:800;color:var(--accent);line-height:1;}
.error-404 .search-form{max-width:480px;margin:24px auto 0;}
.btn{
    display:inline-block;
    background:var(--brand);
    color:#fff;
    padding:12px 26px;
    border-radius:8px;
    font-weight:700;
    margin-top:18px;
}
.btn:hover{background:var(--accent);color:#fff;}

/* =========================================================
   Подвал
   ========================================================= */
.site-footer{background:var(--footer-bg);color:var(--footer-text);margin-top:50px;}
.footer-cols{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:36px;
    padding:54px 0 36px;
}
.footer-col{min-width:0;}
.footer-col .widget{margin:0;color:var(--footer-text);}
.footer-col .widget-title{
    color:var(--footer-head);
    font-size:1.05rem;
    margin-bottom:16px;
}
.footer-col .widget p{color:var(--footer-text);}
.footer-col .widget ul{list-style:none;margin:0;padding:0;}
.footer-col .widget li{padding:6px 0;}
.footer-col .widget a{color:var(--accent-soft);}
.footer-col .widget a:hover{color:#fff;}
.footer-bottom{
    border-top:1px solid rgba(255,255,255,.12);
    padding:22px 0;
}
.footer-bottom .copyright{margin:0;font-size:.88rem;color:var(--footer-text);}

/* =========================================================
   Cookie-баннер (правило [hidden] до основного блока)
   ========================================================= */
.cookie-banner[hidden]{display:none !important;}
.cookie-banner{
    position:fixed;
    left:0;right:0;bottom:0;
    z-index:999;
    background:var(--ink);
    color:#e8edf6;
    display:flex;
    align-items:center;
    gap:18px;
    flex-wrap:wrap;
    padding:16px 22px;
    box-shadow:0 -6px 24px rgba(0,0,0,.2);
}
.cookie-banner .cookie-text{margin:0;flex:1;min-width:200px;font-size:.92rem;}
.cookie-banner .cookie-accept{
    background:var(--accent);
    color:#1c1303;
    border:none;
    padding:11px 24px;
    border-radius:8px;
    font-weight:700;
    cursor:pointer;
}
.cookie-banner .cookie-accept:hover{background:var(--accent-soft);}

/* =========================================================
   Адаптив
   ========================================================= */
@media (max-width:960px){
    .layout-with-sidebar{grid-template-columns:1fr;}
    .feature-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
    .steps{grid-template-columns:repeat(2,minmax(0,1fr));}
    .latest-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
    .split{grid-template-columns:1fr;gap:30px;}
    .split--reverse .split-media{order:0;}
    h1,.entry-title{font-size:1.7rem;}
    h2{font-size:1.45rem;}
}

@media (max-width:600px){
    body{font-size:16px;}
    .nav-toggle{display:flex;}
    .primary-nav{
        flex-basis:100%;
        margin-left:0;
        display:none;
    }
    .primary-nav.is-open{display:block;}
    .primary-nav .menu{flex-direction:column;gap:2px;}
    .primary-nav .menu a{padding:12px 10px;border-radius:6px;}
    .feature-grid,.steps,.latest-grid,.footer-cols{grid-template-columns:1fr;}
    .home-section{padding:46px 0;}
    .brand-name{font-size:.95rem;}
}
