/* Фонове зображення */
body::before {
  content: "";
  background: url("/static/images/fon.png") no-repeat center center fixed;
  /* На стандартних екранах – 30% від ширини */
  background-size: 30% auto;
  opacity: 1;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

/* Для мобільних пристроїв: фонова картинка 50% */
@media (max-width: 767px) {
  body::before {
    background-size: 50% auto;
  }
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f8f8;
}

/* Верхня панель – прикріплена до верху, фон #f8f8f8 */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #f8f8f8;
  padding: 0.1em 0.1em;
  text-align: center;
  z-index: 1000;
}

/* Контейнер для вмісту header, який центровано */
header .container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Стилі для меню в header */
header nav a {
  color: #8c52ff;
  margin: 0 1em;
  text-decoration: none;
}

/* Активне посилання в меню: жирний і підкреслений */
header nav a.active {
  font-weight: bold;
  text-decoration: underline;
}

/* Нижня панель – прикріплена до низу, фон #f8f8f8 */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #f8f8f8;
  color: #8c52ff;
  padding: 0.1em;
  text-align: center;
  z-index: 1000;
}

/* Відступи для основного контенту */
main {
  position: relative;
  z-index: 1;
  padding: 170px 2em 150px;
}

/* Корекція для мобільних пристроїв:
   додаємо додатковий нижній відступ, щоб контент не перекривав футер */
@media (max-width: 767px) {
  main {
    padding-bottom: 100px; /* Підберіть значення згідно з висотою футера */
  }
}

nav a {
  color: #fff;
  margin: 0 1em;
  text-decoration: none;
}

/* Контейнер для майстер‑класи – стандартний CSS Grid */
.workshops-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

/* Контейнер для галереї */
.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

/* Для мобільних пристроїв: 1 стовпчик */
@media (max-width: 767px) {
  .workshops-container,
  .gallery-container {
    grid-template-columns: 1fr;
  }
}

/* Блок майстер‑класу */
.workshop {
  background: #fff;
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Пін (шпилька) для майстер‑класу */
.workshop::before {
  content: "";
  position: absolute;
  top: -90px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: url('/static/images/pin.png') no-repeat center center;
  background-size: contain;
}

/* Фото майстер‑класу */
.workshop img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 10px;
  cursor: pointer;
}

/* Заголовок блоку */
.workshop h2 {
  margin: 10px 0;
  font-size: 1.2em;
}

/* Текстова інформація */
.workshop p {
  margin: 5px 0;
}

/* Кнопка запису, розташована рівно внизу по центру */
.btn {
  margin-top: auto;
  align-self: center;
  padding: 10px 15px;
  background: #007BFF;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  text-align: center;
}

.btn:hover {
  background: #0056b3;
}

.contact {
  background: #fff;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

/* Галерея: блок для фото */
.gallery-item {
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  border-radius: 5px;
}

/* Модальне вікно (lightbox) для фото майстер‑класу та галереї */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80%;
}

/* Кнопки навігації в модальному вікні */
.prev, .next {
  position: absolute;
  top: 50%;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  padding: 16px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.prev {
  left: 0;
}

.next {
  right: 0;
}

.prev:hover, .next:hover {
  color: #bbb;
}

.close {
  position: absolute;
  top: 30px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}
