:root {
  --blue: #cce6ff;
  --ink: #000173;
  --contact: #00019f;
  --line: #666;
  --muted: #999;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  background: var(--blue);
  color: var(--ink);
}

.page {
  width: min(1000px, calc(100% - 16px));
  margin: 8px auto 20px;
}

.header {
  display: grid;
  grid-template-columns: minmax(220px, 325px) minmax(0, 1fr) minmax(200px, 308px);
  gap: 8px;
  height: 225px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  min-width: 0;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 14px;
  color: var(--contact);
  line-height: 1.4;
}

.contact h1 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.25;
}

.contact p {
  margin: 0;
  font-size: 13px;
}

.contact a {
  color: inherit;
  text-decoration: none;
}

.contact a:hover {
  text-decoration: underline;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.gallery a {
  display: block;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.gallery a:hover {
  border-color: var(--contact);
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
}

.footer {
  margin-top: 8px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--muted);
}

.footer p {
  margin: 0;
  font-size: 13px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--contact);
  outline-offset: 2px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 72px 48px;
  background: rgba(0, 0, 0, 0.85);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.lightbox button {
  position: absolute;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--contact);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close {
  top: 16px;
  right: 16px;
}

.lightbox-prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  margin: 0;
  color: #fff;
  text-align: center;
  font-size: 14px;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 860px) {
  .header {
    grid-template-columns: 1fr;
    height: auto;
  }

  .logo {
    min-height: 180px;
  }

  .logo img {
    height: 180px;
  }

  .photo img {
    height: 210px;
  }

  .contact {
    min-height: 160px;
    padding: 20px 16px;
  }

  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .page {
    width: min(1000px, calc(100% - 12px));
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .lightbox {
    padding: 56px 12px 72px;
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 16px;
    transform: none;
  }

  .lightbox-prev {
    left: calc(50% - 52px);
  }

  .lightbox-next {
    right: calc(50% - 52px);
  }

  .lightbox-status {
    bottom: 64px;
  }
}
