/* Site-wide UX polish — buttons, focus, toast, map lazy-load */

:root {
  --ac-brand: #036973;
  --ac-accent: #fdbf26;
  --ac-accent-hover: #e5ab1f;
}

/* Unified primary actions */
.btn-primary,
.btn-send,
.slide-item__btn,
button.btn-send {
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-primary:hover,
.btn-send:hover {
  filter: brightness(1.05);
}

.btn-primary:focus-visible,
.btn-send:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ac-accent);
  outline-offset: 2px;
}

/* Cabinet stub toast */
.site-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 10050;
  max-width: min(90vw, 420px);
  padding: 0.85rem 1.25rem;
  background: var(--ac-brand);
  color: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(3, 105, 115, 0.35);
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.site-toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Lazy 2GIS */
.map-2gis-lazy {
  position: relative;
  min-height: 120px;
}

.map-2gis-load-btn {
  display: inline-block;
  margin: 0.75rem 0;
}

.map-2gis-loaded .map-2gis-mount {
  min-height: 400px;
}

.map-2gis-mount:empty {
  display: none;
}

.map-2gis-loaded .map-2gis-mount:not(:empty) {
  display: block;
}

/* Reduce decorative motion on small screens */
@media (max-width: 767px) {
  .index-hero-decor-heavy {
    display: none !important;
  }
}

/* Form labels readability */
.mat-label {
  font-weight: 600;
  color: var(--ac-brand);
}

/* News: article page */
.news-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.news-article {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(3, 105, 115, 0.08);
  padding: 1.5rem 1.25rem 1.75rem;
}

@media (min-width: 768px) {
  .news-page {
    padding: 0 1.5rem 2.5rem;
  }

  .news-article {
    padding: 2rem 2.5rem 2.25rem;
  }
}

.news-article__hero {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 1.5rem;
  padding: 1rem;
  min-height: 200px;
  background: #f0f4f5;
  border-radius: 0.75rem;
  text-align: center;
}

/* Обложка: крупнее, целиком, без обрезки */
.news-article__hero img,
.news-article__img,
.news-article .img-responsive {
  display: block;
  width: auto !important;
  max-width: 100% !important;
  max-height: 360px !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center;
  margin: 0 auto;
  border-radius: 0.375rem;
}

@media (min-width: 768px) {
  .news-article__hero {
    min-height: 240px;
    padding: 1.25rem;
  }

  .news-article__hero img,
  .news-article__img,
  .news-article .img-responsive {
    max-height: 400px !important;
  }
}

.news-article__body {
  font-size: 1rem;
  line-height: 1.65;
  color: #1a1a1a;
  word-wrap: break-word;
}

.news-article__body p,
.news-article__body ul,
.news-article__body ol,
.news-article__body blockquote {
  margin: 0 0 1rem;
}

.news-article__body h2,
.news-article__body h3,
.news-article__body h4 {
  margin: 1.25rem 0 0.75rem;
  line-height: 1.3;
}

.news-article__body img {
  display: block;
  max-width: 100%;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  margin: 1rem auto;
  border-radius: 0.5rem;
}

.news-article__body table {
  max-width: 100%;
}

.news-page__back {
  margin-top: 1.25rem;
}

/* Список новостей: превью целиком, без обрезки */
.card-news__image {
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 200px;
  min-height: 200px;
  max-height: 200px;
  padding: 0.75rem 1rem;
  background: #f0f4f5;
  border-radius: 1rem 1rem 0 0;
  overflow: hidden;
  flex-shrink: 0;
  order: 0;
}

.card-news__image:hover {
  opacity: 1;
}

.card-news__image img,
.card-news__thumb,
.card-news .img-responsive,
.card-news__image .card-img-top {
  display: block;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 176px !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: 0 auto;
}

/* Главная: блок «Свежие новости» (слайдер) */
.news-item > a.rounded-xl {
  display: flex !important;
  align-items: center;
  justify-content: center;
  height: 11rem !important;
  min-height: 11rem;
  max-height: 11rem;
  padding: 0.625rem;
  background: #f0f4f5;
}

.news-item > a.rounded-xl img {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 10rem !important;
  object-fit: contain !important;
  object-position: center !important;
}
