/*
 * ЖТПП — оформлення поверх Cassiopeia.
 * Кольори та шапка повторюють старий сайт (тема ja_edenite / red).
 */
:root {
  --zh-red: #cc0000;
  --zh-red-dark: #8f0303;
  --zh-red-deep: #4f0101;
  --zh-grey: #6b6b6b;
  --zh-line: #e3dcdc;
  --cassiopeia-color-primary: #8f0303;
  --cassiopeia-color-link: #b30000;
  --cassiopeia-color-hover: #7a0000;
  --link-color: #b30000;
  --link-color-rgb: 179, 0, 0;
  --link-hover-color: #7a0000;
  --link-hover-color-rgb: 122, 0, 0;
  --cassiopeia-font-family-body: "Droid Sans", "Noto Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --cassiopeia-font-family-headings: "Droid Sans", "Noto Sans", "Segoe UI", Roboto, Arial, sans-serif;
}

body.site {
  font-size: 0.95rem;
  color: #222;
  background: #f6f2f2;
}

/* ---------- шапка ---------- */
.container-header {
  background: linear-gradient(90deg, #3b0101 0%, #9e0202 45%, #5a0101 100%);
  box-shadow: none;
}
.container-header .navbar-brand {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  text-align: center;
}
.container-header .brand-logo {
  display: inline-block;
  max-width: 100%;
}
.zh-header-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 88%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 88%, transparent 100%);
}
.container-header > .grid-child:has(.navbar-brand) {
  padding-top: 0;
  padding-bottom: 0;
}

