/*
Theme Name: CryptoAction Block
Theme URI: https://cryptoaction.trade
Author: Cryptoaction
Description: Блочная тема для блога cryptoaction.trade. Светлая, справочная.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: cryptoaction-block
*/

/* Палитра и размеры. Меняются только здесь. */
:root {
  --bg: #fafafa; --surface: #ffffff; --text: #1a1a1a; --muted: #566070;
  --line: #d3d8df; --line-soft: #e3e6eb;
  --accent: #0052ff; --up: #00796b; --down: #b0005a;
  --warn-bg: #fff3e0; --warn-line: #e9cfa6; --warn-text: #6b2e00;
  --ca-pad: 20px;
  --ca-mono: 'JetBrains Mono', ui-monospace, monospace;
}
@media (min-width: 769px) { :root { --ca-pad: 32px; } }

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); }
.wp-site-blocks { padding: 0; }
.wp-site-blocks > * + * { margin-block-start: 0; }
a { text-underline-offset: 3px; }
.ca-mono { font-family: var(--ca-mono); }

/* Типографика */
h1, h2, h3, h4 { font-family: 'Lora', Georgia, serif; font-weight: 700; color: var(--text); }
h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); line-height: 1.15; letter-spacing: -0.01em; }
.entry-content h2 { font-size: 1.55rem; line-height: 1.2; margin-top: 2.2em; }
.entry-content h3 { font-size: 1.25rem; line-height: 1.25; margin-top: 1.6em; }
.entry-content p, .entry-content li { line-height: 1.6; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content img { border-radius: 10px; }
code { font-family: var(--ca-mono); font-size: 0.92em; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 4px; padding: 1px 5px; }
pre, .wp-block-code { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; overflow-x: auto; }
pre code { border: 0; padding: 0; }
blockquote, .wp-block-quote { border: 0; border-left: 3px solid var(--line); padding: 4px 0 4px 18px; margin-left: 0; color: var(--muted); }

/* Шапка */
.ca-header { padding-top: 18px; padding-bottom: 18px; }
.ca-header-row { align-items: center; gap: 16px; }
.ca-header-row > .wp-block-navigation { flex-shrink: 0; flex-wrap: nowrap; }
.ca-header .wp-block-navigation__container { flex-wrap: nowrap; gap: 2px 6px; }
.ca-header .wp-block-navigation-item__content { white-space: nowrap; }
.ca-header .wp-block-site-title { margin: 0; font-family: 'Lora', Georgia, serif; font-size: 1.45rem; font-weight: 700; }
.ca-header .wp-block-site-title a { color: var(--text); text-decoration: none; }
.wp-block-navigation .wp-block-navigation-item__content { color: var(--text); font-weight: 600; padding: 8px 10px; text-decoration: none; }
.wp-block-navigation .wp-block-navigation-item__content:hover, .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content { color: var(--accent); }
.wp-block-navigation__responsive-container-open { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.wp-block-navigation__responsive-container.is-menu-open { background: var(--bg); color: var(--text); }

/* Подвал */
.ca-footer { border-top: 1px solid var(--line); margin-top: 56px; padding-top: 22px; padding-bottom: 28px; font-size: 0.9rem; color: var(--muted); }
.ca-footer p { margin: 0 0 10px; }
.ca-footer a { color: var(--accent); font-weight: 600; text-decoration: none; }
.ca-footer-links { gap: 8px 18px; }

/* Шапка статьи */
.ca-post-head { margin-bottom: 28px; }
.ca-post-head .wp-block-post-title { margin: 0 0 12px; }
.ca-meta { gap: 4px 24px; font-size: 0.88rem; color: var(--muted); line-height: 1.5; }
.ca-meta p, .ca-meta div { margin: 0; }
.ca-meta a { color: var(--accent); font-weight: 600; text-decoration: none; }
.ca-meta .wp-block-post-date { font-family: var(--ca-mono); font-size: 0.82rem; }

/* Предупреждение и раскрытие */
.ca-warn, .is-style-ca-warn { display: flex; gap: 12px; align-items: flex-start; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 14px 16px; margin-block: 1.4rem; }
.ca-warn::before, .is-style-ca-warn::before { content: '!'; flex: none; width: 22px; height: 22px; border: 2px solid var(--warn-text); border-radius: 50%; color: var(--warn-text); font-weight: 800; font-size: 0.8rem; line-height: 18px; text-align: center; margin-top: 1px; }
.ca-warn p, .is-style-ca-warn p { margin: 0; font-size: 0.93rem; line-height: 1.55; color: var(--warn-text); }

/* Карточка данных */
.ca-data { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.ca-kv { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); gap: 12px; justify-content: space-between; align-items: baseline; }
.ca-kv:last-child { border-bottom: 0; }
.ca-kv p { margin: 0; }
.ca-kv p:first-child { color: var(--muted); font-size: 0.95rem; }
.ca-kv p:last-child { font-family: var(--ca-mono); font-size: 0.88rem; text-align: right; }
.ca-stamp { font-family: var(--ca-mono); font-size: 0.78rem; color: var(--muted); margin-top: 8px; }

/* Прогноз */
.ca-scn { gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); align-items: flex-start; flex-wrap: nowrap; --c: var(--text); }
.ca-scn-up { --c: var(--up); }
.ca-scn-down { --c: var(--down); }
.ca-scn .ca-arrow { flex: none; width: 22px; margin: 0; font-family: var(--ca-mono); font-size: 1.3rem; font-weight: 600; line-height: 1.2; color: var(--c); }
.ca-scn .ca-scn-body { gap: 4px; }
.ca-scn .ca-scn-body p { margin: 0; font-size: 0.97rem; line-height: 1.5; }
.ca-scn .ca-scn-body p:first-child { font-weight: 700; font-size: 1.02rem; }
.ca-scn .ca-level { font-family: var(--ca-mono); font-size: 0.82rem; color: var(--c); }
.ca-cancel { border: 1.5px solid var(--text); border-radius: 10px; padding: 14px 16px; margin-top: 18px; }
.ca-cancel p { margin: 0 0 4px; font-size: 0.97rem; line-height: 1.5; }
.ca-cancel p:first-child { font-weight: 700; font-size: 1.02rem; }

/* Кнопки */
.ca-btn, .ca-btn-outline { width: 100%; }
.ca-btn .wp-block-button__link, .ca-btn-outline .wp-block-button__link { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 700; font-size: 1rem; text-decoration: none; box-sizing: border-box; }
.ca-btn .wp-block-button__link { background: var(--accent); color: #fff; border: 1.5px solid var(--accent); }
.ca-btn-outline .wp-block-button__link { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.wp-block-buttons { gap: 10px; }

/* Таблицы: свайп вбок, первая колонка закреплена */
.wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-block: 1.2rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.wp-block-table table { border-collapse: collapse; width: 100%; min-width: 540px; font-size: 0.92rem; }
.wp-block-table th, .wp-block-table td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.wp-block-table tr:last-child td { border-bottom: 0; }
.wp-block-table th { font-weight: 700; color: var(--muted); font-size: 0.82rem; background: var(--bg); }
.wp-block-table td:not(:first-child) { font-size: 0.9rem; }
.wp-block-table th:first-child, .wp-block-table td:first-child { position: sticky; left: 0; background: var(--surface); font-weight: 600; box-shadow: 1px 0 0 var(--line-soft); }
.wp-block-table th:first-child { background: var(--bg); }

/* Инструкция: шаги */
.ca-steps { counter-reset: step; }
.ca-step { counter-increment: step; position: relative; padding-left: 50px; margin-block: 1.6rem; }
.ca-step::before { content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--text); color: #fff; font-family: var(--ca-mono); font-weight: 600; display: flex; align-items: center; justify-content: center; }
.ca-step h3 { margin-top: 0 !important; font-size: 1.2rem; }

/* Главная и списки */
.ca-hero { padding-top: 14px; }
.ca-hero h1 { margin: 0 0 14px; }
.ca-hero .ca-lead { font-size: 1.1rem; line-height: 1.55; color: var(--muted); max-width: 34em; margin: 0 !important; }
.ca-label { font-family: 'Lora', Georgia, serif; font-size: 1.5rem; font-weight: 700; margin: 40px 0 6px; }
.ca-list { margin-top: 0; }
.ca-list .wp-block-post-template { padding: 0; margin: 0; list-style: none; }
.ca-row { padding: 16px 0; border-bottom: 1px solid var(--line); gap: 16px; align-items: flex-start; }
.ca-row-text { flex: 1 1 0; min-width: 0; gap: 4px; }
.ca-thumb { flex: none; margin: 0; }
.ca-thumb img { border-radius: 10px; border: 1px solid var(--line); display: block; }
@media (max-width: 600px) { .ca-thumb { width: 72px !important; } }
.ca-row .wp-block-post-title { margin: 0; font-family: 'Onest', system-ui, sans-serif; font-size: 1.05rem; line-height: 1.35; font-weight: 600; }
.ca-row .wp-block-post-title a { color: var(--text); text-decoration: none; }
.ca-row .wp-block-post-title a:hover { color: var(--accent); }
.ca-row .wp-block-post-date { font-family: var(--ca-mono); font-size: 0.78rem; color: var(--muted); margin: 0; }
.ca-row .wp-block-post-excerpt { margin: 4px 0 0; font-size: 0.92rem; color: var(--muted); }
.ca-row .wp-block-post-excerpt__excerpt { margin: 0; }
.wp-block-post-excerpt__more-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.wp-block-query-pagination { gap: 14px; margin-top: 26px; font-family: var(--ca-mono); font-size: 0.9rem; }
.wp-block-query-pagination a { color: var(--accent); text-decoration: none; }
.ca-trust { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.ca-trust-item { padding: 15px 16px; border-bottom: 1px solid var(--line-soft); gap: 2px; }
.ca-trust-item:last-child { border-bottom: 0; }
.ca-trust-item p { margin: 0; font-size: 0.92rem; color: var(--muted); line-height: 1.45; }
.ca-trust-item p:first-child { font-size: 1rem; font-weight: 600; }
.ca-trust-item a { color: var(--accent); text-decoration: none; }
.ca-archive-head { margin-bottom: 18px; }
.ca-archive-head h1 { margin: 0 0 8px; }
.ca-archive-head p { margin: 0; color: var(--muted); }
.wp-block-search__input { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.wp-block-search__button { background: var(--accent); color: #fff; border: 0; border-radius: 10px; font-weight: 700; padding: 12px 20px; }

/* ===== Макет с сайдбаром ===== */
.ca-layout { gap: 48px; align-items: flex-start; }
.ca-main { flex: 1 1 520px; min-width: 0; max-width: 720px; }
.ca-aside { flex: 0 0 300px; width: 300px; }
@media (max-width: 900px) {
  .ca-layout { gap: 36px; }
  .ca-main, .ca-aside { flex: 1 1 100%; max-width: none; width: 100%; }
}
h1.ca-label { font-size: 1.5rem; margin: 6px 0 6px; }
.ca-widget { margin-bottom: 30px; }
.ca-widget h2 { font-size: 1.1rem; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.ca-widget ul { list-style: none; padding: 0; margin: 0; }
.ca-widget li { padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.95rem; line-height: 1.4; }
.ca-widget li:last-child { border-bottom: 0; }
.ca-widget a { color: var(--text); text-decoration: none; }
.ca-widget a:hover { color: var(--accent); }
.wp-block-categories { color: var(--muted); font-family: var(--ca-mono); font-size: 0.8rem; }
.wp-block-categories li { display: flex; justify-content: space-between; gap: 8px; }
.wp-block-categories a { font-family: 'Onest', system-ui, sans-serif; font-size: 0.95rem; }
.wp-block-latest-posts li:has(.wp-block-latest-posts__featured-image) { display: grid; grid-template-columns: 56px 1fr; gap: 2px 12px; align-items: start; }
.wp-block-latest-posts__featured-image { grid-row: 1 / span 2; margin: 0 !important; float: none; }
.wp-block-latest-posts__featured-image img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.wp-block-latest-posts__post-title { font-weight: 600; }
.wp-block-latest-posts__post-date { display: block; font-family: var(--ca-mono); font-size: 0.75rem; color: var(--muted); }
.wp-block-tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.wp-block-tag-cloud a { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 0.85rem !important; color: var(--text); text-decoration: none; background: var(--surface); }
.wp-block-tag-cloud a:hover { border-color: var(--accent); color: var(--accent); }

/* Подвал по ширине макета (на случай сохранённой в редакторе старой версии) */
.ca-footer > * { max-width: 1068px !important; margin-left: auto !important; margin-right: auto !important; }
