/* DLE legacy form classes + Material Kit / Bootstrap 5 */
.tableform { width: 100%; }
.tableform td { vertical-align: middle; padding: 0.5rem 0.75rem; }
.tableform td.label { width: 220px; font-weight: 600; color: #344767; }
.f_input, .f_textarea, .tableform input[type="text"],
.tableform input[type="password"], .tableform input[type="email"],
.tableform textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  border: 1px solid #d2d6da;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out;
}
.f_input:focus, .f_textarea:focus, .tableform input:focus, .tableform textarea:focus {
  border-color: #e91e63;
  outline: 0;
  box-shadow: 0 0 0 0.125rem rgba(233, 30, 99, 0.15);
}
.fbutton, button.fbutton {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background-image: linear-gradient(195deg, #42424a 0%, #191919 100%);
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
}
.fbutton:hover { opacity: 0.92; }
.fieldsubmit { margin-top: 1rem; }
.impot { color: #f44335; }
.baseform { margin-bottom: 1.5rem; }
#addcform .tableform { margin-top: 0.5rem; }
.searchtable .f_input { max-width: 320px; }

/* Static / product sub-pages */
.static-page-content img { max-width: 100%; height: auto; border-radius: 0.5rem; }
.static-page-content table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 0.9rem; }
.static-page-content table th,
.static-page-content table td { padding: 0.5rem 0.75rem; border: 1px solid #dee2e6; vertical-align: top; }
.static-page-content table th { background: #f8f9fa; font-weight: 600; }
.static-page-content h2,.static-page-content h3,.static-page-content h4 { margin-top: 1.5rem; margin-bottom: 0.75rem; font-weight: 700; color: #344767; }
.static-page-content p { margin-bottom: 0.9rem; line-height: 1.7; }
.static-page-content ul,.static-page-content ol { padding-left: 1.4rem; margin-bottom: 0.9rem; }
.static-page-content a { color: #e91e63; }
.static-page-content a:hover { text-decoration: underline; }

/* On-the-fly reparser output (rgm_reparse_static_html) */
.lead-sm { font-size: 0.95rem; line-height: 1.65; color: #67748e; }
.rgm-product-desc { line-height: 1.7; }
.rgm-product-desc::after { content: ""; display: table; clear: both; }
.rgm-product-hero-img { max-width: min(100%, 320px); }
.static-page-content .rgm-product-card:hover { box-shadow: 0 0.5rem 1rem rgba(0,0,0,.1) !important; }

/* Footer nav: flush left (override theme nav-link padding) */
footer.footer .rgm-footer-nav {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
  margin-bottom: 0;
}
footer.footer .rgm-footer-nav .nav-item {
  margin-left: 0;
}
footer.footer .rgm-footer-nav .nav-link {
  margin-left: 0;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Home: секция «Последние новости» (main.tpl + shortnews.tpl) */
.rgm-home-latest-news {
  margin-top: 0.5rem;
  margin-bottom: 0;
}
.rgm-home-latest-news-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: #344767;
  margin: 0 0 0.85rem;
  text-align: center;
}
@media (min-width: 768px) {
  .rgm-home-latest-news-heading {
    text-align: left;
  }
}

.rgm-news-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  background: #fff;
  overflow: hidden;
}
.rgm-news-card-body {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.8rem;
  min-height: 0;
}
.rgm-news-title {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.4rem;
  /* same vertical slot for 1–3 lines so all cards align */
  min-height: calc(0.875rem * 1.3 * 3);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.rgm-news-title a {
  color: inherit;
  text-decoration: none;
}
.rgm-news-title a:hover {
  color: #e91e63;
}
/* Fixed teaser box — same height every card; overflow clips messy HTML */
.rgm-news-excerpt {
  position: relative;
  flex: 0 0 auto;
  height: 6.5rem;
  overflow: hidden;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.rgm-news-excerpt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.1rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
  pointer-events: none;
}
.rgm-news-excerpt p,
.rgm-news-excerpt div {
  margin-top: 0 !important;
  margin-bottom: 0.35rem !important;
  font-size: inherit !important;
  line-height: 1.4 !important;
}
.rgm-news-excerpt ul,
.rgm-news-excerpt ol {
  margin: 0 0 0.35rem 0 !important;
  padding-left: 1.1rem !important;
  font-size: inherit !important;
}
.rgm-news-excerpt br {
  display: none;
}
.rgm-news-excerpt img {
  float: none !important;
  max-width: min(100%, 5rem) !important;
  width: auto !important;
  max-height: 2.75rem !important;
  height: auto !important;
  object-fit: cover;
  border-radius: 0.25rem;
  display: block;
  margin: 0 0 0.35rem !important;
  vertical-align: baseline;
}
.rgm-news-card-foot {
  margin-top: 0;
  padding-top: 0;
}
.rgm-news-read {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  color: #262626;
  border: 1px solid #262626;
  border-radius: 0.375rem;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
a:hover .rgm-news-read,
.rgm-news-read:hover {
  color: #fff;
  background-color: #262626;
  border-color: #262626;
}
