/* =========================================================
   KRM РФ — главная страница
   Строгая архивная версия
   Файл: /assets/css/page-home.css
   ========================================================= */

/* ---------------------------------------------------------
   Общая логика страницы
   --------------------------------------------------------- */

.page-home {
  --home-border: rgba(15, 23, 42, 0.10);
  --home-border-soft: rgba(15, 23, 42, 0.07);
  --home-border-accent: rgba(185, 28, 28, 0.28);

  --home-card: #ffffff;
  --home-card-muted: #fbfbfc;
  --home-card-accent: #fff8f8;

  --home-text: var(--text);
  --home-muted: var(--muted);
  --home-link: var(--link);

  --home-radius: 18px;
  --home-radius-small: 12px;

  --home-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
  --home-shadow-small: 0 6px 18px rgba(15, 23, 42, 0.05);

  background: var(--bg);
}

/* ---------------------------------------------------------
   Доступность
   --------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--home-border);
  border-radius: 10px;
  background: var(--home-card);
  color: var(--home-text);
  text-decoration: none;
  box-shadow: var(--home-shadow-small);
}

.skip-link:focus {
  top: 1rem;
}

/* ---------------------------------------------------------
   Основная ширина
   --------------------------------------------------------- */

.home-main {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.35rem 0 3rem;
}

/* ---------------------------------------------------------
   Общие элементы
   --------------------------------------------------------- */

.page-home .section-label {
  display: inline-flex;
  align-items: center;
  margin: 0;
  color: var(--home-muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-home .updated-time {
  margin: 0.35rem 0 0.85rem;
  color: var(--home-muted);
  font-size: 0.92rem;
}

.page-home .news-link {
  color: var(--home-link);
  font-weight: 800;
  text-decoration: none;
}

.page-home .news-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.22rem;
}

.page-home .main-nav a[aria-current="page"] {
  color: var(--home-text);
  text-decoration: underline;
  text-underline-offset: 0.25rem;
}

/* ---------------------------------------------------------
   Header compatibility
   --------------------------------------------------------- */

.page-home .site-header {
  background: transparent;
}

/* ---------------------------------------------------------
   Главный экран
   --------------------------------------------------------- */

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 1rem;
  align-items: stretch;
  margin: 1.25rem 0 1rem;
}

.home-hero-content,
.home-hero-panel {
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius);
  background: var(--home-card);
  box-shadow: var(--home-shadow);
}

.home-hero-content {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.home-hero-panel {
  padding: 1.15rem;
}

.home-hero h1 {
  max-width: 820px;
  margin: 0.55rem 0 0.95rem;
  color: var(--home-text);
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.home-lead {
  max-width: 760px;
  margin: 0;
  color: var(--home-muted);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  line-height: 1.62;
}

/* ---------------------------------------------------------
   Кнопки / быстрые действия
   --------------------------------------------------------- */

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.68rem 0.95rem;
  border: 1px solid var(--home-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--home-text);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.home-button:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 23, 42, 0.18);
  background: #f8fafc;
}

.home-button-primary {
  border-color: rgba(185, 28, 28, 0.35);
  background: #fff4f4;
}

.home-button-primary:hover {
  border-color: rgba(185, 28, 28, 0.48);
  background: #ffecec;
}

/* ---------------------------------------------------------
   Панель "Принцип работы"
   --------------------------------------------------------- */

.home-panel-title {
  margin: 0 0 0.8rem;
  color: var(--home-text);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.home-status-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-status-list li {
  padding: 0.72rem 0;
  border-top: 1px solid var(--home-border-soft);
}

.home-status-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.home-status-list strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--home-text);
  font-size: 0.96rem;
  line-height: 1.3;
}

.home-status-list span {
  display: block;
  color: var(--home-muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.home-panel-link,
.home-card-link {
  display: inline-block;
  margin-top: 0.9rem;
  color: var(--home-link);
  font-weight: 800;
  text-decoration: none;
}

.home-panel-link:hover,
.home-card-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.22rem;
}

/* ---------------------------------------------------------
   Карточки ключевых разделов
   --------------------------------------------------------- */

.home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1rem 0;
}

.home-card {
  min-height: 100%;
  padding: 1rem;
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius);
  background: var(--home-card);
  color: var(--home-text);
  text-decoration: none;
  box-shadow: var(--home-shadow-small);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.home-card:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 23, 42, 0.16);
  background: var(--home-card-muted);
}

.home-card-featured {
  border-color: var(--home-border-accent);
  background: var(--home-card-accent);
}

.home-card h2 {
  margin: 0.45rem 0 0.55rem;
  color: var(--home-text);
  font-size: 1.22rem;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.home-card p {
  margin: 0;
  color: var(--home-muted);
  line-height: 1.55;
}

/* ---------------------------------------------------------
   Общие секции
   --------------------------------------------------------- */

.home-section {
  margin: 0.9rem 0;
  padding: clamp(1.05rem, 2.4vw, 1.45rem);
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius);
  background: var(--home-card);
  box-shadow: var(--home-shadow-small);
}

