/* News page — auto-pulled RSS feed grid */
.news-page {
  padding-top: 8px;
}
.news-section {
  margin: 28px 0 36px;
  padding: 20px 22px 24px;
  border: 2px solid #1a1a1a;
  border-radius: 12px;
  background: #fdfaf6;
}
.news-section__head h2 {
  margin: 0 0 4px;
  font-family: var(--serif, 'PT Serif', Georgia, serif);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}
.news-section__sub {
  margin: 0 0 12px;
  font-size: 15px;
  color: #555;
  line-height: 1.5;
}
.news-section__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.news-source {
  font-size: 12px;
  color: #777;
  letter-spacing: 0.02em;
}
.news-refresh {
  margin-left: auto;
  appearance: none;
  border: 2px solid #1a1a1a;
  background: #fff;
  color: #1a1a1a;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.news-refresh:hover {
  background: #b8651a;
  color: #fff;
  transform: translateY(-1px);
}
.news-refresh:active { transform: translateY(0); }
.news-refresh.is-loading {
  opacity: 0.55;
  pointer-events: none;
}
.news-updated {
  margin: 0 0 14px;
  font-size: 12px;
  color: #888;
  font-style: italic;
  min-height: 16px;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.news-loading,
.news-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 16px;
  font-size: 14px;
  color: #888;
  font-style: italic;
}
.news-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #1a1a1a;
  border: 2px solid #e2ddd3;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.news-card:hover {
  border-color: #b8651a;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(184, 101, 26, 0.18);
}
.news-card__media {
  aspect-ratio: 16 / 9;
  background: #f1ece2;
  overflow: hidden;
}
.news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-card__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.news-card__title {
  margin: 0;
  font-family: var(--serif, 'PT Serif', Georgia, serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: #1a1a1a;
}
.news-card__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #555;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card__meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #888;
  padding-top: 4px;
}
.news-card__source {
  font-weight: 600;
  color: #b8651a;
  letter-spacing: 0.02em;
}
.news-foot {
  margin: 32px 0 12px;
  font-size: 12px;
  color: #888;
  font-style: italic;
  text-align: center;
}

/* ===== In-site article modal ===== */
html.news-modal-open,
html.news-modal-open body {
  overflow: hidden !important;
}
.news-card {
  font: inherit;
  cursor: pointer;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}
.news-card:focus-visible {
  outline: 3px solid #b8651a;
  outline-offset: 2px;
}

.news-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: stretch;
  justify-content: center;
}
.news-modal.is-open {
  display: flex;
}
.news-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 12, 8, 0.72);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: nm-fade-in 0.18s ease-out;
}
@keyframes nm-fade-in { from { opacity: 0; } to { opacity: 1; } }
/* Модалка новостей: при открытой модалке html.news-modal-open,
   шапка topbar (z-index 9999) и megamenu (9998) выводятся поверх неё,
   поэтому сама панель должна стартовать ниже них — margin-top:64px. */
html.news-modal-open .news-modal__panel {
  margin-top: 64px;
  height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
}
.news-modal__panel {
  position: relative;
  margin: 16px;
  width: min(1100px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  background: #fdfaf6;
  border: 2px solid #1a1a1a;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: nm-slide-up 0.22s ease-out;
}
@keyframes nm-slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.news-modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 2px solid #1a1a1a;
  background: #fff;
  flex: 0 0 auto;
}
.news-modal__meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.news-modal__source {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b8651a;
}
.news-modal__date {
  font-size: 12px;
  color: #888;
}
.news-modal__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.news-modal__menu-btn { display: none; }
.news-modal__navdropdown { display: none !important; }
.news-modal__close {
  appearance: none;
  background: #fff;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  width: 38px;
  height: 38px;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  color: #1a1a1a;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  padding: 0;
}
.news-modal__close:hover {
  background: #b8651a;
  color: #fff;
  transform: rotate(90deg);
}
.news-modal__title {
  margin: 0;
  padding: 14px 22px 6px;
  font-family: var(--serif, 'PT Serif', Georgia, serif);
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
  background: #fff;
  border-bottom: 1px solid rgba(26, 26, 26, 0.12);
  flex: 0 0 auto;
}
.news-modal__body {
  position: relative;
  flex: 1 1 auto;
  min-height: 320px;
  background: #fff;
  overflow: hidden;
}
.news-modal__frame {
  display: none;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.news-modal__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #888;
  font-style: italic;
  background: #fdfaf6;
}
.news-modal__loading::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 12px;
  border: 3px solid #d8cdb4;
  border-top-color: #b8651a;
  border-radius: 50%;
  animation: nm-spin 0.8s linear infinite;
}
@keyframes nm-spin { to { transform: rotate(360deg); } }
.news-modal__fallback {
  padding: 28px 24px;
  text-align: center;
}
.news-modal__fallback-text {
  margin: 0 0 12px;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}
.news-modal__desc {
  margin: 16px 0 8px;
  font-size: 15px;
  line-height: 1.6;
  color: #1a1a1a;
  text-align: left;
  background: #fdfaf6;
  border: 1px solid rgba(26, 26, 26, 0.1);
  border-radius: 8px;
  padding: 14px 16px;
}

@media (max-width: 720px) {
  .news-modal__panel { margin: 0; width: 100%; height: 100%; max-height: 100%; border-radius: 0; border: 0; }
  .news-modal__head { padding: 10px 12px; gap: 8px; }
  .news-modal__title { padding: 10px 14px 6px; font-size: 17px; }
  .news-modal__close { width: 34px; height: 34px; font-size: 20px; }
}

@media (max-width: 560px) {
  .news-section { padding: 16px 14px 18px; }
  .news-grid { grid-template-columns: 1fr; }
  .news-refresh { width: 100%; margin-left: 0; }
  .news-section__meta { flex-direction: column; align-items: stretch; }
}
