/* Общие стили */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: sans-serif;
  background-color: #f4f4f4;
}

.header {
  text-align: center;
  margin: 20px 0;
}

/* Контейнер */
.container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  column-gap: 20px;
  row-gap: 20px;
}

/* Основной блок */
.main-content {
  flex: 1 1 70%;
}

.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}


.tile {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s;
  text-align: center;
  padding-bottom: 15px;
  flex: 0 1 calc((100% - 40px) / 3); /* 40px — два column-gap по 20px */
}

@media (max-width: 568px) {
  .tile {
    flex: 0 1 calc((100% - 20px) / 2); /* 20px — два column-gap по 10px */
  }
}

@media (max-width: 320px) {
  .tile {
    flex: 1 1 100%; /* 1 плитка */
  }
}



.tile:hover {
  transform: scale(1.02);
}

.tile img {
  width: 100%;
  height: auto;
  display: block;
}



.tile-img-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9; /* или другой нужный тебе */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tile-img-wrapper img {
  max-width: 60%;  /* ограничивает по ширине */
  max-height: 60%; /* ограничивает по высоте */
  object-fit: contain;
  display: block;
}





.tile h3 {
  padding: 10px;
  font-size: 1rem;
}

.video {
}

.programm {
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
margin-bottom: 20px;
}

.programm--near {
  background: #fff;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.programm--full {
  background: #fff;
  border-top: 1px solid #ddd;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
.programm.no-data {
  font-style: italic;
  color: #888;
}

.inner {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background: #f9f9f9;
  padding: 15px 20px;
}


.now {
	color: #e53935; /* яркий красноватый — текущая передача */
}
.before { 
	color: #9e9e9e; /* серый — прошедшее */
}
.after { 
	color: #388e3c; /* спокойный зелёный — следующее */
}

.about {
    padding: 5px 0 10px 45px;
}



/* Сайдбар */
.sidebar {
  flex: 1 1 25%;
}

.sidebar-1, .sidebar-2 {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.sidebar-1 {
	margin-bottom: 20px;
}
/*
.sidebar h2 {
  margin-bottom: 10px;
}
*/
.sidebar h4 {
  margin: 5px 0 15px;
}



.sidebar ul {
  list-style: none;
  padding-left: 0;
}

.sidebar li {
  margin-bottom: 10px;
}

.sidebar a {
  text-decoration: none;
  color: #0077cc;
}

/* Модальное окно */
.modal {
  display: none;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease;
}
.modal {
  overflow: hidden;
  max-height: 100vh;
}

.modal.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: white;
  max-width: 800px;
  width: 95%;
  padding: 20px;
  border-radius: 10px;
  position: relative;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.modal-content iframe {
  width: 100%;
  height: 428px;
}

/* Адаптив */
@media (max-width: 768px) {

  .modal-content iframe {
    height: 400px;
  }
}
@media (max-width: 480px) {

  .modal-content iframe {
    height: 220px;
  }
}
@media (max-width: 380px) {

  .modal-content iframe {
    height: 150px;
  }
}


.modal-content h3 {
  margin: 15px 0 5px;
}

.modal-content p {
  margin-bottom: 10px;
}

.modal-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}
.modal-nav button span {
  font-weight: bold;
  margin: 0 4px;
}

#prev-btn,
#next-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background-color: #ffffff;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

#prev-btn:hover,
#next-btn:hover {
  background-color: #f0f0f0;
  border-color: #999;
}

/* Дополнительно — чтобы они не прилипали друг к другу */
#prev-btn {
  margin-right: 8px;
}


/*
.close {
  position: absolute;
  top: 10px; right: 15px;
  font-size: 28px;
  cursor: pointer;
}
*/
.close {
  display: none !important;
}


/* дополним */
/*
.tile {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.5s ease-out;
}
.tile.visible {
  opacity: 1;
  transform: translateY(0);
}
*/

.site-footer {
  background-color: #f8f8f8;
  color: #555;
  font-size: 14px;
  padding: 20px 10px;
  border-top: 1px solid #ddd;
  margin-top: 20px;
}

.footer-content {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-left,
.footer-right {
  white-space: nowrap;
}

.footer-right a {
  color: #007BFF;
  text-decoration: none;
}

.footer-right a:hover {
  text-decoration: underline;
}




/* Адаптив */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
	padding: 0 20px; /* добавим горизонтальные отступы */
  }

  .main-content, .sidebar {
    flex: 1 1 100%;
  }
  
}
