/* =============================================================
 * KERPC — RSS-колонки соседних епархий (#front-sidebar-prefooter)
 * Чистый Grid: 5 равных колонок одинаковой высоты, paper-warm карточки.
 * Длинный контент обрезается через max-height + ::after gradient fade.
 * ============================================================= */

#front-sidebar-prefooter.front-fullwidth {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  padding: 36px 20px 48px;
  background: var(--paper);
  margin-top: 32px;
  border-top: 1px solid var(--rule);
  width: 100%; max-width: none;
  float: none !important;
  clear: both;
}

/* колонка-карточка */
#front-sidebar-prefooter .rp-color {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  padding: 18px 18px 20px !important;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: flex; flex-direction: column;
  min-height: 340px;
  position: relative;
  overflow: hidden;
}

/* убираем custom_html виджет-разделитель (HR) который zuki кладёт перед RSS */
#front-sidebar-prefooter .rp-color > .widget_custom_html { display: none; }

/* RSS-виджет внутри колонки */
#front-sidebar-prefooter .widget_rss {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  width: 100%;
  display: flex; flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* заголовок RSS-виджета (название епархии) */
#front-sidebar-prefooter .widget_rss .widget-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 18px; line-height: 1.25;
  color: var(--ink-azure-deep);
  letter-spacing: -0.005em;
  margin: 0 0 12px;
  padding: 0 0 10px;
  border-bottom: 2px solid var(--gold-leaf);
  text-transform: none;
  display: flex; align-items: center; gap: 8px;
}
/* стандартная RSS-иконка <img> от WP — мелкая в gold */
#front-sidebar-prefooter .widget_rss .widget-title img.rss-widget-icon {
  width: 14px !important; height: 14px !important;
  filter: hue-rotate(-12deg) saturate(0.8) brightness(0.9);
  vertical-align: -2px;
}
#front-sidebar-prefooter .widget_rss .widget-title a {
  color: var(--ink-azure-deep);
  text-decoration: none;
  background-image: none !important;
}
#front-sidebar-prefooter .widget_rss .widget-title a.rsswidget.rss-widget-feed { line-height: 0; }
#front-sidebar-prefooter .widget_rss .widget-title a:hover { color: var(--ink-azure); }

/* список новостей */
#front-sidebar-prefooter .widget_rss ul {
  list-style: none;
  margin: 0; padding: 0;
  flex: 1 1 auto;
  max-height: 240px;
  overflow: hidden;
  position: relative;
}
#front-sidebar-prefooter .widget_rss ul::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 36px; pointer-events: none;
  background: linear-gradient(180deg, rgba(239,232,218,0) 0%, var(--paper-warm) 100%);
}
#front-sidebar-prefooter .widget_rss li {
  margin: 0 0 10px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--rule);
  font-size: 13px; line-height: 1.4;
}
#front-sidebar-prefooter .widget_rss li:last-child { border-bottom: 0; }

#front-sidebar-prefooter .widget_rss li a.rsswidget {
  display: block;
  color: var(--ink-azure-deep);
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
  background-image: none !important;
  margin-bottom: 4px;
  /* ограничение по строкам */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.16s ease;
}
#front-sidebar-prefooter .widget_rss li a.rsswidget:hover {
  color: var(--ink-azure);
  background: transparent !important;
}
#front-sidebar-prefooter .widget_rss li .rss-date {
  display: block;
  font-family: var(--font-serif); font-style: italic;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 1px;
}
#front-sidebar-prefooter .widget_rss li .rssSummary { display: none; }

/* мобильная адаптивность */
/* tablet 761–1100: 3-в-ряд, но через flex+wrap+center — чтобы 4-я и 5-я во второй
   строке стояли по центру, а не прижимались влево как в grid (repeat 3, 1fr). */
@media (min-width: 761px) and (max-width: 1100px) {
  #front-sidebar-prefooter.front-fullwidth {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
  }
  #front-sidebar-prefooter .rp-color {
    flex: 0 1 calc((100% - 36px) / 3);
    min-width: 200px;
    max-width: calc((100% - 36px) / 3);
  }
}
@media (max-width: 760px) {
  #front-sidebar-prefooter.front-fullwidth {
    display: flex !important;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 24px 16px 32px;
    gap: 12px;
  }
  #front-sidebar-prefooter .rp-color {
    flex: 0 0 80%;
    min-height: 300px;
    scroll-snap-align: start;
  }
}
