:root {
  --color-bg: #faf7f2;
  --color-fg: #1a1a1a;
  --color-accent: #b5651d;
  --header-height: 64px;
  --footer-height: 76px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-fg);
  padding-top: var(--header-height);
  padding-bottom: var(--footer-height);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-fg);
  color: var(--color-bg);
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.header-inner {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: inherit;
  text-decoration: none;
  text-transform: lowercase;
}

.tagline {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.75;
}

/* Gallery */
main {
  padding: 1.75rem clamp(1rem, 4vw, 2.5rem);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

.art-piece {
  margin: 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.art-trigger {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.art-trigger:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.art-piece img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

.art-piece figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  color: #555;
}

.art-title {
  font-weight: 600;
  color: var(--color-fg);
}

.art-meta {
  font-size: 0.75rem;
  color: #888;
}

.art-piece.unavailable .art-trigger img {
  filter: grayscale(0.2);
}

.gallery-loading,
.gallery-error {
  grid-column: 1 / -1;
  text-align: center;
  color: #777;
  padding: 2rem 0;
}

.noscript-notice {
  text-align: center;
  color: #777;
  padding: 1.25rem;
  margin: var(--header-height) 1rem 0;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 5vw, 3rem);
  z-index: 300;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 301;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.3);
}

body.lightbox-open {
  overflow: hidden;
}

/* Footer */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-fg);
  z-index: 100;
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.15);
}

.social-links {
  display: flex;
  gap: 1.5rem;
}

.social-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--color-bg);
  text-decoration: none;
  font-size: 0.65rem;
}

.social-links svg {
  width: 24px;
  height: 24px;
}

.social-links a:hover,
.social-links a:focus-visible {
  color: var(--color-accent);
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: calc(var(--footer-height) + 0.75rem);
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  color: var(--color-fg);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 200;
  font-size: 0.85rem;
}

.cookie-banner p {
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.cookie-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.cookie-actions button {
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  cursor: pointer;
}

#cookie-accept {
  background: var(--color-accent);
  color: #fff;
}

#cookie-decline {
  background: #eee;
  color: #333;
}

@media (max-width: 480px) {
  .art-piece img {
    height: 200px;
  }

  .social-links {
    gap: 1rem;
  }

  .social-links a span {
    display: none;
  }
}
