/*
Theme Name: HiTek Blog
Theme URI: https://example.com/hitek-blog
Author: HiTek Studio
Author URI: https://example.com
Description: Премиальная тёмная тема в стиле Hi-Tech для персонального блога. Full Site Editing, оптимизирована под Core Web Vitals, WCAG 2.1 AA, готова к переводу. Неоновые акценты, моноширинная типографика, стеклянные карточки.
Version: 1.2.0
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: hitek-blog
Tags: dark, one-column, two-columns, right-sidebar, custom-colors, custom-menu, featured-images, full-site-editing, block-patterns, translation-ready, accessibility-ready
*/

/* ==========================================================================
   HI-TEK DESIGN TOKENS
   ========================================================================== */
:root {
  /* Colors */
  --hitek-bg: #0a0e14;
  --hitek-bg-alt: #0f1420;
  --hitek-surface: rgba(255, 255, 255, 0.04);
  --hitek-surface-border: rgba(0, 240, 255, 0.18);
  --hitek-text: #e6f1ff;
  --hitek-text-muted: #8b9bb4;
  --hitek-cyan: #00f0ff;
  --hitek-violet: #b026ff;
  --hitek-cyan-glow: 0 0 12px rgba(0, 240, 255, 0.55);
  --hitek-violet-glow: 0 0 16px rgba(176, 38, 255, 0.45);
  --hitek-grid-line: rgba(0, 240, 255, 0.08);

  /* Typography */
  --hitek-font-display: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --hitek-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --hitek-max-width: 1180px;
  --hitek-radius: 14px;
  --hitek-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light mode override (prefers-color-scheme: light OR .is-light-mode) */
body.is-light-mode {
  --hitek-bg: #f4f7fb;
  --hitek-bg-alt: #ffffff;
  --hitek-surface: rgba(10, 14, 20, 0.03);
  --hitek-surface-border: rgba(0, 150, 200, 0.25);
  --hitek-text: #0a0e14;
  --hitek-text-muted: #4b5a70;
  --hitek-grid-line: rgba(0, 150, 200, 0.08);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--hitek-bg);
  background-image:
    linear-gradient(var(--hitek-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--hitek-grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  color: var(--hitek-text);
  font-family: var(--hitek-font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--hitek-transition), color var(--hitek-transition);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--hitek-font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--hitek-text);
  line-height: 1.25;
}

a { color: var(--hitek-cyan); text-decoration: none; transition: color var(--hitek-transition), text-shadow var(--hitek-transition); }
a:hover, a:focus { color: var(--hitek-violet); text-shadow: var(--hitek-violet-glow); }
a:focus-visible { outline: 2px solid var(--hitek-cyan); outline-offset: 3px; }

img { max-width: 100%; height: auto; display: block; border-radius: var(--hitek-radius); }

.hitek-container { max-width: var(--hitek-max-width); margin-inline: auto; padding-inline: 24px; }

/* Skip link — accessibility */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--hitek-cyan); color: #000; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* Screen-reader-only text (labels, "Search for:", etc.) — visible to assistive tech only */
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  position: static !important; width: auto; height: auto; margin: 0; overflow: visible;
  clip: auto; white-space: normal; background: var(--hitek-cyan); color: #05070a; padding: 10px 16px; border-radius: 8px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.hitek-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(14px) saturate(140%);
  background: rgba(10, 14, 20, 0.72);
  border-bottom: 1px solid var(--hitek-surface-border);
}
.hitek-header-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 16px; gap: 24px; }

.hitek-logo { font-family: var(--hitek-font-display); font-size: 1.35rem; font-weight: 700; color: var(--hitek-text); display: flex; align-items: center; gap: 8px; }
.hitek-logo .dot { color: var(--hitek-cyan); text-shadow: var(--hitek-cyan-glow); }

.hitek-nav ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.hitek-nav a { font-family: var(--hitek-font-display); font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--hitek-text-muted); position: relative; padding-bottom: 4px; }
.hitek-nav a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--hitek-cyan), var(--hitek-violet));
  transition: right var(--hitek-transition);
}
.hitek-nav a:hover, .hitek-nav a:focus, .hitek-nav .current-menu-item a { color: var(--hitek-text); }
.hitek-nav a:hover::after, .hitek-nav a:focus::after, .hitek-nav .current-menu-item a::after { right: 0; }

