/* CAUDEX Project — исследовательский портал, Montserrat */

:root {
  --font: "Montserrat", system-ui, sans-serif;
  --bg: #f4f6f9;
  --bg-card: #ffffff;
  --ink: #152535;
  --ink-muted: #5c6b7a;
  --accent: #1e4d7b;
  --accent-2: #2d6a9f;
  --accent-soft: #e8f0f8;
  --border: #dde3ea;
  --line: #c5ccd6;
  --success: #1f6b4a;
  --error: #9b2c2c;
  --shadow: 0 12px 40px rgba(21, 37, 53, 0.08);
  --shadow-sm: 0 4px 16px rgba(21, 37, 53, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --container: 1140px;
  --prose: 720px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #1a3a54;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}

.site-header--modern {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(21, 37, 53, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-radius: var(--radius-sm);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.logo-text small {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.site-nav a:hover,
.site-nav a.nav-admin,
.site-nav__link:hover {
  color: var(--accent);
}

.site-nav__link {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-muted);
  transition: color 0.2s ease;
}

.site-nav__link--admin {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.85;
}

.logo--enhanced .logo-mark {
  box-shadow: 0 4px 14px rgba(30, 77, 123, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.logo--caudex {
  gap: 0.85rem;
  max-width: min(100%, 420px);
}

.logo-img {
  width: 4.25rem;
  height: 4.25rem;
  object-fit: contain;
  flex-shrink: 0;

}

.logo--caudex:hover .logo-img {
  transform: translateY(-1px);
}

.logo-text__ru {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.logo-text__en {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.logo-text__tagline {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}

.logo--enhanced:hover .logo-mark {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(30, 77, 123, 0.42);
}

.btn-nav-cta {
  padding: 0.5rem 1.15rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(30, 77, 123, 0.22);
  white-space: nowrap;
}

.btn-nav-cta:hover {
  box-shadow: 0 4px 16px rgba(30, 77, 123, 0.32);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
}

.site-main {
  min-height: 60vh;
}

/* Home slider */
.home-slider {
  position: relative;
  background: var(--ink);
}

.home-swiper {
  width: 100%;
  height: clamp(320px, 52vh, 520px);
}

.home-swiper .swiper-slide {
  height: auto;
}

.slide-bg {
  position: relative;
  min-height: clamp(320px, 52vh, 520px);
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
}

.slide-bg--gradient {
  background: linear-gradient(125deg, #152535 0%, #1e4d7b 45%, #3d7ab5 100%);
}

.slide-bg--image {
  background-color: var(--ink);
}

.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(21, 37, 53, 0.82) 0%, rgba(21, 37, 53, 0.35) 100%);
}

.slide-content {
  position: relative;
  z-index: 2;
  padding: 3rem 0;
  color: #fff;
  max-width: 640px;
}

.slide-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 4vw, 2.35rem);
  font-weight: 700;
  line-height: 1.2;
}

.slide-subtitle {
  margin: 0 0 1.25rem;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
}

.home-swiper .swiper-pagination-bullet {
  background: #fff;
  opacity: 0.45;
  width: 10px;
  height: 10px;
}

.home-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  width: 28px;
  border-radius: 999px;
}

.home-swiper .swiper-button-prev,
.home-swiper .swiper-button-next {
  color: #fff;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  backdrop-filter: blur(4px);
}

.home-swiper .swiper-button-prev::after,
.home-swiper .swiper-button-next::after {
  font-size: 1.1rem;
  font-weight: 700;
}

/* Hero */
.hero {
  background: linear-gradient(165deg, #eef2f6 0%, var(--bg) 55%);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0 3rem;
}

.hero--modern {
  background: var(--bg-card);
  border-bottom: none;
  padding: 3.25rem 0 3.5rem;
}

.hero-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 2.65rem);
  font-weight: 700;
  line-height: 1.15;
  max-width: 22ch;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 0 0 1.5rem;
  max-width: 56ch;
  font-size: 1.08rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 0.95rem;
}

.btn-light {
  background: #fff;
  color: var(--accent) !important;
  text-decoration: none;
  border: none;
}

.btn-light:hover {
  background: var(--accent-soft);
}

/* Features */
.features {
  padding: 3.5rem 0;
  background: var(--bg);
}

.features--modern {
  padding: 4rem 0;
  background: linear-gradient(180deg, #f0f4f8 0%, var(--bg) 100%);
  position: relative;
  overflow: hidden;
}

.features--modern::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(30, 77, 123, 0.06) 1px, transparent 0);
  background-size: 28px 28px;
  pointer-events: none;
}

.features--modern .container {
  position: relative;
  z-index: 1;
}

.features-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.section-head.section-head--center.features-head {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: start;
  text-align: left;
}

.features-head h2 {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  letter-spacing: -0.02em;
}

.features-head p {
  margin: 0;
  max-width: 52ch;
}

.section-head--center {
  text-align: center;
  border-bottom: none;
  margin-bottom: 2.25rem;
}

.section-head--center h2 {
  margin-bottom: 0.5rem;
}

.section-head--center p {
  max-width: 50ch;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(221, 227, 234, 0.9);
  border-radius: 16px;
  padding: 1.85rem 1.65rem 1.75rem;
  box-shadow: 0 4px 24px rgba(21, 37, 53, 0.05);
  overflow: hidden;
}

.feature-card__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.15rem;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent-soft) 0%, #fff 100%);
  border: 1px solid rgba(30, 77, 123, 0.12);
  box-shadow: 0 4px 12px rgba(30, 77, 123, 0.08);
}