/* навігація — червона смуга */
.container-header .container-nav {
  background: linear-gradient(#d21919, #c30d0d 50%, #b50000);
  border-top: 1px solid #e04040;
  padding: 0 0.5rem;
  margin-bottom: 0;
  align-items: center;
}
.container-header .container-nav .mod-menu {
  margin: 0;
}
.container-header .mod-menu > li > a,
.container-header .mod-menu > li > span,
.container-header .metismenu > li > button,
.container-header .metismenu > li > a {
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}
.container-header .metismenu > li > button.mm-toggler,
.container-header .metismenu > li > button.mm-toggler:before {
  color: #fff;
}
.container-header .metismenu > li.active > a:after,
.container-header .metismenu > li > a:hover:after,
.container-header .metismenu > li > button:hover:before,
.container-header .metismenu > li.active > button:before {
  background: #fff;
  opacity: .85;
}
.container-header .metismenu > li > ul,
.container-header .mod-menu .mod-menu__sub {
  background: #fff;
  border-top: 3px solid var(--zh-red);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.container-header .mod-menu .mod-menu__sub a,
.container-header .mod-menu .mod-menu__sub span,
.container-header .metismenu .mm-collapse a {
  color: #333;
}
.container-header .mod-menu .mod-menu__sub a:hover,
.container-header .metismenu .mm-collapse a:hover {
  color: var(--zh-red);
  text-decoration: none;
}
.container-header .navbar-toggler {
  color: #fff;
  border-color: rgba(255, 255, 255, .6);
}

/* перемикач мов */
.container-header .container-search {
  margin: 0;
}
.zh-langs ul.lang-inline,
.mod-languages ul.lang-inline {
  margin: 0;
  padding: 0;
}
.mod-languages .lang-inline li {
  margin: 0 0 0 .25rem;
}
.mod-languages .lang-inline a {
  display: inline-block;
  padding: .2rem .55rem;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 3px;
  color: #fff;
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .05em;
  text-decoration: none;
}
.mod-languages .lang-inline a:hover {
  background: #fff;
  color: var(--zh-red);
}

/* ---------- основна сітка ---------- */
.site-grid {
  background: #fff;
  padding-top: 1rem;
  padding-bottom: 1rem;
  box-shadow: 0 0 0 1px #ece6e6;
}
@supports (display: grid) {
  .site-grid {
    grid-gap: 0 1.25rem;
  }
}
@media (min-width: 992px) {
  .wrapper-static .site-grid {
    grid-template-columns: [full-start] minmax(0, 1fr) [main-start] repeat(4, minmax(0, 18rem)) [main-end] minmax(0, 1fr) [full-end];
  }
}

h1, h2, .page-header h1, .page-header h2, .item-title, .item-page h2 {
  color: var(--zh-red);
  font-weight: 400;
}
.page-header h1, .page-header h2 {
  font-size: 1.6rem;
}
.blog-item h2 a, .item-title a {
  color: var(--zh-red);
}
a {
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* картки модулів у колонках — заголовки як на старому сайті */
.container-sidebar-left .card,
.container-sidebar-right .card {
  border: 1px solid var(--zh-line);
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 1.25rem;
}
.container-sidebar-left .card-header,
.container-sidebar-right .card-header {
  background: linear-gradient(#a02b2b, #941c1c 50%, #901a1a);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: .55rem .8rem;
  border-radius: 0;
  border-bottom: 3px solid #6d0f0f;
}
.container-sidebar-left .card-body,
.container-sidebar-right .card-body {
  padding: .25rem .8rem .6rem;
}
.container-sidebar-left .mod-menu,
.container-sidebar-right .mod-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.container-sidebar-left .mod-menu > li,
.container-sidebar-right .mod-menu > li {
  border-bottom: 1px solid var(--zh-line);
}
.container-sidebar-left .mod-menu > li:last-child,
.container-sidebar-right .mod-menu > li:last-child {
  border-bottom: 0;
}
.container-sidebar-left .mod-menu a,
.container-sidebar-right .mod-menu a {
  display: block;
  padding: .55rem 0;
  color: #444;
}
.container-sidebar-left .mod-menu a:hover,
.container-sidebar-right .mod-menu a:hover,
.container-sidebar-left .mod-menu .current > a,
.container-sidebar-right .mod-menu .current > a {
  color: var(--zh-red);
  text-decoration: none;
}
/* список новин у лівій колонці */
.container-sidebar-left .mod-articles-items {
  margin: .4rem 0 0;
  padding-left: 1rem;
}
.container-sidebar-left .mod-articles-items li {
  margin-bottom: .5rem;
}
.container-sidebar-left .mod-articles-items a {
  color: var(--zh-red);
}

/* банери та партнери */
.zh-banners img,
.zh-partners img {
  max-width: 100%;
  height: auto;
}
.zh-banners p,
.zh-partners p {
  margin: 0 0 .5rem;
}
.zh-partners img {
  float: none !important;
  display: block;
  margin: 0 auto .5rem !important;
}
.zh-banner-volunteer {
  text-align: center;
}
.zh-banner-volunteer iframe {
  border: 0;
  max-width: 100%;
}
.zh-currency iframe {
  max-width: 100%;
}

/* хлібні крихти */
.container-component .mod-breadcrumbs__wrapper,
.container-component nav[aria-label] .breadcrumb {
  font-size: .85rem;
}
.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: .75rem;
}

/* ---------- контент ---------- */
.com-content-article__body img,
.item-content img,
.blog-item img,
.contact-miscinfo img {
  max-width: 100%;
  height: auto;
}
.com-content-article__body table,
.contact-miscinfo table {
  max-width: 100%;
}
.com-content-article__body,
.contact-miscinfo {
  overflow-wrap: anywhere;
}
.readmore .btn {
  background: var(--zh-red);
  border-color: var(--zh-red);
}

/* стрічка новин на головній */
.zh-newsfeed .mod-articles-items {
  list-style: none;
  padding: 0;
  margin: 0;
}
.zh-newsfeed .mod-articles-item {
  display: flow-root;
  padding: 1rem 0;
  border-top: 1px solid var(--zh-line);
}
.zh-newsfeed .mod-articles-item figure {
  float: left;
  max-width: 180px;
  margin: 0 1rem .5rem 0;
}
.zh-newsfeed .mod-articles-item h4 {
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: .25rem;
}
.zh-newsfeed .mod-articles-item h4 a {
  color: var(--zh-red);
}
.container-component .card {
  border: 0;
  box-shadow: none;
}
.container-component .card-body {
  padding: 0;
}

/* слайдшоу */
.zh-carousel {
  margin-bottom: 1rem;
}
.zh-carousel img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
}

/* галереї (заміна Widgetkit) */
.zh-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .5rem;
  margin: 1rem 0 1.5rem;
}
.zh-gallery a {
  display: block;
  overflow: hidden;
  border-radius: 3px;
  background: #eee;
}
.zh-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform .25s ease;
}
.zh-gallery a:hover img {
  transform: scale(1.06);
}

/* лайтбокс */
dialog.zh-lightbox-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 94vw;
  max-height: 94vh;
}
dialog.zh-lightbox-dialog::backdrop {
  background: rgba(0, 0, 0, .85);
}
dialog.zh-lightbox-dialog img {
  display: block;
  max-width: 94vw;
  max-height: 86vh;
  margin: 0 auto;
}
dialog.zh-lightbox-dialog .zh-lb-caption {
  color: #fff;
  text-align: center;
  padding: .5rem;
}
dialog.zh-lightbox-dialog button {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, .45);
  color: #fff;
  border: 0;
  font-size: 2rem;
  line-height: 1;
  padding: .5rem .8rem;
  cursor: pointer;
}
dialog.zh-lightbox-dialog .zh-lb-prev { left: 1rem; }
dialog.zh-lightbox-dialog .zh-lb-next { right: 1rem; }
dialog.zh-lightbox-dialog .zh-lb-close { top: 1.5rem; right: 1rem; transform: none; }

