* { box-sizing: border-box; }
:root {
  /* colors (light) */
  --bg: #F6F1EA;
  --surface: #FFFFFF;
  --text: #1C2E36;
  --text-muted: #5D7078;
  --border-color: #DCE4E6;
  --accent-color: #0B5D6B;

  /* typography */
  --font-family: "Rubik", system-ui, -apple-system, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;

  /* geometry */
  --border-radius: 20px;
  --container-padding: 20px;

  /* depth */
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.14);

  /* spacing scale */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  /* container widths */
  --container-max: 1200px;

  /* transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #102A31;
    --surface: #16343D;
    --text: #F2EFE8;
    --text-muted: #A7BAC1;
    --border-color: #2A4B54;
    --accent-color: #0B5D6B;
  }
}
h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  background: var(--bg);
  color: var(--text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
body > main > .container {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.container {
  width: 100%;
  max-width: var(--container-max);
  padding-inline: var(--space-md);
  padding-block: var(--space-lg);
}
.container-central {
  flex: 1;
  height: 100%;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}
a:hover {
  opacity: 0.85;
}

/* Header */
header {
  background: var(--bg);
  border-bottom: 1px solid var(--border-color);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-inline: auto;
  padding: var(--space-md) var(--space-lg);
  max-width: var(--container-max);
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
}
.logo img {
  width: 44px;
  height: 44px;
  border-radius: calc(var(--border-radius) - 4px);
}
.nav-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}
.nav-menu a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.nav-menu a:hover {
  color: var(--accent-color);
}
#nav-toggle {
  display: none;
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--text);
  border-radius: 3px;
}

/* Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
  margin-block: var(--space-lg);
}
@media (min-width: 768px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Cards */
.card {
  padding: var(--space-lg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.card p {
  color: var(--text);
}
.card a {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.card-image {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: calc(var(--border-radius) - 2px);
  margin-bottom: var(--space-md);
}
.card-meta {
  display: flex;
  justify-content: end;
  margin-top: auto;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Article Hero */
.article-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  border: none;
}

.article-hero h1 {
  text-align: center;
  max-width: 900px;
  margin-inline: auto;
}

.featured-image {
  display: block;
  width: 100%;
  max-width: 680px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin: 0 auto var(--space-xl);
  border-radius: calc(var(--border-radius) * 1.5);
  box-shadow: var(--shadow);
  max-height: 45vh;
}

.article-meta {
  display: flex;
  width: 100%;
  max-width: 900px;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: space-between;
  align-items: center;
  margin-inline: auto;
  padding-block: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.article-meta .author {
  font-weight: 600;
}

/* Article Content Images */
.article-body img {
  display: block;
  max-width: min(50%, 620px);
  height: auto;
  margin: var(--space-xl) auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

/* Article Tables */
.article-body table {
  width: 100%;
  margin: var(--space-lg) 0;
  border-collapse: collapse;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
.article-body table thead,
.article-body table tbody,
.article-body table tfoot {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.article-body table thead {
  background: var(--accent-color);
  color: #fff;
}
.article-body table th,
.article-body table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--border-color);
  white-space: normal;
  word-break: break-word;
}
.article-body table th {
  font-weight: 700;
  text-align: center;
}
.article-body table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}
@media (prefers-color-scheme: dark) {
  .article-body table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
  }
}
.article-body table tbody tr:hover {
  background: rgba(0, 105, 217, 0.06);
}
@media (max-width: 768px) {
  .article-body table {
    font-size: 0.85rem;
  }
  .article-body table th,
  .article-body table td {
    padding: 0.75rem;
  }
}

/* Breadcrumb */
.breadcrumb {
  list-style: none;
  display: flex;
  gap: var(--space-xs);
  padding: 0;
  margin: 0 0 var(--space-md) 0;
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: var(--space-xs);
  color: var(--text-muted);
}
.breadcrumb li:last-child {
  font-weight: 700;
}

/* Search Form */
.search-form {
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-lg);
}
.search-form input {
  flex: 1;
  padding: var(--space-md) var(--space-lg);
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg);
  color: var(--text);
}
.search-form input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0,105,217,0.06);
}
.search-form button {
  padding: var(--space-md) 1.5rem;
  font-size: 1rem;
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: opacity 0.25s ease, transform 0.12s ease;
}
.search-form button:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
    width: 48px;
    height: 48px;
    min-height: 48px;
    min-width: 48px;
    align-items: center;
    justify-content: center;
  }

  .hamburger:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: calc(var(--space-lg) * 2 + 45px);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 40;
    padding: var(--space-md);
  }

  .nav-menu ul {
    flex-direction: column;
    padding: var(--space-sm) 0;
    gap: var(--space-xs);
  }

  .nav-menu ul li a {
    padding: var(--space-sm) var(--space-md);
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  #nav-toggle:checked ~ .nav-menu {
    display: block;
  }

  .article-body img {
    float: none !important;
    max-width: 100%;
    margin: var(--space-lg) 0 !important;
  }

  .search-form {
    flex-direction: column;
  }

  .search-form button {
    width: 100%;
    min-height: 48px;
  }

  /* Improved mobile typography */
  .articles-grid article h3 {
    font-size: 1.1rem;
    line-height: 1.4;
  }

  .articles-grid article p {
    font-size: 0.9rem;
  }

  /* Better touch targets */
  .articles-grid article a {
    min-height: 48px;
  }

  /* Larger form elements */
  input, button, textarea, select {
    font-size: 16px;
  }

  .container {
    padding-inline: var(--space-sm);
  }
}
@media (max-width: 600px) {
  .auth-socials {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .article-meta {
    flex-direction: column;
    gap: var(--space-xs);
    align-items: flex-start;
  }
}
.article-body {
  line-height: 1.75;
}
.article-body h1,
.article-body h2,
.article-body h3 {
  margin-block: var(--space-lg) var(--space-md);
}
.article-body p {
  margin-block: var(--space-md);
}
footer {
  text-align: center;
}
footer > .container {
  width: 100%;
  max-width: 100%;
}

/* === SCDL: строка доверия в подвале (D-69-08-02) === */
/* Копирайт наследует --text; строка доверия отличается размером и приглушённым
   цветом, ссылки — акцентом палитры САЙТА, а не литералом. */
.footer-trust {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
  line-height: 2;
}
.footer-trust a {
  color: var(--accent-color);
  padding-inline: var(--space-2xs);
}

/* =========================
   About Section
========================= */
.about-section {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  box-shadow: var(--shadow);
}
.about-section h1 {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}
.about-section h2 {
  font-size: 1.2rem;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}
.about-section p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-sm);
}
.about-section ul {
  margin: var(--space-sm) 0;
  padding-left: var(--space-lg);
}
.about-section li {
  margin-bottom: var(--space-xs);
  line-height: 1.6;
}

/* === SCDL Anchor Pages (D-69-08-02) === */
/* Страницы доверия длиннее «О нас», под которую писался .about-section:
   разделов четыре, и без воздуха они слипаются в простыню. */
.scdl-page {
  max-width: 68ch;
  margin-inline: auto;
}
.scdl-page h2 {
  font-size: 1.25rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}
.scdl-page h2 + p {
  margin-top: 0;
}
.scdl-revision {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: var(--space-xl);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-color);
}

/* =========================
   Comments block
========================= */

.comments h2 {
  margin-bottom: var(--space-lg);
}

/* Grid layout */
.comments-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

/* Tablet */
@media (min-width: 768px) {
  .comments-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .comments-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Single comment */
.comment {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  box-shadow: var(--shadow);
}

/* Header (author + date) */
.comment-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  background-color: transparent !important;
}

/* Author link */
.comment-author-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

/* Hover */
.comment-author-link:hover .comment-author {
  text-decoration: underline;
}

