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

/* ====================  БАЗА  ==================== */
:root {
    --indigo: #0B1D3C;
    --blue: #1E6EE9;
    --teal: #00B4D8;
    --light: #F4F7FC;
    --ink: #1A1F2E;
    --muted: #5A6874;
    --line: #E2E8F2;
    --white: #FFFFFF;
    --gap: 24px;
    --radius: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    color: var(--ink);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 85% -10%, rgba(30, 110, 233, 0.05), transparent 45%),
                      radial-gradient(circle at 10% 5%, rgba(0, 180, 216, 0.05), transparent 40%);
    background-attachment: fixed;
}

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    color: var(--ink);
    line-height: 1.25;
    margin: 0 0 0.6em;
    font-weight: 700;
}
h1 { font-size: 2.3rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

/* Единый контейнер ширины (A12 #7) */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

/* Кнопки (F): прямоугольные, скругление 8px, градиент при ховере, без тени */
.btn {
    display: inline-block;
    padding: 12px 22px;
    background: var(--blue);
    color: var(--white);
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.25s ease;
}
.btn:hover {
    background: linear-gradient(90deg, var(--blue), var(--teal));
    color: var(--white);
    text-decoration: none;
}

/* ====================  ШАПКА  ==================== */
.site-header {
    background: var(--indigo);
    color: var(--white);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: var(--gap);
    flex-wrap: wrap;
    padding: 18px 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 52px; width: auto; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    color: var(--white);
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.25;
}
.brand-desc {
    display: block;
    color: #AFC0DD;
    font-size: 0.8rem;
    margin-top: 2px;
}

.main-nav { margin-left: auto; min-width: 0; }
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--white);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 0.95rem;
    cursor: pointer;
}
.menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.menu a {
    display: block;
    color: #D8E2F4;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}
.menu a:hover,
.menu .current-menu-item > a {
    background: rgba(30, 110, 233, 0.25);
    color: var(--white);
    text-decoration: none;
}

/* ====================  ОСНОВА СТРАНИЦЫ  ==================== */
.site-main { padding: 32px 0 48px; }
.page-wrap { padding-top: 8px; }

/* Хлебные крошки (D4) */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 22px;
}
.breadcrumbs a { color: var(--blue); }
.breadcrumbs .sep { color: var(--muted); margin: 0 6px; }
.breadcrumbs span { color: var(--ink); }

/* Раскладки (E4/E5/E6) */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 30fr);
    gap: 32px;
    align-items: start;
}
.layout-single {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.content-area { min-width: 0; }

article.post-full,
.page-full {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
}
.entry-content { margin-top: 16px; }
.entry-content img { border-radius: var(--radius); display: block; }
.entry-title { margin-bottom: 6px; }
.entry-meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 14px; }

/* Таблицы (F) */
.entry-content table,
table.cgaas-table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 1.2em;
    border: 1px solid var(--line);
}
.entry-content th, .entry-content td,
table.cgaas-table th, table.cgaas-table td {
    border: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
}
.entry-content th, table.cgaas-table th {
    background: var(--light);
    font-weight: 600;
}

/* ====================  КАРТОЧКИ ЗАПИСЕЙ (A8/A10)  ==================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--gap);
}
.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--light);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-thumb-wrap {
    overflow: hidden;
}
.card-thumb-wrap a { display: block; }
.card-thumb-wrap img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.card-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    background: linear-gradient(135deg, var(--indigo), var(--blue));
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}
.card-title { font-size: 1.15rem; margin: 0 0 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--blue); text-decoration: none; }
.card-meta { color: var(--muted); font-size: 0.82rem; margin-bottom: 10px; }
.card-excerpt { color: var(--muted); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    align-self: flex-start;
    margin-top: auto;
}

/* ====================  ПАГИНАЦИЯ (D5)  ==================== */
.pagination { margin: 32px 0 0; }
.pagination .page-numbers {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pagination .page-numbers li { margin: 0; }
.pagination .page-numbers a,
.pagination .page-numbers span {
    display: block;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--blue);
    background: var(--white);
}
.pagination .page-numbers .current {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}
.pagination .page-numbers a:hover {
    background: var(--light);
    text-decoration: none;
}

