/*
Theme Name: Akari — Акцентный минимализм
Theme URI: https://akari.test
Author: AGENT-09
Description: Японский минимализм с одним красным акцентом. Чёрный #0c0a09 + красный #ef4444. Справочник ответов Ростехнадзора — правильные ответы видны сразу.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: akari
*/

:root {
    /* Палитра — японский минимализм */
    --ink:       #0c0a09;   /* основной чёрный */
    --ink-soft:  #1c1917;   /* текст */
    --ink-mute:  #78716c;   /* вторичный текст */
    --ink-faint: #d6d3d1;   /* линии/границы */
    --paper:     #ffffff;   /* фон — максимум белого */
    --paper-alt: #fafaf9;   /* альтернативный фон */
    --accent:    #ef4444;   /* ЕДИНСТВЕННЫЙ красный акцент */
    --accent-d:  #dc2626;   /* hover */
    --accent-10: rgba(239,68,68,0.10);
    --accent-06: rgba(239,68,68,0.06);

    --serif: 'Noto Serif JP', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono:  'JetBrains Mono', 'SF Mono', Consolas, monospace;

    --wrap:    1080px;
    --wrap-narrow: 720px;
    --radius:  2px;
    --shadow:  0 1px 2px rgba(12,10,9,0.04);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink-soft);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
    font-family: var(--serif);
    color: var(--ink);
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.2rem; }
a { color: var(--ink); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ===== LAYOUT ===== */
.ak-wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 24px;
}
.ak-wrap-narrow {
    max-width: var(--wrap-narrow);
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== HEADER ===== */
.ak-header {
    border-bottom: 1px solid var(--ink-faint);
    background: var(--paper);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.92);
}
.ak-header-inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 28px;
}
.ak-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.ak-brand:hover { color: var(--ink); }
.ak-brand-text { line-height: 1; }
.ak-brand-sub { color: var(--ink-mute); font-weight: 400; }
/* Японский минимализм — восходящее красное солнце (Хиномару) над горизонтом */
.ak-logo-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    color: var(--ink);
    display: block;
    transition: transform .25s ease;
}
.ak-brand:hover .ak-logo-icon { transform: translateY(-1px); }
.ak-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    flex: 1;
}
.ak-nav a {
    color: var(--ink-soft);
    font-size: 0.92rem;
    font-weight: 500;
    position: relative;
    padding: 4px 0;
}
.ak-nav a:hover { color: var(--accent); }
.ak-search {
    position: relative;
}
.ak-search input {
    border: 1px solid var(--ink-faint);
    background: var(--paper);
    padding: 8px 14px 8px 36px;
    border-radius: var(--radius);
    font-family: var(--sans);
    font-size: 0.88rem;
    width: 220px;
    color: var(--ink);
    transition: border-color .15s ease, width .2s ease;
}
.ak-search input:focus {
    outline: none;
    border-color: var(--ink);
    width: 260px;
}
.ak-search::before {
    content: "";
    position: absolute;
    left: 13px; top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    border: 1.5px solid var(--ink-mute);
    border-radius: 50%;
}
.ak-search::after {
    content: "";
    position: absolute;
    left: 24px; top: 55%;
    width: 7px; height: 1.5px;
    background: var(--ink-mute);
    transform: rotate(45deg);
}

/* ===== HERO ===== */
.ak-hero {
    padding: 96px 0 80px;
    border-bottom: 1px solid var(--ink-faint);
}
.ak-hero-inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 24px;
}
.ak-kanji {
    font-family: var(--serif);
    color: var(--accent);
    font-size: 0.78rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    margin-bottom: 20px;
    display: inline-block;
}
.ak-kanji::before {
    content: "—";
    margin-right: 10px;
    color: var(--ink-faint);
}
.ak-hero h1 {
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    max-width: 18ch;
    margin: 0 0 28px;
    font-weight: 600;
}
.ak-hero h1 .red { color: var(--accent); font-style: italic; }
.ak-hero-lead {
    font-size: 1.12rem;
    color: var(--ink-mute);
    max-width: 54ch;
    margin: 0 0 36px;
    line-height: 1.65;
}
.ak-hero-cta {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}
.ak-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: #fff;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    border: none;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.ak-btn:hover { background: var(--accent-d); color: #fff; transform: translateY(-1px); }
.ak-btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--ink);
    padding: 13px 26px;
}
.ak-btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* Stats — тонкая линия */
.ak-stats {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--ink-faint);
    margin-top: 80px;
}
.ak-stat {
    flex: 1;
    padding: 28px 0 0;
    border-right: 1px solid var(--ink-faint);
}
.ak-stat:last-child { border-right: none; }
.ak-stat:not(:first-child) { padding-left: 24px; }
.ak-stat .num {
    font-family: var(--serif);
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--ink);
    display: block;
    line-height: 1;
}
.ak-stat .lbl {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-mute);
    margin-top: 8px;
    display: block;
}

