/* =========================================================
   Usmart Ghost Theme — screen.css
   Визуально соответствует лендингу usmart-lms.ru
   ========================================================= */

:root {
  /* Цвета (дизайн-токены Usmart) */
  --color-primary: #2E2F38;
  --color-secondary: #FFFD82;
  --color-body-bg: #F5F5F8;
  --color-card-bg: #ffffff;
  --color-text: #2E2F38;
  --color-text-muted: #8385A8;
  --color-border: #ECEFF3;

  --gray-75: #E8E9FD;
  --gray-100: #ECEFF3;
  --gray-200: #DCE0E9;
  --gray-500: #9A9DBA;
  --gray-700: #767796;
  --gray-900: #4E4F61;

  --color-danger: #FF4343;
  --color-success: #B0FF82;
  --color-cyan: #00ABC2;

  /* Типографика */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

  /* Скругления */
  --radius: 0.75rem;    /* 12px */
  --radius-sm: 1.25rem; /* 20px */
  --radius-lg: 1.5rem;  /* 24px */

  /* Тени */
  --shadow-lg: 0 5px 48px rgba(131, 133, 168, 0.2);
  --shadow-card: 0 8px 48px rgba(131, 133, 168, 0.32);
  --shadow-soft: 0 4px 16px -2px rgba(19, 20, 28, 0.04);

  --container-max: 1200px;
}

/* ---------- Reset / Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.35;
  color: var(--color-text);
  background: var(--color-body-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
  margin: 0 0 1rem;
}

h1 { font-size: 32px; line-height: 40px; }
h2 { font-size: 28px; line-height: 32px; }
h3 { font-size: 24px; line-height: 28px; }
h4 { font-size: 20px; }

p {
  margin: 0 0 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 1rem 2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn:focus-visible {
  outline: 3px solid rgba(0, 171, 194, 0.4);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: #ffffff;
}

.btn-outline-primary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn-outline-primary:hover {
  background: var(--color-primary);
  color: #ffffff;
}

.btn-secondary {
  background: var(--color-secondary);
  color: var(--color-primary);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-lg {
  padding: 1.5rem 2.5rem;
  font-size: 18px;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ---------- Header / Navbar ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 1.5rem;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 1;
}

.site-logo:hover {
  opacity: 0.9;
}

.site-logo__img {
  height: 40px;
  max-height: 40px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav__list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.75rem;
}

.site-nav__link {
  font-weight: 500;
  font-size: 16px;
  color: var(--gray-700);
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.site-nav__link--mgr {
  color: var(--color-primary);
  font-weight: 600;
}

.nav-cta {
  display: inline-block;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border-radius: 8px;
}

.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Hero (home) ---------- */
.hero {
  background: var(--color-body-bg);
  padding: 4.5rem 0 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--gray-75);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  margin-bottom: 1.5rem;
}

.hero__title {
  font-size: 44px;
  line-height: 1.15;
  max-width: 760px;
  margin: 0 auto 1.25rem;
}

.hero__subtitle {
  font-size: 19px;
  line-height: 1.5;
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 0 auto 2.25rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* ---------- Page intro (tag/author) ---------- */
.page-intro {
  background: var(--color-body-bg);
  padding: 3rem 0 2rem;
  text-align: center;
}

.page-intro__title {
  font-size: 32px;
  margin-bottom: 0.5rem;
}

.page-intro__desc {
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 0 auto;
}

.page-intro__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.25rem;
  background: var(--gray-200);
  box-shadow: var(--shadow-lg);
}

