/* Журнал GOC Control — layout как у Kontur: фильтры + сетка карточек */

.journal-page {
  background: #000;
  min-height: 100vh;
}

.journal-page .site-atmosphere,
.journal-page .grain {
  display: none;
}

.journal-header {
  background: #000 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: none;
}

.journal-header .nav a[aria-current="page"] {
  color: #fff;
  box-shadow: inset 0 -2px 0 #2563eb;
}

/* ——— Category bar ——— */
.journal-filters {
  position: sticky;
  top: 64px;
  z-index: 50;
  background: #111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.journal-filters__inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.journal-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

.journal-chips::-webkit-scrollbar { display: none; }

.journal-chip {
  appearance: none;
  flex: 0 0 auto;
  border: none;
  background: #1a1a1a;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.journal-chip:hover { background: #2a2a2a; }

.journal-chip.is-active {
  background: #2563eb;
  color: #fff;
}

.journal-search--compact {
  flex: 0 0 auto;
  position: relative;
  margin-left: auto;
  width: 44px;
  height: 44px;
  z-index: 2;
}

.journal-search--compact input {
  position: absolute;
  right: 0;
  top: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #1a1a1a;
  color: transparent;
  caret-color: #fff;
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: width 0.22s ease, padding 0.22s ease, color 0.22s ease, background 0.22s ease;
}

.journal-search--compact input::placeholder {
  color: transparent;
}

.journal-search--compact:focus-within,
.journal-search--compact.is-open {
  width: min(240px, 46vw);
}

.journal-search--compact:focus-within input,
.journal-search--compact.is-open input,
.journal-search--compact input:not(:placeholder-shown) {
  width: 100%;
  padding: 0 40px 0 14px;
  color: #fff;
  cursor: text;
  background: #222;
}

.journal-search--compact:focus-within input::placeholder,
.journal-search--compact.is-open input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.journal-search--compact .journal-search__icon {
  position: absolute;
  right: 0;
  top: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  opacity: 0.85;
  pointer-events: none;
  color: #fff;
  font-size: 1.1rem;
}

/* ——— Main ——— */
.journal-main {
  padding: 36px 0 72px;
}

.journal-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.journal-title {
  font-family: var(--display);
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #e8e8e8;
  margin: 0 0 28px;
  line-height: 1.15;
}

/* Featured: 2/3 + 1/3 */
.journal-featured {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 28px 24px;
  margin-bottom: 36px;
}

@media (max-width: 860px) {
  .journal-featured { grid-template-columns: 1fr; }
}

/* Uniform grid */
.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 22px;
}

@media (max-width: 980px) {
  .journal-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .journal-grid { grid-template-columns: 1fr; gap: 28px; }
  .journal-filters { top: 56px; }
}

/* ——— Cards (Kontur style) ——— */
.j-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.j-card__cover {
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(37, 99, 235, 0.5), transparent 52%),
    radial-gradient(circle at 85% 25%, rgba(245, 197, 24, 0.2), transparent 48%),
    linear-gradient(145deg, #0d1524, #1a2740);
  position: relative;
  margin-bottom: 14px;
  transition: transform 0.25s ease;
}

.j-card:hover .j-card__cover {
  transform: translateY(-2px);
}

.j-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.j-card__cover-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 3rem;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.16);
}

.j-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 0;
}

.j-card h2,
.j-card h3 {
  font-family: var(--display);
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin: 0;
  letter-spacing: -0.02em;
}

.j-card h3 { font-size: 1.12rem; }

.j-card--featured h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
}

.j-card--side h2 {
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
}

.j-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  color: #8b8b8b;
  font-size: 0.88rem;
  margin-top: 2px;
}

.j-card__meta .j-cat {
  color: #8b8b8b;
}

.j-card__read {
  margin-top: 6px;
  color: #93c5fd;
  font-weight: 600;
  font-size: 0.95rem;
}

.j-card:hover .j-card__read { color: #bfdbfe; }

.j-card p {
  display: none;
}

.j-badge,
.j-card__footer {
  display: none;
}

/* Status / empty */
.journal-loading,
.journal-empty,
.journal-error {
  padding: 28px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: #9ca3af;
  text-align: center;
  margin-bottom: 24px;
}

.journal-error {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
}

.journal-pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.journal-pager button {
  appearance: none;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.journal-pager button.is-active,
.journal-pager button:hover {
  background: #2563eb;
  border-color: #2563eb;
}

/* ——— Article ——— */
.article-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 0 64px;
}

.article-top { margin-bottom: 22px; }

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #93c5fd;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 18px;
}

