/*
Theme Name: dds_myacademicpartner.com
Author: Ирина Лебедева
Description: Информационно-аналитический портал и платформа с AI-инструментами для бизнеса. Сдержанный футуристичный стиль, аналитический характер, AI-направленность.
Version: 1.1
Text Domain: mapai
*/

/* =========================================================================
   Переменные и сброс
   ====================================================================== */
:root {
    --indigo: #1A1F3D;
    --indigo-soft: rgba(26, 31, 61, 0.85);
    --azure: #00A8E8;
    --azure-dark: #0089bd;
    --pearl: #F5F7FC;
    --pearl-deep: #e7ecf6;
    --amber: #FFC857;
    --text-dark: #1A1F3D;
    --text-muted: #5b6280;
    --text-on-dark: #dfe6f5;
    --border-soft: #d8dfee;
    --shell: min(92%, 1180px);
    --radius: 12px;
    --shadow: 0 10px 30px rgba(26, 31, 61, 0.12);
    --shadow-glow: 0 6px 22px rgba(0, 168, 232, 0.35);
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    color: var(--text-dark);
    background: var(--pearl);
    overflow-x: hidden;
}

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

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

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-dark);
    margin: 0 0 0.6em;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

.shell { width: var(--shell); margin-inline: auto; }

/* числа/метрики моноширинным */
.metric, .mono, time, .stat-value { font-family: var(--font-mono); }

/* =========================================================================
   Кнопки
   ====================================================================== */
.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    padding: 11px 22px;
    border-radius: var(--radius);
    background: var(--indigo-soft);
    color: #fff;
    border: 1px solid var(--azure);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover {
    background: var(--azure);
    color: #fff;
    text-decoration: none;
    box-shadow: var(--shadow-glow);
    transform: translateY(1px);
}
.btn-ai {
    background: linear-gradient(110deg, var(--azure), var(--amber));
    border: none;
    color: var(--indigo);
    padding: 14px 28px;
    font-weight: 700;
}
.btn-ai:hover {
    color: var(--indigo);
    box-shadow: 0 8px 26px rgba(255, 200, 87, 0.4);
    transform: translateY(1px);
}

/* =========================================================================
   Шапка
   ====================================================================== */
.site-header {
    background: var(--indigo);
    color: var(--text-on-dark);
    border-bottom: 1px solid rgba(0, 168, 232, 0.3);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-logo { display: block; max-height: 64px; width: auto; }
.brand-graphic { flex: 0 0 auto; }
.brand-text { min-width: 0; }
.site-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    line-height: 1.3;
}
.site-title a { color: #fff; }
.site-title a:hover { text-decoration: none; color: var(--azure); }
.site-description {
    font-size: 0.82rem;
    color: var(--text-on-dark);
    margin: 4px 0 0;
    opacity: 0.85;
}

/* нейросетевая графика названия */
.neural-mark { width: 120px; height: 64px; }
.neural-mark .nm-line { stroke: var(--azure); stroke-width: 1.4; opacity: 0; animation: nmLine 0.8s ease forwards; }
.neural-mark .nm-node { opacity: 0; animation: nmNode 0.6s ease forwards; }
.neural-mark .nm-line:nth-child(1) { animation-delay: 0.1s; }
.neural-mark .nm-line:nth-child(2) { animation-delay: 0.25s; }
.neural-mark .nm-line:nth-child(3) { animation-delay: 0.4s; }
.neural-mark .nm-line:nth-child(4) { animation-delay: 0.55s; }
.neural-mark .nm-node { animation-delay: 0.7s; }
@keyframes nmLine { to { opacity: 0.8; } }
@keyframes nmNode { to { opacity: 1; } }

/* навигация */
.main-nav { margin-left: auto; }
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    color: var(--text-on-dark);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    background: rgba(0, 168, 232, 0.18);
    color: #fff;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--azure);
    color: #fff;
    border-radius: var(--radius);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
}

/* =========================================================================
   Основной макет
   ====================================================================== */
.site-main { padding: 40px 0 60px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: 67% 27%;
    gap: 6%;
    align-items: start;
}
.layout-single { display: block; }
.layout-single .content-area { width: 85%; margin-inline: auto; }

.content-area { min-width: 0; }
.sidebar { min-width: 0; }

