@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/roboto-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/roboto-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/roboto-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/roboto-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --sans: "Golos Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display: "Roboto", var(--sans);

  --red: #d52b1e;
  --red-deep: #a3211a;
  --blue: #0039a6;
  --blue-deep: #00287a;

  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f2f4f8;
  --surface: #ffffff;
  --ink: #10151f;
  --muted: #566072;
  --rule: #e2e6ee;
  --shadow: 0 10px 30px rgba(16, 21, 31, 0.08);
  --footer-bg: #002164;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0e16;
  --bg-alt: #121729;
  --surface: #151b2e;
  --ink: #eef1f8;
  --muted: #9aa4bc;
  --rule: #262f47;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --red: #ff5b4b;
  --red-deep: #ff8072;
  --blue: #5b8dee;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

main {
  flex: 1 0 auto;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--red);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: var(--footer-bg);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}

.header-logo {
  display: block;
  height: 52px;
  width: auto;
  border-radius: 3px;
}

.footer-logo {
  height: 52px;
  border-radius: 3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Language switcher */
.lang-select {
  position: relative;
}
.lang-select-current {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  background: var(--bg-alt);
  cursor: pointer;
  list-style: none;
  transition: border-color 0.2s ease;
}
.lang-select-current::-webkit-details-marker {
  display: none;
}
.lang-select-current:hover {
  border-color: var(--red);
}
.lang-select-current img {
  display: block;
  border-radius: 2px;
}
.lang-select-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--shadow);
  z-index: 5;
}
.lang-select-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink);
}
.lang-select-item a:hover {
  background: var(--bg-alt);
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--rule);
  background: var(--bg-alt);
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.theme-toggle:hover {
  border-color: var(--red);
}
.theme-toggle svg {
  width: 20px;
  height: 20px;
}
:root[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

.byline {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
}

/* Reading progress bar (post pages) */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 1000;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--red);
}

/* Ticker */
.ticker {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--blue-deep);
  padding: 10px 0;
  overflow: hidden;
}
.ticker-label {
  flex: 0 0 auto;
  margin-left: 24px;
  color: #fff;
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 20px;
}
.ticker-viewport {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 24px,
    #000 calc(100% - 24px),
    transparent 100%
  );
}
.ticker-track {
  display: flex;
  width: max-content;
  animation-name: ticker-scroll;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track {
  animation-play-state: paused;
}
.ticker-list {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  padding-right: 12px;
}
.ticker-list a {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
}
.ticker-list a:hover {
  color: var(--red);
}
.ticker-sep {
  font-size: 1.5rem;
  line-height: 0.5rem;
  color: var(--red);
}
@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
  }
  .ticker-viewport {
    overflow-x: auto;
  }
  .ticker-list[aria-hidden] {
    display: none;
  }
}

/* Hero */
.hero {
  padding: 40px 24px 48px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 48px;
}
.hero-image {
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg-alt);
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.hero-image img {
  display: block;
  width: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 7;
}
.hero-title {
  font-size: 3rem;
  line-height: 1.05;
  margin: 0 0 16px;
  border-left: 6px solid var(--red);
  padding-left: 20px;
}
.hero-dek {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0 0 16px;
  max-width: 46em;
}

.btn {
  display: inline-block;
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--blue-deep);
  color: #fff;
  padding: 10px 22px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}
.btn:hover {
  background: var(--footer-bg);
  color: #fff;
}

/* Latest posts grid (homepage) */
.latest-block {
  margin-bottom: 56px;
}
.card-grid.latest-grid {
  grid-template-columns: repeat(4, 1fr);
}
.latest-grid .post-card {
  flex-direction: column;
}
.latest-grid .post-card-image {
  flex: none;
  width: 100%;
  min-width: 0;
}

.see-all {
  display: flex;
  justify-content: center;
  margin: 20px 0 0;
}

