/*
 * infoportal — polish.css
 * Визуальная доработка темы newsblog поверх main.css: единые пропорции картинок, отступы,
 * состояния наведения, подкатегории, статья, подвал. Разметку и классы не меняет — только стили.
 * Цвета и шрифты — токены темы (variables.css).
 */

:root {
  --ip-accent: var(--color-default);
  --ip-radius: 6px;
  --ip-border: #e9ecef;
  --ip-muted: rgba(var(--color-black-rgb), 0.45);
  --ip-ease: 0.2s ease;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(185, 13, 13, 0.15);
}

a {
  transition: color var(--ip-ease), opacity var(--ip-ease);
}

/* Выпадающие списки: своя стрелка с отступом справа вместо системной (прижатой к краю) */
select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
  text-overflow: ellipsis;
  cursor: pointer;
}

select:not([multiple]):not([size]):disabled {
  cursor: default;
  opacity: 0.6;
}

/* Поля фильтров старых разделов объявлений (estates, advert, auto) — в один вид со списками выше */
select.full_input,
select.half_input,
input.full_input,
input.half_input {
  height: 38px;
  padding-left: 12px;
  border: 1px solid var(--ip-border);
  border-radius: var(--ip-radius);
  background-color: #fff;
  font-family: var(--font-secondary);
  font-size: 14px;
  color: var(--color-primary);
  outline: none;
  transition: border-color var(--ip-ease);
}

select.full_input,
select.half_input {
  padding-right: 32px;
  background-position: right 10px center;
}

input.full_input,
input.half_input {
  padding-right: 12px;
}

select.full_input,
input.full_input {
  width: calc(100% - 12px);
  min-width: 180px;
}

select.half_input,
input.half_input {
  width: calc(50% - 10px);
  min-width: 80px;
}

select.full_input:focus,
select.half_input:focus,
input.full_input:focus,
input.half_input:focus {
  border-color: var(--ip-accent);
}

/* ---------- Картинки карточек: одна пропорция, скругление, наведение ---------- */

.post-entry-1 > a,
.post-entry-2 .thumbnail {
  display: block;
  overflow: hidden;
  border-radius: var(--ip-radius);
}

.post-entry-1 > a > img,
.post-entry-2 .thumbnail img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin-bottom: 0;
  background: var(--bs-gray-100);
  transition: transform 0.4s ease;
}

.post-entry-1 > a:hover > img,
.post-entry-2 .thumbnail:hover img {
  transform: scale(1.03);
}

.post-entry-1 > a {
  margin-bottom: 16px;
}

.post-entry-1 .post-meta,
.post-entry-2 .post-meta {
  margin-bottom: 8px;
}

.post-entry-1 h2 {
  margin-bottom: 10px;
  line-height: 1.25;
}

.post-entry-1.lg h2 {
  font-size: 32px;
  line-height: 1.15;
  margin-bottom: 14px;
}

.post-entry-1 h2 a:hover,
.post-entry-2 h3 a:hover {
  color: var(--ip-accent);
}

.post-entry-1 p,
.post-entry-2 p {
  color: rgba(var(--color-black-rgb), 0.68);
  line-height: 1.55;
}

/* Метка без раздела начинается с «•» — прячем висящую точку */
.post-meta > .mx-1:first-child {
  display: none;
}

/* ---------- Слайдер главной ---------- */

.hero-slider .img-bg,
.hero-slider .img-md {
  border-radius: var(--ip-radius);
  overflow: hidden;
}

.hero-slider .img-bg:before,
.hero-slider .img-md:before {
  opacity: 1;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.45) 40%,
    rgba(0, 0, 0, 0) 75%
  );
  transition: opacity var(--ip-ease);
}

.hero-slider .img-md:hover:before {
  opacity: 0.85;
}