/* Author source icon */
.comment-source-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  opacity: 0.9;
}

/* Author name — same typography as site text */
.comment-author {
  font-weight: 600;
  color: var(--text);
}

/* Date — muted, same scale */
.comment-date {
  color: var(--text-muted);
  font-size: 0.9em;
  white-space: nowrap;
}

/* Comment text — EXACTLY like site text */
.comment-content {
  color: var(--text);
  line-height: var(--line-height-base);
}

/* =========================
   Comment CTA
========================= */

.comment-cta-inner {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.comment-cta-text {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.comment-cta-button {
  padding: var(--space-sm) var(--space-lg);
  background: var(--accent-color);
  color: #fff;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.comment-cta-button:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .auth-socials {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .comment-cta-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .comment-cta-button {
    width: 100%;
    text-align: center;
  }
}

/* =========================
   Auth page
========================= */

.auth-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.auth-card-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.auth-title {
  text-align: center;
}

.auth-subtitle {
  margin-top: -0.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Form */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.auth-field label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-field input {
  padding: var(--space-sm) var(--space-md);
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg);
  color: var(--text);
}

.auth-field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error */

.auth-error {
  padding: var(--space-sm) var(--space-md);
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: var(--border-radius);
  font-size: 0.9rem;
}

/* Submit */

.auth-submit {
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  font-size: 1rem;
  font-weight: 600;
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
}

/* Divider */

.auth-divider {
  position: relative;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border-color);
}

.auth-divider::before {
  left: 0;
}

.auth-divider::after {
  right: 0;
}

/* Socials */

.auth-socials {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.auth-social {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg);
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-social img {
  width: 20px;
  height: 20px;
}

.auth-social:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.auth-submit.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
  color: transparent;
}

.auth-submit.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

.auth-social.is-loading {
  pointer-events: none;
  opacity: 0.45;
  filter: grayscale(1);
}

.auth-error {
  animation: auth-error-in 0.2s ease-out;
}

@keyframes auth-error-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}
/* =========================
   Comment replies
========================= */
.comment-replies {
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.comment--reply {
  margin-left: var(--space-lg);
  border-left: 2px solid var(--accent-color, var(--border-color));
  background: transparent;
}

/* ===========================
   Animation Variables
=========================== */
:root {
  --t-fast: 0.15s;
  --t-base: 0.25s;
  --t-slow: 0.4s;
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===========================
   Scroll Animations
=========================== */

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
}

.animate-on-scroll.is-visible {
  animation: fadeSlideUp 0.5s var(--ease-out) forwards;
}

/* Stagger: cascading card appearance */
.articles-grid .animate-on-scroll.is-visible:nth-child(2) { animation-delay: 0.1s; }
.articles-grid .animate-on-scroll.is-visible:nth-child(3) { animation-delay: 0.15s; }
.articles-grid .animate-on-scroll.is-visible:nth-child(4) { animation-delay: 0.2s; }
.articles-grid .animate-on-scroll.is-visible:nth-child(5) { animation-delay: 0.25s; }
.articles-grid .animate-on-scroll.is-visible:nth-child(6) { animation-delay: 0.3s; }

/* Fade-in for lazy-loaded images */
@keyframes imgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

img[loading="lazy"] {
  opacity: 0;
  animation: none;
}

img[loading="lazy"].is-loaded {
  animation: imgFadeIn 0.4s var(--ease-out) forwards;
}

/* ===========================
   Interactive Transitions
=========================== */
.card {
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.card-image {
  transition: transform var(--t-base) var(--ease-out);
}

.card:hover .card-image {
  transform: scale(1.03);
}

.breadcrumb a {
  transition: color var(--t-fast);
}

.card-meta {
  transition: color var(--t-fast);
}

.comment-date {
  transition: color var(--t-fast);
}

.article-meta {
  transition: color var(--t-fast);
}

/* ===========================
   Cookie Banner
=========================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #333;
  transform: translateY(100%);
  opacity: 0;
  transition: transform var(--t-slow), opacity var(--t-slow);
}

.cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.cookie-banner__inner {
  max-width: 1100px;
  margin-inline: auto;
  padding: var(--space-md) var(--container-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.cookie-banner__inner p {
  color: rgba(255,255,255,0.9);
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.5;
}

.cookie-banner__actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.cookie-banner__btn {
  padding: var(--space-xs) var(--space-lg);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: opacity var(--t-fast);
}

.cookie-banner__btn:hover {
  opacity: 0.9;
}

.cookie-banner__btn--accept {
  background: var(--accent-color);
  color: #fff;
}

.cookie-banner__btn--more {
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.3);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.cookie-banner__btn--more:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

@media (max-width: 600px) {
  .cookie-banner__inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ===========================
   Scroll to Top
=========================== */

.scroll-to-top {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #333;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity var(--t-base), visibility var(--t-base), transform var(--t-base);
}

.scroll-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transform: translateY(-2px);
}

/* ===========================
   Share Buttons
=========================== */

.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) 0;
  margin-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.share-buttons__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.share-btn:hover {
  color: #fff;
}

