/*
 * Стили для содержимого, которое теперь приходит из админки:
 * иконки соцсетей, фото галерей, формы с галочками, текст из редактора.
 */

/* ---------- Иконки соцсетей ----------
   Загруженный значок используется как маска и красится цветом текста,
   поэтому одна картинка подходит для любого фона. */
.social-glyph {
  display: block;
  width: 100%;
  height: 100%;
  background-color: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
}

.footer-social-icon-btn {
  width: 40px;
  height: 40px;
  color: #2B2B2B;
  text-decoration: none;
}

.events-social-icon-btn {
  width: 88px;
  height: 88px;
  padding: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  color: #108669;
  box-sizing: border-box;
  text-decoration: none;
}

.news-card-social {
  color: #108669;
  text-decoration: none;
}

.news-card-social::before {
  display: none !important;
}

.news-card-social .social-glyph {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .footer-social-icon-btn {
    width: 30px;
    height: 30px;
  }

  .events-social-icon-btn {
    width: 48px;
    height: 48px;
    padding: 11px;
  }
}

/* ---------- Кнопки, ставшие ссылками ---------- */
a.volunteer-hero-button,
a.mosques-map-hero-button,
a.course-btn,
a.hero-info-btn,
a.umra-program-btn,
a.umra-program-action-btn,
a.pilgrimage-hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

/* ---------- Фото в галереях ---------- */
.photo-item {
  display: block;
  padding: 0;
  border: none;
  overflow: hidden;
  cursor: zoom-in;
}

.photo-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-item:hover img {
  transform: scale(1.03);
}

.photo-item[hidden] {
  display: none;
}

/* Просмотр фото на весь экран */
.mosque-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 20, 20, 0.88);
}

.mosque-lightbox[hidden] {
  display: none;
}

.mosque-lightbox img {
  max-width: min(1200px, 100%);
  max-height: calc(100vh - 120px);
  border-radius: 16px;
  object-fit: contain;
}

.mosque-lightbox-btn {
  position: absolute;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #108669;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.mosque-lightbox-btn--close {
  top: 16px;
  right: 16px;
}

.mosque-lightbox-btn--prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.mosque-lightbox-btn--next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.mosque-lightbox-counter {
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  color: #FFFFFF;
  font-size: 16px;
}

/* ---------- Новость без фото ---------- */
.news-card--no-photo {
  background-image: linear-gradient(180deg, #27CAA2 0%, #14785F 100%);
}

.news-card-sidebar-photo-wrap.news-card--no-photo {
  min-height: 160px;
}

/* ---------- Этапы паломничества: подложка, пока нет картинки ---------- */
.pilgrimage-stages-card {
  background-color: #E8E8E8;
}

/* ---------- Текст вкладок закята из редактора ---------- */
.zakat-info-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: 'SF Pro', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 100%;
  letter-spacing: -0.01em;
  color: #2B2B2B;
}

.zakat-info-list li {
  display: flex;
  align-items: flex-start;
}

.zakat-info-list li::before {
  content: '•';
  margin-right: 8px;
  flex-shrink: 0;
  margin-top: 0.1em;
}

.zakat-info-list--numbered {
  counter-reset: zakat-list;
}

.zakat-info-list--numbered li::before {
  counter-increment: zakat-list;
  content: counter(zakat-list) '.';
}

.zakat-info-text-block a {
  color: #108669;
}

/* Арабская надпись во вкладке «Что такое Умра?» */
div.umra-what-is-btn {
  cursor: default;
  text-align: center;
}

/* ---------- Контакты: карточки контактов сеткой ---------- */
.contacts-page .contacts-info-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  column-gap: 48px;
  row-gap: 40px;
}

/* Первый контакт (адрес мечети) — во всю ширину, когда карточек нечётное число. */
.contacts-page .contacts-info-block:first-child:nth-last-child(odd) {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .contacts-page .contacts-info-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 16px;
  }
}

/* ---------- Формы ---------- */
.form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.mosque-form {
  position: relative;
}

.form-choice-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 72px;
}

.form-choice-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.form-choice-title {
  margin: 0;
  font-family: 'SF Pro', sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 100%;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}