/* =========================================================================
   Хлебные крошки
   ====================================================================== */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
}
.breadcrumbs a { color: var(--azure-dark); }
.breadcrumbs .sep { color: var(--text-muted); margin: 0 4px; }

/* =========================================================================
   Карточки записей
   ====================================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--pearl);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(26, 31, 61, 0.18); }

.card-thumb {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}
.card-thumb img,
.card-thumb .thumb-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.card:hover .card-thumb img { transform: scale(1.04); }

/* QR-подобный узор машинного обучения при наведении */
.card-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    background-image:
        linear-gradient(0deg, rgba(0,168,232,0.18) 2px, transparent 2px),
        linear-gradient(90deg, rgba(0,168,232,0.18) 2px, transparent 2px);
    background-size: 14px 14px;
    transition: opacity 0.3s ease;
}
.card:hover .card-thumb::after { opacity: 1; }

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}
.card-title { font-size: 1.2rem; margin: 0 0 8px; }
.card-title a { color: var(--text-dark); }
.card-title a:hover { color: var(--azure-dark); text-decoration: none; }
.card-meta {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.card-excerpt { color: var(--text-muted); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more { margin-top: auto; padding-top: 14px; }

/* =========================================================================
   Записи / контент
   ====================================================================== */
.entry {
    background: var(--pearl);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}
.entry-title { font-size: 2rem; }
.entry-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.entry-thumb { margin-bottom: 22px; border-radius: var(--radius); overflow: hidden; }
.entry-thumb img { display: block; width: 100%; height: auto; }
.entry-content img { border-radius: var(--radius); }

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--border-soft);
}
.entry-content th, .entry-content td { padding: 10px 14px; text-align: left; }
.entry-content th { background: var(--pearl-deep); font-weight: 600; }

blockquote {
    margin: 1.4em 0;
    padding: 14px 22px;
    border-left: 3px solid var(--azure);
    background: var(--pearl-deep);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-dark);
}

/* =========================================================================
   Сайдбар + виджеты
   ====================================================================== */
.sidebar .widget {
    background: var(--pearl);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 24px;
    color: var(--text-dark);
}
.sidebar .widget-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--azure);
    color: var(--text-dark);
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: 7px 0; border-bottom: 1px solid var(--border-soft); }
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget a { color: var(--azure-dark); }
.sidebar .widget,
.sidebar .widget p { color: var(--text-dark); }
.sidebar .widget .post-date { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.78rem; }

/* =========================================================================
   Пагинация
   ====================================================================== */
.pagination { margin-top: 40px; }
.pagination ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
    justify-content: center;
}
.pagination a, .pagination span {
    display: block;
    padding: 9px 15px;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    background: var(--pearl);
    color: var(--text-dark);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}
.pagination a:hover { background: var(--azure); color: #fff; border-color: var(--azure); text-decoration: none; }
.pagination .current { background: var(--indigo); color: #fff; border-color: var(--indigo); }

/* =========================================================================
   Главная
   ====================================================================== */
.hero {
    background: linear-gradient(135deg, var(--indigo), #2a2f5a);
    color: var(--text-on-dark);
    padding: 64px 0;
    border-radius: var(--radius);
    margin-bottom: 44px;
}
.hero h1 { color: #fff; font-size: 2.4rem; max-width: 760px; }
.hero p { font-size: 1.1rem; max-width: 680px; opacity: 0.92; }
.hero .btn { margin-top: 10px; }

.section { margin-bottom: 56px; }
.section-head { margin-bottom: 26px; }
.section-head h2 { margin-bottom: 6px; }
.section-head .lead { color: var(--text-muted); max-width: 720px; }

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.tile {
    position: relative;
    overflow: hidden;
    background: var(--pearl);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); }
.tile::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    background-image:
        linear-gradient(0deg, rgba(0,168,232,0.12) 2px, transparent 2px),
        linear-gradient(90deg, rgba(0,168,232,0.12) 2px, transparent 2px);
    background-size: 12px 12px;
    transition: opacity 0.3s ease;
}
.tile:hover::after { opacity: 1; }
.tile h3 { position: relative; z-index: 1; }
.tile p { position: relative; z-index: 1; color: var(--text-muted); margin-bottom: 0; }
.tile .tile-icon { font-family: var(--font-mono); color: var(--azure-dark); font-size: 0.85rem; letter-spacing: 1px; display: block; margin-bottom: 10px; }

/* AI-предиктор (ленточный, без внешних данных) */
.predictor {
    background: var(--indigo);
    color: var(--text-on-dark);
    border-radius: var(--radius);
    padding: 36px;
    border: 1px solid rgba(0, 168, 232, 0.3);
}
.predictor h2 { color: #fff; }
.predictor .lead { color: var(--text-on-dark); opacity: 0.9; }
.predictor-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 20px 0; }
.predictor select {
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 11px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--azure);
    background: rgba(255,255,255,0.06);
    color: #fff;
    min-width: 220px;
}
.predictor select option { color: var(--indigo); }
.predictor-result { margin-top: 18px; }
.predictor-bar {
    height: 16px;
    border-radius: 99px;
    background: rgba(255,255,255,0.12);
    overflow: hidden;
    margin: 12px 0;
}
.predictor-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--azure), var(--amber));
    transition: width 0.8s ease;
}
.predictor-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--amber);
}
.predictor-note { font-size: 0.85rem; opacity: 0.75; }

