/*
Theme Name: instarguide.com
Author: Алексей Воронов
Description: Аналитическая тема для блога об инвестициях в недвижимость и упаковке проектов девелоперов. Сдержанно-деловой стиль с тёмно-синими, графитовыми и золотисто-песочными акцентами.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: instarguide
*/

/* ============================================================
   Переменные и базовые стили
   ============================================================ */
:root {
    --bg: #F8F9FA;
    --text: #1E2A32;
    --accent: #D4AF37;
    --indigo: #0B1C2F;
    --terracotta: #B45F3B;
    --graphite: #5A6670;
    --white: #FFFFFF;
    --border: #D9DDE1;
    --indigo-soft: #14304b;
}

* { box-sizing: border-box; }

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

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

::selection {
    background: rgba(212, 175, 55, 0.3);
}
::-moz-selection {
    background: rgba(212, 175, 55, 0.3);
}

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

a {
    color: #9a7d12;
    text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    color: var(--indigo);
    line-height: 1.25;
    margin: 0 0 0.6em;
    font-weight: 700;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

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

blockquote {
    margin: 1.5em 0;
    padding: 0.8em 1.2em;
    border-left: 4px solid var(--terracotta);
    background: #fbf3ef;
    color: #4a3a32;
    font-style: italic;
}

code, pre {
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
    background: #eef0f2;
    border-radius: 4px;
}
code { padding: 2px 5px; font-size: 0.9em; }
pre {
    padding: 14px 16px;
    overflow-x: auto;
    border: 1px solid var(--border);
}

/* Таблицы — видимые границы */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    border: 1px solid var(--indigo);
}
th, td {
    border: 1px solid #c4cdd5;
    padding: 10px 12px;
    text-align: left;
}
th {
    background: var(--indigo);
    color: var(--white);
    font-weight: 600;
}
/* Таблицы внутри статей — тёмно-синяя сетка с золотыми линиями */
.entry-content table th { border-color: var(--accent); }
.entry-content table td { border-color: rgba(212, 175, 55, 0.35); }

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================================
   Контейнер ширины — единственный источник ограничения
   ============================================================ */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

/* ============================================================
   Кнопки
   ============================================================ */
.btn {
    display: inline-block;
    font-size: 0.97rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, transform .12s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary {
    padding: 12px 26px;
    border-radius: 6px;
    border: 2px solid var(--accent);
    background: var(--accent);
    color: var(--indigo);
}
.btn-primary:hover {
    background: var(--indigo);
    color: var(--accent);
    transform: translateY(2px);
}

.btn-secondary {
    padding: 10px 22px;
    border-radius: 6px;
    border: 1px solid var(--indigo);
    background: transparent;
    color: var(--indigo);
    border-bottom: 1px solid var(--indigo);
}
.btn-secondary:hover {
    color: var(--indigo);
    border-bottom-color: var(--accent);
    box-shadow: inset 0 -2px 0 var(--accent);
}

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--white);
    border-bottom: 3px solid var(--indigo);
}
.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px 28px;
    padding: 20px 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1;
}
.brand-logo,
.brand .logo-fallback {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    display: block;
}
.brand-text { min-width: 0; }
.site-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--indigo);
    margin: 0;
    line-height: 1.3;
}
.site-title a { color: var(--indigo); }
.site-title a:hover { text-decoration: none; color: #9a7d12; }
.owner-name {
    color: var(--graphite);
    font-size: 0.82rem;
    font-weight: 500;
}
.owner-name .divider {
    margin: 0 7px;
    color: var(--border);
}
.site-desc {
    margin: 6px 0 0;
    color: var(--graphite);
    font-size: 0.86rem;
    line-height: 1.5;
}

/* Навигация */
.main-nav {
    border-top: 1px solid var(--border);
    background: var(--white);
}
.nav-toggle {
    display: none;
    margin: 10px 0;
    padding: 9px 16px;
    border: 1px solid var(--indigo);
    border-radius: 6px;
    background: var(--white);
    color: var(--indigo);
    font-size: 0.95rem;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 28px;
}
.main-nav li { position: relative; }
.main-nav a {
    display: block;
    padding: 14px 2px;
    color: var(--indigo);
    font-weight: 600;
    font-size: 0.97rem;
}
.main-nav a:hover {
    text-decoration: none;
    color: #9a7d12;
}
.main-nav .current-menu-item > a {
    box-shadow: inset 0 -3px 0 var(--accent);
}

/* ============================================================
   Раскладки
   ============================================================ */
.site-main { padding: 34px 0 56px; }

.layout-with-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 38px;
    align-items: flex-start;
}
.layout-with-sidebar .content-area {
    flex: 1 1 0;
    min-width: 0;
    width: 67%;
}
.layout-with-sidebar .sidebar {
    flex: 0 0 27%;
    min-width: 0;
}
.layout-single .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.layout-single.full .content-area { width: 85%; }

