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

/* ============================================================
   Переменные
   ============================================================ */
:root {
    --ink: #121212;
    --paper: #FFFFFF;
    --accent: #00C2FF;
    --graphite: #2A2A2A;
    --silver: #B0BEC5;
    --hairline: #E2E6E8;
    --shell: min(92%, 1180px);
    --bevel: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
}

/* ============================================================
   Сброс
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
}

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

a {
    color: #0086b3;
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--ink);
    margin: 0 0 0.6em;
}
h1 { font-size: 2.05rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }

blockquote {
    margin: 1.4em 0;
    padding: 0.6em 1.2em;
    background: var(--graphite);
    color: #EAEAEA;
    border-left: 3px solid var(--accent);
}
blockquote p:last-child { margin-bottom: 0; }

code, kbd, pre, samp {
    font-family: "IBM Plex Mono", "Consolas", monospace;
}
:not(pre) > code {
    background: var(--graphite);
    color: var(--accent);
    padding: 0.12em 0.4em;
    font-size: 0.88em;
}
pre {
    background: var(--graphite);
    background-image: linear-gradient(180deg, #313131 0%, #232323 100%);
    color: #D7E7EC;
    padding: 1.1em 1.3em;
    overflow-x: auto;
    border-left: 3px solid var(--accent);
    font-size: 0.9rem;
    line-height: 1.6;
}
pre code { color: inherit; background: none; padding: 0; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    border: 1px solid var(--graphite);
}
th, td {
    border: 1px solid var(--hairline);
    padding: 0.6em 0.8em;
    text-align: left;
}
th {
    background: var(--graphite);
    color: var(--paper);
    font-weight: 600;
}

hr { border: none; border-top: 1px solid var(--hairline); margin: 2em 0; }

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

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

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 16px clamp(16px, 4vw, 48px);
    background: var(--ink);
    color: #E9EDEF;
    border-top: 2px solid var(--accent);
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: 0.92rem; }
.cookie-banner a { color: var(--accent); }
/* Кнопка на тёмном фоне баннера — светлый текст (иначе ink-на-ink не виден) */
.cookie-banner .btn { color: var(--paper); }
.cookie-banner .btn:hover { color: var(--ink); }

/* ============================================================
   Контейнер ширины — единственное место (A12.7)
   ============================================================ */
.shell {
    width: var(--shell);
    margin-inline: auto;
}

.site-main { padding: 38px 0 64px; }

/* Раскладки */
.layout-single { display: block; }
.layout-single .content-area {
    width: 85%;
    margin-inline: auto;
}
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 2.45fr) minmax(0, 1fr);
    gap: 44px;
    align-items: start;
}
.layout-with-sidebar .content-area { min-width: 0; }

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--hairline);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 20px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand-logo, .brand-mark { flex: 0 0 auto; }
.brand-mark { display: block; }
.brand-text { min-width: 0; }
.brand-title {
    display: block;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--ink);
    font-weight: 600;
    max-width: 540px;
}
.brand-desc {
    display: block;
    font-size: 0.74rem;
    color: var(--silver);
    line-height: 1.45;
    margin-top: 3px;
    max-width: 540px;
}

.main-nav { margin-left: auto; }
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--graphite);
    color: var(--ink);
    width: 42px; height: 42px;
    cursor: pointer;
    clip-path: var(--bevel);
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
    display: block;
    width: 18px; height: 2px;
    background: var(--ink);
    margin: 0 auto;
    position: relative;
    transition: 0.2s ease;
}
.nav-toggle span::before { content: ""; position: absolute; top: -6px; }
.nav-toggle span::after { content: ""; position: absolute; top: 6px; }

