/*
Theme Name: Klise — Православная Гагаузия
Theme URI: https://klise.md
Author: Klise Migration
Description: Кастомная тема церковного сайта «Православная Гагаузия» (Покровский храм, с. Конгаз). Перенос дизайна Joomla-шаблона at_grafik (Helix3, preset4) на собственный ООП-движок с виджетными областями.
Version: 1.3.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: klise
*/

/* ============ Design tokens (at_grafik preset4) ============ */
:root {
  --klise-accent: #eb4947;
  --klise-accent-dark: #e61c19;
  --klise-text: #333;
  --klise-muted: #777;
  --klise-bar-bg: #f5f5f5;
  --klise-border: #e5e5e5;
  --klise-header-h: 90px;
  --klise-gold: #c9a227;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  line-height: 24px;
  color: var(--klise-text);
  background: #fff;
}
a { color: var(--klise-accent); text-decoration: none; }
a:hover { color: var(--klise-accent-dark); }
img { max-width: 100%; height: auto; }
h1,h2,h3,h4,h5,h6 { line-height: 1.25; color: #222; }

.klise-container { max-width: 1170px; margin: 0 auto; padding: 0 15px; }

/* ============ Top bar ============ */
#klise-top-bar {
  background: var(--klise-bar-bg);
  border-bottom: 1px solid var(--klise-border);
  font-size: 12px;
  color: var(--klise-muted);
}
#klise-top-bar .klise-container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 36px; flex-wrap: wrap;
}
#klise-top-bar a { color: var(--klise-muted); }
#klise-top-bar a:hover { color: var(--klise-accent); }
#klise-top-bar .klise-top-contact span { margin-right: 16px; }
#klise-top-bar .klise-top-date { font-style: italic; }