.hitek-cta {
  font-family: var(--hitek-font-display); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 10px 20px; border-radius: 999px; border: 1px solid var(--hitek-cyan); color: var(--hitek-cyan) !important;
  box-shadow: inset 0 0 0 0 var(--hitek-cyan);
  transition: all var(--hitek-transition);
}
.hitek-cta:hover, .hitek-cta:focus { background: var(--hitek-cyan); color: #05070a !important; text-shadow: none; box-shadow: var(--hitek-cyan-glow); }

/* Залитая (solid) кнопка — используется для основного/акцентного CTA.
   Отдельный класс со своим !important, иначе базовый .hitek-cta color:!important
   перебивает даже инлайн-стили и делает текст невидимым на цветном фоне. */
.hitek-cta--filled {
  background: var(--hitek-cyan);
  border-color: var(--hitek-cyan);
  color: #05070a !important;
  text-shadow: none;
}
.hitek-cta--filled:hover, .hitek-cta--filled:focus {
  background: var(--hitek-violet);
  border-color: var(--hitek-violet);
  color: #05070a !important;
  box-shadow: var(--hitek-violet-glow);
}

.hitek-menu-toggle { display: none; background: none; border: 1px solid var(--hitek-surface-border); border-radius: 8px; color: var(--hitek-text); padding: 8px 12px; cursor: pointer; }

.hitek-mobile-menu { border-top: 1px solid var(--hitek-surface-border); background: var(--hitek-bg); }
.hitek-mobile-menu ul { list-style: none; margin: 0; padding: 16px 0; display: flex; flex-direction: column; gap: 4px; }
.hitek-mobile-menu a { font-family: var(--hitek-font-display); text-transform: uppercase; letter-spacing: 0.06em; padding: 12px 4px; display: block; color: var(--hitek-text-muted); border-bottom: 1px solid var(--hitek-grid-line); }
.hitek-mobile-menu a:hover { color: var(--hitek-cyan); }

.hitek-nav a.is-active { color: var(--hitek-cyan); }
.hitek-nav a.is-active::after { right: 0; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hitek-hero { padding-block: 100px 80px; position: relative; overflow: hidden; }
.hitek-hero::before {
  content: ''; position: absolute; inset: -20% -10% auto -10%; height: 480px;
  background: radial-gradient(ellipse at 30% 30%, rgba(0,240,255,0.16), transparent 60%),
              radial-gradient(ellipse at 70% 60%, rgba(176,38,255,0.14), transparent 60%);
  filter: blur(20px); pointer-events: none;
}
.hitek-hero-eyebrow {
  font-family: var(--hitek-font-display); color: var(--hitek-cyan); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.85rem; display: inline-flex; align-items: center; gap: 10px; margin-bottom: 20px;
}
.hitek-hero-eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--hitek-cyan); box-shadow: var(--hitek-cyan-glow); }
.hitek-hero h1 { font-size: clamp(1.8rem, 3.6vw, 3.4rem); max-width: none; margin: 0 0 20px; white-space: nowrap; }
.hitek-hero h1 .accent { color: var(--hitek-cyan); text-shadow: var(--hitek-cyan-glow); }
.hitek-hero p.lede { color: var(--hitek-text-muted); font-size: 1.15rem; max-width: 56ch; }

.hitek-hero-search {
  margin-top: 32px;
  margin-inline: auto;
  max-width: 560px;
  padding: 24px;
}
.hitek-hero-search .search-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hitek-hero-search .search-field {
  width: 100%;
}
.hitek-hero-search .search-submit {
  width: 100%;
}

/* ==========================================================================
   CARDS / GLASSMORPHISM
   ========================================================================== */
.hitek-card {
  background: var(--hitek-surface);
  border: 1px solid var(--hitek-surface-border);
  border-radius: var(--hitek-radius);
  padding: 28px;
  backdrop-filter: blur(8px);
  transition: transform var(--hitek-transition), box-shadow var(--hitek-transition), border-color var(--hitek-transition);
}
.hitek-card:hover { transform: translateY(-4px); border-color: var(--hitek-cyan); box-shadow: 0 12px 30px rgba(0,240,255,0.08); }