.form-choice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.form-choice-option,
.form-agreement {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.form-choice-box {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: 1px solid #FFFFFF;
  border-radius: 8px;
  box-sizing: border-box;
  background: transparent center / 12px 12px no-repeat;
}

.is-active > .form-choice-box {
  background-color: #FFFFFF;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M10 3L4.5 8.5L2 6' stroke='%23108669' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.form-choice-label {
  font-family: 'SF Pro', sans-serif;
  font-weight: 510;
  font-size: 24px;
  line-height: 100%;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}

.form-agreement-text {
  font-family: 'SF Pro', sans-serif;
  font-weight: 510;
  font-size: 16px;
  line-height: 100%;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}

.form-agreement-link {
  color: inherit;
  text-decoration: underline;
}

.form-choice-error {
  margin-top: -6px;
}

/* Светлый вариант — форма на белой карточке («Контакты») */
.form-choice-group--light .form-choice-title {
  font-size: 20px;
  color: #2B2B2B;
}

.form-choice-group--light .form-choice-label,
.form-agreement--light .form-agreement-text {
  font-size: 16px;
  color: #2B2B2B;
}

.form-choice-group--light .form-choice-box,
.form-agreement--light .form-choice-box {
  border-color: #BABABA;
}

.form-choice-group--light .is-active > .form-choice-box,
.form-agreement--light.is-active > .form-choice-box {
  border-color: #108669;
  background-color: #108669;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M10 3L4.5 8.5L2 6' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.form-agreement--light .form-agreement-link {
  color: #108669;
}

.contacts-form-card .form-choice-groups {
  gap: 24px;
}

.mosque-form [data-mf-submit]:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (max-width: 768px) {
  .form-choice-groups {
    flex-direction: column;
    gap: 24px;
  }

  .form-choice-group {
    gap: 8px;
  }

  .form-choice-title {
    font-size: 20px;
  }

  .form-choice-option .form-choice-box {
    width: 20px;
    height: 20px;
  }

  .form-choice-label {
    font-size: 16px;
  }

  .form-agreement-text {
    font-size: 14px;
  }
}

/* ---------- Слайдер «Деятельность мечети» ---------- */
div.activity-slide-image {
  background: #E8E8E8;
}

a.activity-slide-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

/* ======================================================================
   Правки по отчёту вёрстки (2026-09-29)
   ====================================================================== */

/* ---------- Карточки курсов: фото и текст на одном уровне ----------
   Заголовок занимает две строки даже когда он короткий, поэтому фото
   и текст во всех карточках ряда начинаются на одной высоте. */
.education-card .education-title,
.course-card .course-title {
  min-height: 2em;
}

/* ---------- Цифры под картой мечетей: одинаковый размер и прокрутка вбок ----------
   Пока карточек четыре (как в макете), ряд выглядит как раньше. Если добавить
   ещё — ряд не ломается на две строки, а прокручивается. */
.mosques-map-stats.mosques-map-stats--scroll {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: #108669 #E6F2EE;
  padding-bottom: 12px;
}

.mosques-map-stats.mosques-map-stats--scroll::-webkit-scrollbar {
  height: 6px;
}

.mosques-map-stats.mosques-map-stats--scroll::-webkit-scrollbar-thumb {
  background: #108669;
  border-radius: 3px;
}

.mosques-map-stats.mosques-map-stats--scroll::-webkit-scrollbar-track {
  background: #E6F2EE;
  border-radius: 3px;
}

.mosques-map-stats.mosques-map-stats--scroll .mosques-map-stat-card {
  flex: 0 0 calc((100% - 72px) / 4);
  scroll-snap-align: start;
}

/* ---------- Просмотр фото новости: снимок помещается целиком ---------- */
.news-card-lightbox .news-card-lightbox-photo-wrap {
  aspect-ratio: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: calc(100vh - 180px);
  background: transparent;
}

.news-card-lightbox .news-card-lightbox-photo {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  border-radius: 16px;
}

@media (max-width: 768px) {
  /* ---------- Меньший отступ под шапкой на телефоне ---------- */
  .hero-container,
  .news-hero-section,
  .pilgrimage-hero-container,
  .volunteer-hero-section,
  .zakat-hero-section,
  .mosques-map-hero-section,
  .contacts-hero-section,
  .legal-hero-section,
  .hutby-section,
  .news-card-hero-section,
  .not-found-hero-section,
  .server-error-hero-section,
  .course-hero-container {
    padding-top: 12px !important;
  }

  .umra-program-section {
    padding-top: 0 !important;
  }

  .umra-program-container {
    margin-top: 12px;
  }

  /* ---------- Кнопка «Смотреть всё» ---------- */
  .news-section-button--below {
    font-size: 14px !important;
  }

  /* ---------- Вопрос-ответ: как в макете на всех страницах ----------
     Эти размеры были только в стилях страницы курса, поэтому на других
     страницах ответ оставался крупным. */
  .faq-title,
  .umra-faq-title,
  .pilgrimage-faq-title {
    font-size: 28px !important;
  }

  .faq-item-question,
  .umra-faq-item-question,
  .pilgrimage-faq-item-question {
    font-size: 20px !important;
  }

  .faq-item-answer-text,
  .faq-item-answer-text > p,
  .umra-faq-item-answer-text,
  .umra-faq-item-answer-text > p,
  .pilgrimage-faq-item-answer-text,
  .pilgrimage-faq-item-answer-text > p {
    font-size: 14px !important;
  }

  /* Ряды карточек на телефоне остаются столбиком */
    .mosques-map-stats.mosques-map-stats--scroll {
    flex-direction: column;
    overflow-x: visible;
    padding-bottom: 0;
  }

    .mosques-map-stats.mosques-map-stats--scroll .mosques-map-stat-card {
    flex: 0 0 auto;
  }

  .news-card-lightbox .news-card-lightbox-photo-wrap,
  .news-card-lightbox .news-card-lightbox-photo {
    max-height: calc(100vh - 140px);
  }
}

@media (max-width: 1023px) {
  /* Цифры под картой на планшете — столбиком, как и обычный ряд */
  .mosques-map-stats.mosques-map-stats--scroll {
    flex-direction: column;
    overflow-x: visible;
  }

  .mosques-map-stats.mosques-map-stats--scroll .mosques-map-stat-card {
    flex: 0 0 auto;
  }
}

/* ---------- Карта OpenStreetMap ---------- */
.mosque-marker-pin {
  display: block;
  width: 40px;
  height: 46px;
  background: #108669;
  border: 2px solid #FFFFFF;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 4px 10px rgba(16, 134, 105, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mosque-marker-glyph {
  width: 22px;
  height: 22px;
  transform: rotate(45deg);
  background-color: #FFFFFF;
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
}

.leaflet-container {
  font-family: 'SF Pro', system-ui, -apple-system, sans-serif;
}

.leaflet-popup-content {
  font-size: 15px;
  line-height: 1.35;
  color: #2B2B2B;
}

.leaflet-popup-content strong {
  font-size: 16px;
}

.mosque-map--empty {
  display: none;
}