/* Post card */
.card-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 36px 32px;
  margin-bottom: 32px;
}
.post-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.post-card-content {
  flex: 1;
  min-width: 0;
}
.post-card-image {
  display: block;
  flex: 0 0 30%;
  min-width: 260px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--bg-alt);
}
.post-card-image img {
  display: block;
  width: 100%;
  object-fit: cover;
  aspect-ratio: 3 / 2;
}
.post-card-title {
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0 0 8px;
}
.dek {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.post {
  padding: 32px 24px;
}

/* Post detail */
.page-title {
  text-transform: uppercase;
  margin: 0 0 24px;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
}

.post-header {
  margin: 0 auto 36px;
  max-width: 62rem;
}

.post-title {
  font-size: 2.8rem;
  line-height: 1.1;
  margin: 0 0 18px;
}

.post-dek {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0 0 18px;
}

.post-body {
  font-size: 1.1rem;
  line-height: 1.75;
  max-width: 62rem;
  margin: auto;
}

.page-single .page-title {
  max-width: 62rem;
  margin: 0 auto 24px;
}

/* 404 */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 96px 24px;
}
.error-code {
  font-family: var(--display);
  font-size: 7rem;
  font-weight: 700;
  line-height: 1;
  margin: 0;
  color: var(--red);
}
.error-title {
  margin: 8px 0 12px;
}
.error-message {
  color: var(--muted);
  max-width: 32em;
  margin: 0 0 28px;
}

.post-body p {
  margin: 0 0 1.4em;
}

.post-body h2 {
  font-size: 1.7rem;
  margin: 1.8em 0 0.6em;
}

.post-body figure {
  margin: 1.8em 0;
}
.post-body img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  height: auto;
  border-radius: 6px;
  margin: 1.8em auto;
}
.post-body figure img {
  margin: 0 auto;
}
.post-hero {
  margin: 0;
}
.post-body figcaption,
.post-hero figcaption {
  margin-top: 0.6em;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
  text-align: center;
}

.post-body blockquote {
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.2em;
  border-left: 3px solid var(--red);
  font-family: var(--display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--muted);
}
.post-body blockquote p {
  margin: 0 0 0.6em;
}
.post-body blockquote p:last-child {
  margin-bottom: 0;
}

.audio-embed {
  margin: 2rem auto;
  max-width: 720px;
}
.audio-embed-title {
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0 0 10px;
}
.audio-embed audio {
  width: 100%;
}

.post-footer {
  max-width: 42em;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}

/* Related posts carousel */
.carousel-section {
  margin: 48px 0 56px;
}
.carousel {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
}
.carousel .post-card {
  flex: 0 0 240px;
  flex-direction: column;
  scroll-snap-align: start;
}
.carousel .post-card-image {
  flex: none;
  width: 100%;
  min-width: 0;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 32px 0 60px;
  margin: 0;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.85rem;
}

.pagination .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.pagination .page-item:not(.disabled):not(.active) .page-link:hover {
  border-color: var(--red);
  color: var(--red);
}

.pagination .page-item.active .page-link {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.pagination .page-item.disabled .page-link {
  border-color: var(--rule);
  color: var(--rule);
  text-decoration: none;
}

/* Footer */
.site-footer {
  font-size: 0.8rem;
  color: #fff;
  background-color: var(--footer-bg);
  border-top: 3px solid var(--red);
  flex-shrink: 0;
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px 24px;
}

.footer-left {
  display: flex;
  gap: 30px;
  align-items: center;
}

.footer-nav {
  display: flex;
  align-items: center;
  font-family: var(--display);
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.footer-nav a {
  padding: 0 10px;
}
.footer-nav a:first-child {
  padding-left: 0;
}
.footer-nav a + a {
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}
.footer-nav a:hover {
  color: var(--red);
}

.footer-copy {
  color: #b7bfd4;
}

@media (max-width: 1100px) {
  .card-grid.latest-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .card-grid.latest-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .site-footer-inner {
    flex-direction: column;
    row-gap: 12px;
  }
  .header-logo,
  .footer-logo {
    height: 36px;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 2rem;
  }
  .post-title {
    font-size: 1.9rem;
  }
  .post-card {
    flex-direction: column;
  }
  .post-card-image {
    flex-basis: auto;
    min-width: 0;
    width: 100%;
  }
  .card-grid.latest-grid {
    grid-template-columns: 1fr;
  }
  .carousel .post-card {
    flex: 0 0 200px;
  }
}

