/* Один список новостей + окно просмотра строго по экрану */

body.tph-news-open { overflow: hidden; }

.tph-zaliv-overlay,
.article-panel.is-open {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9600 !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  transform: none !important;
  opacity: 1 !important;
  box-sizing: border-box;
  padding: max(10px, env(safe-area-inset-top, 0px)) 10px max(10px, env(safe-area-inset-bottom, 0px)) !important;
  background: rgba(5,7,10,.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tph-zaliv-overlay {
  display: none;
  align-items: stretch;
  justify-content: center;
}
.tph-zaliv-overlay.is-open { display: flex; }

.article-panel.is-open {
  overflow: hidden !important;
  display: flex !important;
  align-items: stretch;
  justify-content: center;
  transition: none !important;
}

.tph-zaliv-overlay-box,
.article-panel.is-open .article-panel__inner {
  width: min(820px, 100%);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #12161d;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  box-sizing: border-box;
}

.article-panel.is-open .article-panel__inner {
  transform: none !important;
  opacity: 1 !important;
  animation: none !important;
}

.tph-zaliv-overlay-head,
.article-panel.is-open .article-panel__head {
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px !important;
  background: #171c24;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.tph-zaliv-close,
.article-panel.is-open .article-panel__close {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto !important;
  height: auto !important;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  border-radius: 12px !important;
  border: 1px solid #c41e3a !important;
  background: #c41e3a !important;
  color: #fff !important;
  font: inherit;
  font-size: 13px !important;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transform: none !important;
}
.tph-zaliv-close span,
.article-panel.is-open .article-panel__close span {
  font-size: 20px;
  line-height: 1;
  font-weight: 400;
}
.tph-zaliv-close:hover,
.article-panel.is-open .article-panel__close:hover {
  background: #a01830 !important;
  border-color: #a01830 !important;
  transform: none !important;
}

.tph-zaliv-overlay-body,
.article-panel.is-open .article-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 18px !important;
  max-height: none !important;
}

.tph-zaliv-overlay-foot,
.article-panel.is-open .article-panel__foot {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding: 10px 14px max(10px, env(safe-area-inset-bottom, 0px));
  background: #171c24;
  border-top: 1px solid rgba(255,255,255,.08);
}

.tph-zaliv-overlay-foot .tph-zaliv-close,
.article-panel.is-open .article-panel__close--foot {
  width: 100%;
  max-width: 420px;
}

.tph-zaliv-panel-date {
  display: inline-block; margin-bottom: 8px; padding: 5px 10px; border-radius: 999px;
  background: rgba(124, 92, 180, .22); color: #e4d7ff; font-size: 12px; font-weight: 700;
}
.tph-zaliv-panel-title,
.article-panel.is-open .article-panel__title {
  margin: 0; color: #fff; font-size: clamp(16px, 3.6vw, 24px) !important; line-height: 1.25;
}
.tph-zaliv-panel-text {
  margin: 0 0 16px; color: rgba(255,255,255,.6); font-size: 14px; line-height: 1.55;
}
.tph-zaliv-tractors { display: flex; flex-direction: column; gap: 12px; }

.tph-zaliv-card {
  display: grid; grid-template-columns: minmax(160px, .85fr) 1.15fr;
  overflow: hidden;
  background: linear-gradient(145deg, #161a22, #0e1116);
  border: 1px solid rgba(255,255,255,.08); border-radius: 16px;
  text-decoration: none; color: inherit;
  animation: tphZalivIn .55s cubic-bezier(.22,1,.36,1) both;
}
.tph-zaliv-card:hover { border-color: rgba(196,30,58,.45); }
.tph-zaliv-info {
  display: flex; flex-direction: column; justify-content: center;
  gap: 10px; padding: 14px 14px 14px 16px; min-width: 0;
}
.tph-zaliv-brand {
  display: inline-flex; width: fit-content; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.tph-zaliv-model { margin: 0; color: #fff; font-size: clamp(16px, 3vw, 22px); line-height: 1.15; font-weight: 800; }
.tph-zaliv-spec {
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
  padding: 7px 0; border-bottom: 1px dashed rgba(255,255,255,.08); font-size: 13px;
}
.tph-zaliv-spec:last-child { border-bottom: none; }
.tph-zaliv-spec span { color: rgba(255,255,255,.48); }
.tph-zaliv-spec b { color: #fff; font-weight: 700; }
.tph-zaliv-price { color: #E74C3C; font-size: 18px; font-weight: 800; }
.tph-zaliv-price small {
  display: block; margin-top: 2px; color: rgba(255,255,255,.4);
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.tph-zaliv-cta {
  display: inline-flex; align-items: center; gap: 6px;
  color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.tph-zaliv-photo {
  position: relative; min-height: 140px; max-height: 200px; overflow: hidden; background: #0a0c10;
}
.tph-zaliv-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.tph-zaliv-photo::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 36px 14px rgba(14,17,22,.5);
}
.tph-zaliv-photo.is-empty {
  background: linear-gradient(145deg, #1a1f28, #0c0e13);
}
.tph-zaliv-photo.is-empty::before {
  content: 'ФОТО'; position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; z-index: 1;
  color: rgba(255,255,255,.18); font-size: 12px; font-weight: 800; letter-spacing: .16em;
}
.tph-zaliv-empty {
  padding: 18px; border: 1px dashed rgba(255,255,255,.12); border-radius: 14px;
  color: rgba(255,255,255,.55); font-size: 14px;
}
@keyframes tphZalivIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Картинки обычных новостей не растягивают окно */
.article-panel.is-open .article-panel__body img,
.article-panel.is-open .article-panel__body video,
.article-panel.is-open .article-panel__body iframe {
  display: block !important;
  max-width: 100% !important;
  width: auto !important;
  max-height: min(42vh, 360px) !important;
  height: auto !important;
  object-fit: contain !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.article-panel.is-open .article-panel__body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

@media (max-width: 720px) {
  .tph-zaliv-card { grid-template-columns: 1fr; }
  .tph-zaliv-photo { min-height: 160px; max-height: 180px; order: -1; }
  .tph-zaliv-overlay-head,
  .article-panel.is-open .article-panel__head { flex-wrap: wrap; }
  .tph-zaliv-close,
  .article-panel.is-open .article-panel__close { margin-left: auto; }
  .article-panel.is-open .article-panel__close--foot,
  .tph-zaliv-overlay-foot .tph-zaliv-close { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tph-zaliv-card { animation: none; }
}
