/* ============================================================
   Bethlehem 6 — main stylesheet
   Color palette and typography distilled from the J3 bethlehem
   template, rebuilt for modern browsers.
   ============================================================ */

:root {
  /* Brand */
  --brand-color: #3366bc;
  --brand-dark:  #1f2431;
  --brand-light: #4183d7;
  /* Teal accent inherited from legacy .btn-info content */
  --accent-teal:       #49afcd;
  --accent-teal-hover: #5bc0de;

  /* Surfaces */
  --bg-color:      #ececec;
  --surface:       #ffffff;
  --surface-alt:   #f0f0f0;   /* sidebar pills, spoiler headers */
  --surface-muted: #f5f5f5;   /* disabled controls */

  /* Lines */
  --border:    #d5d5d5;
  --line:      #ddd;
  --line-soft: #e6e6e6;

  /* Text */
  --text:          #1a1a1a;
  --text-strong:   #333;
  --text-soft:     #444;
  --muted:         #606573;
  --text-disabled: #b5b5b5;
  --on-dark:       #d8d8d8;   /* body text on the dark footer */

  /* Type scale (rem base = 16px) */
  --fs-xs:  .8rem;     /* 12.8 — badges, legends */
  --fs-sm:  .9rem;     /* 14.4 — meta, captions */
  --fs-nav: .95rem;    /* 15.2 — navigation, dense controls */
  --fs-md:  1rem;      /* 16   — secondary body */
  --fs-lg:  1.15rem;   /* 18.4 — item titles */
  --fs-xl:  1.4rem;    /* 22.4 — sub-headings */
  --fs-2xl: 1.6rem;    /* 25.6 — section headings */
  --fs-3xl: 2.1rem;    /* 33.6 — page title */

  --container-width: 1200px;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 14px rgba(0, 0, 0, 0.12);
  --font-body: 'PT Sans', Arial, Helvetica, sans-serif;
}

/* ===== Reset / base ===== */
* { box-sizing: border-box; }
html { font-size: 100%; background: var(--bg-color); min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-color);
}
img { max-width: 100%; height: auto; }
figure { margin: 0 0 .75rem; }   /* browser default 1em 40px squeezes images inside cards */
a { color: var(--brand-color); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand-light); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { margin: 0 0 .6em; line-height: 1.2; color: var(--brand-dark); }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }

/* Bootstrap-like utilities used by Joomla core module markup */
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
.list-unstyled { list-style: none; margin: 0; padding: 0; }

/* ===== Minimal grid (Bootstrap-5-compatible subset used by the template) ===== */
.row { display: flex; flex-wrap: wrap; margin-inline: calc(var(--bh-gutter, 1rem) / -2); }
.row > * { padding-inline: calc(var(--bh-gutter, 1rem) / 2); box-sizing: border-box; min-width: 0; }
.g-2 { --bh-gutter: .5rem; }
.g-3 { --bh-gutter: .75rem; }
.g-4 { --bh-gutter: 1.25rem; }
.g-2 > *, .g-3 > *, .g-4 > * { margin-bottom: var(--bh-gutter, 1rem); }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mb-3 { margin-bottom: 1rem; }
.d-lg-none { }