.hitek-grid { display: grid; gap: 24px; }
.hitek-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.hitek-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.hitek-section { padding-block: 72px; }
.hitek-section-title { font-size: 1.9rem; margin-bottom: 12px; }
.hitek-section-kicker { font-family: var(--hitek-font-display); color: var(--hitek-violet); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.14em; margin-bottom: 10px; display: block; }

/* ==========================================================================
   POST CARDS
   ========================================================================== */
.hitek-post-card { display: flex; flex-direction: column; height: 100%; }
.hitek-post-card .thumb { border-radius: var(--hitek-radius); overflow: hidden; margin-bottom: 18px; aspect-ratio: 16/10; border: 1px solid var(--hitek-surface-border); }
.hitek-post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.hitek-post-card:hover .thumb img { transform: scale(1.06); }
.hitek-post-card .meta { font-family: var(--hitek-font-display); font-size: 0.78rem; color: var(--hitek-text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.hitek-post-card h3 { font-size: 1.15rem; margin: 0 0 10px; }
.hitek-post-card .excerpt { color: var(--hitek-text-muted); font-size: 0.95rem; flex-grow: 1; }
.hitek-post-card .read-more { font-family: var(--hitek-font-display); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 14px; }

/* ==========================================================================
   SINGLE POST
   ========================================================================== */
.hitek-single { padding-block: 60px 100px; }
.hitek-single .post-header { margin-bottom: 36px; }
.hitek-single .post-header .meta { font-family: var(--hitek-font-display); color: var(--hitek-cyan); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px; }
.hitek-single .post-header h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.hitek-single .featured-image { margin-block: 32px; border: 1px solid var(--hitek-surface-border); }
.hitek-entry-content { max-width: 74ch; font-size: 1.08rem; }
.hitek-entry-content h2, .hitek-entry-content h3 { margin-top: 2.2em; }
.hitek-entry-content p { margin-bottom: 1.4em; }
.hitek-entry-content blockquote {
  border-left: 3px solid var(--hitek-cyan); margin: 2em 0; padding: 0.4em 0 0.4em 1.4em;
  color: var(--hitek-text-muted); font-style: italic;
}
.hitek-entry-content pre, .hitek-entry-content code {
  font-family: var(--hitek-font-display); background: var(--hitek-bg-alt); border: 1px solid var(--hitek-surface-border);
  border-radius: 8px;
}
.hitek-entry-content pre { padding: 20px; padding-top: 44px; overflow-x: auto; position: relative; }
.hitek-entry-content code { padding: 2px 6px; font-size: 0.9em; }
.hitek-entry-content pre code { border: none; padding: 0; background: none; }

/* Кнопка "Копировать" в блоках кода */
.hitek-copy-btn {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--hitek-font-display); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--hitek-surface); border: 1px solid var(--hitek-surface-border); border-radius: 6px;
  color: var(--hitek-text-muted); padding: 5px 10px; cursor: pointer; line-height: 1;
  transition: color var(--hitek-transition), border-color var(--hitek-transition), background var(--hitek-transition);
}
.hitek-copy-btn:hover { color: var(--hitek-cyan); border-color: var(--hitek-cyan); }
.hitek-copy-btn.is-copied { color: #05070a; background: var(--hitek-cyan); border-color: var(--hitek-cyan); }

/* Изображения в тексте записи — кликабельны для увеличения */
.hitek-entry-content img {
  cursor: zoom-in;
  transition: opacity var(--hitek-transition);
}
.hitek-entry-content img:hover { opacity: 0.92; }

/* ==========================================================================
   ЛАЙТБОКС ИЗОБРАЖЕНИЙ (увеличение/уменьшение)
   ========================================================================== */
.hitek-lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(5, 7, 10, 0.92);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity var(--hitek-transition), visibility var(--hitek-transition);
}
.hitek-lightbox.is-open { opacity: 1; visibility: visible; }

