/* Общие стили */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  background-color: #f5f5f7; /* Светло-серый, похожий на стиль Apple */
  color: #333;
  overflow: hidden;
}

.container {
  display: flex;
  flex-direction: column;
  box-sizing: content-box;
  padding: 0 30px;
  padding-bottom: 15px;
}

.item-title {
  border-bottom: 1px solid #ddd;
}

.item-page {
  flex: 1;
}

.intro {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.1em;
}

.magazine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.magazine-card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s;
}

.magazine-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 7px rgba(0, 0, 0, 0.2);
}

.pop-up_img img {
  width: 100%;
  height: auto;
}

.card-info {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 1em;
  color: #178188; /* Синий цвет, похожий на ссылки Apple */
  text-decoration: none;
  flex: 1;
  margin-right: 10px;
  transition: color 0.3s;
}

.card-title:hover {
  color: #207076;
  text-decoration: underline;
}

.btn_pdf {
  padding: 8px 15px;
  background-color: #1b8890;
  color: #fff;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 0.9em;
}

.btn_pdf:hover {
  background-color: #22757a;
}

/* Футер */
.footer {
  background-color: rgb(213, 213, 213);
  color: white;
  padding: 12px 0;
  text-align: center;
  width: 100%;
  margin-top: auto;
}

.footer-container {
  max-width: 73%;
  margin: 0 auto;
}

.footer-link {
  color: #28383d;
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

/* Модальное окно */
.modal {
  display: none; /* Скрыто по умолчанию */
  position: fixed;
  z-index: 1000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.5s;
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 80%;
  max-height: 80%;
  border-radius: 8px;
  animation: zoomIn 0.5s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    transform: scale(0.7);
  }
  to {
    transform: scale(1);
  }
}

.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  transition: color 0.3s;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

#caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
}

/* Стили для маленьких карточек */
.small-card {
  margin-top: 10px;
  margin-bottom: auto;
}

.big-container-for-small {
  border: none;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0;
  box-shadow: none;
}

.big-container-for-small:hover {
  box-shadow: none;
  transform: none;
}

/* Адаптивная сетка */
@media (min-width: 768px) {
  .magazine-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}
