:root {
  --blog-primary: #0f3d63;
  --blog-primary-dark: #082a45;
  --blog-accent: #c9a35e;
  --blog-text: #172033;
  --blog-muted: #64748b;
  --blog-background: #f8fafc;
  --blog-surface: #ffffff;
  --blog-border: #e2e8f0;
  --blog-shadow: 0 18px 45px rgba(15, 23, 42, 0.09);
  --blog-radius: 20px;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--blog-text);
  background: var(--blog-background);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 9999;
  padding: 12px 18px;
  color: #ffffff;
  background: var(--blog-primary-dark);
  border-radius: 8px;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip: rect(0, 0, 0, 0);
}

/* Hero */

.blog-hero {
  position: relative;
  isolation: isolate;
  min-height: 430px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #ffffff;
}

.blog-hero__background {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.blog-hero__background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(4, 25, 43, 0.94) 0%,
      rgba(8, 42, 69, 0.82) 48%,
      rgba(8, 42, 69, 0.42) 100%
    ),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.38));
}

.blog-hero__container,
.blog-section__container {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.blog-hero__container {
  padding-block: 90px;
}

.blog-hero__eyebrow {
  margin: 0 0 16px;
  color: #f1d296;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.blog-hero__title {
  max-width: 780px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 6vw, 5.2rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
}

.blog-hero__description {
  max-width: 690px;
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.75;
}

/* Main section */

.blog-section {
  padding: 82px 0 110px;
}

.blog-section__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.blog-section__eyebrow {
  margin: 0 0 8px;
  color: var(--blog-accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.blog-section__title {
  margin: 0;
  color: var(--blog-primary-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.1;
}

.blog-section__count {
  flex-shrink: 0;
  margin: 0;
  color: var(--blog-muted);
  font-size: 0.95rem;
}

/* Search */

.blog-toolbar {
  margin-bottom: 35px;
}

.blog-search {
  position: relative;
  max-width: 520px;
}

.blog-search svg {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: var(--blog-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.blog-search input {
  width: 100%;
  min-height: 54px;
  padding: 14px 18px 14px 52px;
  color: var(--blog-text);
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: 13px;
  outline: none;
  box-shadow: 0 5px 20px rgba(15, 23, 42, 0.035);
  font: inherit;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.blog-search input:focus {
  border-color: var(--blog-primary);
  box-shadow: 0 0 0 4px rgba(15, 61, 99, 0.11);
}

/* Article cards */

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.article-card {
  min-width: 0;
  overflow: hidden;
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.055);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.article-card:hover {
  border-color: rgba(15, 61, 99, 0.25);
  box-shadow: var(--blog-shadow);
  transform: translateY(-6px);
}

.article-card__link {
  display: flex;
  height: 100%;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.article-card__image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #dbe4eb;
}

.article-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .article-card__image img {
  transform: scale(1.045);
}

.article-card__category {
  position: absolute;
  top: 16px;
  left: 16px;
  margin: 0;
  padding: 8px 12px;
  color: #ffffff;
  background: rgba(8, 42, 69, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.article-card__date {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--blog-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.article-card__date svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.article-card__title {
  margin: 0;
  color: var(--blog-primary-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.38rem;
  line-height: 1.3;
}

.article-card__excerpt {
  display: -webkit-box;
  margin: 15px 0 0;
  overflow: hidden;
  color: var(--blog-muted);
  font-size: 0.94rem;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.article-card__read-more {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding-top: 22px;
  color: var(--blog-primary);
  font-size: 0.87rem;
  font-weight: 800;
}

.article-card__read-more svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.article-card:hover .article-card__read-more svg {
  transform: translateX(4px);
}

.article-card__link:focus-visible {
  outline: 3px solid var(--blog-accent);
  outline-offset: -3px;
}

/* Loading, empty and error states */

.article-loading {
  grid-column: 1 / -1;
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: var(--blog-muted);
}

.article-loading__spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #d9e1e8;
  border-top-color: var(--blog-primary);
  border-radius: 50%;
  animation: article-spin 0.8s linear infinite;
}

.article-empty,
.article-error {
  padding: 48px 25px;
  text-align: center;
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
}

.article-empty h3,
.article-error h3 {
  margin: 0 0 10px;
  color: var(--blog-primary-dark);
  font-size: 1.35rem;
}

.article-empty p,
.article-error p {
  margin: 0;
  color: var(--blog-muted);
  line-height: 1.65;
}

.article-error code {
  color: var(--blog-primary);
}

.javascript-warning {
  margin: 20px;
  padding: 18px;
  color: #7c2d12;
  background: #ffedd5;
  border: 1px solid #fdba74;
  border-radius: 10px;
}

@keyframes article-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .blog-hero {
    min-height: 390px;
  }

  .blog-hero__container,
  .blog-section__container {
    width: min(100% - 28px, 1180px);
  }

  .blog-hero__container {
    padding-block: 72px;
  }

  .blog-section {
    padding: 62px 0 80px;
  }

  .blog-section__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-card__content {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