/* ===== SECTIONS ===== */
.ak-section {
    padding: 72px 0;
    border-bottom: 1px solid var(--ink-faint);
}
.ak-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 40px;
    gap: 20px;
    flex-wrap: wrap;
}
.ak-section-head h2 {
    margin: 0;
}
.ak-section-head .ak-kanji { margin-bottom: 0; }
.ak-section-more {
    font-size: 0.85rem;
    color: var(--ink-mute);
    font-weight: 500;
}
.ak-section-more:hover { color: var(--accent); }

/* ===== COURSE GRID ===== */
.ak-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0;
    border-top: 1px solid var(--ink-faint);
    border-left: 1px solid var(--ink-faint);
}
.ak-card {
    display: flex;
    flex-direction: column;
    padding: 28px 24px;
    border-right: 1px solid var(--ink-faint);
    border-bottom: 1px solid var(--ink-faint);
    background: var(--paper);
    color: var(--ink-soft);
    transition: background .15s ease;
    min-height: 150px;
    position: relative;
}
.ak-card:hover { background: var(--paper-alt); color: var(--ink-soft); }
.ak-card:hover .ak-card-code { color: var(--accent); }
.ak-card-code {
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
    transition: color .15s ease;
}
.ak-card-title {
    font-size: 0.88rem;
    color: var(--ink-mute);
    line-height: 1.45;
    margin-bottom: auto;
}
.ak-card-meta {
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--ink-mute);
    display: flex;
    align-items: center;
    gap: 8px;
}
.ak-card-meta .dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
}

/* compact list variant */
.ak-list {
    border-top: 1px solid var(--ink-faint);
}
.ak-list-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 4px;
    border-bottom: 1px solid var(--ink-faint);
    color: var(--ink-soft);
    transition: padding .15s ease, color .15s ease;
}
.ak-list-item:hover { padding-left: 14px; color: var(--accent); }
.ak-list-item:hover .ak-list-arrow { opacity: 1; transform: translateX(0); }
.ak-list-num {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ink-mute);
    min-width: 48px;
}
.ak-list-item:hover .ak-list-num { color: var(--accent); }
.ak-list-title {
    flex: 1;
    font-size: 0.95rem;
}
.ak-list-arrow {
    color: var(--accent);
    opacity: 0;
    transform: translateX(-6px);
    transition: all .15s ease;
    font-size: 1.1rem;
}

/* ===== TICKET (билет) ===== */
.ak-ticket {
    padding: 56px 0 72px;
}
.ak-ticket-head {
    margin-bottom: 48px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--ink);
}
.ak-ticket-crumb {
    font-size: 0.8rem;
    color: var(--ink-mute);
    margin-bottom: 18px;
    letter-spacing: 0.02em;
}
.ak-ticket-crumb a { color: var(--ink-mute); }
.ak-ticket-crumb a:hover { color: var(--accent); }
.ak-ticket-crumb .sep { margin: 0 10px; color: var(--ink-faint); }
.ak-ticket-h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin: 0 0 16px;
}
.ak-ticket-h1 .num {
    color: var(--accent);
    font-style: italic;
}
.ak-ticket-sub {
    color: var(--ink-mute);
    font-size: 0.98rem;
    margin: 0;
}
.ak-ticket-sub strong { color: var(--ink); font-weight: 600; }

/* список вопросов билета — ответы видны СРАЗУ */
.ak-q {
    padding: 36px 0;
    border-bottom: 1px solid var(--ink-faint);
}
.ak-q:last-child { border-bottom: none; }
.ak-q-num {
    font-family: var(--serif);
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
    display: block;
    font-weight: 600;
}
.ak-q-text {
    font-family: var(--serif);
    font-size: 1.3rem;
    line-height: 1.45;
    color: var(--ink);
    margin: 0 0 24px;
    font-weight: 500;
}
/* варианты ответов — минималистично */
.ak-answers {
    margin: 0;
    padding: 0;
}
.ak-answers li {
    position: relative;
    padding: 12px 0 12px 32px;
    color: var(--ink-mute);
    border-bottom: 1px solid var(--ink-faint);
    font-size: 0.98rem;
    line-height: 1.55;
}
.ak-answers li:last-child { border-bottom: none; }
.ak-answers li::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 22px;
    width: 6px;
    height: 1px;
    background: var(--ink-faint);
}
/* ПРАВИЛЬНЫЙ — маленький красный кружок ● + выделение */
.ak-answers li.correct {
    color: var(--ink);
    font-weight: 500;
    background: var(--accent-06);
}
.ak-answers li.correct::before {
    content: "●";
    background: none;
    width: auto;
    height: auto;
    top: 12px;
    left: 4px;
    color: var(--accent);
    font-size: 0.8rem;
    line-height: 1.6;
}
.ak-correct-mark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 8px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    vertical-align: middle;
}

