/* ====================== ОБЩИЕ ПЕРЕМЕННЫЕ ====================== */
:root {
  --bg: #0f111a;
  --surface: #181b24;
  --text: #e8eaed;
  --text-muted: #9aa0a6;
  --accent: #ff4081;
  --card-bg: #1e2230;
  --border: #2d3241;
  --radius: 12px;
  --gap: 16px;
}

/* ====================== СБРОС И БАЗА ====================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', system-ui, -apple-system-ui, sans-serif;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ====================== ШАПКА ====================== */
header {
  padding: 1rem;
  background: rgba(15, 17, 26, 0.95);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--accent);
}

/* ====================== КОНТЕЙНЕР ====================== */
.container {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--gap);
  width: 100%;
}

/* ====================== HERO ====================== */
.hero {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 2rem 0 3rem;
  align-items: center;
  text-align: center;
}

.hero-text h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: white;
}

.hero-text p {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.hero-signature {
  margin-top: 2rem;
  font-style: italic;
  color: var(--accent);
}

.hero-image img {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
  object-fit: cover;
}

/* ====================== СПИСОК НОВОСТЕЙ ====================== */
#news-list {
  display: grid;
  gap: var(--gap);
  margin-bottom: 3rem;
}

/* Карточка новости */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.card img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
  background: #000;
}

.card-info {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-info h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* ====================== РЕКЛАМА ====================== */
/* Широкий баннер (по умолчанию скрыт на мобилках) */
.ad-wide {
  margin: 2rem 0;
  text-align: center;
  display: none; /* будет включён только на десктопе */
}

.ad-wide img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* Два боковых квадратных баннера (тоже только десктоп) */
.ad-side-container {
  display: none; /* скрыто на мобилках */
  gap: 1rem;
  margin: 2rem 0;
  justify-content: center;
}

.ad-side {
  flex: 1;
  max-width: 300px;
}

.ad-side img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Квадратная реклама между карточками новостей (только мобилка) */
.ad-mobile {
  display: block;
  margin: 1.5rem auto;
  text-align: center;
}

.ad-mobile img {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Футерная реклама */
.ad-footer {
  text-align: center;
  margin: 2rem 0;
}

.ad-footer img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* ====================== ФУТЕР ====================== */
footer {
  padding: 2rem var(--gap);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ====================== АДАПТАЦИЯ ====================== */

/* Планшеты */
@media (min-width: 640px) {
  :root { --gap: 24px; }

  .hero {
    flex-direction: row;
    text-align: left;
    align-items: center;
  }

  .hero-text {
    flex: 1;
    padding-right: 2rem;
  }

  .hero-image {
    flex: 1;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

  #news-list {
    grid-template-columns: 1fr 1fr;
  }
}

/* Десктоп */
@media (min-width: 1024px) {
  header {
    padding: 1.5rem 2rem;
  }

  .logo {
    font-size: 2rem;
  }

  .hero-text h1 {
    font-size: 3.2rem;
  }

  .hero-text p {
    font-size: 1.15rem;
  }

  #news-list {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Включаем десктопную рекламу */
  .ad-wide {
    display: block;
  }

  .ad-side-container {
    display: flex;
  }

  /* Скрываем мобильную рекламу между карточками */
  .ad-mobile {
    display: none;
  }
}

/* Очень большие экраны */
@media (min-width: 1400px) {
  .container {
    padding: 0 4rem;
  }
}