@media (min-width: 768px) {
  .col-md-1 { flex: 0 0 8.3333%; max-width: 8.3333%; }
  .col-md-2 { flex: 0 0 16.6667%; max-width: 16.6667%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
  .col-md-5 { flex: 0 0 41.6667%; max-width: 41.6667%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}
@media (min-width: 992px) {
  .col-lg-1 { flex: 0 0 8.3333%; max-width: 8.3333%; }
  .col-lg-2 { flex: 0 0 16.6667%; max-width: 16.6667%; }
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .col-lg-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
  .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
  .col-lg-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
  .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
  .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
  .order-lg-1 { order: 1; }
  .order-lg-2 { order: 2; }
  .d-lg-none { display: none !important; }
}
.order-1 { order: 1; } .order-2 { order: 2; } .order-3 { order: 3; }

/* ===== Legacy Bootstrap-2 classes still present in migrated content ===== */
.row-fluid { display: flex; flex-wrap: wrap; gap: 0; width: 100%; }
.row-fluid [class*="span"] { box-sizing: border-box; padding: 0 .5rem; }
.row-fluid .span3 { flex: 0 0 25%; max-width: 25%; }
.row-fluid .span4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
.row-fluid .span6 { flex: 0 0 50%; max-width: 50%; }
.row-fluid .span8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
.row-fluid .span9 { flex: 0 0 75%; max-width: 75%; }
.row-fluid .span12 { flex: 0 0 100%; max-width: 100%; }
@media (max-width: 767.98px) {
  .row-fluid { display: block; }
  .row-fluid [class*="span"] { max-width: 100%; }
}
.blok_pic img { width: 100%; height: auto; border-radius: var(--radius); }
.blok_tex { text-align: center; }
/* Rubric card captions were h4 before the heading-outline fix — keep their size */
#bh-utility .item_title { font-size: var(--fs-lg); }

/* ===== Keyboard focus ===== */
:focus-visible {
  outline: 3px solid var(--brand-color);
  outline-offset: 2px;
  border-radius: 2px;
}
/* On the brand-blue header and the dark footer a blue ring would disappear */
#bh-header :focus-visible,
#bh-footer :focus-visible,
.bh-strip :focus-visible,
.bh-mainmenu li ul :focus-visible {
  outline-color: #fff;
}

.visually-hidden-focusable {
  position: absolute; left: -9999px; top: auto;
}
.visually-hidden-focusable:focus {
  left: 1rem; top: 1rem; background: var(--brand-color); color: #fff;
  padding: .5rem 1rem; border-radius: var(--radius); z-index: 9999;
}

/* ===== Layout container ===== */
.bh-container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 1rem;
}

.bh-strip { background: var(--brand-dark); color: var(--on-dark); padding: .35rem 0; font-size: var(--fs-sm); }
.bh-strip a { color: #fff; }

/* ===== Header (blue band like original bethlehem) ===== */
#bh-header {
  background: var(--brand-color);
  box-shadow: var(--shadow);
}
.bh-header-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding-block: .5rem;
}
.bh-logo .bh-logo-link {
  display: inline-flex; align-items: center; text-decoration: none;
}
.bh-logo .site-title { font-weight: 700; font-size: var(--fs-xl); color: #fff; }
.bh-logo .site-logo { max-height: 52px; width: auto; }

.bh-mainmenu { display: flex; justify-content: flex-end; }
.bh-mainmenu-target { display: flex; }
.bh-mainmenu ul.menu,
.bh-mainmenu ul.nav,
.bh-mainmenu .nav {
  list-style: none; display: flex; flex-wrap: wrap; gap: .1rem;
  margin: 0; padding: 0;
}
.bh-mainmenu li { position: relative; }
.bh-mainmenu li > a,
.bh-mainmenu li > .nav-header,
.bh-mainmenu li > span {
  display: block; padding: .6rem .8rem;
  color: #fff; text-transform: uppercase; font-weight: 700;
  font-size: var(--fs-nav); letter-spacing: .02em; border-radius: var(--radius);
  white-space: nowrap;
}
.bh-mainmenu li > a:hover,
.bh-mainmenu li:hover > a,
.bh-mainmenu li.current > a,
.bh-mainmenu li.active > a {
  background: rgba(255, 255, 255, .16); color: #fff; text-decoration: none;
}
/* Dropdowns: blue panel like the original bethlehem */
.bh-mainmenu li ul {
  list-style: none; margin: 0; padding: .3rem 0;
  background: var(--brand-light);
  border: 0; border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-hover); min-width: 230px;
  position: absolute; top: 100%; left: 0; z-index: 1000;
  display: none;
}
.bh-mainmenu li:hover > ul,
.bh-mainmenu li:focus-within > ul { display: block; }
.bh-mainmenu li ul li > a {
  text-transform: none; color: #fff; font-weight: 400;
  padding: .5rem 1rem; border-radius: 0; font-size: var(--fs-nav);
  white-space: normal;
}
.bh-mainmenu li ul li > a:hover,
.bh-mainmenu li ul li.active > a,
.bh-mainmenu li ul li.current > a {
  background: rgba(0, 0, 0, .22); color: #fff;
}
/* Third level: fly out to the right */
.bh-mainmenu li ul li ul { top: 0; left: 100%; border-radius: var(--radius); }
/* Hide Joomla's accessibility sub-toggle buttons: hover/focus-within opens instead */
.bh-mainmenu .mod-menu__toggle-sub { display: none; }
/* Chevron indicator on top-level items that have a submenu */
.bh-mainmenu > .bh-mainmenu-target > ul > li.parent > a::after,
.bh-mainmenu > .bh-mainmenu-target > ul > li.deeper > a::after {
  content: ''; display: inline-block; margin-left: .35rem;
  width: .55em; height: .55em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-.15em);
}

