/* ====================================
   АДАПТИВНЫЕ УЛУЧШЕНИЯ
   Использует встроенное мобильное меню темы Alpha Church
   ==================================== */

/* === ХЛЕБНЫЕ КРОШКИ / BREADCRUMBS === */
.breadcrumbs {
  padding: 1rem;
  margin: 0 auto;
  max-width: 1200px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .breadcrumbs {
    padding: 1.5rem 2rem;
  }
}

.breadcrumb-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .breadcrumb-item {
    font-size: 1rem;
  }
}

.breadcrumb-item:not(:last-child)::after {
  content: "›";
  margin-left: 0.5rem;
  color: #6c757d;
  font-weight: bold;
}

.breadcrumb-item a {
  color: #007bff;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-item a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: #6c757d;
  font-weight: 500;
}

/* === СЧЁТЧИКИ ЦЕРКВЕЙ === */
.church-counter {
  display: inline-block;
  background: #e3f2fd;
  color: #1976d2;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-size: 1rem;
  border-left: 4px solid #1976d2;
}

@media (min-width: 768px) {
  .church-counter {
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
  }
}

.church-counter i {
  margin-right: 0.5rem;
}

.church-counter strong {
  font-weight: 700;
  font-size: 1.2em;
}

/* Счётчик на карточках континентов */
.continent-church-count {
  margin-top: 0.5rem;
  color: #555;
  font-size: 0.95rem;
  font-weight: 500;
}

@media (min-width: 768px) {
  .continent-church-count {
    font-size: 1rem;
  }
}

.continent-church-count i {
  color: #1976d2;
  margin-right: 0.3rem;
}

/* Счётчик на карточках стран */
.country-church-count {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}

@media (min-width: 768px) {
  .country-church-count {
    font-size: 0.9rem;
  }
}

.country-church-count i {
  color: #1976d2;
  margin-right: 0.25rem;
  font-size: 0.9em;
}

/* === СТРАНИЦА ЦЕРКВИ (НОВЫЙ ДИЗАЙН) === */

.church-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

@media (min-width: 768px) {
  .church-page {
    padding: 2rem;
  }
}

/* --- HERO СЕКЦИЯ (информация + карта) --- */
.church-hero {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 900px) {
  .church-hero {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
  }
}

/* Левая колонка: информация */
.church-info {
  order: 1;
}

@media (min-width: 900px) {
  .church-info {
    order: 1;
  }
}

.church-title {
  font-size: 1.6rem;
  color: #2c3e50;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .church-title {
    font-size: 2rem;
  }
}

@media (min-width: 1024px) {
  .church-title {
    font-size: 2.2rem;
  }
}

.church-subtitle {
  color: #666;
  font-size: 1rem;
  margin: 0 0 1.5rem 0;
  font-style: italic;
}

.church-address-block {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #1976d2;
}

.church-address-block i {
  color: #1976d2;
  font-size: 1.2rem;
  margin-top: 0.1rem;
}

.church-address-block span {
  color: #333;
  line-height: 1.5;
}

/* Кнопки действий */
.church-actions {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .church-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: white;
  transition: all 0.2s;
  min-height: 80px;
  text-align: center;
}

.action-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.action-btn:active {
  transform: translateY(-1px);
}

.action-btn i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.action-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.action-value {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.25rem;
  word-break: break-all;
}