.share-btn svg {
  flex-shrink: 0;
}

.share-btn--vk:hover {
  background: #4680C2;
  border-color: #4680C2;
}

.share-btn--tg:hover {
  background: #2AABEE;
  border-color: #2AABEE;
}

.share-btn--tw:hover {
  background: #1DA1F2;
  border-color: #1DA1F2;
}

@media (max-width: 600px) {
  .share-buttons {
    justify-content: center;
  }
  .share-buttons__label {
    width: 100%;
    text-align: center;
  }
}

/* ===========================
   Related Articles
=========================== */

.related-articles {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.related-articles__heading {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--border-color);
}

.related-articles__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.related-card {
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-color);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.related-card .card-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.related-card .card-body {
  padding: var(--space-md);
}

.related-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 var(--space-xs);
  color: var(--text);
}

.related-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 768px) {
  .related-articles__grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* ===========================
   Subscribe Form (Footer)
=========================== */

.footer-subscribe {
  padding: var(--space-xl) var(--container-padding) var(--space-lg);
  max-width: 500px;
  margin-inline: auto;
  text-align: center;
}

.subscribe-block__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--space-xs);
}

.subscribe-block__text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 var(--space-lg);
}

.subscribe-form__group {
  display: flex;
  gap: 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.subscribe-form__input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: none;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  min-width: 0;
}

.subscribe-form__input::placeholder {
  color: var(--text-muted);
}

.subscribe-form__btn {
  padding: var(--space-sm) var(--space-lg);
  background: var(--accent-color);
  color: #fff;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--t-fast);
}

.subscribe-form__btn:hover {
  opacity: 0.9;
}

.subscribe-form__success {
  margin-top: var(--space-md);
  font-size: 0.9rem;
  color: #16a34a;
  font-weight: 600;
}

.subscribe-form__success.is-visible {
  display: block !important;
}

@media (max-width: 600px) {
  .auth-socials {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .subscribe-form__group {
    flex-direction: column;
  }
}

/* ===========================
   Accessibility
=========================== */

/* ===========================
   Accessibility: Skip Link
=========================== */
.skip-link {
  position: fixed;
  top: -100%;
  white-space: nowrap;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-color);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  transition: top var(--transition-fast);
  white-space: nowrap;
}

.skip-link:focus {
  top: var(--space-sm);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ===========================
   Reading Progress Bar
=========================== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0,0,0,0.05);
  z-index: 1000;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  height: 100%;
  background: var(--accent-color);
  width: 0%;
  transition: width 0.1s linear;
}

/* ===========================
   Reading Time
=========================== */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reading-time::before {
  content: "⏱";
  font-size: 0.9em;
}

