.article-gallery {
  --gallery-red: #b0062d;
  --gallery-yellow: #f5b500;
  margin: 36px 0;
  min-width: 0;
}
.article-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}
.article-gallery-header h2 {
  margin: 0;
  padding-left: 13px;
  border-left: 4px solid var(--gallery-yellow);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.4;
}
.article-gallery-controls {
  display: flex;
  align-items: center;
  gap: 9px;
}
.article-gallery:not(.article-gallery-ready) .article-gallery-controls button { display: none; }
.article-gallery-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #dedbdb;
  border-radius: 5px;
  background: #fff;
  color: var(--gallery-red);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.article-gallery-controls button:hover:not(:disabled) {
  border-color: var(--gallery-red);
  background: #fff6f8;
}
.article-gallery-controls button:disabled {
  opacity: .35;
  cursor: default;
}
.article-gallery-controls [data-gallery-counter] {
  min-width: 57px;
  color: #555;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}
.article-gallery-track {
  display: flex;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--gallery-red) #efeded;
  border: 1px solid #e6e2e2;
  border-top: 3px solid var(--gallery-red);
  border-radius: 6px;
  background: #f6f4f3;
  -webkit-overflow-scrolling: touch;
}
.article-gallery-track::-webkit-scrollbar { height: 7px; }
.article-gallery-track::-webkit-scrollbar-track { background: #efeded; }
.article-gallery-track::-webkit-scrollbar-thumb { background: var(--gallery-red); border-radius: 8px; }
.article-gallery-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.article-gallery-slide img {
  display: block;
  width: 100%;
  height: clamp(250px, 50vw, 500px);
  max-height: none;
  margin: 0;
  object-fit: contain;
  background: #191d20;
}
.article-gallery-slide figcaption {
  margin: 0;
  padding: 12px 16px;
  background: #f6f4f3;
  color: #555;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.article-gallery button:focus-visible,
.article-gallery-track:focus-visible {
  outline: 3px solid var(--gallery-yellow);
  outline-offset: 3px;
}
@media (max-width: 575px) {
  .article-gallery { margin: 28px 0; }
  .article-gallery-header { gap: 10px; margin-bottom: 12px; }
  .article-gallery-header h2 { font-size: 19px; }
  .article-gallery-controls { margin-left: auto; }
  .article-gallery-slide img { height: clamp(250px, 75vw, 400px); }
  .article-gallery-slide figcaption { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .article-gallery-controls button { transition: none; }
  .article-gallery-track { scroll-behavior: auto; }
}