/* навигация prev/next */
.ak-pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 56px;
    padding-top: 28px;
    border-top: 1px solid var(--ink-faint);
    gap: 20px;
}
.ak-pager a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border: 1px solid var(--ink-faint);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink);
    transition: border-color .15s ease, color .15s ease;
}
.ak-pager a:hover { border-color: var(--accent); color: var(--accent); }
.ak-pager .ak-pager-num {
    font-family: var(--serif);
    color: var(--accent);
    font-weight: 600;
}

/* ===== ARCHIVE (курс — список билетов) ===== */
.ak-archive-head {
    padding: 56px 0 40px;
    border-bottom: 1px solid var(--ink);
}
.ak-archive-h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin: 0 0 14px;
}
.ak-archive-lead {
    color: var(--ink-mute);
    max-width: 60ch;
    font-size: 1.02rem;
    margin: 0 0 20px;
}
.ak-archive-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.ak-chip {
    font-size: 0.78rem;
    color: var(--ink-mute);
    padding: 6px 14px;
    border: 1px solid var(--ink-faint);
    border-radius: 40px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.ak-chip .rdot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* ===== CTA section ===== */
.ak-cta {
    padding: 72px 0;
    background: var(--ink);
    color: var(--paper);
    text-align: center;
}
.ak-cta h2 {
    color: var(--paper);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin-bottom: 18px;
}
.ak-cta h2 .red { color: var(--accent); }
.ak-cta p {
    color: rgba(255,255,255,0.7);
    max-width: 52ch;
    margin: 0 auto 32px;
    font-size: 1.05rem;
}
.ak-cta .ak-btn {
    background: var(--accent);
}
.ak-cta .ak-btn:hover { background: #fff; color: var(--ink); }

/* ===== SEO-блок ===== */
.ak-seo {
    padding: 64px 0;
    background: var(--paper-alt);
}
.ak-seo-inner {
    max-width: var(--wrap-narrow);
    margin: 0 auto;
    padding: 0 24px;
}
.ak-seo h2 { font-size: 1.6rem; }
.ak-seo h3 { font-size: 1.1rem; margin: 28px 0 12px; color: var(--ink); }
.ak-seo p { color: var(--ink-soft); }
.ak-seo strong { color: var(--ink); }

/* ===== BREADCRUMBS ===== */
.ak-crumb {
    font-size: 0.8rem;
    color: var(--ink-mute);
    margin: 24px 0 0;
    letter-spacing: 0.02em;
}
.ak-crumb a { color: var(--ink-mute); }
.ak-crumb a:hover { color: var(--accent); }
.ak-crumb .sep { margin: 0 8px; color: var(--ink-faint); }
.ak-crumb .now { color: var(--ink-soft); }

/* ===== FOOTER ===== */
.ak-footer {
    background: var(--paper);
    border-top: 1px solid var(--ink-faint);
    padding: 64px 0 32px;
    color: var(--ink-mute);
    font-size: 0.88rem;
}
.ak-footer-inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
}
.ak-footer h4 {
    font-family: var(--sans);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink);
    margin: 0 0 18px;
    font-weight: 600;
}
.ak-footer a {
    color: var(--ink-mute);
    display: block;
    padding: 5px 0;
}
.ak-footer a:hover { color: var(--accent); }
.ak-footer p { color: var(--ink-mute); line-height: 1.6; }
.ak-footer-brand {
    font-family: var(--serif);
    font-size: 1.2rem;
    color: var(--ink);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.ak-footer-disc {
    border-top: 1px solid var(--ink-faint);
    margin-top: 48px;
    padding-top: 24px;
    max-width: var(--wrap);
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    font-size: 0.8rem;
    color: var(--ink-mute);
    line-height: 1.6;
}

/* ===== 404 / search-empty ===== */
.ak-empty {
    text-align: center;
    padding: 120px 24px;
}
.ak-empty .big {
    font-family: var(--serif);
    font-size: 6rem;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 20px;
}
.ak-empty p { color: var(--ink-mute); }

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 880px) {
    .ak-header-inner { flex-wrap: wrap; gap: 14px; padding: 14px 18px; }
    .ak-nav { order: 3; width: 100%; gap: 18px; overflow-x: auto; padding-bottom: 4px; }
    .ak-nav a { white-space: nowrap; font-size: 0.85rem; }
    .ak-search { margin-left: auto; }
    .ak-search input { width: 140px; }
    .ak-search input:focus { width: 160px; }
    .ak-hero { padding: 56px 0 48px; }
    .ak-hero-cta { flex-direction: column; align-items: stretch; }
    .ak-hero-cta .ak-btn { justify-content: center; }
    .ak-stats { flex-wrap: wrap; margin-top: 56px; }
    .ak-stat { flex: 1 1 50%; padding: 22px 12px 0 0; border-bottom: 1px solid var(--ink-faint); }
    .ak-stat:nth-child(2) { border-right: none; }
    .ak-stat:nth-child(3), .ak-stat:nth-child(4) { padding-top: 22px; }
    .ak-stat .num { font-size: 1.7rem; }
    .ak-section { padding: 48px 0; }
    .ak-section-head { margin-bottom: 28px; }
    .ak-footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
    .ak-ticket { padding: 32px 0 48px; }
    .ak-ticket-head { margin-bottom: 32px; padding-bottom: 20px; }
    .ak-q { padding: 28px 0; }
    .ak-q-text { font-size: 1.12rem; }
    .ak-answers li { font-size: 0.92rem; }
    .ak-pager { flex-direction: column; align-items: stretch; }
    .ak-pager a { justify-content: center; }
    .ak-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    body { font-size: 16px; }
    .ak-wrap, .ak-wrap-narrow, .ak-hero-inner, .ak-footer-disc { padding: 0 16px; }
    .ak-header-inner { padding: 12px 16px; }
    .ak-footer-inner { grid-template-columns: 1fr; }
    .ak-hero h1 { font-size: 2rem; }
    .ak-correct-mark {
        font-size: 0.62rem;
        padding: 2px 6px;
        margin-left: 6px;
    }
    .ak-answers li { padding-left: 26px; }
}