/* ============================================================
   Хлебные крошки
   ============================================================ */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--graphite);
    margin: 0 0 22px;
}
.breadcrumbs a { color: #9a7d12; }
.breadcrumbs .sep {
    margin: 0 7px;
    color: var(--border);
}

/* ============================================================
   Карточки записей (вертикальные, сетка)
   ============================================================ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
    gap: 26px;
}
.card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: 0;
}
.card-thumb-wrap {
    overflow: hidden;
    background: var(--indigo);
}
.card-thumb-wrap img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
}
.card-thumb-wrap a:hover img { transform: scale(1.04); }
.card-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    background: linear-gradient(135deg, var(--indigo), var(--indigo-soft));
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
}
.card-meta {
    font-size: 0.78rem;
    color: var(--graphite);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 8px;
}
.card-title {
    font-size: 1.12rem;
    margin: 0 0 10px;
}
.card-title a { color: var(--indigo); }
.card-title a:hover { color: #9a7d12; text-decoration: none; }
.card-excerpt {
    color: #404a52;
    font-size: 0.95rem;
}
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}
.card-actions {
    margin-top: auto;
    padding-top: 14px;
}

/* ============================================================
   Запись и страница
   ============================================================ */
.entry-header { margin-bottom: 20px; }
.entry-title { font-size: 2rem; }
.entry-meta {
    font-size: 0.85rem;
    color: var(--graphite);
    margin-top: 6px;
}
.entry-thumb {
    margin: 0 0 24px;
    border-radius: 6px;
    overflow: hidden;
}
.entry-thumb img { display: block; width: 100%; }
.entry-content { font-size: 1.03rem; }
.entry-content img { border-radius: 6px; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content a { text-decoration: underline; }

.post-list-item {
    padding: 22px 0;
    border-bottom: 1px solid var(--border);
}
.post-list-item:first-child { padding-top: 0; }

/* ============================================================
   Пагинация
   ============================================================ */
.pagination {
    margin: 38px 0 0;
}
.pagination .page-numbers {
    display: inline-block;
    min-width: 42px;
    padding: 9px 12px;
    margin: 0 4px 8px 0;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    color: var(--indigo);
    font-weight: 600;
    font-size: 0.92rem;
}
.pagination a.page-numbers:hover {
    text-decoration: none;
    border-color: var(--accent);
    color: #9a7d12;
}
.pagination .page-numbers.current {
    background: var(--indigo);
    border-color: var(--indigo);
    color: var(--accent);
}
.pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
}

/* ============================================================
   Сайдбар и виджеты — светлый фон, тёмный текст
   ============================================================ */
.sidebar .widget {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 22px;
    color: var(--text);
}
.sidebar .widget-title {
    font-size: 1.05rem;
    color: var(--indigo);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
}
.sidebar .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar .widget li {
    padding: 7px 0;
    border-bottom: 1px solid #eef0f2;
}
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget a { color: #34404a; }
.sidebar .widget a:hover { color: #9a7d12; }
.sidebar .widget .post-date {
    display: block;
    font-size: 0.78rem;
    color: var(--graphite);
}

/* ============================================================
   Cookie-баннер  (правило скрытия — ДО основного блока стилей)
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: var(--indigo);
    color: #e6e9ec;
    border-top: 2px solid var(--accent);
}
.cookie-banner .cookie-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 24px;
    padding: 16px 0;
}
.cookie-banner p {
    margin: 0;
    font-size: 0.9rem;
    flex: 1;
    min-width: 240px;
}
.cookie-banner a { color: var(--accent); }

/* ============================================================
   Подвал — тёмный фон, светлый текст виджетов
   ============================================================ */
.site-footer {
    background: var(--indigo);
    color: #c4ccd3;
    margin-top: auto;
}
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px;
    padding: 46px 0 36px;
}
.footer-col { min-width: 0; }
.footer-col .widget { color: #c4ccd3; }
.footer-col .widget-title {
    color: var(--white);
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
}
.footer-col .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-col .widget li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-col .widget li:last-child { border-bottom: none; }
.footer-col .widget a { color: #e2b94a; }
.footer-col .widget a:hover { color: var(--white); }
.footer-col .widget p { color: #c4ccd3; }
.footer-col .widget .post-date {
    display: block;
    font-size: 0.78rem;
    color: #8e99a3;
}
.site-info {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 18px 0;
    font-size: 0.83rem;
    color: #8e99a3;
}

/* ============================================================
   Главная страница
   ============================================================ */
.home-section { padding: 0 0 18px; }
.home-section + .home-section { padding-top: 30px; }
.section-head {
    margin-bottom: 22px;
}
.section-head .eyebrow {
    display: block;
    color: var(--terracotta);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 6px;
}
.section-head h2 { margin: 0; }

/* Hero — ключевая цифра недели */
.hero-figure {
    background: var(--indigo);
    color: #d6dde3;
    border-radius: 8px;
    padding: 48px 44px;
    background-image:
        linear-gradient(rgba(212, 175, 55, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, 0.06) 1px, transparent 1px);
    background-size: 38px 38px;
}
.hero-figure .eyebrow {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
}
.hero-number {
    font-size: 80px;
    line-height: 1;
    font-weight: 800;
    color: var(--accent);
    margin: 14px 0 10px;
}
.hero-conclusion {
    font-size: 1.15rem;
    color: var(--white);
    max-width: 640px;
}
.hero-actions { margin-top: 22px; }
.hero-actions .btn-secondary {
    border-color: var(--accent);
    color: var(--accent);
}
.hero-actions .btn-secondary:hover {
    box-shadow: inset 0 -2px 0 var(--white);
}

/* Истории, которые продают — карточки с ROI-маркерами */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 24px;
}
.story-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: var(--white);
    border: 1px solid var(--border);
    min-width: 0;
}
.story-photo {
    height: 170px;
    background: linear-gradient(125deg, var(--indigo) 0%, var(--indigo-soft) 55%, var(--terracotta) 160%);
    clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%);
}
.roi-marker {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--accent);
    color: var(--indigo);
    font-weight: 800;
    font-size: 0.9rem;
    padding: 7px 12px;
    border-radius: 6px;
}
.story-body { padding: 18px 20px 22px; }
.story-body h3 { margin-bottom: 8px; }
.story-body p { font-size: 0.95rem; color: #404a52; }

/* Направления */
.directions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 18px;
}
.direction-card {
    min-width: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    padding: 20px 20px 22px;
}
.direction-card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.direction-card p { font-size: 0.9rem; color: #404a52; margin: 0; }

/* Инвест-календарь + контакты */
.calendar-block {
    background: var(--indigo);
    color: #d6dde3;
    border-radius: 8px;
    padding: 36px 40px;
}
.calendar-block .section-head h2 { color: var(--white); }
.calendar-block .eyebrow { color: var(--accent); }
.calendar-list {
    list-style: none;
    margin: 0 0 26px;
    padding: 0;
}
.calendar-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.calendar-list li:last-child { border-bottom: none; }
.calendar-date {
    flex: 0 0 110px;
    color: var(--accent);
    font-weight: 700;
}
.calendar-event { min-width: 0; color: var(--white); }
.contact-static {
    margin-top: 8px;
    font-size: 0.95rem;
}
.contact-static a { color: var(--accent); }

/* Ротатор (slider.js) */
.rotator {
    position: relative;
    background: #fbf3ef;
    border-left: 4px solid var(--terracotta);
    border-radius: 6px;
    padding: 26px 30px;
}
.rotator-slide { display: none; }
.rotator-slide.is-active { display: block; }
.rotator-slide blockquote {
    margin: 0;
    border: none;
    background: none;
    padding: 0;
    font-size: 1.1rem;
}
.rotator-slide cite {
    display: block;
    margin-top: 10px;
    font-style: normal;
    font-weight: 700;
    color: var(--indigo);
}
.rotator-dots {
    margin-top: 16px;
    display: flex;
    gap: 8px;
}
.rotator-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: none;
    background: #d9c9bf;
    cursor: pointer;
    padding: 0;
}
.rotator-dot.is-active { background: var(--terracotta); }

/* ============================================================
   Поиск
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--white);
    color: var(--text);
}
.search-form .search-submit {
    padding: 10px 20px;
    border: 2px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: var(--indigo);
    font-weight: 600;
    cursor: pointer;
}
.search-form .search-submit:hover {
    background: var(--indigo);
    color: var(--accent);
}
.sidebar .widget .search-form { margin: 0; }

/* ============================================================
   404
   ============================================================ */
.error-404 {
    text-align: center;
    padding: 30px 0 10px;
}
.error-404 .code {
    font-size: 84px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}
.error-404 .search-form {
    max-width: 460px;
    margin: 24px auto 18px;
    justify-content: center;
}

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area {
    margin-top: 44px;
    padding-top: 28px;
    border-top: 2px solid var(--border);
}
.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.comment-list ul.children {
    list-style: none;
    margin: 0;
    padding-left: 28px;
}
.comment-body {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.comment-author { font-weight: 700; color: var(--indigo); }
.comment-meta {
    font-size: 0.8rem;
    color: var(--graphite);
    margin-bottom: 6px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--white);
    color: var(--text);
}
.comment-form p { margin-bottom: 14px; }
.comment-form .form-submit input {
    padding: 12px 26px;
    border: 2px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: var(--indigo);
    font-weight: 600;
    cursor: pointer;
}
.comment-form .form-submit input:hover {
    background: var(--indigo);
    color: var(--accent);
}

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 960px) {
    .layout-with-sidebar { display: block; }
    .layout-with-sidebar .content-area,
    .layout-with-sidebar .sidebar {
        width: 100%;
    }
    .layout-with-sidebar .sidebar { margin-top: 38px; }
    .footer-widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-number { font-size: 62px; }
    .layout-single .content-area { width: 92%; }
    .layout-single.full .content-area { width: 92%; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1, .entry-title { font-size: 1.6rem; }
    .nav-toggle { display: block; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        gap: 0;
        padding-bottom: 10px;
    }
    .main-nav ul.is-open { display: flex; }
    .main-nav a { padding: 11px 2px; }
    .footer-widgets { grid-template-columns: minmax(0, 1fr); }
    .hero-figure { padding: 32px 24px; }
    .hero-number { font-size: 52px; }
    .calendar-block { padding: 26px 22px; }
    .calendar-date { flex-basis: 100%; }
    .layout-single .content-area,
    .layout-single.full .content-area { width: 100%; }
}