.bh-burger {
  display: none; background: transparent; border: 0; padding: .25rem;
  width: 38px; height: 38px;
}
.bh-burger span {
  display: block; width: 22px; height: 3px; flex: 0 0 3px; background: #fff;
  margin: 2.5px 0; border-radius: 2px; transition: transform .2s, opacity .2s;
}
.bh-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.bh-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.bh-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.bh-lang { font-size: var(--fs-sm); color: #fff; }
.bh-lang a { color: #fff; }
.bh-lang ul { list-style: none; display: flex; gap: .5rem; margin: 0; padding: 0; align-items: center; }
.bh-lang img { vertical-align: middle; }

/* ===== Breadcrumbs ===== */
#bh-breadcrumbs {
  background: var(--surface); border-bottom: 1px solid var(--border);
  font-size: var(--fs-md); color: var(--muted); padding: .7rem 0;
}
#bh-breadcrumbs ol, #bh-breadcrumbs ul { padding: 0; margin: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
#bh-breadcrumbs li + li::before {
  content: '\203A'; margin-right: .5rem;
  color: var(--brand-color); font-weight: 700; font-size: var(--fs-lg);
}
#bh-breadcrumbs a { color: var(--brand-color); }

/* ===== Showcase (home) ===== */
#bh-showcase { padding: 1.5rem 0; }

