/* палитра по логотипу: тёплый бежевый, мягкие серые */
:root {
  --bg: #f5f1eb;
  --bg-card: #fdfcf9;
  --border: #e0dbd2;
  --text: #3d3935;
  --text-muted: #5c5752;
  --text-soft: #6b6560;
  --link: #5a6b5e;
  --gallery-placeholder: #e8e4de;
}

/* minimal reset */
*, *::before, *::after { box-sizing: border-box; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }

body {
  margin: 0;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

.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;
}

h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

/* header */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1rem;
}
.header-logo {
  flex-shrink: 0;
  width: 180px;
  height: auto;
  border: 1px solid var(--border);
}
.header-text {
  min-width: 0;
  text-align: left;
}
.header h1 {
  margin: 0;
  font-family: 'Caveat', cursive;
  font-weight: 500;
  font-size: 2.6rem;
  color: var(--text);
}

/* main */
main { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem; }

.about {
  margin-bottom: 1.5rem;
  color: var(--text-soft);
}
.about h2 { margin: 0 0 0.5rem; font-size: 1.25rem; color: var(--text); }
.about p { margin: 0; }

.for-whom {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
}
.for-whom p { margin: 0 0 0.75rem; }
.for-whom ul { margin: 0; padding-left: 1.25rem; list-style: disc; }
.for-whom li { margin-bottom: 0.5rem; }
.for-whom li:last-child { margin-bottom: 0; }

/* gallery */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}
@media (min-width: 480px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

.gallery h2 { margin: 0 0 1rem; font-size: 1.25rem; grid-column: 1 / -1; color: var(--text); }
.gallery-item figure { margin: 0; }
.gallery-link {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 0.5rem;
  background: var(--gallery-placeholder);
  text-decoration: none;
  color: inherit;
}
/* квадратный контейнер: центральная часть изображения по центру */
.gallery-link::before {
  content: '';
  display: block;
  padding-bottom: 100%;
}
.gallery-link img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
@supports (aspect-ratio: 1) {
  .gallery-link::before { display: none; padding-bottom: 0; }
  .gallery-link { aspect-ratio: 1; }
}

.gallery-item figcaption {
  padding: 0.75rem 0.25rem 0;
  font-size: 0.95rem;
}
.item-title { font-weight: 600; color: var(--text); }
.price { display: block; color: var(--text-muted); margin-top: 0.25rem; }
.price:empty { display: none; }

/* contacts */
.order-info {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
}
.order-info p { margin: 0 0 0.75rem; }
.order-info p:last-child { margin-bottom: 0; }

.contacts {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}
.contacts h2 { margin: 0 0 0.5rem; font-size: 1.25rem; color: var(--text); }
.contacts p { margin: 0 0 0.75rem; color: var(--text-soft); }
.contact-list li { margin-bottom: 0.5rem; }
.contact-list a { color: var(--link); text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

/* footer */
.footer {
  padding: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

/* fullscreen overlay (shown by JS) */
.fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.fullscreen-overlay[hidden] { display: none; }
.fullscreen-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  font-size: 1.75rem;
  line-height: 1;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}
.fullscreen-close:hover { background: rgba(255,255,255,0.15); }
.fullscreen-prev,
.fullscreen-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  padding: 0;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.fullscreen-overlay:hover .fullscreen-prev,
.fullscreen-overlay:hover .fullscreen-next { opacity: 1; }
.fullscreen-prev:hover,
.fullscreen-next:hover { background: rgba(255, 255, 255, 0.25); }
.fullscreen-prev { left: 1rem; }
.fullscreen-next { right: 1rem; }
.fullscreen-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100vh;
  overflow-y: auto;
}
.fullscreen-img {
  max-width: 100vw;
  max-height: calc(100vh - 4rem);
  width: auto;
  height: auto;
  object-fit: contain;
}
.fullscreen-title {
  flex-shrink: 0;
  margin: 0.75rem 0 0;
  padding: 0 1rem;
  color: #fff;
  font-size: 1.125rem;
  text-align: center;
}

/** анимация наведения на карточку - лёгкий scale + яркость изображения */
.gallery-link {
  transition: transform 0.25s ease;
}
.gallery-link img {
  transition: filter 0.25s ease;
}
.gallery-link:hover {
  transform: scale(1.02);
}
.gallery-link:hover img {
  filter: brightness(1.04);
}