/* quantumzona.com - design system per SITE_SPEC.md section 6.
   Class prefix qz- (unique across sites). Fonts: Jost (heading) + Nunito
   Sans (body) - free analogs for the unavailable Avenir Light per spec. */

:root {
  --qz-bg: #FFFFFE;
  --qz-text: #212121;
  --qz-accent: #DF3131;
  --qz-dark: #000000;
  --qz-muted: #646464;
  --qz-muted2: #969696;
  --qz-border: #D8D8D8;
  --qz-footer-bg: #F5F5F5;
  --qz-font-heading: "Jost", system-ui, sans-serif;
  --qz-font-body: "Nunito Sans", system-ui, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--qz-bg);
  color: var(--qz-text);
  font-family: var(--qz-font-body);
  font-size: 16px;
  line-height: 1.65;
}

img { max-width: 100%; display: block; }
a { color: var(--qz-accent); text-decoration: underline; }
a:hover { color: var(--qz-dark); }

h1, h2, h3 {
  font-family: var(--qz-font-heading);
  font-weight: 400;
  color: var(--qz-text);
  margin: 0 0 16px;
}
h1 { font-size: 44px; line-height: 1.15; }
h2 { font-size: 28px; margin-top: 32px; color: var(--qz-text); }
h3 { font-size: 20px; }
p { margin: 0 0 16px; }

.qz-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}
@media (max-width: 700px) { .qz-container { padding: 0 24px; } }

/* ── header ───────────────────────────────────────────────────────────── */

.qz-header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--qz-border);
  position: sticky; top: 0; z-index: 30;
}
.qz-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 84px;
}
.qz-logo {
  font-family: var(--qz-font-heading); font-size: 21px; color: var(--qz-text);
  text-decoration: none; line-height: 1.2;
}
.qz-logo-sub { display: block; font-size: 12px; color: var(--qz-muted); font-family: var(--qz-font-body); }
.qz-nav > ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.qz-nav > ul > li { position: relative; }
.qz-nav a {
  font-size: 15px; color: var(--qz-text); text-decoration: none; display: inline-block;
  padding: 8px 0;
}
.qz-nav a[aria-current="page"] { color: var(--qz-accent); border-bottom: 1px solid var(--qz-accent); }
.qz-submenu {
  display: none; position: absolute; left: 0; top: 100%;
  background: #FFFFFF; border: 1px solid var(--qz-border); min-width: 220px;
  list-style: none; margin: 0; padding: 8px 0; z-index: 10;
}
.qz-has-sub:hover .qz-submenu, .qz-has-sub:focus-within .qz-submenu { display: block; }
.qz-submenu li { padding: 0 16px; }
.qz-submenu a { display: block; padding: 8px 0; font-size: 14px; }
.qz-nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: none;
  cursor: pointer; padding: 8px;
}
.qz-nav-toggle span { width: 24px; height: 2px; background: var(--qz-text); display: block; }

@media (max-width: 860px) {
  .qz-header-inner { min-height: 64px; }
  .qz-nav-toggle { display: flex; }
  .qz-nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    background: #FFFFFF; border-bottom: 1px solid var(--qz-border);
  }
  .qz-nav.qz-nav-open { display: block; }
  .qz-nav > ul { flex-direction: column; gap: 0; padding: 8px 24px 16px; }
  .qz-nav > ul > li { width: 100%; }
  .qz-submenu { position: static; border: none; padding: 0 0 0 16px; }
  .qz-has-sub:hover .qz-submenu, .qz-has-sub:focus-within .qz-submenu { display: block; }
}

/* ── footer ───────────────────────────────────────────────────────────── */