/* ============ Header ============ */
#klise-header {
  background: #fff;
  min-height: var(--klise-header-h);
  box-shadow: 0 3px 3px rgba(0,0,0,.05);
  position: relative;
  z-index: 100;
}
#klise-header .klise-container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--klise-header-h); flex-wrap: wrap;
}
.klise-logo { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.klise-logo .klise-logo-cross {
  font-size: 40px; color: var(--klise-accent); line-height: 1;
  font-family: Georgia, serif;
}
.klise-logo h1, .klise-logo .klise-logo-text {
  margin: 0; font-size: 21px; font-weight: 700; letter-spacing: .2px;
}
.klise-logo a { color: #222; }
.klise-logo a:hover { color: var(--klise-accent); }
.klise-logo .klise-logo-tagline { margin: 3px 0 0; font-size: 12px; color: var(--klise-muted); }

.klise-sticky #klise-header.is-stuck {
  position: fixed; top: 0; left: 0; right: 0;
  animation: klise-slide-down .25s ease;
}
@keyframes klise-slide-down { from { transform: translateY(-100%);} to { transform: translateY(0);} }

/* ============ Primary nav ============ */
.klise-nav { display: flex; align-items: center; }
.klise-nav ul { list-style: none; margin: 0; padding: 0; }
.klise-nav > ul { display: flex; flex-wrap: wrap; }
.klise-nav > ul > li { position: relative; }
.klise-nav > ul > li > a {
  display: block; position: relative;
  padding: 34px 13px; color: #222;
  font-weight: 600; font-size: 13px; text-transform: uppercase;
  letter-spacing: .3px; line-height: 22px; white-space: nowrap;
}
/* Анимированное подчёркивание */
.klise-nav > ul > li > a::before {
  content: ""; position: absolute; left: 13px; right: 100%; bottom: 26px;
  height: 2px; background: var(--klise-accent); transition: right .22s ease;
}
.klise-nav > ul > li:hover > a::before,
.klise-nav > ul > li.current-menu-item > a::before,
.klise-nav > ul > li.current-menu-ancestor > a::before { right: 13px; }
.klise-nav > ul > li:hover > a,
.klise-nav > ul > li.current-menu-item > a,
.klise-nav > ul > li.current-menu-ancestor > a { color: var(--klise-accent); }
/* Стрелка у пунктов с подменю */
.klise-nav > ul > li.klise-has-sub > a::after {
  content: "\25BE"; font-size: 9px; margin-left: 5px; color: #aaa;
  vertical-align: 2px; transition: transform .2s ease, color .2s ease;
  display: inline-block;
}
.klise-nav > ul > li.klise-has-sub:hover > a::after {
  color: var(--klise-accent); transform: rotate(180deg);
}
.klise-nav .sub-menu {
  position: absolute; top: 100%; left: 0; min-width: 250px;
  background: #fff; border-top: 3px solid var(--klise-accent);
  box-shadow: 0 10px 24px rgba(0,0,0,.14); border-radius: 0 0 3px 3px;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all .2s ease; z-index: 200; padding: 6px 0;
}
.klise-nav li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.klise-nav .sub-menu li { position: relative; }
.klise-nav .sub-menu a {
  display: block; padding: 8px 18px; color: #333; font-size: 13px;
  border-left: 2px solid transparent; transition: all .15s ease;
}
.klise-nav .sub-menu a:hover,
.klise-nav .sub-menu .current-menu-item > a {
  border-left-color: var(--klise-accent); background: #faf5f5;
  color: var(--klise-accent); padding-left: 22px;
}
.klise-nav .sub-menu .klise-has-sub > a::after {
  content: "\25B8"; float: right; color: #bbb; font-size: 10px;
}
.klise-nav .sub-menu .sub-menu {
  top: -9px; left: 100%; border-top: 3px solid var(--klise-accent);
}
/* Последние пункты — подменю вправо, чтобы не вылезало за экран */
.klise-nav > ul > li:nth-last-child(-n+2) .sub-menu { left: auto; right: 0; }
.klise-nav > ul > li:nth-last-child(-n+2) .sub-menu .sub-menu { left: auto; right: 100%; }

/* Offcanvas / mobile */
.klise-burger {
  display: none; background: var(--klise-accent); color: #fff; border: 0;
  font-size: 18px; padding: 8px 13px; cursor: pointer; border-radius: 2px;
}
#klise-offcanvas {
  position: fixed; top: 0; right: -320px; width: 300px; height: 100%;
  background: #fff; color: #333; z-index: 1000; overflow-y: auto;
  transition: right .25s ease; padding: 18px 20px;
  box-shadow: -6px 0 24px rgba(0,0,0,.15);
  border-left: 3px solid var(--klise-accent);
}
#klise-offcanvas.open { right: 0; }
#klise-offcanvas ul { list-style: none; margin: 0; padding: 0; }
#klise-offcanvas > ul, #klise-offcanvas .klise-offcanvas-menu { margin-top: 8px; }
#klise-offcanvas li a {
  display: block; padding: 10px 6px; color: #222;
  border-bottom: 1px solid #f0f0f0; font-size: 14px; font-weight: 600;
}
#klise-offcanvas li a:hover,
#klise-offcanvas li.current-menu-item > a { color: var(--klise-accent); }
/* Подменю раскрыты всегда, с отступом и направляющей */
#klise-offcanvas .sub-menu {
  margin: 0 0 4px 8px; padding-left: 10px; border-left: 2px solid #f3dcdc;
}
#klise-offcanvas .sub-menu li a {
  font-weight: 400; font-size: 13px; color: #555;
  padding: 8px 4px; border-bottom: 1px dotted #eee;
}
#klise-offcanvas .klise-offcanvas-close {
  background: #f5f5f5; border: 1px solid var(--klise-border); border-radius: 3px;
  color: #333; font-size: 20px; line-height: 1; padding: 4px 11px;
  cursor: pointer; float: right;
}
#klise-offcanvas .klise-offcanvas-close:hover { color: #fff; background: var(--klise-accent); border-color: var(--klise-accent); }
.klise-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 900;
}
.klise-overlay.show { display: block; }

/* ============ Marquee (Бегущая строка) ============ */
#klise-marquee {
  background: var(--klise-accent); color: #fff; font-size: 13px;
  overflow: hidden; white-space: nowrap;
}
#klise-marquee .klise-marquee-track {
  display: inline-block; padding: 6px 0; padding-left: 100%;
  animation: klise-marquee 40s linear infinite;
}
#klise-marquee a { color: #fff; margin-right: 48px; }
#klise-marquee a:hover { text-decoration: underline; }
@keyframes klise-marquee { from { transform: translateX(0);} to { transform: translateX(-100%);} }