/* ---------- Posts grid ---------- */
.posts-section {
  padding: 2.5rem 0 4rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

/* ---------- Post card ---------- */
.card {
  background: var(--color-card-bg);
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

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

.card__link:hover {
  color: inherit;
}

.card__image-wrap {
  padding: 12px;
  padding-bottom: 0;
}

.card__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 0.75rem;
  background: var(--gray-100);
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.5rem 1.5rem;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.card__tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--gray-75);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

.card__title {
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  color: var(--color-text);
  margin: 0 0 0.75rem;
}

.card__excerpt {
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin: 0 0 1.25rem;
  flex: 1;
}

.card__meta {
  color: var(--color-text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card__author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card__author-avatar {
  border-radius: 50%;
  width: 32px;
  height: 32px;
  object-fit: cover;
  background: var(--gray-200);
}

.card__author-avatar:empty {
  display: inline-block;
  background: var(--gray-200);
}

.card__meta-sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gray-500);
}

/* ---------- Post single ---------- */
.post-single {
  padding: 3rem 0 2rem;
  max-width: 760px;
  margin: 0 auto;
}

.post-single__back {
  margin-bottom: 1.5rem;
}

.post-single__back a {
  font-weight: 500;
  font-size: 15px;
  color: var(--color-text-muted);
}

.post-single__back a:hover {
  color: var(--color-primary);
}

.post-single__meta {
  color: var(--color-text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.post-single__title {
  font-size: 40px;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.post-single__subtitle {
  font-size: 20px;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.post-single__header {
  margin-bottom: 1.5rem;
}

.post-single__figure {
  margin: 0 0 2rem;
  text-align: center;
}

.post-single__figure img {
  width: 100%;
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
}

.post-single__figure figcaption {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 0.75rem;
}

.post-single__content {
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-text);
}

.post-single__image {
  width: 100%;
  object-fit: cover;
}

.post-single__content img {
  border-radius: 1rem;
  margin: 1.5rem auto;
}

.post-single__content h2,
.post-single__content h3 {
  margin-top: 2rem;
}

.post-single__content blockquote {
  border-left: 4px solid var(--color-secondary);
  background: var(--gray-75);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--gray-700);
}

.post-single__content a {
  color: var(--color-cyan);
  text-decoration: underline;
}

.post-single__content pre {
  background: var(--color-primary);
  color: #fff;
  border-radius: 1rem;
  padding: 1.25rem;
  overflow-x: auto;
}

.post-single__content code {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.post-single__content .kg-card {
  margin: 1.5rem 0;
}

/* ---------- KarMa image widths ---------- */
.kg-width-wide {
  width: 100%;
  max-width: 720px;
}

.kg-width-full {
  width: 100%;
  max-width: 100%;
}

.post-single__content .kg-width-wide,
.post-single__content .kg-width-wide img {
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.post-single__content .kg-width-full,
.post-single__content .kg-width-full img {
  width: 100%;
  max-width: 100%;
}

/* ---------- CTA block (post) ---------- */
.cta-block {
  background: var(--color-primary);
  border-radius: 1rem;
  padding: 2.5rem;
  text-align: center;
  margin: 2.5rem 0 0;
}

.cta-block__title {
  color: #ffffff;
  font-size: 24px;
  margin-bottom: 1rem;
}

.cta-block__text {
  color: rgba(255, 255, 255, 0.85);
  max-width: 520px;
  margin: 0 auto 1.75rem;
}

.cta-block__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--gray-900);
  color: rgba(255, 255, 255, 0.85);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer__brand {
  flex: 1 1 280px;
}

.site-footer__logo {
  font-weight: 700;
  font-size: 24px;
  color: #ffffff;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.site-footer__about {
  font-size: 14px;
  max-width: 340px;
  color: rgba(255, 255, 255, 0.7);
}

.site-footer__col {
  flex: 0 1 auto;
  min-width: 140px;
}

.site-footer__title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ffffff;
  margin-bottom: 1rem;
}

.site-footer__nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.site-footer__nav a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.site-footer__nav a:hover {
  color: var(--color-secondary);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  padding-top: 1.5rem;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.site-footer__bottom a {
  color: rgba(255, 255, 255, 0.75);
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2.5rem 0 0;
}

.pagination .btn {
  padding: 0.875rem 1.5rem;
}

.pagination__info {
  color: var(--color-text-muted);
  font-size: 14px;
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .site-header__inner {
    height: 64px;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav__list {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .site-nav__link {
    display: block;
    padding: 0.5rem 0;
    border-bottom: none;
  }

  .nav-cta {
    width: 100%;
  }

  .nav-cta .btn {
    width: 100%;
  }

  .nav-toggle.is-active .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle.is-active .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.is-active .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

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

  .hero {
    padding: 3rem 0 2.5rem;
  }

  .hero__title {
    font-size: 32px;
  }

  .hero__subtitle {
    font-size: 17px;
  }

  .post-single__title {
    font-size: 30px;
  }

  .btn-lg {
    padding: 1.25rem 2rem;
  }

  .site-footer__top {
    flex-direction: column;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .posts-grid {
    gap: 1.25rem;
  }

  .card__body {
    padding: 1rem 1.25rem 1.25rem;
  }

  .cta-block {
    padding: 2rem 1.5rem;
  }
}
