/* Stylesheet for the static blog pipeline (scripts/blog/render*.mjs).
   Standalone HTML documents with no JS and no access to the SPA's bundled CSS,
   so this brings the same design tokens (docs/SITE_ARCHITECTURE_RULES.md /
   src/styles/variables.css) to a plain server-rendered page. Kept intentionally
   simpler than the SPA chrome (no JS-driven interactivity here), but same
   palette, radii, and type language so the blog reads as part of the same site. */

@import url("https://fonts.googleapis.com/css2?family=Russo+One&family=Open+Sans:wght@400;500;600;700&family=Inter:wght@400;500;700&display=swap");

:root {
  --color-primary: #013672;
  --color-green: #99ea48;
  --color-green-secondary: #84d65a;
  --color-background-light: #f7f4fc;
  --color-white: #ffffff;
  --color-text: #333333;
  --color-text-secondary: #666666;
  --color-border: #e5e7eb;

  --container-width: 900px;
  --radius-medium: 20px;
  --radius-round: 999px;

  --font-heading: "Russo One", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-secondary: "Open Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-secondary);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header — static equivalent of the SPA's glass pill nav. */
body > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 16px max(20px, calc((100% - var(--container-width)) / 2));
  background: linear-gradient(180deg, #03407f 0%, #013672 100%);
}

body > header > a {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 400;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

body > header > a:hover {
  text-decoration: none;
  opacity: 0.9;
}

body > header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-left: auto;
}

body > header nav a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
}

body > header nav a:hover {
  color: #fff;
  text-decoration: none;
}

/* Footer — static equivalent of the SPA footer. */
body > footer {
  margin-top: 64px;
  padding: 28px max(20px, calc((100% - var(--container-width)) / 2));
  background: #021c3a;
}

body > footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

body > footer nav a {
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
}

body > footer nav a:hover {
  color: #fff;
  text-decoration: none;
}

main {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 40px 20px 64px;
}

/* Breadcrumbs (article pages) */
main > nav[aria-label="Хлебные крошки"] ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  font-family: var(--font-secondary);
  font-size: 13px;
  color: var(--color-text-secondary);
}

main > nav[aria-label="Хлебные крошки"] li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--color-border);
}

main > nav[aria-label="Хлебные крошки"] li {
  display: flex;
  gap: 6px;
}

/* Blog hub / cluster hub listing */
main > p:first-of-type,
main > h1 + p {
  max-width: 42rem;
  font-size: 17px;
  color: var(--color-text-secondary);
}

main > ul,
section > ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

main > ul > li,
section > ul > li {
  padding: 20px;
  border: 1px solid rgba(1, 54, 114, 0.12);
  border-radius: var(--radius-medium);
  background: var(--color-white);
  box-shadow: 0 1px 2px rgba(1, 54, 114, 0.04), 0 10px 28px rgba(1, 54, 114, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

main > ul > li:hover,
section > ul > li:hover {
  transform: translateY(-2px);
  border-color: rgba(1, 54, 114, 0.22);
  box-shadow: 0 4px 8px rgba(1, 54, 114, 0.06), 0 16px 36px rgba(1, 54, 114, 0.09);
}

main > ul > li > a,
section > ul > li > a {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  color: var(--color-primary);
}

main > ul > li > a:hover,
section > ul > li > a:hover {
  text-decoration: none;
}

main > ul > li > p,
section > ul > li > p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

/* Article */
article > header h1 {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.article-meta__author,
.article-meta__dates {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

article > header img {
  margin-top: 20px;
  border-radius: var(--radius-medium);
}

article h2 {
  margin: 40px 0 14px;
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
}

article h3 {
  margin: 28px 0 10px;
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 700;
  color: var(--color-primary);
}

article p {
  margin: 0 0 16px;
}

article ul,
article ol {
  margin: 0 0 16px;
  padding-left: 1.4em;
}

article li {
  margin-bottom: 6px;
}

article blockquote {
  margin: 24px 0;
  padding: 4px 20px;
  border-left: 3px solid var(--color-green);
  color: var(--color-text-secondary);
  font-style: italic;
}

article code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--color-background-light);
  font-size: 0.9em;
}

/* Related / commercial CTA sections after the article */
main > section[aria-labelledby] {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

main > section[aria-labelledby] h2 {
  margin: 0 0 16px;
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 700;
  color: var(--color-primary);
}

main > section[aria-labelledby] ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  grid-template-columns: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

main > section[aria-labelledby] li {
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
}

main > section[aria-labelledby] a {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--radius-round);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(1, 54, 114, 0.05);
  border: 1px solid rgba(1, 54, 114, 0.12);
}

main > section[aria-labelledby] a:hover {
  background: rgba(1, 54, 114, 0.09);
  text-decoration: none;
}

@media (max-width: 640px) {
  main > ul,
  section > ul {
    grid-template-columns: 1fr;
  }

  body > header {
    padding: 14px 16px;
  }

  main {
    padding: 28px 16px 48px;
  }
}