/* ============ Layout ============ */
#klise-main-body { padding: 30px 0; }
.klise-row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.klise-col { padding: 0 15px; min-width: 0; }
.klise-col-left  { flex: 0 0 215px; max-width: 215px; }
.klise-col-main  { flex: 1 1 0; }
.klise-col-right { flex: 0 0 215px; max-width: 215px; }

/* ============ Modules (widget boxes) ============ */
.klise-module {
  margin-bottom: 24px; background: #fff;
  border: 1px solid var(--klise-border); border-radius: 3px;
  padding: 14px 14px 10px; box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.klise-module-title, .widget-title {
  margin: -14px -14px 12px; padding: 11px 14px 9px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: #222;
  background: var(--klise-bar-bg);
  border-bottom: 2px solid var(--klise-accent);
  border-radius: 3px 3px 0 0;
  display: block;
}
.klise-module ul, .widget ul { list-style: none; margin: 0; padding: 0; }
.klise-module ul li { border-bottom: 1px dotted var(--klise-border); }
.klise-module ul li:last-child { border-bottom: 0; }
.klise-module ul li a {
  display: block; padding: 7px 2px 7px 4px; color: #222; font-size: 13px;
  border-left: 2px solid transparent; transition: all .15s ease;
}
.klise-module ul li a:hover {
  color: var(--klise-accent); border-left-color: var(--klise-accent); padding-left: 9px;
}
.klise-module ul li.current-menu-item > a,
.klise-module ul li.current-menu-ancestor > a {
  color: var(--klise-accent); font-weight: 600;
}

/* --- Аккордеон подменю в сайдбаре --- */
.klise-module ul .sub-menu {
  overflow: hidden; max-height: 0; transition: max-height .3s ease;
  margin: 0 0 0 6px; padding-left: 8px; border-left: 2px solid #f0dede;
}
.klise-module ul li.klise-open > .sub-menu,
.klise-module ul li.current-menu-ancestor > .sub-menu,
.klise-module ul li.current-menu-item > .sub-menu { max-height: 1200px; }
.klise-module ul .sub-menu li { border-bottom: 0; }
.klise-module ul .sub-menu li a { font-size: 12px; color: #555; padding: 5px 2px 5px 4px; }
.klise-module ul .sub-menu li a::before { content: "\203A"; margin-right: 6px; color: #c9a9a9; }
/* Кнопка-переключатель (вставляется JS) */
.klise-sub-toggle {
  float: right; width: 22px; height: 22px; margin-top: 5px;
  background: none; border: 0; cursor: pointer; color: #999;
  font-size: 11px; line-height: 1; padding: 0;
  transition: transform .25s ease, color .2s ease;
}
.klise-sub-toggle:hover { color: var(--klise-accent); }
li.klise-open > .klise-sub-toggle,
li.current-menu-ancestor > .klise-sub-toggle { transform: rotate(180deg); color: var(--klise-accent); }

/* Search */
.klise-searchform { display: flex; gap: 0; }
.klise-searchform input[type=search] {
  flex: 1 1 auto; min-width: 0; border: 1px solid var(--klise-border);
  border-right: 0; border-radius: 3px 0 0 3px;
  padding: 8px 10px; font-size: 13px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.klise-searchform input[type=search]:focus {
  border-color: var(--klise-accent);
  box-shadow: 0 0 0 3px rgba(235, 73, 71, .12);
}
.klise-searchform button {
  background: var(--klise-accent); color: #fff; border: 0;
  padding: 8px 13px; cursor: pointer; border-radius: 0 3px 3px 0;
  transition: background .15s ease;
}
.klise-searchform button:hover { background: var(--klise-accent-dark); }

/* Translate widget (Google Translate element) */
.klise-translate { padding: 2px 0 6px; }
.klise-translate .goog-te-combo {
  width: 100%; padding: 8px; font-size: 13px;
  border: 1px solid var(--klise-border); border-radius: 3px;
  background: #fff; color: #333; outline: none;
}
.klise-translate .goog-te-combo:focus { border-color: var(--klise-accent); }
.klise-translate .goog-te-gadget { font-size: 0 !important; color: transparent !important; }
.klise-translate .goog-te-gadget .goog-te-combo { font-size: 13px !important; margin: 0 !important; }
.klise-translate .goog-logo-link, .klise-translate .goog-te-gadget span { display: none !important; }

/* ============ Posts ============ */
.klise-post { margin-bottom: 40px; }
.klise-post-date {
  display: inline-block; font-size: 12px; font-weight: 700;
  color: var(--klise-accent); text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 6px;
}
.klise-post-title { margin: 0 0 12px; font-size: 24px; font-weight: 700; text-transform: uppercase; }
.klise-post-title a { color: #222; }
.klise-post-title a:hover { color: var(--klise-accent); }
h2.klise-post-title { font-size: 19px; }
.klise-post-meta { font-size: 12px; color: var(--klise-muted); margin-bottom: 12px; }
.klise-post-meta a { color: var(--klise-muted); }
.klise-post-meta a:hover { color: var(--klise-accent); }
.klise-post-meta .klise-meta-sep { margin: 0 7px; color: #ccc; }
.klise-post-content { overflow-wrap: break-word; }
.klise-post-content iframe { max-width: 100%; }
.klise-video-wrap { position: relative; padding-bottom: 56.25%; height: 0; margin: 14px 0; }
.klise-video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

.klise-readmore {
  display: inline-block; margin-top: 10px; padding: 7px 18px;
  background: var(--klise-accent); color: #fff !important; font-size: 12px;
  text-transform: uppercase; letter-spacing: .5px; border-radius: 2px;
}
.klise-readmore:hover { background: var(--klise-accent-dark); }

.klise-post-divider { border: 0; border-top: 1px solid var(--klise-border); margin: 32px 0; }

.klise-archive-badge {
  display: inline-block; background: var(--klise-gold); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 2px; margin-left: 8px; vertical-align: middle;
}

/* Page title band (category/archive) */
.klise-page-title-band {
  background: linear-gradient(135deg, var(--klise-accent) 0%, #c93532 100%);
  color: #fff; padding: 26px 0; margin-bottom: 6px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.12);
}
.klise-page-title-band h1 { margin: 0; color: #fff; font-size: 24px; text-transform: uppercase; letter-spacing: .5px; }
.klise-page-title-band .klise-breadcrumbs { font-size: 12px; opacity: .9; margin-top: 6px; }
.klise-page-title-band .klise-breadcrumbs a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); }
.klise-page-title-band .klise-post-count { font-size: 12px; opacity: .85; margin-left: 10px; font-weight: 400; text-transform: none; }

/* Pagination */
.klise-pagination { margin: 30px 0 10px; text-align: center; }
.klise-pagination .page-numbers {
  display: inline-block; padding: 7px 13px; margin: 0 2px;
  border: 1px solid var(--klise-border); color: #333; font-size: 13px;
}
.klise-pagination .page-numbers.current,
.klise-pagination .page-numbers:hover { background: var(--klise-accent); color: #fff; border-color: var(--klise-accent); }

/* ============ Bottom & footer ============ */
#klise-bottom {
  background: #262626; border-top: 3px solid var(--klise-accent);
  padding: 40px 0 16px; margin-top: 28px; color: #b9b9b9; font-size: 13px;
}
#klise-bottom .klise-col { flex: 1 1 250px; }
#klise-bottom .klise-module {
  background: transparent; border: 0; box-shadow: none; padding: 0;
}
#klise-bottom .klise-module-title, #klise-bottom .widget-title {
  margin: 0 0 14px; padding: 0 0 10px; background: transparent;
  color: #fff; font-size: 13px; letter-spacing: .6px;
  border-bottom: 2px solid var(--klise-accent); border-radius: 0;
}
#klise-bottom a { color: #cfcfcf; }
#klise-bottom a:hover { color: #fff; }
#klise-bottom .klise-module ul li { border-bottom-color: #3a3a3a; }
#klise-bottom .klise-module ul li a { color: #cfcfcf; }
#klise-bottom .klise-module ul li a:hover { color: #fff; border-left-color: var(--klise-accent); }
#klise-bottom .klise-footer-note { color: #8f8f8f; line-height: 21px; }
#klise-bottom .klise-footer-menu li a { text-transform: none; font-weight: 400; }
#klise-calendar-row { padding: 24px 0 0; }
#klise-footer {
  background: #1c1c1c; color: #8f8f8f; font-size: 12px; padding: 16px 0;
  border-top: 1px solid #333;
}
#klise-footer a { color: #ccc; }
#klise-footer a:hover { color: var(--klise-accent); }
#klise-footer .klise-container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ============ Scroll to top ============ */
#klise-scroll-top {
  position: fixed; right: 22px; bottom: 26px; z-index: 800;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--klise-accent); color: #fff; font-size: 20px;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, background .15s ease;
}
#klise-scroll-top.show { opacity: 1; transform: translateY(0); }
#klise-scroll-top:hover { background: var(--klise-accent-dark); }

/* ============ Фильтр новостей ============ */
.klise-filter label { display: block; margin-bottom: 10px; font-size: 12px; color: var(--klise-muted); }
.klise-filter label span { display: block; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .4px; font-size: 11px; }
.klise-filter select {
  width: 100%; padding: 7px 8px; font-size: 13px;
  border: 1px solid var(--klise-border); border-radius: 3px; background: #fff; color: #333; outline: none;
}
.klise-filter select:focus { border-color: var(--klise-accent); }
.klise-filter button {
  width: 100%; margin-top: 2px; padding: 8px 0;
  background: var(--klise-accent); color: #fff; border: 0; border-radius: 3px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .5px; cursor: pointer;
}
.klise-filter button:hover { background: var(--klise-accent-dark); }
.klise-filter-reset { display: block; text-align: center; margin-top: 8px; font-size: 12px; color: var(--klise-muted); }

/* Translate widget */
.klise-translate select {
  width: 100%; padding: 7px; border: 1px solid var(--klise-border); font-size: 13px; background: #fff;
}

/* ============ Content typography ============ */
.klise-post-content { font-size: 14px; line-height: 25px; color: #3a3a3a; }
.klise-post-content h1, .klise-post-content h2, .klise-post-content h3,
.klise-post-content h4, .klise-post-content h5 {
  margin: 26px 0 12px; line-height: 1.3; color: #222;
}
.klise-post-content h2 { font-size: 21px; padding-bottom: 8px; border-bottom: 1px solid var(--klise-border); }
.klise-post-content h3 { font-size: 18px; }
.klise-post-content h4 { font-size: 16px; }
.klise-post-content p { margin: 0 0 14px; }
.klise-post-content ul, .klise-post-content ol { margin: 0 0 16px; padding-left: 24px; }
.klise-post-content li { margin-bottom: 5px; }
.klise-post-content blockquote {
  margin: 18px 0; padding: 12px 18px; background: #faf7f2;
  border-left: 3px solid var(--klise-gold); color: #555; font-style: italic;
}
.klise-post-content img { border-radius: 2px; }
.klise-post-content img[align="left"], .klise-post-content img.alignleft { margin: 4px 16px 8px 0; }
.klise-post-content img[align="right"], .klise-post-content img.alignright { margin: 4px 0 8px 16px; }
.klise-post-content table { max-width: 100%; border-collapse: collapse; margin: 0 0 16px; }
.klise-post-content td, .klise-post-content th { padding: 6px 10px; border: 1px solid var(--klise-border); }
.klise-post-content hr { border: 0; border-top: 1px solid var(--klise-border); margin: 22px 0; }
.klise-post-content a { text-decoration: underline; text-decoration-color: rgba(235,73,71,.35); text-underline-offset: 2px; }
.klise-post-content a:hover { text-decoration-color: var(--klise-accent); }

/* ============ Responsive ============ */
@media (max-width: 991px) {
  .klise-col-left, .klise-col-right { flex: 0 0 100%; max-width: 100%; }
  .klise-col-left { order: 2; } .klise-col-main { order: 1; flex: 0 0 100%; } .klise-col-right { order: 3; }
  .klise-nav > ul { display: none; }
  .klise-burger { display: inline-block; }
}
@media (max-width: 600px) {
  .klise-post-title { font-size: 19px; }
  #klise-top-bar .klise-container { justify-content: center; }
}
