/* Стили только для страницы новостей.
   Карточки — ручные и из Instagram — одного фиксированного размера. */

.blogs-section {
  background: #f4f6f8;
  padding: 48px 0 72px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.news-card {
  box-sizing: border-box;
  width: 100%;
  height: 360px;
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 18px rgba(20, 35, 50, 0.06);
}

.news-card-media {
  flex: 0 0 156px;
  height: 156px;
  background: #e7eef3;
  overflow: hidden;
}

.news-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-card-body {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 16px;
}

.news-card-title {
  margin: 0 0 8px;
  color: #1c2833;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.news-card-text {
  margin: 0;
  color: #5d6b76;
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.news-card-more {
  margin-top: auto;
  align-self: flex-start;
  display: inline-block;
  padding: 7px 14px;
  border-radius: 6px;
  background: #0d6e9e;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.news-card-more:hover,
.news-card-more:focus {
  background: #0a587f;
  color: #fff;
  text-decoration: none;
}

/* Instagram занимает ту же карточку целиком */
.news-card--insta {
  position: relative;
  padding: 0;
  background: #fff;
}

.news-card--insta .instagram-media,
.news-card--insta iframe {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #fff !important;
}

.news-card--insta iframe {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
}

@media (max-width: 991px) {
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-card {
    max-width: 360px;
    margin: 0 auto;
  }
}

/* Модальные окна ручных новостей */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(16, 24, 32, 0.62);
}

.modal-overlay:target {
  display: flex;
}

.modal-window {
  box-sizing: border-box;
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #1c2833;
  font-size: 18px;
  line-height: 32px;
  text-align: center;
  text-decoration: none;
}

.modal-close:hover,
.modal-close:focus {
  color: #0d6e9e;
  text-decoration: none;
}

.modal-img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #e7eef3;
}

.modal-content {
  padding: 20px 22px 26px;
}

.modal-content h2 {
  margin: 10px 0 12px;
  color: #1c2833;
  font-size: 24px;
  line-height: 1.3;
}

.modal-content p {
  margin: 0 0 12px;
  color: #3d4b55;
  font-size: 15px;
  line-height: 1.55;
}

.blog-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e7eef3;
  color: #0d6e9e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}