.hero-slider .img-bg .img-bg-inner h2,
.hero-slider .img-md .img-md-inner h3 {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.hero-slider .img-md .img-md-inner h3 {
  font-size: 22px;
  line-height: 1.2;
}

/* правая колонка — ровно по высоте слайдера: две карточки делят её поровну */
@media (min-width: 768px) {
  .hero-slider .row > .col-md-4 > .d-flex {
    height: 100%;
    gap: 12px;
  }
  .hero-slider .row > .col-md-4 .swiper-slide {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
    margin-top: 0 !important;
  }
  .hero-slider .row > .col-md-4 .img-md {
    height: 100%;
  }
}

/* заголовки карточек слайдера: не больше 3 строк (на планшете карточки низкие — текст вылезал за верх) */
.hero-slider .img-bg .img-bg-inner h2,
.hero-slider .img-md .img-md-inner h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .hero-slider .img-bg .img-bg-inner {
    margin-left: 16px;
    margin-bottom: 36px;
    padding-left: 18px;
    padding-right: 18px;
  }
  .hero-slider .img-bg .img-bg-inner h2 {
    font-size: 28px;
  }
  .hero-slider .img-md .img-md-inner {
    padding: 8px 12px;
    margin: 0 8px 8px;
    width: calc(100% - 16px);
  }
  .hero-slider .img-md .img-md-inner h3 {
    font-size: 17px;
    line-height: 1.25;
  }
}

/* белые поля, «зашитые» в часть снимков (≈8% сверху и снизу), в маленьких карточках выглядели как сдвиг —
   снимок чуть увеличен и обрезается по краям; пока грузится — мягкий фон вместо пустоты */
.hero-slider .img-md,
.hero-slider .img-bg {
  background-color: #e9ecef;
}
.hero-slider .img-md {
  background-size: auto 122% !important;
  background-position: center center;
}
@supports (background-size: max(1px, 1%)) {
  .hero-slider .img-md {
    background-size: max(122%, 100% auto) !important;
  }
}

/* мягкая подложка под заголовком: текст читается и на светлых снимках (у части фото белые поля сверху/снизу) */
.hero-slider .img-bg .img-bg-inner,
.hero-slider .img-md .img-md-inner {
  background: rgba(15, 15, 20, 0.14);
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--ip-radius) + 2px);
  padding-top: 12px;
  padding-bottom: 12px;
}
.hero-slider .img-md .img-md-inner {
  margin-left: 10px;
  margin-right: 10px;
  margin-bottom: 10px;
  padding-left: 14px;
  padding-right: 14px;
  width: calc(100% - 20px);
}
.hero-slider .img-bg .img-bg-inner {
  margin-left: 24px;
  margin-bottom: 40px;
  padding-left: 24px;
  padding-right: 24px;
}
/* телефон: подложка по центру слайда, над точками пагинации; отступы меньше */
@media (max-width: 767.98px) {
  .hero-slider .img-bg .img-bg-inner {
    width: calc(100% - 24px);
    max-width: none;
    margin: 0 12px 34px;
    padding: 10px 14px;
  }
  .hero-slider .img-bg .img-bg-inner h2 {
    font-size: 22px;
    line-height: 1.25;
    margin-bottom: 0;
  }
}
.hero-slider .img-bg:before,
.hero-slider .img-md:before {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 55%);
}

.hero-slider .swiper-pagination-bullet-active {
  background: #fff;
}

.hero-slider .custom-swiper-button-next,
.hero-slider .custom-swiper-button-prev {
  transition: opacity var(--ip-ease), background var(--ip-ease);
}

/* ---------- Заголовки секций главной ---------- */

.category-section {
  padding-top: 24px;
  padding-bottom: 24px;
}

.section-header {
  position: relative;
  align-items: flex-end;
}

.section-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 72px;
  height: 2px;
  background: var(--ip-accent);
}

.section-header h2 {
  font-size: 42px;
  line-height: 1.1;
}

.section-header .more a {
  font-family: var(--font-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.section-header .more a:hover {
  color: var(--ip-accent);
}

/* ---------- Подкатегории (строка под шапкой) ---------- */

.brc-2 {
  padding-top: 20px;
}

.brc-2 .breadcrumb {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.brc-2 .breadcrumb-item {
  margin: 0 !important;
  padding: 0;
}

.brc-2 .breadcrumb-item::before {
  display: none;
}

.brc-2 .breadcrumb-item a {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--ip-border);
  border-radius: 999px;
  font-family: var(--font-secondary);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-primary);
  background: #fff;
  transition: color var(--ip-ease), border-color var(--ip-ease), background var(--ip-ease);
}

.brc-2 .breadcrumb-item a:hover {
  border-color: var(--ip-accent);
  color: var(--ip-accent);
}

.brc-2 .breadcrumb-item.active a {
  background: var(--ip-accent);
  border-color: var(--ip-accent);
  color: #fff;
}

#main > hr {
  margin: 0;
  border-color: var(--ip-border);
  opacity: 1;
}