/* ====================  ГЛАВНАЯ (E3)  ==================== */
.front-wrap {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.band { padding: 56px 0; }
.band-hero {
    background: var(--indigo);
    color: var(--white);
}
.band-hero h1 { color: var(--white); font-size: 2.6rem; }
.band-hero .lead { color: #C7D4EC; font-size: 1.15rem; max-width: 720px; }
.band-hero .btn { margin-top: 10px; }
.band-light { background: var(--light); }

.section-head { margin-bottom: 28px; }
.section-head h2 { margin-bottom: 8px; }
.section-head p { color: var(--muted); max-width: 760px; margin: 0; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--gap);
}
.feature {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    min-width: 0;
}
.band-light .feature { background: var(--white); }
.feature-icon {
    width: 46px;
    height: 46px;
    display: block;
    margin-bottom: 14px;
    color: var(--blue);
}
.feature h3 { font-size: 1.15rem; }
.feature p { color: var(--muted); margin: 0; }

/* Блок «Как это работает» — горизонтальная схема без временных меток */
.flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--gap);
}
.flow-step {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    min-width: 0;
}
.flow-step .step-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--blue), var(--teal));
    color: var(--white);
    font-weight: 700;
    margin-bottom: 12px;
}
.flow-step h3 { font-size: 1.08rem; }
.flow-step p { color: var(--muted); margin: 0; }

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--gap);
}
.metric {
    text-align: center;
    padding: 8px;
    min-width: 0;
}
.metric .metric-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--teal);
}
.metric .metric-label { color: var(--muted); }

.recent-head { margin-bottom: 26px; }

/* ====================  САЙДБАР  ==================== */
.sidebar { min-width: 0; }

/* ====================  ВИДЖЕТЫ (контраст по областям, F)  ==================== */
.widget { margin: 0 0 28px; }
.widget:last-child { margin-bottom: 0; }
.widget-title { font-size: 1.1rem; margin: 0 0 14px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { margin: 0 0 8px; padding: 0 0 8px; border-bottom: 1px solid rgba(0, 0, 0, 0.06); }
.widget li:last-child { border-bottom: none; }

/* Сайдбар — светлый фон, тёмный текст */
.sidebar .widget {
    background: var(--light);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
}
.sidebar .widget-title { color: var(--ink); }
.sidebar .widget,
.sidebar .widget li,
.sidebar .widget p { color: var(--ink); }
.sidebar .widget a { color: var(--blue); }
.sidebar .widget a:hover { color: var(--indigo); }
.sidebar .widget .post-date { color: var(--muted); font-size: 0.82rem; }

/* ====================  ПОДВАЛ (E2)  ==================== */
.site-footer {
    background: var(--indigo);
    color: #C7D4EC;
    padding: 48px 0 0;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 32px;
}
.footer-col { min-width: 0; }

/* Подвал — тёмный фон, светлый текст у виджетов */
.site-footer .widget,
.site-footer .widget p,
.site-footer .widget li { color: #C7D4EC; }
.site-footer .widget-title { color: var(--white); }
.site-footer .widget a { color: #FFFFFF; }
.site-footer .widget a:hover { color: var(--teal); }
.site-footer .widget li { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.site-footer .widget .post-date { color: #8FA3C6; font-size: 0.82rem; }
.site-footer .widget .rss-date { color: #8FA3C6; }

.footer-contact a { color: var(--white); }
.site-copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
    padding: 20px 0;
    text-align: center;
    color: #8FA3C6;
    font-size: 0.88rem;
}

/* ====================  ПОИСК  ==================== */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 480px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
}
.search-form .search-submit { white-space: nowrap; }
.site-footer .search-form .search-field { background: var(--white); color: var(--ink); }

/* ====================  КОММЕНТАРИИ  ==================== */
.comments-area {
    margin-top: 32px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 28px; padding: 0; }
.comment-body {
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
}
.comment-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.comment-author { font-weight: 600; color: var(--ink); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    margin-top: 4px;
}
.comment-form p { margin-bottom: 14px; }

/* ====================  404 (E8)  ==================== */
.error-404 {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
}
.error-404 .big-code {
    font-size: 4rem;
    font-weight: 700;
    color: var(--blue);
    line-height: 1;
}
.error-404 .search-form { margin: 24px auto; }

/* ====================  COOKIE-БАННЕР (D6/A11)  ==================== */
/* Правило для [hidden] размещено ДО основного блока стилей (A11) */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--indigo);
    color: #D8E2F4;
    padding: 16px 20px;
    border-top: 2px solid var(--blue);
}
.cookie-banner p { margin: 0; font-size: 0.9rem; max-width: 720px; }
.cookie-banner a { color: var(--teal); }
.cookie-banner .btn { padding: 9px 20px; }

/* ====================  АДАПТИВ (~960px / ~600px)  ==================== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); }
    .front-wrap, .layout-single { width: 92%; }
    h1 { font-size: 2rem; }
    .band-hero h1 { font-size: 2.1rem; }
}

@media (max-width: 600px) {
    .header-inner { align-items: flex-start; }
    .main-nav { margin-left: auto; width: auto; }
    .nav-toggle { display: inline-block; }
    .menu {
        display: none;
        flex-direction: column;
        gap: 4px;
        width: 100%;
        margin-top: 12px;
        flex-basis: 100%;
    }
    .main-nav.is-open .menu { display: flex; }
    .band { padding: 40px 0; }
    article.post-full, .page-full { padding: 22px; }
    .front-wrap, .layout-single { width: 100%; }
    .search-form { flex-direction: column; }
    .search-form .search-submit { width: 100%; }
}