/* акордеон (заміна Widgetkit) */
details.zh-accordion {
  border: 1px solid var(--zh-line);
  margin-bottom: .5rem;
}
details.zh-accordion > summary {
  cursor: pointer;
  padding: .6rem .9rem;
  background: #f7efef;
  color: var(--zh-red-dark);
  font-weight: 600;
}
details.zh-accordion[open] > summary {
  border-bottom: 1px solid var(--zh-line);
}
.zh-accordion-body {
  padding: .75rem .9rem;
}

/* карта та відео */
.zh-map iframe {
  width: 100%;
  border: 0;
}
video.zh-video {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  background: #000;
  margin: 1rem auto;
}

/* контактна форма */
.com-contact .contact-form,
.contact-form {
  max-width: 640px;
}
.contact-form .btn-primary {
  background: var(--zh-red);
  border-color: var(--zh-red);
}

/* ---------- підвал ---------- */
.container-footer {
  background: linear-gradient(#7d0202, #4f0101);
  color: #f1dede;
}
.container-footer .grid-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
  gap: .5rem 1.5rem;
}
.container-footer a {
  color: #fff;
}
.container-footer .mod-menu {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.zh-copyright {
  margin: 0;
  font-size: .85rem;
}
#back-top {
  background: var(--zh-red);
}

/* кнопки «Детальніше» */
.readmore .btn,
.mod-articles-readmore .btn,
a.btn.btn-secondary {
  background: var(--zh-red);
  border-color: var(--zh-red);
  color: #fff;
}
.readmore .btn:hover,
.mod-articles-readmore .btn:hover {
  background: var(--zh-red-dark);
  border-color: var(--zh-red-dark);
  color: #fff;
  text-decoration: none;
}

/* у стрічці новин заголовки всередині анонсу не мають бути більшими за заголовок новини */
.zh-newsfeed .mod-articles-item :is(h1, h2, h3, h5, h6),
.blog-item .item-content :is(h1, h2, h3) {
  font-size: 1rem;
  font-weight: 600;
  color: #222;
  line-height: 1.4;
}
.zh-newsfeed .mod-articles-item h4,
.blog-item .item-content .page-header h2 {
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--zh-red);
}
.zh-newsfeed .mod-articles-item img {
  max-width: 100%;
  height: auto;
}

/* сторінка контактів */
.zh-contact .contact-miscinfo h2,
.zh-contact .contact-miscinfo h3 {
  font-size: 1.35rem;
}
.zh-contact-form {
  margin-top: 2rem;
  padding: 1.25rem;
  background: #faf5f5;
  border: 1px solid var(--zh-line);
}
.zh-contact-form h2 {
  font-size: 1.3rem;
}
.zh-contact-form legend {
  font-size: 1rem;
}

.container-footer .mod-menu,
.footer .mod-menu {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
}
.container-footer .mod-menu > li {
  margin: 0;
  padding: 0;
}

/* мобільні екрани: картинки в матеріалах без обтікання */
@media (max-width: 575.98px) {
  .com-content-article__body img,
  .contact-miscinfo img,
  .blog-item .item-content img,
  .zh-newsfeed .mod-articles-item figure {
    float: none !important;
    display: block;
    margin: 0 auto 1rem !important;
    max-width: 100% !important;
  }
  .com-content-article__body,
  .contact-miscinfo {
    text-align: left;
  }
  .com-content-article__body p[style*="justify"],
  .com-content-article__body div[style*="justify"] {
    text-align: left !important;
  }
}

/* =====================================================================
 * Відповідність старому сайту (шаблон ja_edenite / red).
 * Значення взято з обчислених стилів живого сайту zhcci.org.ua.
 * Базовий розмір шрифту змінюється одним рядком: --zh-font-size.
 * ===================================================================== */