.hitek-lightbox-stage {
  max-width: 92vw; max-height: 82vh; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.hitek-lightbox-stage img {
  max-width: 92vw; max-height: 82vh; border-radius: 8px;
  border: 1px solid var(--hitek-surface-border);
  cursor: grab;
  transition: transform 150ms ease-out;
  transform-origin: center center;
  user-select: none;
}
.hitek-lightbox-stage img:active { cursor: grabbing; }

.hitek-lightbox-controls {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  background: var(--hitek-surface); border: 1px solid var(--hitek-surface-border);
  border-radius: 999px; padding: 8px; backdrop-filter: blur(10px);
}
.hitek-lightbox-controls button {
  width: 40px; height: 40px; border-radius: 50%;
  background: transparent; color: var(--hitek-text);
  border: 1px solid var(--hitek-surface-border);
  font-family: var(--hitek-font-display); font-size: 1.1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: border-color var(--hitek-transition), color var(--hitek-transition), background var(--hitek-transition);
}
.hitek-lightbox-controls button:hover { border-color: var(--hitek-cyan); color: var(--hitek-cyan); box-shadow: none; transform: none; }
.hitek-lightbox-zoom-level {
  font-family: var(--hitek-font-display); font-size: 0.78rem; color: var(--hitek-text-muted);
  min-width: 46px; text-align: center; user-select: none;
}

.hitek-lightbox-close {
  position: absolute; top: 20px; right: 24px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--hitek-surface); border: 1px solid var(--hitek-surface-border); color: var(--hitek-text);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--hitek-transition), color var(--hitek-transition);
}
.hitek-lightbox-close:hover { border-color: var(--hitek-cyan); color: var(--hitek-cyan); box-shadow: none; transform: none; }

@media (max-width: 680px) {
  .hitek-lightbox-close { top: 12px; right: 12px; width: 38px; height: 38px; }
  .hitek-lightbox-controls { bottom: 16px; }
}
.hitek-entry-content a { border-bottom: 1px dotted var(--hitek-cyan); }
.hitek-entry-content ul, .hitek-entry-content ol { padding-left: 1.4em; }

.hitek-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
.hitek-tags a {
  font-family: var(--hitek-font-display); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid var(--hitek-surface-border); border-radius: 999px; padding: 6px 14px; color: var(--hitek-text-muted) !important;
}
.hitek-tags a:hover { border-color: var(--hitek-cyan); color: var(--hitek-cyan) !important; }

/* ==========================================================================
   SIDEBAR / WIDGETS
   ========================================================================== */
.widget { margin-bottom: 32px; }
.widget-title { font-family: var(--hitek-font-display); font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--hitek-cyan); margin-bottom: 16px; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.hitek-footer { border-top: 1px solid var(--hitek-surface-border); padding-block: 56px 32px; margin-top: 80px; }
.hitek-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.hitek-footer-grid.hitek-footer-grid--single { grid-template-columns: 1fr; max-width: 480px; }
.hitek-footer h3 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--hitek-cyan); margin-bottom: 16px; }
.hitek-footer ul { list-style: none; margin: 0; padding: 0; }
.hitek-footer li { margin-bottom: 10px; }
.hitek-footer a { color: var(--hitek-text-muted); }
.hitek-footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; border-top: 1px solid var(--hitek-grid-line); font-size: 0.85rem; color: var(--hitek-text-muted); font-family: var(--hitek-font-display); }

/* ==========================================================================
   BUTTONS / FORMS
   ========================================================================== */
.wp-block-button__link, button, input[type="submit"] {
  font-family: var(--hitek-font-display); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85rem;
  background: linear-gradient(90deg, var(--hitek-cyan), var(--hitek-violet)); color: #05070a; border: none;
  padding: 12px 24px; border-radius: 999px; cursor: pointer; transition: box-shadow var(--hitek-transition), transform var(--hitek-transition);
}
.wp-block-button__link:hover, button:hover, input[type="submit"]:hover { box-shadow: var(--hitek-cyan-glow); transform: translateY(-2px); }

input, textarea, select {
  background: var(--hitek-surface); border: 1px solid var(--hitek-surface-border); border-radius: 8px;
  color: var(--hitek-text); padding: 12px 14px; font-family: var(--hitek-font-body); width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--hitek-cyan); border-color: var(--hitek-cyan); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .hitek-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .hitek-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .hitek-nav { display: none; }
  .hitek-menu-toggle { display: inline-flex; }
  .hitek-grid.cols-3, .hitek-grid.cols-2 { grid-template-columns: 1fr; }
  .hitek-footer-grid { grid-template-columns: 1fr; }
  .hitek-hero { padding-block: 64px 48px; }
  .hitek-hero h1 { white-space: normal; font-size: clamp(1.7rem, 6.4vw, 2.4rem); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