.bh-video {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden; margin-bottom: .75rem;
}
.bh-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ===== mod_sermonials — «Новые проповеди» (recreates the J3 look) ===== */
.mod-sermonials-item {
  display: flex; align-items: center; gap: .9rem;
  padding: .6rem .8rem; margin-bottom: .6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.sermon-play {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: var(--radius);
  background: var(--surface); color: var(--brand-color);
  border: 1px solid var(--brand-color);
  transition: background .15s ease, color .15s ease;
}
.sermon-play:hover { background: var(--brand-color); color: #fff; }
.sermon-play svg { margin-left: 2px; width: 18px; height: 18px; }
.mod-sermonials .sermon-info { flex: 1 1 auto; min-width: 0; }
.mod-sermonials .sermon-name { margin: 0 0 .15rem; font-size: var(--fs-lg); line-height: 1.3; font-weight: 400; }
.mod-sermonials .sermon-author { font-size: var(--fs-sm); color: var(--text-soft); }
.sermon-datebadge {
  flex: 0 0 auto; text-align: center; min-width: 48px;
  color: var(--text-strong); line-height: 1.05;
}
.sermon-datebadge .d { display: block; font-size: var(--fs-2xl); font-weight: 700; }
.sermon-datebadge .m { display: block; font-size: var(--fs-sm); text-transform: lowercase; }

/* ===== com_sermonials pages ===== */
.sermonials-sermon .sermon-when { color: var(--muted); margin: .1rem 0; }
.sermonials-sermon .sermon-date { color: var(--muted); font-size: var(--fs-sm); }
.sermonials-sermon .sermon-meta { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 1rem 0; }
.sermonials-sermon .sermon-meta dt { font-weight: 700; color: var(--brand-dark); }
.sermonials-sermon .sermon-meta dd { margin: 0; }
.sermonials-sermon .sermon-scripture2 {
  border-left: 4px solid var(--brand-color); background: rgba(51, 102, 188, .06);
  margin: 1rem 0; padding: .75rem 1rem; font-style: italic;
}
.sermonials-sermon .sermon-player { width: 100%; margin: 1rem 0 .25rem; }
.sermonials-sermon .sermon-download { font-size: var(--fs-sm); }
/* h2 for a correct outline, but visually a sub-heading inside the article */
.sermonials-sermon .sermon-about h2 { font-size: var(--fs-xl); }
.sermon-tags { margin-top: 1.25rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.sermon-tags-label { font-weight: 700; margin-right: .35rem; }
.sermon-tag {
  display: inline-block; padding: .15rem .6rem; margin: .15rem .2rem;
  background: var(--brand-color); color: #fff; border-radius: 999px; font-size: var(--fs-sm);
}
.sermon-tag:hover { background: var(--brand-light); color: #fff; text-decoration: none; }

/* Searcher */
.ss-controls { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1rem; }
.ss-controls .form-control {
  width: 100%; padding: .65rem .9rem; font-size: var(--fs-lg);
  border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit;
}
.ss-controls .form-control:focus { outline: 2px solid var(--brand-color); border-color: var(--brand-color); }
.ss-filter { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .9rem; background: var(--surface); }
.ss-filter legend { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); padding: 0 .3rem; float: none; width: auto; }
.ss-filter label { margin-right: 1rem; white-space: nowrap; display: inline-block; font-size: var(--fs-md); cursor: pointer; }
#ss-clear { align-self: flex-start; }
.ss-books { display: block; }
.ss-books[hidden] { display: none !important; }
.ss-books .ss-book {
  display: inline-block; margin: .1rem .15rem; padding: .2rem .55rem;
  border: 1px solid var(--border); border-radius: 999px;
  font-size: var(--fs-nav); cursor: pointer; background: var(--surface);
  transition: background .12s ease, border-color .12s ease;
}
.ss-books .ss-book:hover { border-color: var(--brand-color); }
.ss-books .ss-book:has(input:checked) {
  background: var(--brand-color); border-color: var(--brand-color); color: #fff;
}
.ss-books .ss-book input { accent-color: #fff; margin-right: .25rem; }
.table-responsive { overflow-x: auto; }

/* ===== Tag cloud (mod_tags_popular) ===== */
.tagscloud { line-height: 1; }
/* nowrap kept long tag names from breaking, but in a narrow sidebar it pushed
   past the column and caused page-wide horizontal scroll */
.tagscloud .tag { display: inline-block; margin: 0 .45rem .3rem 0; max-width: 100%; overflow-wrap: break-word; }
.tagscloud .tag-name { text-decoration: none; }
.tagscloud .tag-name:hover { text-decoration: underline; }
.tagscloud sup { color: var(--muted); font-size: .7em; margin-left: .1rem; }
/* Sidebar cloud (default layout) — keep pills readable */
.bh-rsidebar .tagspopular ul, .bh-lsidebar .tagspopular ul { list-style: none; margin: 0; padding: 0; }
.bh-rsidebar .tagspopular li, .bh-lsidebar .tagspopular li { display: inline-block; margin: 0 .3rem .3rem 0; }
.bh-rsidebar .tagspopular li a, .bh-lsidebar .tagspopular li a {
  display: inline-block; background: var(--surface-alt); border: 1px solid var(--line-soft);
  padding: .15rem .6rem; border-radius: 999px; font-size: var(--fs-nav);
}
.bh-rsidebar .tagspopular li a:hover, .bh-lsidebar .tagspopular li a:hover {
  background: var(--brand-color); border-color: var(--brand-color); color: #fff; text-decoration: none;
}

/* ===== Pagination (standard Joomla/BS5 markup) ===== */
.pagination__wrapper { margin: 1.25rem 0; }
ul.pagination {
  display: flex; flex-wrap: wrap; gap: .3rem;
  list-style: none; margin: 1rem 0; padding: 0;
  justify-content: center;
}
.pagination .page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 .6rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--brand-color);
  font-size: var(--fs-nav); text-decoration: none; line-height: 1;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.pagination .page-item:hover .page-link { border-color: var(--brand-color); background: rgba(51, 102, 188, .07); text-decoration: none; }
.pagination .page-item.active .page-link {
  background: var(--brand-color); border-color: var(--brand-color); color: #fff; font-weight: 700;
}
.pagination .page-item.disabled .page-link {
  color: var(--text-disabled); background: var(--surface-muted); cursor: default; pointer-events: none;
}
/* Arrow glyphs instead of the (unloaded) Joomla icon font */
.pagination .icon-angle-double-left::before  { content: '\00AB'; }
.pagination .icon-angle-left::before         { content: '\2039'; }
.pagination .icon-angle-right::before        { content: '\203A'; }
.pagination .icon-angle-double-right::before { content: '\00BB'; }
.pagination [class*="icon-angle"] { font-style: normal; font-size: var(--fs-lg); }
/* "Page X of Y" counter */
.pagination-counter, .counter { text-align: center; color: var(--muted); font-size: var(--fs-sm); }

/* Tables (component lists) */
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: .5rem .65rem; text-align: left; border-bottom: 1px solid var(--border); }
.table thead th { background: var(--brand-color); color: #fff; font-weight: 700; }
.table-striped tbody tr:nth-child(odd) { background: rgba(0, 0, 0, .025); }
.form-select, select {
  padding: .45rem .6rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: var(--fs-nav); background: var(--surface); width: 100%;
}
.form-label { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); display: block; margin-bottom: .2rem; }
.btn-link { background: transparent; color: var(--brand-color); }
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin: 1rem 0; }
.alert-info { background: rgba(51, 102, 188, .08); border: 1px solid rgba(51, 102, 188, .25); }

/* Rubric cards row — same vertical rhythm as its neighbours */
#bh-utility { padding: 1.5rem 0; }

/* ===== Maintop 3-column (home) ===== */
#bh-maintop { padding: 1.5rem 0; }
.bh-block-header {
  display: flex; align-items: center; gap: .75rem;
  border-bottom: 1px solid var(--border); padding-bottom: .5rem; margin-bottom: 1rem;
}
.bh-block-header img { width: 38px; height: 38px; flex: 0 0 auto; }
.bh-block-header h2, .bh-block-header h3 { margin: 0; font-size: var(--fs-2xl); font-weight: 400; color: var(--text-strong); }
/* Maintop content blocks — light border card like the original */
#bh-maintop .bh-block-wrapper { border: 1px solid var(--line); }

/* News items — big intro image left, title + text right (original layout) */
.mod-articlesnews__item {
  display: grid; grid-template-columns: 44% 1fr; gap: .15rem 1rem;
  align-items: start;
  padding: .8rem 0; border-bottom: 1px solid var(--line);
}
.mod-articlesnews__item:last-child { border-bottom: 0; }
.mod-articlesnews__item figure,
.mod-articlesnews__item .newsflash-image {
  grid-column: 1; grid-row: 1 / span 8;
  margin: 0; width: 100%; float: none;
}
.mod-articlesnews__item img { border-radius: 0; width: 100%; height: auto; display: block; }
.mod-articlesnews__item > :not(figure):not(.newsflash-image) { grid-column: 2; }
.mod-articlesnews__item .newsflash-title {
  margin: 0 0 .2rem; font-size: var(--fs-lg); font-weight: 400; line-height: 1.25;
}
.mod-articlesnews__item p { margin: .15rem 0; font-size: var(--fs-md); color: var(--text-strong); }
@media (max-width: 575.98px) {
  .mod-articlesnews__item { grid-template-columns: 1fr; }
  .mod-articlesnews__item figure,
  .mod-articlesnews__item .newsflash-image { grid-row: auto; }
  .mod-articlesnews__item > :not(figure):not(.newsflash-image) { grid-column: 1; }
}

/* Ministries list — blue check marks like the original */
.mod-articlescategory { list-style: none; margin: 0; padding: 0; }
.mod-articlescategory > li {
  position: relative; padding: .22rem 0 .22rem 1.6rem;
}
.mod-articlescategory > li::before {
  content: ''; position: absolute; left: 0; top: .38rem;
  width: 1rem; height: 1rem;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%233366bc" d="M6.1 11.6 2.5 8l-1.2 1.2 4.8 4.8 8.6-8.6-1.2-1.2z"/></svg>') no-repeat center / contain;
}

/* Schedule table inside maintop-c */
.bh-maintop-c table { width: 100%; border-collapse: collapse; }
.bh-maintop-c table td { padding: .2rem .3rem; font-size: var(--fs-nav); }

/* Teal "btn-info" button (used inside legacy module content) */
.btn-info, a.btn-info {
  display: inline-block; background: var(--accent-teal); color: #fff !important;
  padding: .4rem 1rem; border-radius: var(--radius); border: 0;
  font-style: normal; text-decoration: none; font-size: var(--fs-sm);
}
.btn-info:hover { background: var(--accent-teal-hover); text-decoration: none; }
.btn-info i { font-style: normal; }

/* ===== Generic block surround (used by jdoc style="bh-block") ===== */
.bh-block-wrapper {
  background: var(--surface); padding: 1rem 1.25rem;
  border-radius: var(--radius); border: 1px solid var(--line-soft); margin-bottom: 1rem;
}
.bh-card-wrapper {
  background: transparent; padding: 0; height: 100%;
}
.bh-block-wrapper .module-title {
  font-size: var(--fs-lg); margin: 0 0 .75rem;
  padding-bottom: .35rem; border-bottom: 1px solid var(--border);
  color: var(--brand-dark);
}
/* Showcase section titles — big, on the page background, like the original */
.bh-card-wrapper .module-title {
  font-size: var(--fs-2xl); font-weight: 400; margin: 0 0 .9rem;
  padding-bottom: .5rem; border-bottom: 1px solid var(--border);
  color: var(--text-strong);
}

/* ===== Main content ===== */
.bh-main { padding: 1.5rem 0 2rem; }
.bh-main article { background: var(--surface); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.bh-main .item-image img { border-radius: var(--radius); }
.bh-main .article-info {
  font-size: var(--fs-nav); color: var(--muted); margin-bottom: 1rem;
  display: flex; flex-wrap: wrap; gap: 1rem;
}
.bh-main .article-info dt { display: none; }
.bh-main .article-info dd { margin: 0; }

.bh-main .blog .items-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.bh-main .blog .items-row > div { background: var(--surface); padding: 1rem; border-radius: var(--radius); box-shadow: var(--shadow); }

/* Category blog multi-column layouts (J6 emits columns-N / masonry-N from menu params) */
.blog-items[class*="columns-"] { display: grid; gap: 1.25rem; align-items: start; }
.blog-items.columns-2 { grid-template-columns: repeat(2, 1fr); }
.blog-items.columns-3 { grid-template-columns: repeat(3, 1fr); }
.blog-items.columns-4 { grid-template-columns: repeat(4, 1fr); }
.blog-items[class*="masonry-"] { column-gap: 1.25rem; }
.blog-items.masonry-2 { column-count: 2; }
.blog-items.masonry-3 { column-count: 3; }
.blog-items.masonry-4 { column-count: 4; }
.blog-items[class*="masonry-"] > * { break-inside: avoid; margin-bottom: 1.25rem; }
@media (max-width: 991.98px) {
  .blog-items.columns-3, .blog-items.columns-4 { grid-template-columns: repeat(2, 1fr); }
  .blog-items.masonry-3, .blog-items.masonry-4 { column-count: 2; }
}
@media (max-width: 575.98px) {
  .blog-items[class*="columns-"] { grid-template-columns: 1fr; }
  .blog-items[class*="masonry-"] { column-count: 1; }
}
/* Compact item cards inside multi-column blogs */
.blog-items[class*="columns-"] > .com-content-category-blog__item,
.blog-items[class*="masonry-"] > .com-content-category-blog__item {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 1rem;
}
.blog-items .com-content-category-blog__item h2,
.blog-items .com-content-category-blog__item .page-header h2 {
  font-size: var(--fs-lg); margin: 0 0 .5rem;
}
.blog-items .com-content-category-blog__item img { border-radius: var(--radius); }
.blog-items .com-content-category-blog__item figure.item-image { margin: 0 0 .75rem; }
.blog-items .com-content-category-blog__item figure.item-image img { width: 100%; }

/* Sidebars */
.bh-lsidebar, .bh-rsidebar { display: flex; flex-direction: column; gap: 1rem; }
/* Sidebar module titles — large like the original («Темы», «Ресурсы») */
.bh-lsidebar .bh-block-wrapper, .bh-rsidebar .bh-block-wrapper {
  background: transparent; border: 0; padding: 0;
}
.bh-lsidebar .bh-block-wrapper .module-title,
.bh-rsidebar .bh-block-wrapper .module-title {
  font-size: var(--fs-xl); font-weight: 400; color: var(--text-strong);
  border-bottom: 1px solid var(--border); padding-bottom: .4rem; margin-bottom: .6rem;
}
/* Sidebar lists — gray bar rows like the original */
.bh-lsidebar .module-content ul,
.bh-rsidebar .module-content ul {
  list-style: none; margin: 0; padding: 0;
}
.bh-lsidebar .module-content ul li,
.bh-rsidebar .module-content ul li { margin: 0 0 .35rem; }
.bh-lsidebar .module-content ul li > a,
.bh-rsidebar .module-content ul li > a {
  display: block; background: var(--surface-alt); border: 1px solid var(--line-soft);
  padding: .45rem .8rem; border-radius: 3px;
  color: var(--brand-color); font-size: var(--fs-lg);
}
.bh-lsidebar .module-content ul li > a:hover,
.bh-rsidebar .module-content ul li > a:hover,
.bh-lsidebar .module-content ul li.active > a,
.bh-rsidebar .module-content ul li.active > a {
  background: var(--brand-color); border-color: var(--brand-color);
  color: #fff; text-decoration: none;
}
/* nested submenu rows slightly indented */
.bh-lsidebar .module-content ul ul,
.bh-rsidebar .module-content ul ul { margin: .35rem 0 0 1rem; }

/* ===== Legacy spoiler blocks in article content (ported from J3 bethlehem) ===== */
.spoiler > input + label::after { content: '+'; float: right; font-family: monospace; font-weight: 700; font-size: 120%; }
.spoiler > input:checked + label::after { content: '-'; float: right; font-family: monospace; font-weight: 700; font-size: 120%; }
.spoiler > input { display: none; }
.spoiler > input + label,
.spoiler > .spoiler_body {
  background: var(--surface-alt); padding: 8px 15px; overflow: hidden;
  width: 100%; box-sizing: border-box; display: block; font-size: var(--fs-md);
}
.spoiler > input + label { cursor: pointer; margin: .35rem 0 0; font-weight: 400; }
.spoiler > input + label:hover { background: var(--line-soft); }
.spoiler > input + label + .spoiler_body { display: none; }
.spoiler > input:checked + label + .spoiler_body { display: block; }
.spoiler > .spoiler_body { background: #fff; border: 3px solid var(--surface-alt); border-top: none; }

/* ===== Sections ===== */
#bh-mainbottom { padding: 1.5rem 0; background: rgba(255,255,255,.4); }
#bh-bottom { padding: 1.5rem 0; }
#bh-extension { padding: 1rem 0; }

/* ===== Footer ===== */
#bh-footer { background: var(--brand-dark); color: var(--on-dark); margin-top: 2rem; }
#bh-footer a { color: #fff; }
#bh-footer h3 { color: #fff; font-size: var(--fs-md); text-transform: uppercase; letter-spacing: .05em; }
#bh-copyright { padding: 1.5rem 0; font-size: var(--fs-sm); border-top: 1px solid rgba(255,255,255,.07); }
.bh-copy-text p { margin: 0; }
/* «Вход» menu in the footer — as a button, like the original */
#bh-copyright .mod-menu { list-style: none; margin: 0; padding: 0; }
#bh-copyright .mod-menu a {
  display: inline-block; background: var(--brand-color); color: #fff;
  padding: .4rem 1.2rem; border-radius: var(--radius);
  text-transform: uppercase; font-size: var(--fs-xs); letter-spacing: .04em;
}
#bh-copyright .mod-menu a:hover { background: var(--brand-light); text-decoration: none; }

#bh-back-top {
  position: fixed; right: 1rem; bottom: 1rem;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--brand-color); color: #fff; border: 0; font-size: var(--fs-xl);
  box-shadow: var(--shadow-hover); cursor: pointer; opacity: 0; transition: opacity .2s;
  z-index: 100;
}
#bh-back-top.visible { opacity: 1; }

