/* ===========================
   Базовый размер (ВАЖНО для iframe)
=========================== */
html {
  font-size: 16px;
}

body {
  font-family: Arial, sans-serif;
  font-size: 1rem;
  margin: 0;
  padding: 0;
  background: #f9f9f9;
}

/* ===========================
   Header
=========================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1.25rem; /* 15px 20px */
  background: #fff;
  box-shadow: 0 0.125rem 0.3rem rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

header .logo {
  font-size: 3.5rem; /* БЫЛО em — критично */
  font-weight: bold;
}

header .categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem; /* 10px */
}

header .categories button {
  padding: 0.5rem 0.75rem; /* 8px 12px */
  border: none;
  background: #007BFF;
  color: #fff;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.9rem; /* БЫЛО em */
}

header .categories button.active {
  background: #0056b3;
}

/* ===========================
   Контейнер и карточки тизеров
=========================== */
#teaserContainer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem; /* 20px */
  padding: 1.25rem;
}

.teaser {
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0.125rem 0.375rem rgba(0,0,0,0.1);
  text-decoration: none;
  color: #000;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}

.teaser:hover {
  transform: translateY(-0.3rem);
}

.teaser img,
.teaser video {
  width: 100%;
  height: auto;
  display: block;
}

.teaser .content {
  padding: 0.625rem; /* 10px */
}

.teaser .content h3 {
  font-size: 2rem;   /* БЫЛО 2em — вот где был ад */
  margin: 0;
  line-height: 1.2;    /* line-height ВСЕГДА без единиц */
}

/* ===========================
   Skeleton
=========================== */
.teaser.skeleton {
  background: #eee;
  min-height: 12.5rem; /* 200px */
  display: flex;
  flex-direction: column;
}

.teaser.skeleton .img {
  background: #ddd;
  height: 9.375rem; /* 150px */
}

.teaser.skeleton .content h3 {
  background: #ddd;
  height: 1.25rem; /* 20px */
  margin: 0.625rem;
}

/* ===========================
   Адаптивность
=========================== */
@media (max-width: 1024px) {
  #teaserContainer {
    grid-template-columns: 1fr;
    gap: 0.95rem;
  }
}

@media (max-width: 768px) {
  #teaserContainer {
    grid-template-columns: 1fr;
    gap: 0.625rem;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
  }

  header .categories button {
    font-size: 0.8rem;
    padding: 0.375rem 0.625rem;
  }
}