#main > hr + section {
  padding-top: 36px;
}

/* ---------- Списки разделов и поиска ---------- */

.search-result .post-entry-2 {
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--ip-border);
}

.search-result .post-entry-2 .thumbnail img {
  aspect-ratio: 4 / 3;
}

.search-result .post-entry-2 h3 {
  line-height: 1.25;
  margin-bottom: 10px;
}

@media (min-width: 768px) {
  .search-result .post-entry-2.small-img .thumbnail {
    flex: 0 0 30%;
    margin-bottom: 0;
  }
}

/* Пагинация */
.custom-pagination li {
  transition: background var(--ip-ease), color var(--ip-ease);
}

.custom-pagination li.active {
  background: var(--ip-accent);
}

.custom-pagination li.active:hover {
  background: var(--ip-accent);
  opacity: 0.9;
}

/* ---------- Боковая колонка ---------- */

.aside-block .custom-tab-nav .nav-item button.active,
.aside-block .custom-tab-nav .nav-link.active {
  border-bottom-color: var(--ip-accent) !important;
}

.aside-block .post-entry-1.border-bottom {
  border-color: var(--ip-border) !important;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.aside-block .post-entry-1 h2 {
  font-size: 18px;
  margin-bottom: 0;
}

/* ---------- Статья ---------- */

.single-post h1 {
  font-size: 40px;
  line-height: 1.15;
  margin-bottom: 20px !important;
}

.single-post .news_img,
.single-post a[data-fancybox] {
  display: block;
}

.single-post a[data-fancybox] img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--ip-radius);
  margin: 0 0 28px;
  cursor: zoom-in;
}

.detail-content {
  font-size: 19px;
  line-height: 1.7;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

.detail-content p {
  margin-bottom: 1.1em;
}

.detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--ip-radius);
}

.detail-content a {
  color: var(--ip-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-content blockquote {
  margin: 1.5em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--ip-accent);
  font-style: italic;
}

/* ---------- Подвал ---------- */

.footer .footer-content {
  padding: 48px 0;
}

.footer .footer-heading {
  text-align: left;
  font-family: var(--font-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 16px;
  padding-bottom: 0;
}

.footer .footer-heading img {
  width: auto;
  max-width: 150px;
}

.footer .footer-links li {
  margin-bottom: 8px;
}

.footer .footer-links li a {
  font-size: 16px;
}

.footer .footer-links li a:hover {
  color: #fff;
}

.footer .footer-legal {
  padding: 28px 0;
  font-size: 14px;
}

/* Кнопка «наверх» */
.scroll-top {
  background: var(--ip-accent);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.scroll-top:hover {
  background: var(--color-primary);
}

.scroll-top i {
  color: #fff;
}

/* ---------- Страница поиска (макет column2 без шапки) ---------- */

#main > .span-19 {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

#main > .span-19 #content > hr {
  margin: 20px 0 28px;
  border-color: var(--ip-border);
  opacity: 1;
}

.searchForm form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin: 0;
}

.searchForm .col-padding-reset {
  width: auto;
  flex: 0 0 auto;
  padding: 0;
}

.searchForm .col-md-8 {
  flex: 1 1 280px;
  display: flex;
  gap: 10px;
}

.searchForm select,
.searchForm input[type="text"] {
  height: 42px;
  padding: 0 14px;
  line-height: 40px;
  border: 1px solid var(--ip-border);
  border-radius: var(--ip-radius);
  background-color: #fff;
  font-family: var(--font-secondary);
  font-size: 14px;
  color: var(--color-primary);
  outline: none;
  transition: border-color var(--ip-ease);
}

.searchForm select {
  padding-right: 36px;
  min-width: 170px;
}

.searchForm input[type="text"] {
  flex: 1;
  min-width: 0;
}

.searchForm select:focus,
.searchForm input[type="text"]:focus {
  border-color: var(--ip-accent);
}

.searchForm input[type="submit"] {
  height: 42px;
  padding: 0 22px;
  border: none;
  border-radius: var(--ip-radius);
  background: var(--ip-accent);
  color: #fff;
  font-family: var(--font-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--ip-ease);
}

.searchForm input[type="submit"]:hover {
  opacity: 0.9;
}

.search_query_title {
  margin-top: 28px;
  font-size: 28px;
}

.search_query_title .term {
  color: var(--ip-accent);
}

.list-view .search_title {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.3;
}

.list-view .search_title a {
  color: var(--color-black);
}

.list-view .search_title a:hover {
  color: var(--ip-accent);
}

.list-view .search_content {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--ip-border);
  color: rgba(var(--color-black-rgb), 0.68);
  line-height: 1.6;
}