/* ===========================
   Reduced Motion
=========================== */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
  .animate-on-scroll.is-visible {
    animation: none;
  }
  img[loading="lazy"] {
    opacity: 1;
  }
  img[loading="lazy"].is-loaded {
    animation: none;
  }
  .cookie-banner {
    transition: none;
  }
  .scroll-to-top {
    transition: none;
  }
  .reading-progress span {
    transition: none;
  }
}

/* Fix: auto-reveal hidden elements that never enter viewport */
.animate-on-scroll:not(.is-visible) {
  animation: aos-fallback-reveal 0.5s ease forwards;
  animation-delay: 1.5s;
}
@keyframes aos-fallback-reveal {
  to { opacity: 1; transform: translateY(0); }
}

/* === Contacts === */
.contacts-hero { margin-bottom: 2rem; }
.contacts-hero h1 { font-family: var(--font-heading); margin-bottom: 0.5rem; }
.contacts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 3rem; }
.contacts-form-section h2 { font-family: var(--font-heading); margin-bottom: 1rem; }
.contacts-form .form-group { margin-bottom: 1rem; }
.contacts-form .form-group label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
.contacts-form .form-group input,
.contacts-form .form-group textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-color, #ccc);
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface, #fff);
  color: var(--text, #333);
}
.contacts-form .form-group textarea { min-height: 120px; resize: vertical; }
.contacts-form .btn-submit {
  padding: 0.8rem 2rem;
  background: var(--accent-color, #333);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.contacts-form .btn-submit:hover { opacity: 0.9; }
.contacts-info h3 { font-family: var(--font-heading); margin-bottom: 0.5rem; }
.contacts-info p { margin-bottom: 0.5rem; }
.contacts-info a { color: var(--accent-color, #333); }
.social-links { list-style: none; padding: 0; }
.social-links li { margin-bottom: 0.3rem; }
@media (max-width: 768px) {
  .contacts-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Тач-цели, не покрытые селекторами плана 69-09.
   Правила 69-09 поднимали только те классы, у которых объявление размера
   УЖЕ существовало; у элементов ниже min-height не был объявлен вовсе,
   поэтому сканер mobile_css_test их не видел, а палец получал 24–41 px.
   Порог 48 px — параграф 15.1 (domain/techseo.TouchTargetMinPx).
   ============================================ */
@media (max-width: 768px) {
  .comment-author-link,
  .subscribe-form__input,
  .subscribe-form__btn,
  .cookie-banner__btn,
  .author-link,
  .share-btn,
  .comment-cta-button,
  .breadcrumb li a {
    min-height: 48px;
  }

  .comment-author-link,
  .subscribe-form__btn,
  .cookie-banner__btn,
  .author-link,
  .share-btn,
  .comment-cta-button,
  .breadcrumb li a {
    display: inline-flex;
    align-items: center;
  }

  .subscribe-form__btn,
  .cookie-banner__btn,
  .share-btn {
    justify-content: center;
  }

  /* Иконочные кнопки шеринга узкие по содержимому: в editorial и luxe замер дал
     42×48 и 43.6×48 — высота порог держит, ширина нет. Порог книги про ОБЕ
     стороны. */
  .share-btn {
    min-width: 48px;
  }
}

/* === Изображение с подписью (фаза 72, §16.2е книги) ===
   Ширина обёртки повторяет ширину картинок статьи темы, иначе подпись
   растянулась бы на всю колонку под картинкой в половину её. Отступы самой
   картинки внутри обёртки снимаются: воздух вокруг блока задаёт figure, а
   расстояние до подписи — её margin-top. !important здесь не украшение —
   тема объявляет отступы картинок статьи через !important на узкой ширине. */
figure {
  margin: var(--space-xl) auto;
  max-width: min(50%, 620px);
}

.article-body figure img {
  margin: 0 !important;
  max-width: 100%;
}

figcaption {
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 768px) {
  figure {
    max-width: 100%;
  }
}
