/* Исправления офлайн-копии nytimes.com: видео, анимации, аудиоплеер статьи */

/* ---------- заглушки «идёт загрузка», которые NYT убирает своим JS ---------- */
.kmlvXG_pseudoHeadlineAfter::after,
.kmlvXG_pseudoHeadlineBefore::before { display: none !important; }

/* ---------- видео в верхнем блоке ---------- */
.local-video {
  position: absolute;
  inset: 0;
  background: #000;
}
.local-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- лента «Watch Today’s Videos» ---------- */
.local-feed {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 4 * 16px) / 5);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding-bottom: 4px;
}
.local-feed__item { scroll-snap-align: start; min-width: 0; }
.local-feed__player {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--tpl-color-background-tertiary, #ebebeb);
  cursor: pointer;
}
.local-feed__player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.local-feed__player:hover video { transform: scale(1.03); }
.local-feed__sound {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 14px;
  line-height: 32px;
  cursor: pointer;
}
.local-feed__sound:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.local-feed__kicker {
  margin: 8px 0 2px;
  font: 700 .6875rem/1.2 nyt-franklin, helvetica, arial, sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--tpl-color-content-secondary, #5a5a5a);
}
.local-feed__title {
  margin: 6px 0 0;
  font: 700 1rem/1.25 nyt-cheltenham, georgia, "times new roman", serif;
  color: var(--tpl-color-content-primary, #121212);
}
.local-feed__title a { color: inherit; text-decoration: none; }
.local-feed__title a:hover { text-decoration: underline; }
@media (max-width: 740px) {
  .local-feed { grid-auto-columns: 46%; }
}

/* ---------- фото-сетки (promo grid) — плавное движение, как у живых промо NYT ---------- */
.local-kenburns {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--tpl-color-background-tertiary, #ebebeb);
}
.local-kenburns img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 60% 45%;
  animation: local-kenburns 16s ease-in-out infinite alternate;
}
@keyframes local-kenburns {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.12) translate(-2%, -1.5%); }
}

/* ---------- метка рубрики у вставленной статьи ---------- */
.local-kicker {
  margin: 0 0 6px;
  font: 700 .6875rem/1.2 nyt-franklin, helvetica, arial, sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--tpl-color-content-secondary, #5a5a5a);
}
.local-article-pkg:target { animation: local-flash 1.8s ease-out; }
@keyframes local-flash { from { background: #fff6d1; } to { background: transparent; } }

/* ---------- аудиоплеер статьи ---------- */
.local-waveform {
  display: inline-block;
  width: 90px;
  height: 15px;
  margin-left: 10px;
  vertical-align: middle;
  background: url("../waveform-static.gif") 50% / contain no-repeat;
}
/* страница статьи всегда светлая (tpl-always-light), поэтому и волна светлая */
.local-listen--playing .local-waveform { background-image: url("../waveform.gif"); }
.local-listen-progress {
  height: 2px;
  margin-top: 6px;
  background: #dfdfdf;
  overflow: hidden;
}
.local-listen-progress span { display: block; height: 100%; width: 0; background: #121212; transition: width .25s linear; }

/* кнопки панели статьи без JS NYT были выключены */
.actionbar-button[disabled] { opacity: 1; cursor: pointer; }
.actionbar-button[aria-checked="true"] svg { fill: currentColor; }

/* ---------- «More to Read» под статьёй ---------- */
.local-related {
  max-width: 1200px;
  margin: 48px auto 64px;
  padding: 0 20px;
}
.local-related__heading {
  margin: 0 0 20px;
  padding-top: 8px;
  border-top: 2px solid #121212;
  font: 700 1rem/1.25 nyt-franklin, helvetica, arial, sans-serif;
  color: #121212;
}
.local-related__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.local-related__item { min-width: 0; }
.local-related__link { display: block; color: #121212; text-decoration: none; }
.local-related__media {
  display: block;
  aspect-ratio: 3 / 2;
  margin-bottom: 10px;
  overflow: hidden;
  background: #ebebeb;
}
.local-related__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.local-related__link:hover .local-related__media img { transform: scale(1.04); }
.local-related__kicker {
  display: block;
  margin-bottom: 4px;
  font: 700 .6875rem/1.2 nyt-franklin, helvetica, arial, sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #5a5a5a;
}
.local-related__title {
  display: block;
  font: 700 1.125rem/1.25 nyt-cheltenham, georgia, "times new roman", serif;
}
.local-related__link:hover .local-related__title { text-decoration: underline; }
.local-related__summary {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font: 400 .9375rem/1.35 nyt-imperial, georgia, "times new roman", serif;
  color: #363636;
}
.local-related__home { margin: 32px 0 0; font: 600 .875rem/1.3 nyt-franklin, helvetica, arial, sans-serif; }
.local-related__home a { color: #326891; text-decoration: none; }
.local-related__home a:hover { text-decoration: underline; }
@media (max-width: 1024px) {
  .local-related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .local-related { padding: 0 16px; }
  .local-related__grid { grid-template-columns: 1fr; gap: 24px; }
}

/* всплывающее сообщение */
.local-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10000;
  transform: translate(-50%, 20px);
  opacity: 0;
  padding: 10px 16px;
  border-radius: 4px;
  background: #121212;
  color: #fff;
  font: 500 14px/1.3 nyt-franklin, helvetica, arial, sans-serif;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.local-toast--show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .local-kenburns img { animation: none; }
  .local-feed__player video { transition: none; }
}