:root {
  --zh-font: "Lucida Grande", Arial, sans-serif;
  --zh-font-size: 12px;
  --cassiopeia-font-family-body: var(--zh-font);
  --cassiopeia-font-family-headings: var(--zh-font);
}
body.site,
body.site input,
body.site select,
body.site textarea,
body.site button {
  font-family: var(--zh-font);
}
body.site {
  font-size: var(--zh-font-size);
  line-height: 1.5;          /* 18px при 12px, як у старого сайту */
}
body.site p {
  margin: 10px 0;
}
h1, .page-header h1 { font-size: 1.8em; font-weight: 700; color: #515756; line-height: 1.2; margin-top: 8px; }
.page-header h1, .page-header h2,
.item-title, .item-page h2,
.blog-item .item-content .page-header h2 {
  font-size: 1.5em;          /* 18px */
  font-weight: 400;
  line-height: 1.2;
  color: var(--zh-red);
}
.blog-item h2 a, .item-title a { color: var(--zh-red); }

/* головне меню: 12px жирним */
.container-header .mod-menu > li > a,
.container-header .mod-menu > li > span,
.container-header .metismenu > li > button,
.container-header .metismenu > li > a {
  font-size: var(--zh-font-size);
  font-weight: 700;
  padding-left: 20px;
  padding-right: 20px;
}
.container-header .mod-menu .mod-menu__sub a,
.container-header .mod-menu .mod-menu__sub span,
.container-header .metismenu .mm-collapse a {
  font-size: var(--zh-font-size);
}

/* заголовки модулів у колонках: 12px жирним, текст зліва по центру висоти */
.container-sidebar-left .card-header,
.container-sidebar-right .card-header {
  font-size: var(--zh-font-size);
  font-weight: 700;
  line-height: 1.2;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  min-height: 2.4em;
  margin: 0;
}
.container-sidebar-left .card-body,
.container-sidebar-right .card-body {
  padding: 5px 10px 8px;
}

/* меню в колонках: 12px, колір #626a69, відступ 6px 4px, стрілка справа при наведенні */
.container-sidebar-left .mod-menu a,
.container-sidebar-right .mod-menu a {
  font-size: var(--zh-font-size);
  line-height: 1.6;
  padding: 6px 4px;
  color: #626a69;
  transition: color .5s, background-position .5s;
  background: no-repeat 97% 50% / 6px 10px;
}
.container-sidebar-left .mod-menu a:hover,
.container-sidebar-right .mod-menu a:hover,
.container-sidebar-left .mod-menu .current > a,
.container-sidebar-right .mod-menu .current > a {
  color: var(--zh-red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 10'%3E%3Cpath d='M1 1l4 4-4 4' fill='none' stroke='%23cc0000' stroke-width='1.6'/%3E%3C/svg%3E");
}

/* список новин у лівій колонці: червоні посилання, марківник зліва */
.container-sidebar-left .mod-articles-items,
.container-sidebar-right .mod-articles-items {
  list-style: none;
  margin: 10px 0;
  padding: 0;
}
.container-sidebar-left .mod-articles-items li,
.container-sidebar-right .mod-articles-items li {
  position: relative;
  padding: 0 0 0 15px;
  margin: 0 0 10px;
  line-height: 1.6;
}
.container-sidebar-left .mod-articles-items li::before,
.container-sidebar-right .mod-articles-items li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: .65em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--zh-red);
}
.container-sidebar-left .mod-articles-items a,
.container-sidebar-right .mod-articles-items a {
  color: var(--zh-red);
  font-size: var(--zh-font-size);
  font-weight: 400;
}

/* банери та партнери: збільшення на 10% при наведенні (як на старому сайті) */
.zh-banners .card-body,
.zh-partners .card-body,
.zh-currency .card-body {
  overflow: visible;
}
.zh-banners img,
.zh-partners img,
.container-sidebar-left .mod-custom img,
.container-sidebar-right .mod-custom img {
  transition: transform .5s ease-out;
  position: relative;
}
.zh-banners img:hover,
.zh-partners img:hover,
.container-sidebar-left .mod-custom img:hover,
.container-sidebar-right .mod-custom img:hover {
  transform: scale(1.1);
  z-index: 5;
}
.zh-banners p,
.zh-partners p {
  margin: 0 0 10px;
}
.zh-banners hr {
  margin: 0 0 10px;
}
/* партнери: картинки по центру колонки, без обтікання */
.zh-partners .mod-custom {
  text-align: center;
}
.zh-partners .mod-custom img {
  float: none !important;
  display: inline-block;
  vertical-align: middle;
  margin: 5px auto !important;
}

/* заокруглення 8px для зображень в основній частині, як у старого шаблону */
.container-component img,
.main-top img,
.main-bottom img,
main img {
  border-radius: 8px;
}
.zh-gallery img {
  border-radius: 0;
}

