:root {
  --bg: #E4E2E3;
  --card-title: #1a1a1a;
  --card-text: #6b6b6b;
  --card-meta: #8a8a8a;
  --card-footer: #464955;
  --accent: #6b3fa0;
  --line: #cfcbc7;
  --nav-active: #6b3fa0;
  --ui-dark-primary: #1C2230;
  --ui-white-primary: #FFF;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--card-title);
  transition: background 0.3s ease;
}

body.post-open {
  background: #fff;
}

.hero {
  padding: 64px 60px 40px;
}

.hero__title {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  max-width: 700px;
}

/* ===== News section ===== */

.news {
  position: relative;
  padding: 0 60px 80px;
}

.news__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}

.news__heading {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

.news__nav {
  display: flex;
  gap: 10px;
}

.news__nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: #b5b1ad;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.news__nav-btn:disabled {
  cursor: default;
  opacity: 0.5;
}

.news__nav-btn--active {
  border-color: var(--nav-active);
  color: var(--nav-active);
}

.news__nav-btn:not(:disabled):hover {
  background: var(--nav-active);
  color: #fff;
}

.news__track-wrap {
  overflow: hidden;
}

.news__track {
  display: flex;
  gap: 32px;
  transition: transform 0.4s ease;
}

/* ===== Card ===== */

.news-card {
  position: relative;
  flex: 0 0 calc(25% - 24px);
  min-width: 240px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.news-card:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: -17px;
  width: 1px;
  background: #D4D6DB;
}

.news-card__head {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.news-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #d8d4ce;
  flex: 0 0 auto;
}

.news-card__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.news-card__author {
  margin-bottom: 4px;
}

.news-card__author-name {
  color: var(--ui-dark-primary, #1C2230);
  font-family: "Merriweather Sans", sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 300;
  line-height: 24px;
}

.news-card__title {
  color: var(--ui-dark-primary, #1C2230);
  font-family: Merriweather, serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px;
  margin: 0 0 10px;
}

.news-card__excerpt {
  font-size: 14px;
  line-height: 1.5;
  color: var(--card-text);
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--card-footer);
}

.news-card__footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: inherit;
}

.news-card__footer-link svg {
  width: 20px;
  height: 20px;
}

/* ===== Skeleton ===== */

.news-card--skeleton .news-card__title,
.news-card--skeleton .news-card__excerpt,
.news-card--skeleton .news-card__author-name {
  background: linear-gradient(90deg, #ddd9d4 25%, #ece9e5 37%, #ddd9d4 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 4px;
  color: transparent;
}

.news-card--skeleton .news-card__avatar {
  animation: shimmer 1.4s ease infinite;
  background: linear-gradient(90deg, #ddd9d4 25%, #ece9e5 37%, #ddd9d4 63%);
  background-size: 400% 100%;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

/* ===== Error / empty state ===== */

.news__state {
  padding: 40px 0;
  text-align: center;
  color: var(--card-text);
  font-size: 15px;
  width: 100%;
}

/* ===== Full post overlay ===== */

.post-overlay {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  background: #fff;
  z-index: 10;
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
  overflow-y: auto;
}

.post-overlay.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.post-overlay__inner {
  max-width: 1200px;
  height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  padding: 20px 24px 80px;
  position: relative;
}

.post-overlay__close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--card-title);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.post-overlay__content {
  text-align: center;
  overflow: hidden;
}

.post-overlay__category {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 12px;
}

.post-overlay__content h1 {
  font-size: 32px;
  line-height: 1.3;
  margin: 0 0 28px;
  padding: 0 40px;
}

.post-overlay__author {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  text-align: left;
}

.post-overlay__author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: #d8d4ce;
}

.post-overlay__author-name {
  font-weight: 700;
  font-size: 15px;
}

.post-overlay__author-role {
  font-size: 13px;
  color: var(--card-meta);
}

.post-overlay__meta {
  color: var(--card-meta);
  font-size: 13px;
  margin-bottom: 16px;
}

.post-overlay__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 36px;
}

.post-overlay__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}

.post-overlay__tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 6px;
}

.post-overlay__body-clip {
  position: relative;
  max-height: 480px;
  overflow: hidden;
  text-align: left;
}

.post-overlay__body-clip>img,
.post-overlay__body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.post-overlay__body {
  font-size: 15px;
  line-height: 1.7;
  color: #333;
}

.post-overlay__body a {
  color: var(--accent);
}

.post-overlay__fade {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 182px;
  background: linear-gradient(0deg, #FFF 0%, rgba(255, 255, 255, 0.00) 100%);
  pointer-events: none;
}

.post-overlay__readmore {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  border-radius: 0;
  background: #1a1a1a;
  color: var(--ui-white-primary, #FFF);
  font-family: Inter, sans-serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 400;
  line-height: 28px;
  /* 140% */
  padding: 8px 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.25s ease, transform 0.25s ease;
}

.post-overlay__readmore:hover {
  background: #333;
  transform: translateX(-50%) translateY(-2px);
}

/* ===== Responsive ===== */

@media (max-width: 1024px) {
  .news-card {
    flex: 0 0 calc(50% - 16px);
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 40px 20px 24px;
  }

  .hero__title {
    font-size: 24px;
  }

  .news {
    padding: 0 20px 60px;
  }

  .news-card {
    flex: 0 0 calc(85% - 16px);
  }
}