.qz-footer { background: var(--qz-footer-bg); border-top: 1px solid var(--qz-border); margin-top: 64px; }
.qz-footer-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding: 40px 40px; }
.qz-footer-logo { font-family: var(--qz-font-heading); font-size: 20px; margin: 0 0 8px; }
.qz-footer-tagline { color: var(--qz-muted); font-size: 14px; }
.qz-footer-links { list-style: none; margin: 0; padding: 0; }
.qz-footer-links li { margin-bottom: 8px; }
.qz-footer-links a, .qz-footer-col a { color: var(--qz-text); text-decoration: none; }
.qz-footer-links a:hover, .qz-footer-col a:hover { color: var(--qz-accent); }
.qz-footer-label { color: var(--qz-text); font-weight: 600; margin-bottom: 8px; }
.qz-footer-copy { color: var(--qz-muted); font-size: 13px; padding: 16px 40px 24px; }
@media (max-width: 700px) { .qz-footer-inner, .qz-footer-copy { padding-left: 24px; padding-right: 24px; } .qz-footer-inner { grid-template-columns: 1fr; } }

/* ── hero ─────────────────────────────────────────────────────────────── */

.qz-hero { position: relative; width: 100%; overflow: hidden; background: var(--qz-dark); }
.qz-hero-wide { aspect-ratio: 16/9; max-height: 480px; }
.qz-hero-flat { height: 300px; }
.qz-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qz-hero-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center; }
.qz-hero-text { width: 100%; }
.qz-hero-text h1 { color: #FFFFFF; text-shadow: 0 2px 10px rgba(0,0,0,0.6); margin: 0 0 8px; }
.qz-hero-sub { color: #FFFFFF; font-size: 18px; text-shadow: 0 1px 6px rgba(0,0,0,0.5); margin: 0 0 16px; }
@media (max-width: 480px) { .qz-hero-wide { aspect-ratio: 4/3; } .qz-hero-flat { height: 200px; } .qz-hero-text h1 { font-size: 30px; } }

/* ── breadcrumbs ──────────────────────────────────────────────────────── */

.qz-crumbs { display: block; font-size: 13px; color: var(--qz-muted); margin: 20px 0 8px; }
.qz-crumbs a { color: var(--qz-muted); text-decoration: none; }
.qz-crumbs a:hover { color: var(--qz-accent); }
.qz-crumbs-sep { margin: 0 8px; }
.qz-crumbs-mid { margin: 0 8px 0 0; color: var(--qz-muted2); }
.qz-crumbs-current { color: var(--qz-text); }

/* ── layout / articles ────────────────────────────────────────────────── */

.qz-page-body { padding-bottom: 40px; }
.qz-article-h1 { max-width: 760px; }
.qz-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .qz-layout { grid-template-columns: 1fr; } }
.qz-article { max-width: 760px; }
.qz-article h2 { color: var(--qz-text); }
.qz-article-img { width: 100%; border-radius: 4px; margin-bottom: 16px; object-fit: cover; }

.qz-sidebar {
  background: var(--qz-footer-bg); border: 1px solid var(--qz-border);
  border-radius: 6px; padding: 20px; position: sticky; top: 100px;
}
.qz-sidebar-title { font-size: 18px; margin-top: 0; }
.qz-sidebar-note { font-size: 14px; color: var(--qz-muted); }
.qz-sidebar-list { list-style: none; padding: 0; margin: 0; }
.qz-sidebar-list li { margin-bottom: 8px; }
.qz-sidebar-list a { color: var(--qz-text); text-decoration: none; font-size: 14px; }
.qz-sidebar-list a:hover { color: var(--qz-accent); }

.qz-intro { max-width: 760px; margin: 40px auto; }

/* ── section titles / cards ──────────────────────────────────────────── */

.qz-section-title { text-align: center; margin-top: 48px; }
.qz-cards-section { margin-bottom: 16px; }
.qz-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 24px; }
@media (max-width: 900px) { .qz-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .qz-cards { grid-template-columns: 1fr; } }
.qz-card { background: #FFFFFF; border: 1px solid var(--qz-border); border-radius: 6px; overflow: hidden; transition: box-shadow .2s; }
.qz-card:hover { box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.qz-card-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.qz-card-body { padding: 16px 20px; }
.qz-card-title { font-size: 18px; margin: 0 0 8px; }
.qz-card-title a { color: var(--qz-text); text-decoration: none; }
.qz-card:hover .qz-card-title a { color: var(--qz-accent); }
.qz-card-desc { font-size: 14px; color: var(--qz-muted); margin: 0; }

/* ── O meni block / latest / contact band ────────────────────────────── */

.qz-omeni-section { margin: 48px 0; }
.qz-omeni-block { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: center; }
.qz-editorial-img { width: 100%; border-radius: 6px; object-fit: cover; aspect-ratio: 3/4; }
@media (max-width: 700px) { .qz-omeni-block { grid-template-columns: 1fr; } }

.qz-latest-section { margin-bottom: 56px; }
.qz-latest-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 32px; list-style: none; margin: 16px 0 32px; padding: 0; }
.qz-latest-list a { color: var(--qz-text); text-decoration: none; border-bottom: 1px solid var(--qz-border); display: block; padding: 10px 0; font-size: 15px; }
.qz-latest-list a:hover { color: var(--qz-accent); }
/* Одинокий элемент в последнем ряду 3-колоночной сетки - растянуть на всю
   ширину вместо пустого «хвоста» (не меняет число пунктов, только раскладку). */
.qz-latest-list li:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
.qz-latest-list li:nth-last-child(2):nth-child(3n+1),
.qz-latest-list li:last-child:nth-child(3n+2) { grid-column: span 2; }
@media (max-width: 700px) { .qz-latest-list { grid-template-columns: 1fr; } }

.qz-contact-band { background: var(--qz-footer-bg); border: 1px solid var(--qz-border); border-radius: 6px; padding: 20px 24px; text-align: center; }
.qz-contact-band p { margin: 0; }

/* ── related / sidebar list on hubs ──────────────────────────────────── */

.qz-related { margin-top: 48px; max-width: 760px; }
.qz-related-title { font-size: 20px; }
.qz-related-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.qz-related-list a { display: block; padding: 12px 16px; background: var(--qz-footer-bg); border: 1px solid var(--qz-border); border-radius: 4px; color: var(--qz-text); text-decoration: none; font-size: 14px; }
.qz-related-list a:hover { border-color: var(--qz-accent); color: var(--qz-accent); }

/* ── contact form / buttons ───────────────────────────────────────────── */

.qz-contact-article { max-width: 760px; }
.qz-contact-form { margin: 24px 0 40px; }
.qz-field { margin-bottom: 16px; }
.qz-field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.qz-field input, .qz-field textarea {
  width: 100%; font-family: var(--qz-font-body); font-size: 16px; padding: 10px 12px;
  border: 1px solid var(--qz-border); border-radius: 4px; background: #FFFFFF; color: var(--qz-text);
}
.qz-field input:focus, .qz-field textarea:focus { outline: 2px solid var(--qz-accent); }

.qz-btn {
  display: inline-block; background: var(--qz-dark); color: #FFFFFF; border: none;
  border-radius: 4px; padding: 12px 28px; font-family: var(--qz-font-body);
  font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.qz-btn:hover { background: var(--qz-accent); color: #FFFFFF; }

/* ── error pages ──────────────────────────────────────────────────────── */

.qz-error-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 24px; }
.qz-error-code { font-family: var(--qz-font-heading); font-size: 88px; color: var(--qz-accent); margin: 0; }
.qz-error-msg { font-size: 18px; color: var(--qz-text); margin: 8px 0 24px; }

.qz-archive-list { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 24px; }
.qz-archive-list a { color: var(--qz-text); font-size: 14px; }
@media (max-width: 700px) { .qz-archive-list { grid-template-columns: 1fr; } }

@media (max-width: 640px) {
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
