/**
 * Мини-сайт (site_kind / plan = modules): пожертвования + записки.
 * Подключается отдельно от modern.css — не смешивать с темой обычных сайтов.
 */

body[data-site-kind="modules"] .footer-links {
  display: none !important;
}

body.site-modules-only,
body[data-site-kind="modules"] {
  background: linear-gradient(
    178deg,
    var(--background-light, #f3f4f6) 0%,
    var(--background-medium, #e8e9ea) 45%,
    var(--background-light, #f3f4f6) 100%
  ) !important;
  /* Шапка скрыта — modern.css даёт padding-top под fixed header; у мини-сайта контент с верхнего края */
  padding-top: max(0px, env(safe-area-inset-top, 0px)) !important;
}

body.site-modules-only .floating-elements {
  display: none !important;
}

body.site-modules-only .main-header,
body[data-site-kind="modules"] .main-header {
  display: none !important;
}

body.site-modules-only.theme-modern .hero-wrapper {
  display: none !important;
}

body.site-modules-only.theme-modern #news-section {
  display: none !important;
}

body.site-modules-only main.main-content,
body.site-modules-only.theme-modern main.main-content,
body[data-site-kind="modules"] main.main-content,
body[data-site-kind="modules"].theme-modern main.main-content {
  padding-top: 0 !important;
  padding-bottom: 1rem !important;
}

body.site-modules-only .modules-site-top {
  max-width: 44rem;
  margin: 0 auto 1rem;
  /* небольшой зазор от верха экрана (поверх safe-area у body) */
  padding: 0.5rem 1rem 0;
}

@media (max-width: 767px) {
  body.site-modules-only .modules-site-top {
    padding-top: 0.7rem;
  }
}

body.site-modules-only .modules-site-brand {
  margin-bottom: 0.75rem;
  text-align: center;
}

/* Логотип + название — один ряд; на мобиле без переноса лого и колонки с названием */
body.site-modules-only .modules-site-brand__row {
  display: flex;
  max-width: 100%;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  box-sizing: border-box;
}

body.site-modules-only .modules-site-brand__row--no-logo {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

body.site-modules-only .modules-site-brand__row--no-logo .modules-site-brand__text {
  text-align: center;
  max-width: none;
}

body.site-modules-only .modules-site-brand__text {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 36rem;
  text-align: left;
}

body.site-modules-only .modules-site-brand__row:not(.modules-site-brand__row--no-logo) .modules-site-brand__text {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
}

body.site-modules-only .modules-site-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  border-radius: 8px;
  margin: 0;
  /* визуально ближе к первой букве, без «пустого коридора» */
  margin-right: 0.1rem;
}

body.site-modules-only .modules-site-title {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 3.2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: #141414;
  margin: 0 0 0.35rem;
  text-align: center;
}

/* Узкий экран: название и логотип чуть крупнее, в одну строку с логотипом */
@media (max-width: 639px) {
  body.site-modules-only .modules-site-logo {
    width: 52px;
    height: 52px;
  }

  body.site-modules-only .modules-site-brand__row:not(.modules-site-brand__row--no-logo) .modules-site-title {
    font-size: clamp(0.88rem, 3.4vw + 0.42rem, 1.48rem);
    line-height: 1.18;
    word-break: break-word;
    hyphens: auto;
  }

  body.site-modules-only .modules-site-brand__row:not(.modules-site-brand__row--no-logo) .modules-site-subtitle {
    font-size: 0.875rem;
  }

  body.site-modules-only .modules-site-brand__row--no-logo .modules-site-title {
    font-size: clamp(1.2rem, 4.2vw, 1.58rem);
  }
}

body.site-modules-only .modules-site-brand__row:not(.modules-site-brand__row--no-logo) .modules-site-title {
  text-align: left;
}

body.site-modules-only .modules-site-subtitle {
  font-family: Manrope, system-ui, sans-serif;
  font-size: 0.875rem;
  color: #4a4a4a;
  margin: 0;
  line-height: 1.4;
  text-align: center;
}

body.site-modules-only .modules-site-brand__row:not(.modules-site-brand__row--no-logo) .modules-site-subtitle {
  text-align: left;
}

body.site-modules-only .modules-site-tabs {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 auto;
  padding: 0.35rem 0.25rem 0.75rem;
  max-width: 34rem;
}

body.site-modules-only .modules-site-tab {
  flex: 1 1 148px;
  max-width: 260px;
  padding: 0.88rem 1rem;
  border: 1px solid color-mix(in srgb, var(--primary-gold, #8b7355) 22%, transparent);
  border-radius: 999px;
  font-family: Manrope, system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
  background: color-mix(in srgb, var(--primary-gold, #8b7355) 12%, var(--background-light, #fff));
  color: var(--primary-gold-dark, var(--primary-gold, #5c4a32));
}

body.site-modules-only .modules-site-tab--active {
  background: linear-gradient(
    135deg,
    var(--primary-gold, #8b7355) 0%,
    var(--primary-gold-dark, #5c4a32) 100%
  );
  color: var(--text-on-primary, #fff);
  border-color: transparent;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--primary-gold, #8b7355) 32%, transparent);
}

body.site-modules-only .modules-site-tab:not(.modules-site-tab--active):hover {
  background: color-mix(in srgb, var(--primary-gold, #8b7355) 20%, var(--background-light, #fff));
}

body.site-modules-only #modules-site-top + .zapiski-page,
body.site-modules-only #modules-site-top + .content-block,
body.site-modules-only #modules-site-top + section.modules-treby-bare,
body.site-modules-only #modules-site-top + #donations-container.content-block.donations-page-block {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.07);
  padding: 1.35rem 1rem 1.75rem;
  max-width: 44rem;
  margin: 0 auto 1rem;
  box-sizing: border-box;
  transition: box-shadow 0.25s ease;
}

/* Базовое правило выше сильнее .content-block:hover — без отдельного :hover тень при наведении не менялась */
body.site-modules-only #modules-site-top + .zapiski-page:hover,
body.site-modules-only #modules-site-top + .content-block:hover,
body.site-modules-only #modules-site-top + section.modules-treby-bare:hover,
body.site-modules-only #modules-site-top + #donations-container.content-block.donations-page-block:hover {
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.12),
    0 8px 28px rgba(0, 0, 0, 0.08);
}

body.site-modules-only #donations-section {
  display: none !important;
}

@media (min-width: 768px) {
  body.site-modules-only #modules-site-top + .zapiski-page,
  body.site-modules-only #modules-site-top + .content-block,
  body.site-modules-only #modules-site-top + section.modules-treby-bare,
  body.site-modules-only #modules-site-top + #donations-container.content-block.donations-page-block {
    padding: 1.75rem 2rem 2.25rem;
  }
}

/* Футер без отдельной цветной плашки — фон как у страницы, текст единым «футерным» тоном */
body.site-modules-only .main-footer,
body[data-site-kind="modules"] .main-footer {
  margin-top: 0.5rem;
  padding: 0.5rem 0 1.25rem;
  background: transparent !important;
  overflow: visible;
}

body.site-modules-only .footer-background,
body[data-site-kind="modules"] .footer-background {
  display: none !important;
}

body.site-modules-only.theme-modern .main-footer::before,
body.site-modules-only.theme-modern .main-footer::after,
body[data-site-kind="modules"].theme-modern .main-footer::before,
body[data-site-kind="modules"].theme-modern .main-footer::after {
  content: none !important;
  display: none !important;
  height: 0 !important;
  width: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

body.site-modules-only.theme-modern .footer-bottom::before,
body.site-modules-only.theme-modern .footer-bottom::after,
body[data-site-kind="modules"].theme-modern .footer-bottom::before,
body[data-site-kind="modules"].theme-modern .footer-bottom::after {
  content: none !important;
  display: none !important;
  height: 0 !important;
  width: 0 !important;
  background: none !important;
}

body.site-modules-only .main-footer,
body[data-site-kind="modules"] .main-footer {
  border-top: none !important;
  box-shadow: none !important;
}

body.site-modules-only.theme-modern .footer-bottom,
body[data-site-kind="modules"].theme-modern .footer-bottom {
  border-top: none !important;
  border-bottom: none !important;
}

body.site-modules-only .main-footer .container,
body[data-site-kind="modules"] .main-footer .container {
  padding-bottom: 0;
}

body.site-modules-only.theme-modern .footer-bottom,
body[data-site-kind="modules"].theme-modern .footer-bottom {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

/* Текст футера — тёмный тон из палитры темы */
body.site-modules-only .main-footer,
body[data-site-kind="modules"] .main-footer {
  --modules-footer-text: var(--primary-deep-dark, var(--primary-deep, var(--text-dark, #1a1a1a)));
  color: var(--modules-footer-text);
}

body.site-modules-only.theme-modern .footer-bottom p,
body[data-site-kind="modules"].theme-modern .footer-bottom p {
  color: var(--modules-footer-text) !important;
}

body.site-modules-only .footer-legal,
body[data-site-kind="modules"] .footer-legal {
  color: color-mix(in srgb, var(--modules-footer-text) 92%, transparent) !important;
  opacity: 1 !important;
}

body.site-modules-only.theme-modern .footer-credits-link,
body[data-site-kind="modules"].theme-modern .footer-credits-link {
  color: var(--modules-footer-text) !important;
}

body.site-modules-only.theme-modern .footer-credits-link:hover,
body[data-site-kind="modules"].theme-modern .footer-credits-link:hover {
  color: var(--primary-gold, var(--modules-footer-text)) !important;
  background: transparent !important;
  text-decoration: underline;
}

body.site-modules-only .footer-social-link,
body[data-site-kind="modules"] .footer-social-link {
  color: var(--modules-footer-text);
}

body.site-modules-only .footer-social-link:hover,
body[data-site-kind="modules"] .footer-social-link:hover {
  color: var(--modules-footer-text) !important;
  background: color-mix(in srgb, var(--primary-gold, var(--primary-deep)) 14%, transparent) !important;
  transform: none;
}

body.site-modules-only.theme-modern .footer-content,
body[data-site-kind="modules"].theme-modern .footer-content {
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
  min-height: 0;
}