/* ===== Error / Offline ===== */
.bh-error, .bh-offline {
  text-align: center; padding: 4rem 1rem; max-width: 600px; margin-inline: auto;
}
.bh-error h1 { font-size: 6rem; color: var(--brand-color); margin: 0; }
.btn { display: inline-block; padding: .55rem 1.5rem; border-radius: var(--radius); border: 0; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--brand-color); color: #fff; }
.btn-primary:hover { background: var(--brand-light); color: #fff; text-decoration: none; }

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
  /* Mobile header like the original: burger left, logo centered */
  #bh-header { position: relative; }
  .bh-header-grid { grid-template-columns: 44px 1fr 44px; }
  .bh-mainmenu { grid-column: 1; grid-row: 1; justify-content: flex-start; }
  .bh-logo { grid-column: 2; grid-row: 1; justify-self: center; }
  .bh-lang { grid-column: 3; grid-row: 1; }
  .bh-burger { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; }
  /* Open menu drops as a full-width blue panel under the header */
  .bh-mainmenu-target {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 1200;
    background: var(--brand-color); box-shadow: var(--shadow-hover);
  }
  .bh-mainmenu-target.open { display: flex; flex-direction: column; }
  /* mod_menu emits ul.mod-menu.nav (no .menu class) — target any direct list */
  .bh-mainmenu-target > ul,
  .bh-mainmenu ul.mod-menu,
  .bh-mainmenu ul.nav {
    flex-direction: column; align-items: stretch; width: 100%; gap: 0;
  }
  /* 44px minimum tap target */
  .bh-mainmenu li > a { padding-block: .85rem; border-radius: 0; white-space: normal; }

  /* Parent row: link fills the width, toggle sits at its right */
  .bh-mainmenu li.parent,
  .bh-mainmenu li.deeper { display: flex; flex-wrap: wrap; align-items: stretch; }
  .bh-mainmenu li.parent > a,
  .bh-mainmenu li.deeper > a { flex: 1 1 auto; }
  /* Our decorative chevron belongs to the desktop hover menu only */
  .bh-mainmenu > .bh-mainmenu-target > ul > li.parent > a::after,
  .bh-mainmenu > .bh-mainmenu-target > ul > li.deeper > a::after { content: none; }

  /* Joomla's own toggle button drives the submenu (media/mod_menu/js/menu.js) */
  .bh-mainmenu .mod-menu__toggle-sub {
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 52px; width: 52px; min-height: 44px;
    background: rgba(0, 0, 0, .14); border: 0; color: #fff; cursor: pointer;
  }
  .bh-mainmenu .mod-menu__toggle-sub [class*="icon-"] { display: none; }
  .bh-mainmenu .mod-menu__toggle-sub::after {
    content: ''; width: .5em; height: .5em;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-.12em);
    transition: transform .2s ease;
  }
  .bh-mainmenu .mod-menu__toggle-sub[aria-expanded="true"]::after {
    transform: rotate(-135deg) translateY(-.12em);
  }

  /* Submenus: inline and collapsed until the toggle flips aria-hidden */
  .bh-mainmenu li ul,
  .bh-mainmenu li:hover > ul {
    display: none; position: static; border: 0; box-shadow: none;
    background: rgba(0, 0, 0, .12); min-width: 0; border-radius: 0;
    flex: 0 0 100%; width: 100%;
  }
  .bh-mainmenu li ul[aria-hidden="false"],
  .bh-mainmenu li.show-menu > ul { display: block; }
  .bh-mainmenu li ul li > a { color: #fff; padding-left: 1.8rem; }
}
@media (max-width: 575.98px) {
  body { font-size: 16px; }
  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }
}