/* Print-friendly */
@media print {
    .ak-header, .ak-footer, .ak-pager, .ak-cta { display: none; }
    body { color: #000; }
    .ak-answers li.correct { background: none; font-weight: 700; }
}


/* PANELSU ANSWER BUTTON/OPTION SAFETY PATCH */
.entry-content ul.answers li,
ul.answers li,
.gts-answers li,
.gts-q-answers li,
.kf-answers li,
.kf-q-answers li,
.bilet-content .answers li,
.gm-answers li,
.a07-answers li,
.ak-answers li,
.sk-answers li {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.entry-content ul.answers li > span,
ul.answers li > span,
.gts-answers li > span,
.gts-q-answers li > span,
.kf-answers li > span,
.kf-q-answers li > span,
.bilet-content .answers li > span,
.gm-answers li > span,
.a07-answers li > span,
.ak-answers li > span,
.sk-answers li > span,
.kf-answers li .ans-text,
.kf-q-answers li .ans-text,
.entry-content ul.answers li > span.txt,
.gts-q-answers li > span:not(.letter):not(.badge),
.sk-answers li > span:not(.letter):not(.badge) {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gts-q-answers li,
.kf-answers li,
.kf-q-answers li,
.gm-answers li,
.sk-answers li {
  align-items: flex-start;
}

.gts-q-answers li.correct .badge,
.kf-q-answers li.correct .badge,
.kf-answers li.correct .mark,
.gm-answers li.correct::after,
.sk-answers li .badge,
.entry-content ul.answers li.correct .answer-mark,
.bilet-content .answers li.correct .answer-mark,
ul.answers li.correct .answer-mark {
  max-width: 100%;
}

@media (max-width: 768px) {
  .gts-q-answers li,
  .kf-answers li,
  .kf-q-answers li,
  .gm-answers li,
  .sk-answers li {
    flex-wrap: wrap;
  }

  .gts-q-answers li.correct .badge,
  .kf-q-answers li.correct .badge,
  .kf-answers li.correct .mark,
  .sk-answers li .badge,
  .entry-content ul.answers li.correct .answer-mark,
  .bilet-content .answers li.correct .answer-mark,
  ul.answers li.correct .answer-mark {
    margin-left: 0;
    margin-top: 8px;
    white-space: normal;
  }
}