.list-view .search_content mark {
  padding: 0 2px;
  background: rgba(185, 13, 13, 0.1);
  color: inherit;
}

/* ---------- Мобильные ---------- */

@media (max-width: 767.98px) {
  .section-header h2 {
    font-size: 30px;
  }
  .post-entry-1.lg h2 {
    font-size: 26px;
  }
  .single-post h1 {
    font-size: 28px;
  }
  .detail-content {
    font-size: 17px;
  }
  .footer .footer-heading {
    text-align: center;
  }
  /* подкатегории — одна строка с прокруткой */
  .brc-2 .breadcrumb {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-right: -12px;
    padding-right: 12px;
  }
  .brc-2 .breadcrumb::-webkit-scrollbar {
    display: none;
  }
  .brc-2 .breadcrumb-item a {
    white-space: nowrap;
  }
  #main > hr + section {
    padding-top: 24px;
  }

  /* карточки в одну колонку — без десктопных отступов сетки */
  .category-section .row.g-5 {
    --bs-gutter-y: 0.5rem;
  }
  .category-section .border-start {
    border-left: 0 !important;
  }
  .post-entry-1 {
    margin-bottom: 28px;
  }
  .post-entry-1.lg p {
    margin-bottom: 0;
  }
  .search-result .post-entry-2 .thumbnail {
    margin-right: 0 !important;
    margin-bottom: 14px;
  }
  .search-result .post-entry-2 .thumbnail img {
    aspect-ratio: 16 / 10;
  }
  .section-header {
    margin-bottom: 1.75rem !important;
  }
  .category-section {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  /* поиск — поля в столбик */
  .searchForm .col-padding-reset,
  .searchForm select {
    width: 100%;
    flex: 1 1 100%;
  }
  .search_query_title {
    font-size: 22px;
  }
}

/* ---------- Мобильное меню ---------- */

@media (max-width: 1279.98px) {
  .ip-mobile .mobile-nav-toggle {
    transition: transform 0.25s ease, color 0.2s ease;
  }
  .mobile-nav-active .ip-mobile .mobile-nav-toggle {
    transform: rotate(90deg);
  }
  .mobile-nav-active .ip-mobile .navbar ul {
    bottom: auto;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    padding: 8px 0;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    animation: ip-menu-in 0.25s ease both;
  }
  .mobile-nav-active .ip-mobile .navbar li + li {
    border-top: 1px solid var(--ip-border);
  }
  .mobile-nav-active .ip-mobile .navbar a {
    padding: 14px 22px;
    font-family: var(--font-primary);
    font-size: 19px;
    font-weight: 500;
    color: var(--color-primary);
  }
  .mobile-nav-active .ip-mobile .navbar li.active > a,
  .mobile-nav-active .ip-mobile .navbar a:hover {
    color: var(--ip-accent);
  }
  .mobile-nav-active .ip-mobile .navbar li.active > a {
    box-shadow: inset 3px 0 0 var(--ip-accent);
  }
}

@keyframes ip-menu-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav-active .ip-mobile .navbar ul {
    animation: none;
  }
}