/* ===== Touch devices on wide screens =====
   Desktop submenus open on :hover, which never fires on a touch screen —
   tapping the parent just navigates away. Above 992px with no hover support,
   fall back to Joomla's own toggle button (media/mod_menu/js/menu.js). */
@media (hover: none) and (min-width: 992px) {
  .bh-mainmenu > .bh-mainmenu-target > ul > li.parent,
  .bh-mainmenu > .bh-mainmenu-target > ul > li.deeper {
    display: flex; align-items: stretch;
  }
  /* the decorative chevron is replaced by the real button */
  .bh-mainmenu > .bh-mainmenu-target > ul > li.parent > a::after,
  .bh-mainmenu > .bh-mainmenu-target > ul > li.deeper > a::after { content: none; }
  .bh-mainmenu > .bh-mainmenu-target > ul > li.parent > a,
  .bh-mainmenu > .bh-mainmenu-target > ul > li.deeper > a { padding-right: .35rem; }

  .bh-mainmenu .mod-menu__toggle-sub {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 34px; min-height: 44px;
    background: transparent; border: 0; color: #fff; cursor: pointer;
    border-radius: var(--radius);
  }
  .bh-mainmenu .mod-menu__toggle-sub [class*="icon-"] { display: none; }
  .bh-mainmenu .mod-menu__toggle-sub::after {
    content: ''; width: .5em; height: .5em;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-.12em);
    transition: transform .2s ease;
  }
  .bh-mainmenu .mod-menu__toggle-sub[aria-expanded="true"] { background: rgba(255, 255, 255, .16); }
  .bh-mainmenu .mod-menu__toggle-sub[aria-expanded="true"]::after {
    transform: rotate(-135deg) translateY(-.12em);
  }
  .bh-mainmenu li ul[aria-hidden="false"],
  .bh-mainmenu li.show-menu > ul { display: block; }
}

/* ===== Reduced motion =====
   Honour the OS-level "reduce motion" setting for every transition here. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