/* кнопки «Детальніше…»: маленькі, текст по центру, як у старого сайту */
.readmore .btn,
p.readmore a,
.mod-articles-readmore .btn,
a.btn.btn-secondary {
  font-size: 11px;
  line-height: 1.5;
  padding: 1px 8px;
  text-transform: lowercase;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3em;
  background: #a1a1a1 linear-gradient(#b5b5b5, #8f8f8f);
  border-color: #a1a1a1;
  color: #fff;
  transition: background-color .5s;
}
.readmore .btn:hover,
p.readmore a:hover,
.mod-articles-readmore .btn:hover,
a.btn.btn-secondary:hover {
  background: var(--zh-red) linear-gradient(#e01010, #b00000);
  border-color: var(--zh-red);
  color: #fff;
}
p.readmore {
  margin: 10px 0 0;
}

/* стрічка новин: заголовок 15px жирним червоним, парні рядки сірі, мініатюра з рамкою */
.zh-newsfeed .mod-articles-items > li:nth-child(even) {
  background: #e8e8e8;
}
.zh-newsfeed .mod-articles-item {
  padding: 4px 6px;
  border-top: 0;
}
.zh-newsfeed .mod-articles-item h4,
.zh-newsfeed .mod-articles-item h4 a {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 4px;
  color: var(--zh-red);
}
.zh-newsfeed .mod-articles-item figure,
.zh-newsfeed .mod-articles-item img {
  border: 1px solid #ccc;
  padding: 2px;
  background: #fff;
  border-radius: 0;
}
.zh-newsfeed .mod-articles-item figure {
  margin: 0 5px 5px 0;
}
.zh-newsfeed .mod-articles-item .mod-articles-date {
  font-size: 10px;
  color: #666;
}
.zh-newsfeed .mod-articles-item p {
  margin: 0 0 6px;
}

/* підвал */
.zh-copyright,
.container-footer {
  font-size: var(--zh-font-size);
}

/* «детальніше…» завжди під текстом, а не збоку від картинки */
p.readmore {
  clear: both;
  overflow: hidden;
}
/* заголовки матеріалів без підкреслення (підкреслення лише при наведенні) */
.page-header h2 a,
.page-header h1 a,
.item-title a,
.blog-item h2 a,
.zh-newsfeed .mod-articles-item h4 a {
  text-decoration: none;
}
.page-header h2 a:hover,
.item-title a:hover,
.blog-item h2 a:hover,
.zh-newsfeed .mod-articles-item h4 a:hover {
  text-decoration: underline;
}

/* ===== Додаткові правки ===== */

/* 1. Без проміжку між зображенням шапки й смугою меню */
.container-header .navbar-brand,
.container-header .brand-logo {
  display: block;
  line-height: 0;
  font-size: 0;
}
.container-header .zh-header-img {
  display: block;
  vertical-align: top;
}

/* 3. Підкреслення активного/наведеного пункту меню лише під словом, без смужки під стрілкою */
.container-header .metismenu > li > button.mm-toggler-link:before,
.container-header .metismenu > li > button.mm-toggler-link:hover:before,
.container-header .metismenu > li.active > button.mm-toggler-link:before {
  content: none !important;
  display: none !important;
  background: none !important;
}

/* 2. Вузькі екрани: бургер по центру смуги по вертикалі, відступи по боках */
@media (max-width: 991.98px) {
  .container-header .container-nav {
    padding-left: 16px;
    padding-right: 16px;
  }
  .container-header .container-nav nav {
    margin-top: 0;
    align-self: center;
  }
  .container-header .navbar-toggler {
    margin: 0;
    align-self: center;
  }
  .container-header .container-nav .container-search,
  .container-header .container-nav .mod-languages {
    align-self: center;
  }
}

/* 4. Банери в лівій колонці по центру для всіх мов */
.sidebar-left .mod-custom,
.container-sidebar-left .mod-custom {
  text-align: center;
}
.sidebar-left .mod-custom p,
.container-sidebar-left .mod-custom p {
  text-align: center;
}
.sidebar-left .mod-custom img,
.container-sidebar-left .mod-custom img {
  float: none !important;
  display: inline-block;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 5. Анімований волонтерський банер (Adobe Edge у iframe) */
.zh-banner-volunteer iframe,
.banner_div iframe {
  display: block;
  width: 170px;
  height: 200px;
  max-width: 100%;
  margin: 0 auto;
  border: 0;
  overflow: hidden;
}

/* 6. Кнопки «Попередня / Наступна» під статтею ведуть на некоректну навігацію, тому прибрані */
nav.pagenavigation,
.pagenavigation {
  display: none !important;
}