.home-section h2 {
  margin: 0.35rem 0 0.75rem;
  color: var(--home-text);
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.home-section h3 {
  color: var(--home-text);
}

.home-section p {
  color: var(--home-muted);
  line-height: 1.65;
}

/* ---------------------------------------------------------
   Последнее важное + быстрый вход
   --------------------------------------------------------- */

.home-section-split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.85fr);
  gap: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-section-main,
.home-section-aside {
  padding: clamp(1.05rem, 2.4vw, 1.45rem);
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius);
  background: var(--home-card);
  box-shadow: var(--home-shadow-small);
}

.home-section-main #latestTitle {
  max-width: 760px;
}

.home-section-aside h2 {
  margin-top: 0.35rem;
}

.home-section-aside {
  min-height: auto;
}

/* ---------------------------------------------------------
   Feature-блоки
   --------------------------------------------------------- */

.home-feature {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}

.home-feature-image {
  overflow: hidden;
  border-radius: var(--home-radius-small);
  background: #f1f5f9;
}

.home-feature-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.home-feature-text {
  min-width: 0;
}

.home-feature-text p:first-child {
  margin-top: 0;
}

.home-feature-assessment {
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
}

/* ---------------------------------------------------------
   Списки ссылок
   --------------------------------------------------------- */

.home-link-list {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.home-link-list a {
  display: block;
  padding: 0.75rem 0;
  border-top: 1px solid var(--home-border-soft);
  color: var(--home-text);
  line-height: 1.35;
  text-decoration: none;
}

.home-link-list li:first-child a {
  border-top: 0;
  padding-top: 0;
}

.home-link-list a:hover {
  color: var(--home-link);
  text-decoration: underline;
  text-underline-offset: 0.22rem;
}

/* ---------------------------------------------------------
   Карта и данные
   --------------------------------------------------------- */

.home-section-map {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 1rem;
  align-items: start;
}

.home-section-map h2 {
  max-width: 760px;
}

.home-note {
  padding: 1rem;
  border: 1px solid var(--home-border-soft);
  border-radius: var(--home-radius-small);
  background: var(--home-card-muted);
  box-shadow: none;
}

.home-note h3 {
  margin: 0 0 0.75rem;
  color: var(--home-text);
  font-size: 1.05rem;
  line-height: 1.25;
}

.home-note ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--home-muted);
  line-height: 1.6;
}

.home-note li + li {
  margin-top: 0.25rem;
}

/* ---------------------------------------------------------
   Две колонки
   --------------------------------------------------------- */

.home-section-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.home-section-columns > div {
  min-width: 0;
}

/* ---------------------------------------------------------
   О проекте
   --------------------------------------------------------- */

.home-about {
  border-color: var(--home-border-accent);
  background: var(--home-card-accent);
}

.home-actions-bottom {
  margin-top: 1.25rem;
}

/* ---------------------------------------------------------
   Фокус, изображения, мелочи
   --------------------------------------------------------- */

.page-home a:focus-visible {
  outline: 3px solid rgba(185, 28, 28, 0.28);
  outline-offset: 3px;
  border-radius: 0.35rem;
}

.page-home img {
  max-width: 100%;
}

/* ---------------------------------------------------------
   Адаптив
   --------------------------------------------------------- */

@media (max-width: 960px) {
  .home-hero,
  .home-section-split,
  .home-section-map,
  .home-feature,
  .home-feature-assessment {
    grid-template-columns: 1fr;
  }

  .home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-hero-panel {
    order: 2;
  }
}

@media (max-width: 720px) {
  .home-main {
    width: min(100% - 1rem, 1120px);
    padding-top: 0.8rem;
  }

  .home-hero {
    margin-top: 0.8rem;
  }

  .home-hero h1 {
    font-size: clamp(1.85rem, 10vw, 2.75rem);
    line-height: 1.1;
  }

  .home-lead {
    font-size: 1rem;
  }

  .home-grid,
  .home-section-columns {
    grid-template-columns: 1fr;
  }

  .home-actions {
    display: grid;
  }

  .home-button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .home-main {
    width: min(100% - 0.75rem, 1120px);
  }

  .home-hero-content,
  .home-hero-panel,
  .home-card,
  .home-section,
  .home-section-main,
  .home-section-aside {
    border-radius: 14px;
  }

  .home-hero-content,
  .home-hero-panel,
  .home-card,
  .home-section,
  .home-section-main,
  .home-section-aside,
  .home-note {
    padding: 1rem;
  }

  .home-hero h1 {
    letter-spacing: -0.035em;
  }

  .home-feature {
    gap: 0.8rem;
  }
}