.menu {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    gap: 4px;
}
.menu a {
    display: block;
    padding: 8px 14px;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.menu a:hover,
.menu .current-menu-item > a {
    color: var(--accent);
    border-color: var(--accent);
    clip-path: var(--bevel);
}
.menu .sub-menu {
    list-style: none;
    margin: 0; padding: 0;
}

/* ============================================================
   Кнопки — «скошенный прямоугольник» (F)
   ============================================================ */
.btn,
.wp-block-button__link,
button.search-submit,
input[type="submit"] {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 10px 22px;
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--accent);
    cursor: pointer;
    clip-path: var(--bevel);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.btn:hover,
button.search-submit:hover,
input[type="submit"]:hover {
    background: var(--accent);
    color: var(--ink);
}
.btn--ghost { border-color: var(--graphite); }

/* ============================================================
   Хлебные крошки
   ============================================================ */
.breadcrumbs {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.78rem;
    color: var(--silver);
    padding: 14px 0;
    margin-bottom: 6px;
}
.breadcrumbs a { color: #5a6b72; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--accent); margin: 0 4px; }
.breadcrumbs span:last-child { color: var(--ink); }

/* ============================================================
   Карточки записей (A8, A10 — вертикальный паттерн)
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}
.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--accent);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-3px); }
.card-thumb {
    display: block;
    width: 100%;
}
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-thumb--blank {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background: var(--graphite);
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
    min-width: 0;
}
.card-params {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.68rem;
}
.param-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: #F1F4F5;
    color: var(--graphite);
    border: 1px solid var(--hairline);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.param-tag--accent { border-color: var(--accent); color: #0086b3; }
.card-title { font-size: 1.18rem; margin-bottom: 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); }
.card-meta {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.72rem;
    color: var(--silver);
    margin-bottom: 10px;
}
.card-excerpt { color: #3a3a3a; font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 14px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.8rem;
    font-weight: 600;
}
.card-more a { color: var(--accent); }
.card-more a::after { content: " →"; }

/* ============================================================
   Запись / страница — контент
   ============================================================ */
.entry {
    background: var(--paper);
}
.entry-header { margin-bottom: 22px; }
.entry-title { font-size: 2.1rem; }
.entry-meta {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.78rem;
    color: var(--silver);
    margin-top: 8px;
}
.entry-meta a { color: #5a6b72; }
.entry-thumb { margin: 0 0 24px; }
.entry-thumb img { display: block; width: 100%; }
.entry-content { min-width: 0; }
.entry-content img { display: block; }
.entry-content > * { max-width: 100%; }
.entry-footer {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--hairline);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.8rem;
}
.tag-list a {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 3px 9px;
    background: #F1F4F5;
    border: 1px solid var(--hairline);
    color: var(--graphite);
    font-size: 0.78rem;
}
.tag-list a:hover { border-color: var(--accent); color: var(--accent); }

.page-title {
    font-size: 1.9rem;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
}

/* ============================================================
   Сайдбар и виджеты
   ============================================================ */
.sidebar { min-width: 0; }
.widget {
    background: #F6F8F9;
    border: 1px solid var(--hairline);
    border-top: 3px solid var(--accent);
    padding: 20px 22px;
    margin-bottom: 26px;
    color: var(--ink);
}
.widget-title {
    font-size: 1rem;
    font-family: "IBM Plex Mono", monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink);
    margin-bottom: 14px;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px dashed var(--hairline); }
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--graphite); }
.widget a:hover { color: var(--accent); }
.widget .post-date { display: block; font-size: 0.72rem; color: var(--silver); font-family: "IBM Plex Mono", monospace; }

/* ============================================================
   Подвал
   ============================================================ */
.site-footer {
    background: var(--ink);
    color: var(--silver);
    margin-top: 40px;
}
.status-line {
    background: #000;
    border-top: 1px solid var(--graphite);
    border-bottom: 1px solid var(--graphite);
    padding: 8px 0;
    overflow: hidden;
}
.status-line .shell { display: flex; align-items: center; gap: 10px; }
.status-dot {
    flex: 0 0 auto;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: appai-pulse 1.6s infinite;
}
@keyframes appai-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
.status-log {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.74rem;
    color: var(--silver);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.status-log b { color: var(--accent); font-weight: 600; }

.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    padding: 48px 0 32px;
}
.footer-col { min-width: 0; }
/* Виджеты в подвале — светлый текст на тёмном фоне (F: контраст) */
.footer-col .widget {
    background: transparent;
    border: none;
    border-top: 2px solid var(--accent);
    padding: 16px 0 0;
    margin-bottom: 0;
    color: var(--silver);
}
.footer-col .widget-title { color: var(--paper); }
.footer-col .widget a { color: var(--silver); }
.footer-col .widget a:hover { color: var(--accent); }
.footer-col .widget li { border-bottom-color: var(--graphite); }
.footer-col .widget .post-date { color: #6b7a80; }
/* Виджет «Навигация» отдаёт <ul class="menu"> — в подвале это
   вертикальный список, а не горизонтальная строка шапки */
.footer-col .menu { display: block; }
.footer-col .menu a {
    display: inline-block;
    padding: 0;
    border: 0;
    color: var(--silver);
}
.footer-col .menu a:hover,
.footer-col .menu .current-menu-item > a {
    color: var(--accent);
    clip-path: none;
}

.footer-bottom {
    border-top: 1px solid var(--graphite);
    padding: 18px 0;
    font-size: 0.8rem;
    font-family: "IBM Plex Mono", monospace;
    color: #7a8a90;
}

/* ============================================================
   Пагинация
   ============================================================ */
.pagination {
    margin-top: 38px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pagination .page-numbers {
    display: inline-block;
    min-width: 42px;
    padding: 8px 12px;
    text-align: center;
    border: 1px solid var(--hairline);
    color: var(--graphite);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.85rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.pagination a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ink);
    clip-path: var(--bevel);
}

/* ============================================================
   Форма поиска
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--graphite);
    font: inherit;
    font-size: 0.92rem;
    background: var(--paper);
    color: var(--ink);
}
.search-form .search-field:focus {
    outline: none;
    border-color: var(--accent);
}

/* ============================================================
   Главная страница
   ============================================================ */
.section {
    padding: 52px 0;
    border-bottom: 1px solid var(--hairline);
}
.section--dark {
    background: var(--ink);
    color: #D7DEE1;
    border-bottom: none;
}
.section--dark h2, .section--dark h3 { color: var(--paper); }
.section-kicker {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    margin-bottom: 8px;
}
.section-title { font-size: 1.85rem; margin-bottom: 26px; }
.section-intro { max-width: 720px; }

/* Слайдер */
.slider {
    position: relative;
    border: 1px solid var(--graphite);
    background: #181818;
    overflow: hidden;
}
.slide {
    display: none;
    padding: 40px clamp(20px, 5vw, 56px);
    min-height: 220px;
}
.slide.is-active { display: block; }
.slide-no {
    font-family: "IBM Plex Mono", monospace;
    color: var(--accent);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
}
.slide h3 { font-size: 1.5rem; margin: 8px 0 10px; }
.slide p { color: var(--silver); margin: 0; }
.slider-controls {
    display: flex;
    gap: 8px;
    padding: 14px clamp(20px, 5vw, 56px);
    border-top: 1px solid var(--graphite);
}
.slider-dot {
    width: 26px; height: 4px;
    background: var(--graphite);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s ease;
}
.slider-dot.is-active { background: var(--accent); }

/* Колонки-фичи */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}
.feature {
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--hairline);
    border-top: 3px solid var(--accent);
    background: var(--paper);
}
.feature-num {
    font-family: "IBM Plex Mono", monospace;
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 600;
}
.feature h3 { margin: 8px 0 6px; font-size: 1.12rem; }
.feature p { margin: 0; font-size: 0.95rem; color: #444; }

/* Плитки-инструменты с тултипом */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.tool-tile {
    position: relative;
    min-width: 0;
    padding: 22px 18px;
    background: var(--graphite);
    border: 1px solid #3a3a3a;
    text-align: center;
    cursor: help;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.tool-tile:hover { border-color: var(--accent); transform: translateY(-3px); }
.tool-tile .tool-name {
    font-family: "IBM Plex Mono", monospace;
    color: var(--paper);
    font-size: 0.92rem;
    font-weight: 600;
}
.tool-tip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    width: 200px;
    background: var(--accent);
    color: var(--ink);
    font-size: 0.78rem;
    line-height: 1.4;
    padding: 9px 11px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 5;
    clip-path: var(--bevel);
}
.tool-tile:hover .tool-tip,
.tool-tile:focus-within .tool-tip { opacity: 1; visibility: visible; }

/* Темы / категории */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.topic-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--accent);
    background: var(--paper);
    font-weight: 600;
    color: var(--ink);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.topic-card:hover { background: var(--accent); color: var(--ink); }