.article-back:hover { color: #bfdbfe; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: #8b8b8b;
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.article-meta .j-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.22);
  color: #bfdbfe;
  font-weight: 700;
  font-size: 0.78rem;
}

.article-wrap h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.15;
  margin-bottom: 14px;
  color: #fff;
}

.article-excerpt {
  font-size: 1.15rem;
  color: #b0b0b0;
  margin-bottom: 22px;
}

.article-cover {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 28px;
  aspect-ratio: 16 / 9;
  background: linear-gradient(145deg, #0b1728, #1a2d48);
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-byline {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
  color: #9ca3af;
  font-size: 0.95rem;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #e8eef7;
}

.article-body h2 {
  margin: 1.6em 0 0.55em;
  font-size: 1.45rem;
  color: #fff;
}

.article-body h3 {
  margin: 1.35em 0 0.45em;
  font-size: 1.2rem;
  color: #fff;
}

.article-body p { margin: 0 0 1em; }
.article-body ul, .article-body ol { margin: 0 0 1.1em 1.2em; }
.article-body li { margin: 0.35em 0; }
.article-body a { color: #93c5fd; }
.article-body a:hover { color: #bfdbfe; }
.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: rgba(15, 23, 42, 0.7);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.j-figure {
  margin: 1.4em 0;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(7, 17, 31, 0.5);
}

.j-figure img { width: 100%; display: block; }
.j-figure figcaption {
  padding: 10px 14px;
  color: #8b8b8b;
  font-size: 0.9rem;
}

.j-quote {
  margin: 1.4em 0;
  padding: 18px 20px;
  border-left: 3px solid #f5c518;
  background: rgba(245, 197, 24, 0.08);
  border-radius: 0 14px 14px 0;
}

.j-quote cite {
  display: block;
  margin-top: 8px;
  color: #8b8b8b;
  font-style: normal;
  font-size: 0.9rem;
}

.j-callout {
  margin: 1.3em 0;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.j-callout--info { background: rgba(37, 99, 235, 0.14); border-color: rgba(96, 165, 250, 0.35); }
.j-callout--tip { background: rgba(16, 185, 129, 0.12); border-color: rgba(52, 211, 153, 0.35); }
.j-callout--warn { background: rgba(245, 158, 11, 0.12); border-color: rgba(251, 191, 36, 0.4); }

.j-link-card {
  display: grid;
  gap: 4px;
  margin: 1.2em 0;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 32, 51, 0.55);
  text-decoration: none;
  color: inherit;
}

.j-link-card span { color: #9ca3af; font-size: 0.95rem; }
.j-link-card em { color: #93c5fd; font-style: normal; font-size: 0.85rem; word-break: break-all; }

.j-video {
  margin: 1.4em 0;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
}

.j-video iframe { width: 100%; height: 100%; border: 0; }

.j-hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 2em 0;
}

.j-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: 0.18s ease;
}

.j-btn--primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
}
.j-btn--primary:hover { filter: brightness(1.08); }

.j-btn--outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.j-btn--outline:hover { border-color: rgba(147, 197, 253, 0.5); }

.j-btn--download {
  background: linear-gradient(135deg, rgba(245, 197, 24, 0.95), #eab308);
  color: #07111f;
}
.j-btn--download:hover { filter: brightness(1.05); }

.j-inline-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.2em 0; }

.article-docs, .article-actions, .article-related {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.article-docs h2, .article-actions h2, .article-related h2 {
  font-size: 1.25rem;
  margin-bottom: 14px;
  color: #fff;
}

.j-doc-card {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 32, 51, 0.5);
  margin-bottom: 10px;
}

.j-doc-card__meta { display: grid; gap: 2px; }
.j-doc-card__meta span { color: #8b8b8b; font-size: 0.85rem; }

.article-actions__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.article-related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.article-related-grid .j-card p { display: none; }
.article-related-grid .j-card h3 { font-size: 1.05rem; }

@media (max-width: 640px) {
  .article-related-grid { grid-template-columns: 1fr; }
  .j-doc-card { flex-direction: column; align-items: flex-start; }
}

.container-narrow {
  width: min(1180px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}