.contact-inline { margin-top: 8px; }
.contact-inline a { color: var(--amber); font-family: var(--font-mono); }

/* =========================================================================
   Подвал
   ====================================================================== */
.site-footer {
    background: var(--indigo);
    color: var(--text-on-dark);
    padding: 50px 0 0;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px;
    padding-bottom: 36px;
}
.footer-col { min-width: 0; }
.site-footer .widget { margin-bottom: 0; color: var(--text-on-dark); }
.site-footer .widget-title { color: #fff; font-size: 1.05rem; margin: 0 0 14px; }
.site-footer .widget,
.site-footer .widget p { color: var(--text-on-dark); }
.site-footer .widget a { color: var(--azure); }
.site-footer .widget a:hover { color: var(--amber); }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li { padding: 6px 0; }
.footer-contact a { color: var(--amber); font-family: var(--font-mono); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 20px 0;
    font-size: 0.85rem;
    color: var(--text-on-dark);
    opacity: 0.85;
    text-align: center;
}

/* =========================================================================
   Формы (поиск, комментарии)
   ====================================================================== */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    font-family: var(--font-body);
    font-size: 1rem;
}
.search-form button {
    border: none;
    background: var(--azure);
    color: #fff;
    border-radius: var(--radius);
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 600;
}
.search-form button:hover { background: var(--azure-dark); }

.comments-area { margin-top: 40px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 24px; padding: 0; }
.comment-item { margin-bottom: 18px; }
.comment-body {
    background: var(--pearl);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 18px;
}
.comment-meta { font-size: 0.85rem; margin-bottom: 8px; }
.comment-author { font-weight: 600; }
.comment-date { color: var(--text-muted); margin-left: 8px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    font-family: var(--font-body);
    font-size: 1rem;
    margin-top: 4px;
}
.comment-form p { margin-bottom: 14px; }

/* =========================================================================
   404
   ====================================================================== */
.error-404 { text-align: center; padding: 40px 0; }
.error-404 .code { font-family: var(--font-mono); font-size: 5rem; color: var(--azure); font-weight: 700; }
.error-404 .search-form { max-width: 480px; margin: 24px auto; }

/* =========================================================================
   Cookie-баннер (A11: правило hidden до основного блока)
   ====================================================================== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--indigo);
    color: var(--text-on-dark);
    border-top: 1px solid var(--azure);
    padding: 16px 0;
}
.cookie-banner .shell {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.cookie-banner p { margin: 0; font-size: 0.9rem; min-width: 220px; flex: 1; }
.cookie-banner a { color: var(--azure); }

/* =========================================================================
   Адаптив
   ====================================================================== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 36px; }
    .layout-single .content-area { width: 100%; }
    .footer-cols { grid-template-columns: 1fr; gap: 26px; }
    .hero { padding: 44px 0; }
    .hero h1 { font-size: 1.9rem; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    .main-nav {
        display: none;
        width: 100%;
        margin-left: 0;
        margin-top: 12px;
    }
    .main-nav[hidden] { display: none !important; }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 4px; }
    .nav-toggle { display: block; }
    .header-inner { gap: 14px; }
    .card-grid { grid-template-columns: 1fr; }
    .entry { padding: 20px; }
    .predictor { padding: 24px; }
}