.topic-card span {
    display: block;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.7rem;
    color: var(--silver);
    font-weight: 400;
    margin-top: 4px;
}
.topic-card:hover span { color: var(--graphite); }

.home-recent { padding: 52px 0; }

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area { margin-top: 44px; }
.comments-title, .comment-reply-title {
    font-size: 1.3rem;
    font-family: "IBM Plex Mono", monospace;
}
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list ul.children { list-style: none; margin: 0; padding-left: 28px; }
.comment-body {
    padding: 16px 18px;
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--accent);
    margin-bottom: 14px;
    background: #F6F8F9;
}
.comment-meta {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.76rem;
    color: var(--silver);
    margin-bottom: 8px;
}
.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%;
    padding: 9px 12px;
    border: 1px solid var(--graphite);
    font: inherit;
    font-size: 0.92rem;
    background: var(--paper);
}
.comment-form textarea:focus,
.comment-form input:focus { outline: none; border-color: var(--accent); }
.comment-form p { margin-bottom: 14px; }
.comment-form label { display: block; font-size: 0.84rem; margin-bottom: 4px; }

/* ============================================================
   404
   ============================================================ */
.error-404 { text-align: center; padding: 30px 0 50px; }
.error-404 .big {
    font-family: "IBM Plex Mono", monospace;
    font-size: 5rem;
    color: var(--accent);
    line-height: 1;
}
.error-404 .search-form { max-width: 420px; margin: 24px auto; }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .layout-single .content-area { width: 100%; }
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
    .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feature-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1, .entry-title { font-size: 1.6rem; }
    .card-grid { grid-template-columns: minmax(0, 1fr); }
    .footer-cols { grid-template-columns: minmax(0, 1fr); }
    .tool-grid, .topic-grid { grid-template-columns: minmax(0, 1fr); }
    .header-inner { gap: 14px; }
    .main-nav { margin-left: auto; }
    .nav-toggle { display: block; }
    .menu {
        display: none;
        flex-direction: column;
        position: absolute;
        left: 0; right: 0;
        top: 100%;
        background: var(--paper);
        border-bottom: 1px solid var(--hairline);
        padding: 10px var(--shell);
        gap: 0;
        z-index: 50;
    }
    .menu.is-open { display: flex; }
    .site-header { position: relative; }
    .menu a { padding: 12px 4px; border-bottom: 1px dashed var(--hairline); }
    .menu a:hover, .menu .current-menu-item > a { clip-path: none; border-color: transparent; }
    .section { padding: 38px 0; }
    .brand-title, .brand-desc { font-size: 0.72rem; }
}
