:root {
  --background: #ffffff;
  --text-dark: #222222;
  --accent: #d32f2f;
  --border: rgba(0, 0, 0, 0.08);
  --card: #fafafa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text-dark);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-header {
  background-color: #fff6f6;
  background-image:
    radial-gradient(circle at top left, rgba(210, 50, 50, 0.12) 0%, transparent 20%),
    radial-gradient(circle at top right, rgba(211, 47, 47, 0.1) 0%, transparent 18%),
    linear-gradient(180deg, #fff7f6 0%, #ffffff 60%, #fff9f9 100%);
  padding: 40px 22px;
  text-align: center;
  border-bottom: 1px solid rgba(211, 47, 47, 0.12);
  box-shadow: inset 0 -1px 0 rgba(211, 47, 47, 0.08);
}

.site-header h1 {
  margin: 0 auto;
  font-size: 35px;
  max-width: 900px;
  font-weight: 900;
  color: #b71c1c;
  line-height: 1.05;
  letter-spacing: -0.05em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95), 0 10px 28px rgba(183, 28, 28, 0.08);
  padding: 0.2em 0.5em;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  border: 1px solid rgba(183, 28, 28, 0.12);
}

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.gallery-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.image-card {
  background: var(--card);
  border: 1px solid var(--border);

  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
  transition: transform 250ms ease, box-shadow 250ms ease;
}

.image-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.1);
}

.image-card img {
  display: block;
  width: 100%;
  height: 300px;
}

.card-footer {
  padding: 14px 16px;
}

.card-footer p {
  margin: 0;
  font-size: 0.95rem;
  color: #555555;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
}

.pagination button {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-dark);
  padding: 10px 16px;
  border-radius: 999px;
  min-width: 48px;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.pagination button:hover:not(:disabled) {
  background: #faf0f0;
  transform: translateY(-1px);
}

.pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pagination button.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.pagination span {
  color: #777777;
  font-weight: 600;
}

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.lightbox.show {
  display: flex;
}

.lightbox-content {
  position: relative;
  width: min(1100px, 90vw);
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

.lightbox-content img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 85vh;
  display: block;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.lightbox-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.lightbox-loader.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-loader::before {
  content: '';
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: lightbox-spin 0.8s linear infinite;
}

@keyframes lightbox-spin {
  to {
    transform: rotate(360deg);
  }
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: white;
  font-size: 22px;
  width: 48px;
  height: 48px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
}

.lightbox-prev {
  left: 10px;
}

.lightbox-next {
  right: 10px;
}

.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-50%) scale(1.03);
}

@media (max-width: 900px) {
  .image-card img {
    height: 220px;
  }
}

@media (max-width: 720px) {
  .image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-card img {
    height: 190px;
  }

  .lightbox-content {
    width: 100%;
    max-height: 100vh;
    padding: 0 12px;
  }

  .lightbox-content img {
    max-height: 75vh;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .lightbox-close {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }
}

  .pagination {
    gap: 8px;
    padding: 12px;
  }

  .pagination button {
    padding: 12px 15px;
    min-width: 46px;
  
}

@media (max-width: 480px) {
  .site-header {
    padding: 24px 14px;
  }
  .site-header h1 {
    font-size: 19px;
    padding: 0.18em 0.5em;
  }
  .main-content {
    padding: 18px 12px 30px;
  }
  .pagination {
    gap: 8px;
    padding: 12px 10px;
  }
  .pagination button {
    padding: 12px 14px;
    min-width: 44px;
  }
}
