:root {
  color-scheme: light;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #f8fafc;
  color: #0f172a;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f8fafc;
}

a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 24px;
  margin: 64px clamp(20px, 5vw, 56px);
  padding-bottom: 30px;
  text-align: center;
  border-bottom: 1px solid #BAC2D2;
}

.site-header a {
  text-decoration: none;
}

.site-title {
  display: inline-flex;
  align-items: center;
  align-self: start;
  gap: 10px;
  justify-self: start;
  min-width: 0;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.site-header__title {
  margin-bottom: 20px;
}

.site-header__description {
  margin: 0;
  color: #212121;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  min-width: 0;
  overflow-wrap: anywhere;
}

.site-header__nav {
  display: flex;
  align-self: start;
  justify-self: end;
  justify-content: flex-end;
  min-width: 0;
}

.site-header__index-link {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  color: #FFFFFF;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  background-color: #006FCC;
  padding: 16px 15px;
}

.site-header__index-arrow {
  display: block;
  flex: 0 0 auto;
  transition: transform 160ms ease;
}

.site-header__index-link:hover .site-header__index-arrow {
  transform: translateX(4px);
}

.site-title__logo {
  display: block;
  width: auto;
  max-width: 169px;
  height: 35px;
  object-fit: contain;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: #475569;
  font-size: 0.9375rem;
}

.site-main {
  margin: 0 auto;
  max-width: 960px;
  padding: 48px clamp(20px, 5vw, 56px);
}

.site-footer {
  font-size: 0.875rem;
  line-height: 1.5;
}

.site-footer__contact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  min-height: 136px;
  box-sizing: border-box;
  background: #006fcc;
  color: #ffffff;
  padding: 28px clamp(20px, 5vw, 56px) 8px;
  font-size: 0.92em;
  text-align: right;
}

.site-footer__brand {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.site-footer__logo {
  display: block;
  width: 152px;
  max-width: 36vw;
  height: auto;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 10px;
}

.site-footer__links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-size: 0.875rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.site-footer__links a::before {
  display: block;
  width: 1px;
  height: 1em;
  background: currentColor;
  content: "";
}

.site-footer__links a:hover {
  text-decoration: underline;
}

.site-footer__copyright {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  box-sizing: border-box;
  background: #ffffff;
  color: #212121;
  padding: 8px clamp(20px, 5vw, 56px);
  text-align: center;
}

.site-footer__contact p,
.site-footer__copyright p {
  margin: 0;
}

.site-footer__contact p {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  min-height: 34px;
  max-width: 48rem;
}

.back-to-top {
  --back-to-top-bottom: clamp(16px, 4vw, 32px);

  position: fixed;
  right: clamp(16px, 4vw, 32px);
  bottom: var(--back-to-top-bottom);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #002d53;
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    background-color 0.2s ease,
    bottom 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
  visibility: hidden;
}

.back-to-top--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.back-to-top__arrow {
  display: block;
  width: 13px;
  height: 8px;
}

.back-to-top__label {
  margin-top: 5px;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: #001f3a;
}

.page-heading {
  margin-bottom: 32px;
}

.page-heading--center {
  text-align: center;
}

.page-heading h1,
.not-found h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
}

.page-heading .page-heading__subtle-title {
  color: #334155;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.page-heading p,
.empty-state p {
  color: #000000;
  line-height: 26px;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.category-tags a {
  border: 1px solid #D6E2EB;
  border-radius: 999px;
  background: #ffffff;
  color: #006FCC;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  padding: 8px 14px;
  text-decoration: none;
}

.category-tags a:hover {
  border-color: #38bdf8;
  color: #0369a1;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #b6e4ff;
  border-radius: 999px;
  background: #ffffff;
  color: #006FCC;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  padding: 4px 20px;
  text-decoration: none;
}

.category-pill:hover,
.category-pill:focus-visible {
  border-color: #38bdf8;
  color: #0369a1;
}

.article-list {
  display: grid;
  gap: 32px;
}

.article-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  background: transparent;
}

.article-header__image {
  display: block;
  overflow: hidden;
  background: #e2e8f0;
}

.article-card__image {
  position: relative;
  display: flex;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  background: #e2e8f0;
  color: inherit;
  text-decoration: none;
}

.article-header__image {
  aspect-ratio: 2.7 / 1;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 16px;
  border-radius: 8px;
}

.article-card__image img,
.article-header__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card__image--placeholder {
  box-sizing: border-box;
  background: url("../images/article-placeholder-bg.webp") center / 100% 100% no-repeat;
  padding: 20px;
}

.article-card__placeholder-title {
  position: relative;
  color: #0f172a;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}

.article-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding-top: 18px;
}

.article-card__date {
  color: #5D6A72;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1;
}

.article-card h2 {
  margin: 10px 0 10px;
  font-size: 1.375rem;
  line-height: 1.35;
}

.article-card h2 a {
  text-decoration: none;
}

.article-card h2 a:hover,
.site-header a:hover {
  text-decoration: underline;
}

.article-card p {
  margin: 0;
  color: #212121;
  line-height: 1.75;
}

.article-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 22px;
}

.article-card__author {
  margin-left: auto;
  color: #5D6A72;
  font-size: 0.875rem;
  font-weight: 500;
}

.text-link {
  color: #0369a1;
  font-weight: 700;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3vw, 28px);
  margin-top: 40px;
}

.pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  color: #212121;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.pagination a.pagination__item:hover,
.pagination a.pagination__item:focus-visible {
  background: #f1f5f9;
}

.pagination__current {
  background: #1a1a1a;
  color: #ffffff;
}

