@import url('https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&family=PT+Serif:wght@400;700&display=swap');

:root {
  --primary: #0039A6;
  --on-primary: #FFFFFF;
  --secondary: #D52B1E;
  --on-secondary: #FFFFFF;
  --background: #FFFFFF;
  --on-background: #0F172A;
  --surface: #F8FAFC;
  --on-surface: #0F172A;
  --surface-variant: #E2E8F0;
  --on-surface-variant: #334155;
  --outline: #CBD5E1;
  --outline-variant: #94A3B8;
  --error: #D52B1E;
  --on-error: #FFFFFF;
  --info: #0284C7;

  --font-display: 'PT Serif', serif;
  --font-body: 'PT Sans', sans-serif;

  --rounded-sm: 2px;
  --rounded-md: 4px;
  --rounded-lg: 8px;
  --rounded-full: 9999px;
}

body {
  font-family: var(--font-body);
  background-color: var(--surface);
  color: var(--on-background);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* Непрозрачная шапка на всех страницах: текст статьи не должен просвечивать при прокрутке. */
body > header {
  background-color: var(--background) !important;
  opacity: 1;
  isolation: isolate;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.10);
}

body > header > div:first-child {
  background-color: var(--background);
}

@media (min-width: 1024px) {
  body > header {
    min-height: 80px;
  }

  body > header nav {
    background-color: var(--background);
  }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--on-primary);
  border-radius: var(--rounded-md);
  height: 48px;
  padding: 0 24px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary:hover {
  background-color: var(--secondary);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.input-field {
  background-color: var(--background);
  color: var(--on-background);
  font-family: var(--font-body);
  border-radius: var(--rounded-md);
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--outline);
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.1s ease, padding 0.1s ease;
}
.input-field:focus {
  border: 2px solid var(--primary);
  padding: 0 15px; 
}

.nav-link {
  color: var(--on-background);
  font-family: var(--font-body);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.nav-link:hover {
  color: var(--primary);
}
.nav-link.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.card {
  background-color: var(--background);
  color: var(--on-background);
  border-radius: var(--rounded-lg);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--outline-variant);
}

.news-card-top-border {
  border-top: 4px solid var(--secondary);
}

/* Mobile reading layout: avoid a long sidebar pushing the article content below it. */
@media (max-width: 1023px) {
  .biography-sidebar {
    display: none;
  }

  #mobile-menu {
    position: absolute;
    inset: 80px 0 auto 0;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 60;
  }

  #mobile-menu .nav-link {
    display: block;
    padding: 10px 0;
    font-size: 1rem;
    line-height: 1.35;
  }

  .prose {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .prose img.float-right {
    float: none;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 24px;
  }
}