.action-phone {
  background: linear-gradient(135deg, #00b894, #00a085);
}

.action-email {
  background: linear-gradient(135deg, #0984e3, #0870c4);
}

.action-website {
  background: linear-gradient(135deg, #6c5ce7, #5a4bd1);
}

/* Правая колонка: карта */
.church-map-container {
  order: 2;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  background: #f0f0f0;
}

@media (min-width: 900px) {
  .church-map-container {
    position: sticky;
    top: 1rem;
  }
}

.church-map {
  width: 100%;
  height: 250px;
}

@media (min-width: 600px) {
  .church-map {
    height: 300px;
  }
}

@media (min-width: 900px) {
  .church-map {
    height: 350px;
  }
}

.map-external-link {
  display: block;
  padding: 0.75rem;
  background: #fff;
  text-align: center;
  color: #1976d2;
  text-decoration: none;
  font-size: 0.9rem;
  border-top: 1px solid #e0e0e0;
  transition: background 0.2s;
}

.map-external-link:hover {
  background: #f5f5f5;
}

.map-external-link i {
  margin-right: 0.5rem;
}

.church-map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 250px;
  color: #999;
  text-align: center;
  padding: 2rem;
}

.church-map-placeholder i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.church-map-placeholder p {
  margin: 0;
  font-size: 1.1rem;
}

.church-map-placeholder small {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

/* --- РАСПИСАНИЕ СЛУЖЕНИЙ --- */
.church-schedule {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.church-schedule h2 {
  margin: 0 0 1.5rem 0;
  color: #2c3e50;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.church-schedule h2 i {
  color: #1976d2;
}

.schedule-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 600px) {
  .schedule-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .schedule-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.schedule-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.schedule-card:hover {
  border-color: #1976d2;
  transform: translateY(-2px);
}

.schedule-day {
  font-size: 0.85rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.schedule-time {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1976d2;
  margin-bottom: 0.5rem;
}

.schedule-name {
  font-size: 1rem;
  color: #2c3e50;
  font-weight: 500;
}

.schedule-note {
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.5rem;
  font-style: italic;
}

/* --- СОЦИАЛЬНЫЕ СЕТИ --- */
.church-social {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  border-radius: 12px;
  color: white;
}

.church-social h2 {
  margin: 0 0 1.5rem 0;
  color: white;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.social-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  text-decoration: none;
  color: white;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.social-btn i {
  font-size: 1.1rem;
}

/* Цвета соцсетей */
.social-btn.telegram { background: #0088cc; }
.social-btn.telegram:hover { background: #006699; }

.social-btn.youtube { background: #FF0000; }
.social-btn.youtube:hover { background: #cc0000; }

.social-btn.facebook { background: #1877F2; }
.social-btn.facebook:hover { background: #0d65d9; }

.social-btn.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

.social-btn.vk { background: #4C75A3; }
.social-btn.vk:hover { background: #3d5f82; }

.social-btn.tiktok { background: #010101; border: 1px solid #333; }

.social-btn.twitter { background: #000000; }
.social-btn.twitter:hover { background: #333; }

.social-btn.whatsapp { background: #25D366; }
.social-btn.whatsapp:hover { background: #1da851; }

.social-btn.viber { background: #7360F2; }
.social-btn.viber:hover { background: #5a47cc; }

/* --- О ЦЕРКВИ --- */
.church-about {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.church-about h2 {
  margin: 0 0 1rem 0;
  color: #2c3e50;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e9ecef;
}

.church-about h2 i {
  color: #1976d2;
}

.church-about-content {
  line-height: 1.8;
  color: #444;
}

.church-about-content p {
  margin: 1rem 0;
}

/* --- ФУТЕР СТРАНИЦЫ --- */
.church-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e9ecef;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

@media (min-width: 600px) {
  .church-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.church-footer .church-meta {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  color: #888;
  font-size: 0.9rem;
}

.church-footer .church-meta i {
  margin-right: 0.5rem;
  color: #aaa;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #1976d2;
  color: white !important;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-back:hover {
  background: #1565c0;
  transform: translateX(-3px);
}

/* Leaflet popup стили */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

.leaflet-popup-content {
  margin: 12px 16px;
  line-height: 1.5;
}

/* === БАЗОВЫЕ СТИЛИ === */
html {
  font-size: 14px; /* Для мобильных */
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

@media (min-width: 1200px) {
  html {
    font-size: 18px;
  }
}

/* === КОНТЕЙНЕР С MAX-WIDTH === */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .main-container {
    padding: 0 2rem;
  }
}

/* === ВСТРОЕННОЕ МОБИЛЬНОЕ МЕНЮ ТЕМЫ === */
/* Тема Alpha Church уже имеет #navButton и #navPanel */
/* Они автоматически появляются на экранах < 980px */
/* Дополнительный JS НЕ НУЖЕН! */

/* === СЕТКА КОНТИНЕНТОВ === */
.continents-grid {
  padding: 2rem 1rem;
  text-align: center;
}

@media (min-width: 768px) {
  .continents-grid {
    padding: 3rem 2rem;
  }
}

.continents-grid h2 {
  margin-bottom: 2rem;
  font-size: 1.8rem;
  color: #2c3e50;
}

@media (min-width: 768px) {
  .continents-grid h2 {
    font-size: 2.2rem;
    margin-bottom: 2.5rem;
  }
}

.continent-cards {
  display: grid;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  
  /* Мобильный: 1 колонка по центру */
  grid-template-columns: 1fr;
  justify-items: center;
}

@media (min-width: 600px) {
  .continent-cards {
    /* Планшет вертикальный: 2 колонки */
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 0;
  }
}

@media (min-width: 900px) {
  .continent-cards {
    /* Планшет горизонтальный: 3 колонки */
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1200px) {
  .continent-cards {
    /* Десктоп: 3 колонки с оптимальным размером */
    max-width: 1400px;
    gap: 2.5rem;
  }
}

.continent-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  width: 100%;
  max-width: 380px; /* Ограничение максимальной ширины на мобильных */
  
  /* Одинаковая высота для всех карточек */
  height: 100%;
  min-height: 320px;
}

@media (min-width: 600px) {
  .continent-card {
    max-width: none; /* Убираем ограничение на планшете */
    min-height: 340px;
  }
}

@media (min-width: 900px) {
  .continent-card {
    min-height: 360px;
  }
}

.continent-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.15);
}

/* Контейнер изображения с фиксированной высотой */
.continent-card-image {
  flex: 0 0 auto;
  width: 100%;
  height: 200px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e9ecef;
}

@media (min-width: 768px) {
  .continent-card-image {
    height: 220px;
    padding: 2rem;
  }
}

.continent-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 100%;
}

/* Контейнер контента с flex-grow для одинаковой высоты */
.continent-card-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  background: #ffffff;
}

@media (min-width: 768px) {
  .continent-card-content {
    padding: 2rem;
  }
}

.continent-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: #2c3e50;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .continent-card h3 {
    font-size: 1.5rem;
  }
}

/* Счётчик церквей в карточке */
.continent-card .continent-church-count {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 2px solid #f0f0f0;
  color: #555;
  font-size: 1rem;
  font-weight: 500;
}

/* === СЕТКА СТРАН (ФЛАГИ) === */
.countries-grid {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
  
  /* Мобильный: 2 колонки */
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 480px) {
  .countries-grid {
    /* Большой телефон: 3 колонки */
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .countries-grid {
    /* Планшет: 4 колонки */
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .countries-grid {
    /* Большой планшет: 5 колонок */
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1200px) {
  .countries-grid {
    /* Десктоп: 6 колонок (максимум) */
    grid-template-columns: repeat(6, 1fr);
  }
}

.country-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #333;
  padding: 1rem;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.2s;
  min-height: 120px;
}

@media (min-width: 768px) {
  .country-card {
    padding: 1.5rem;
    min-height: 140px;
  }
}

.country-card:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.country-card img {
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 0.8rem;
  width: 80px;
  height: 60px;
  object-fit: cover;
}

@media (min-width: 768px) {
  .country-card img {
    width: 96px;
    height: 72px;
  }
}

.country-card span {
  font-weight: 500;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .country-card span {
    font-size: 1rem;
  }
}

/* === СПИСОК ЦЕРКВЕЙ === */
.church-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.church-list li {
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.2s;
}

@media (min-width: 768px) {
  .church-list li {
    padding: 2rem;
  }
}

.church-list li:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.church-list li a {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  text-decoration: none;
}

@media (min-width: 768px) {
  .church-list li a {
    font-size: 1.3rem;
  }
}

.church-list li a:hover {
  color: #3498db;
}

/* === УЛУЧШЕНИЕ ЧИТАЕМОСТИ === */
article {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

@media (min-width: 768px) {
  article {
    padding: 2rem;
  }
}

article h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  article h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
  }
}

article h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  article h2 {
    font-size: 1.8rem;
  }
}

/* === АДАПТИВНЫЕ ОТСТУПЫ === */
@media (max-width: 767px) {
  /* Уменьшить отступы на мобильных */
  section {
    padding: 1rem 0.5rem;
  }
  
  /* Увеличить размер кликабельных элементов */
  a, button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* === УЛУЧШЕНИЕ ACCESSIBILITY === */

/* Skip-link: скрыт по умолчанию, появляется при фокусе (Tab) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: #1976d2;
  color: white !important;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  font-weight: 600;
  z-index: 10000;
  border-radius: 0 0 8px 0;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #ff9800;
  outline-offset: 2px;
}

/* Фокус для клавиатурной навигации */
a:focus, button:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

/* Скрыть outline при клике мышью */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}