.pagination__disabled {
  opacity: 0.45;
}

.pagination__control img {
  display: block;
  width: 6px;
  height: auto;
}

.article-detail {
  margin: 0 auto;
  max-width: 44rem;
}

.article-detail__main {
  min-width: 0;
}

.article-surface {
  width: 100%;
  max-width: 44rem;
  box-sizing: border-box;
  margin: 0 auto;
  border-radius: 8px;
  background: #ffffff;
  padding: 60px 86px;
}

.article-header {
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 40px;
  padding-bottom: 40px;
}

.article-header h1 {
  margin: 15px 0 8px;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  line-height: 1.25;
}

.article-header p {
  margin: 0 0 15px;
  color: #475569;
  font-size: 1rem;
  line-height: 1.65;
}

.article-header__date {
  display: block;
  margin-top: 15px;
  color: #5D6A72;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
}

.article-header__date:first-child {
  margin-top: 0;
}

.article-header__author {
  color: #5D6A72;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
}

.article-body {
  color: #1e293b;
  font-size: 1.0625rem;
  line-height: 2;
  overflow-wrap: break-word;
}

.article-body > * + * {
  margin-top: 1.35rem;
}

.article-body p {
  margin-block: 0;
}

.article-body h2,
.article-body h3 {
  color: #0f172a;
  line-height: 1.3;
  scroll-margin-top: 24px;
}

.article-body h2 {
  margin-top: 4.6rem;
  font-size: 1.5rem;
}

.article-body h2::before {
  content: '';
  position: absolute;
  width: 2.1em;
  height: 2px;
  margin-top: -0.8rem;
  background: #006FCC;
}

.article-body h3 {
  margin-top: 2rem;
  font-size: 1.25rem;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
}

.article-body li + li {
  margin-top: 0.35rem;
}

.article-body a {
  color: #0369a1;
  font-weight: 700;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.article-body pre {
  overflow-x: auto;
  border-radius: 8px;
  background: #111827;
  color: #e5e7eb;
  font-size: 0.9375rem;
  line-height: 1.7;
  padding: 16px;
}

.article-body :not(pre) > code {
  border-radius: 4px;
  background: #e2e8f0;
  color: #0f172a;
  padding: 2px 6px;
}

.article-body blockquote {
  border-left: 4px solid #38bdf8;
  color: #475569;
  margin-left: 0;
  padding: 10px 0 10px 18px;
}

.article-body img {
  max-width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.article-toc {
  display: none;
}

.article-toc__title {
  display: inline-block;
  margin: 0;
  color: #0f172a;
  font-size: 1.24em;
  font-weight: 500;
}

.article-toc__divider {
  border: none;
  height: 1px;
  background-color: #D3D3D3;
}

.article-toc ol {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-toc a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  color: #006FCC;
  font-size: 0.875rem;
  line-height: 1.5;
  text-decoration: none;
}

.article-toc__item--child a {
  padding-left: 14px;
  font-size: 0.8125rem;
}

.article-toc__number {
  color: #0f172a;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.article-toc a:hover {
  color: #0369a1;
  text-decoration: underline;
}

.empty-state {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 32px;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.eyebrow {
  margin: 0 0 8px;
  color: #0369a1;
  font-size: 0.8125rem;
  font-weight: 700;
}

@media (min-width: 760px) {
  .site-main {
    max-width: 1180px;
    padding-block: 32px 48px;
  }

  .page-heading {
    margin-bottom: 22px;
  }

  .page-heading h1,
  .not-found h1 {
    font-size: 2.25rem;
  }

  .page-heading p,
  .empty-state p {
    margin-block: 0;
  }

  .article-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 60px 35px;
  }

  .article-card h2 {
    font-size: 1.25rem;
  }

  .article-card h2 a,
  .article-card p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
  }

  .article-card h2 a {
    -webkit-line-clamp: 2;
  }

  .article-card p {
    line-height: 1.6;
    -webkit-line-clamp: 2;
  }

  .article-card__footer {
    padding-top: 20px;
  }
}

@media (min-width: 1120px) {
  .article-detail {
    display: grid;
    align-items: start;
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 40px;
    position: relative;
    left: 50%;
    max-width: none;
    width: min(1440px, calc(100vw - 80px));
    transform: translateX(-50%);
  }

  .article-detail__main {
    grid-column: 2;
  }

  .article-surface {
    max-width: none;
    margin: 0;
  }

  .article-toc {
    display: block;
    position: sticky;
    box-sizing: border-box;
    grid-column: 1;
    grid-row: 1;
    justify-self: stretch;
    top: 24px;
    width: 100%;
  }

  .article-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header {
    --site-header-mobile-padding: 12px;
    --site-title-mobile-logo-height: 28px;

    gap: 28px;
    grid-template-columns: 1fr;
    justify-items: center;
    margin: 36px clamp(20px, 5vw, 56px) 40px;
    position: relative;
    padding-block: var(--site-header-mobile-padding);
  }

  .site-title {
    justify-self: start;
  }

  .site-header__description {
    justify-self: center;
    font-size: 0.9375rem;
  }

  .site-header__nav {
    position: absolute;
    top: calc(var(--site-header-mobile-padding) + var(--site-title-mobile-logo-height));
    right: 0;
    transform: translateY(-100%);
  }

  .site-title__logo {
    height: var(--site-title-mobile-logo-height);
  }

  .article-surface {
    padding: 36px 20px;
  }

  .article-card h2 {
    font-size: 1.25rem;
  }

  .article-card__footer {
    padding-top: 18px;
  }

  .empty-state {
    padding: 20px;
  }
}
