/* ---- Загальні стилі ---- */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  background: #fff;
  color: #111;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1; /* займає простір між header і footer */
}

/* ---- Header ---- */
header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 40px;
  flex-wrap: wrap;
  background: #fff;
}

.logo-container {
  display: flex;
  flex-direction: column;
}

.logo {
  font-size: 1.8rem;
  font-weight: 600;
  color: #111;
  text-decoration: none;
}

.subtitle {
  color: #555;
  font-size: 0.9rem;
  margin-top: 5px;
}

/* Навігація */
nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 5px;
}

nav a {
  text-decoration: none;
  color: #111;
  font-weight: 500;
  padding: 5px 10px;
}

nav a.active {
  font-weight: 700;
}

#lang-toggle {
  cursor: pointer;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  font-weight: bold;
}

/* ---- Галерея (masonry) ---- */
#gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  max-width: 1200px;
  margin: 20px auto;
  grid-auto-rows: 10px;
  grid-auto-flow: dense;
  padding: 0 20px; /* відступи від країв */
}

.item .content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item img, .item video {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  object-fit: cover;
}

/* Теги без # */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span {
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  color: white;
  user-select: none;
  transition: 0.2s;
}
.tags span:hover { opacity: 0.8; }

#modal-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
#modal-tags span { padding: 3px 8px; border-radius: 20px; font-size: 0.7rem; font-weight: 500; color: white; cursor: pointer; }

/* ---- Модалка ---- */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

.modal img, .modal video {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 12px;
  object-fit: contain;
}

.modal .close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: white;
  cursor: pointer;
}

/* ---- Контакти ---- */
.contact-section {
  max-width: 600px;
  margin: 40px auto;
  padding: 0 20px;
  text-align: center;
}

.contact-links a {
  display: inline-block;
  margin: 10px;
  padding: 10px 15px;
  background: #111;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
}

/* ---- Footer ---- */
footer {
  text-align: center;
  padding: 15px;
  font-size: 0.8rem;
  background: #fff;
  flex-shrink: 0; /* футер завжди внизу */
}

/* --- Мобільна адаптивність --- */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
  }

  nav {
    padding-top: 0;
  }

  #gallery {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 15px;
  }
}

@media (max-width: 480px) {
  #gallery {
    grid-template-columns: 1fr;
    padding: 0 10px;
  }
}