.feature-card--2 .feature-card__icon {
  background: linear-gradient(145deg, #e6f4f7 0%, #fff 100%);
  border-color: rgba(26, 92, 110, 0.15);
}

.feature-card--3 .feature-card__icon {
  background: linear-gradient(145deg, #e8edf8 0%, #fff 100%);
  border-color: rgba(26, 47, 122, 0.15);
}

.feature-num {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.feature-card--2 .feature-num {
  color: #1a5c6e;
}

.feature-card--3 .feature-num {
  color: #1a2f7a;
}

.feature-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.feature-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* Sections */
.publications {
  padding: 3.5rem 0;
  background: var(--bg-card);
}

.about {
  padding: 3.5rem 0;
}

.section-head {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--ink);
}

.section-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.section-head p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.section-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.section-head--row .btn {
  flex-shrink: 0;
}

.pub-home-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.pub-home-col {
  padding: 1.35rem 1.35rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.pub-home-col--latest {
  background: linear-gradient(160deg, #e8f2fa 0%, #f0f6fc 100%);
  border-color: #c5d9eb;
}

.pub-home-col--latest .pub-home-col__title {
  color: #1a4d7a;
}

.pub-home-col--popular {
  background: #1452dc1f;
  border-color: #3d3b4040;
}

.pub-home-col--popular .pub-home-col__title {
  color: #1a2f7a;
}

.pub-home-col__title {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.pub-home-col .article-card {
  background: rgba(255, 255, 255, 0.92);
}

.article-grid--compact {
  grid-template-columns: 1fr;
  gap: 1rem;
}

.pub-home-cta {
  margin-top: 2rem;
  text-align: center;
}

.article-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.article-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  background: #fff3e0;
  color: #b45309;
  border-radius: 999px;
}

.article-views {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-left: auto;
}

/* Archive page */
.page-hero--compact {
  padding: 2rem 0 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.page-back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1rem;
  text-decoration: none;
  font-size: 0.875rem;
}

.page-hero--compact h1 {
  margin: 0.5rem 0 0.5rem;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.page-hero-lead {
  margin: 0;
  max-width: 58ch;
  color: var(--ink-muted);
}

.articles-count {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-2);
}

.publications--archive {
  padding: 2.5rem 0 3.5rem;
}

.articles-filter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.articles-filter__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.articles-filter__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.articles-filter__reset {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.articles-filter__grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(280px, 2fr) auto;
  gap: 1rem;
  align-items: end;
}

.articles-filter__period-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.articles-filter__period-inputs {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.articles-filter__field--date {
  flex: 1;
  min-width: 140px;
  margin-bottom: 0;
}

.articles-filter__field--date span {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 0.3rem;
}

.articles-filter__field--date input[type="date"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: var(--font);
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.articles-filter__field--date input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.65;
}

.articles-filter__period-sep {
  padding-bottom: 0.65rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.articles-filter__field span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.articles-filter__field select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: var(--font);
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.articles-filter__actions {
  display: flex;
  align-items: flex-end;
}

.article-source {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-2);
  background: var(--accent-soft);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.article-byline-source {
  color: var(--accent-2);
  font-weight: 600;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.pagination-link {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.pagination-link:hover {
  border-color: var(--accent-2);
  background: var(--accent-soft);
}

.pagination-info {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-muted);
}

/* Article grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.article-card--modern:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #c5d4e4;
}

.article-card time {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.article-card h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.35;
}

.article-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.article-card h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.article-meta {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.article-excerpt {
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.read-more {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 0.25rem;
}

/* About */
.about--modern {
  background: linear-gradient(180deg, var(--bg) 0%, #e8eef4 100%);
}

.about-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.about-copy h2 {
  margin-top: 0;
}

.about h2 {
  margin-top: 0;
  font-size: 1.35rem;
}

.about p {
  color: var(--ink-muted);
}

.about-topics {
  margin: 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  list-style: none;
}

.about-topics--modern {
  box-shadow: var(--shadow-sm);
  border-left-width: 4px;
  border-left-color: var(--accent-2);
}

.about-topics--interactive {
  padding: 0.5rem;
}

.about-topics--interactive li {
  border-top: none;
  padding: 0;
  margin-bottom: 0.5rem;
}

.about-topics--interactive li:last-child {
  margin-bottom: 0;
}

.about-topic-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.about-topic-btn:hover {
  background: var(--accent-soft);
  border-color: #b8cfe0;
  color: var(--accent);
}

.about-topic-btn__icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--accent-2);
  transition: transform 0.15s;
}

.about-topic-btn:hover .about-topic-btn__icon {
  transform: translateX(4px);
}

/* Модальное окно темы */
body.topic-modal-open {
  overflow: hidden;
}

.topic-modal[hidden] {
  display: none !important;
}

.topic-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.topic-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 37, 53, 0.55);
  backdrop-filter: blur(4px);
}

.topic-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(100%, 560px);
  max-height: min(85vh, 640px);
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: 0 24px 64px rgba(21, 37, 53, 0.2);
  animation: topicModalIn 0.25s ease;
}

@keyframes topicModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.topic-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ink-muted);
  cursor: pointer;
}

.topic-modal__close:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.topic-modal__title {
  margin: 0 2rem 1rem 0;
  font-size: 1.25rem;
  line-height: 1.3;
  padding-right: 1rem;
}

.topic-modal__body {
  font-size: 0.98rem;
}

.topic-modal__body p:first-child {
  margin-top: 0;
}

.about-topics li {
  padding: 0.35rem 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.about-topics li + li {
  border-top: 1px solid var(--border);
}

/* Author modal */
.author-modal__dialog {
  width: min(100%, 520px);
}

.author-modal__lead {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.author-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.author-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.author-form label span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.author-form input,
.author-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.author-form input:focus,
.author-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.author-form__msg {
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.author-form__msg--ok {
  background: #e8f5ec;
  color: #1a5c32;
}

.author-form__msg--err {
  background: #fdecea;
  color: #8b2e24;
}

/* Article page */
.article-page {
  padding: 2rem 0 4rem;
  max-width: var(--prose);
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  text-decoration: none;
}

.article-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.article-header h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.25;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.prose {
  font-size: 1.05rem;
  line-height: 1.75;
}

.prose h2,
.prose h3 {
  margin-top: 2rem;
  font-weight: 700;
}

.prose p {
  margin: 1rem 0;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  font-style: italic;
  color: var(--ink-muted);
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose img,
.prose .article-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.prose figure {
  margin: 1.75rem 0;
  padding: 0;
}

.prose figure img {
  margin: 0 auto;
}

.prose figcaption {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.4;
}

.prose img.align-left,
.prose img[style*="float: left"] {
  margin: 0.5rem 1.25rem 1rem 0;
  float: left;
  max-width: min(100%, 420px);
}

.prose img.align-right,
.prose img[style*="float: right"] {
  margin: 0.5rem 0 1rem 1.25rem;
  float: right;
  max-width: min(100%, 420px);
}

.prose::after {
  content: "";
  display: table;
  clear: both;
}

@media (max-width: 640px) {
  .prose img.align-left,
  .prose img.align-right {
    float: none;
    margin-left: auto;
    margin-right: auto;
  }
}

.article-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
}

.btn-primary:hover {
  background: #1a3a54;
}

.btn-outline {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent) !important;
}

.btn-outline:hover {
  background: var(--accent-soft);
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-muted);
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: #c8d0d8;
  margin-top: 2rem;
  padding: 2.5rem 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.footer-logo {
  width: 4rem;
  height: 4rem;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.95;
  display: block;
    border: 2px solid #fff;
    padding: 7px;
    box-sizing: content-box;
    border-radius: 50%;
    background: #fff;
}

.footer-title {
  color: #fff;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.footer-muted,
.footer-label {
  font-size: 0.9rem;
  margin: 0;
}

.footer-label {
  color: #fff;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: #c8d0d8;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1rem 0 1.5rem;
  font-size: 0.8rem;
  color: #8a96a3;
}

/* Admin */
.admin-body {
  background: #eef1f4;
}

.admin-header {
  background: var(--ink);
  color: #fff;
}

.admin-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.85rem 0;
}

.admin-brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-nav a {
  color: #b8c5d0;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-nav a:hover,
.admin-nav .admin-logout {
  color: #fff;
}

.admin-main {
  padding: 2rem 0 3rem;
}

.admin-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-toolbar h1 {
  margin: 0;
  font-size: 1.5rem;
}

.muted {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.admin-login {
  max-width: 420px;
  margin: 3rem auto;
}

.admin-login h1 {
  margin-top: 0;
}

.login-hint {
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.admin-form label {
  display: block;
  margin-bottom: 1.25rem;
}

.admin-form label span {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
  color: var(--ink-muted);
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-family: var(--font);
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.editor-field .tox-tinymce {
  margin-top: 0.35rem;
  border-radius: var(--radius);
  border-color: var(--border) !important;
}

.editor-field .tox .tox-edit-area__iframe {
  background: #fff;
}

.admin-form textarea.content-editor {
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.5;
}

.field-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.alert-error,
.alert-error {
  background: #fdeaea;
  color: var(--error);
  border: 1px solid #f5c6c6;
}

.alert-success {
  background: #e8f5ef;
  color: var(--success);
  border: 1px solid #b8e0cc;
}

.admin-table-wrap {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  background: #f9fafb;
}

.table-actions {
  white-space: nowrap;
}

.table-actions a,
.table-actions button {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  margin-right: 0.75rem;
}

.inline-form {
  display: inline;
}

.link-danger {
  background: none;
  border: none;
  padding: 0;
  color: var(--error);
  cursor: pointer;
  text-decoration: underline;
}

.table-link {
  font-size: 0.8rem;
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
}

.badge-published {
  background: #e8f5ef;
  color: var(--success);
}

.badge-draft {
  background: #f0f2f5;
  color: var(--ink-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem 1rem;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a,
  .site-nav__link {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
  }

  .site-nav .btn-nav-cta {
    margin-top: 0.5rem;
    width: 100%;
    text-align: center;
    border-bottom: none;
  }

  .site-header .header-inner {
    position: relative;
    flex-wrap: wrap;
  }

  .logo--caudex {
    max-width: calc(100% - 3rem);
  }

  .logo-text__tagline {
    display: none;
  }

  .logo-text__en {
    font-size: 0.65rem;
  }

  .about-inner,
  .footer-grid,
  .features-grid,
  .pub-home-columns {
    grid-template-columns: 1fr;
  }

  .section-head--row {
    align-items: flex-start;
    flex-direction: column;
  }

  .articles-filter__grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero h1 {
    max-width: none;
  }

  .home-swiper .swiper-button-prev,
  .home-swiper .swiper-button-next {
    display: none;
  }

  .admin-nav {
    width: 100%;
  }
}

/* Появление при скролле (Tilda-style) */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(36px);
    transition:
      opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
  }

  .reveal-fade {
    transform: none;
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
    will-change: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}
