/* Global Styles */
body, html {
  margin: 0;
  padding: 0;
  font-family: 'Playfair Display', serif;
  background-color: #F5F1E7;
  color: #4B3621;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 60px 20px;
  background-image: url('background.jpg'); /* optional background */
  background-size: cover;
  background-position: center;
  color: #F5F1E7;
}

.hero .logo {
  max-width: 250px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 2.5rem;
  margin: 0;
}

/* Button Navigation */
.button-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 40px 20px;
}

.btn {
  background-color: #4B3621;
  color: #F5F1E7;
  text-decoration: none;
  font-size: 1.2rem;
  padding: 15px 30px;
  border-radius: 8px;
  transition: transform 0.2s, background-color 0.2s;
  text-align: center;
  min-width: 120px;
}

.btn:hover {
  background-color: #D8A86D;
  transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  .btn {
    width: 100%; /* buttons full width on mobile */
  }
}

/* Photos gallery styles */
.galleries { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.gallery-covers { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.gallery-cover { cursor: pointer; position: relative; overflow: hidden; border-radius: 8px; }
.gallery-cover img { width: 100%; height: 220px; object-fit: cover; display:block; }
.gallery-cover .year-label { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,0.5); color:#fff; padding:6px 10px; border-radius:6px; font-weight:700; }

@media (max-width: 1024px) {
  .gallery-covers { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .gallery-covers { grid-template-columns: 1fr; }
  .gallery-cover img { height: 200px; }
}

/* Year gallery overlay */
.gallery-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display:none; align-items: flex-start; justify-content: center; padding: calc(var(--gallery-offset-top, 40px) + 16px) 16px 16px; z-index: 2147483647; overflow:auto; }
.gallery-overlay.open { display:flex; }
.gallery-panel {
  /* use site frame style to match other photo frames */
  background: linear-gradient(180deg, rgba(0,0,0,0.04), rgba(0,0,0,0.06));
  width: min(1100px, 98%);
  border-radius: 8px;
  padding: 18px;
  box-sizing: border-box;
  box-shadow: 0 18px 48px rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.06);
  margin-top: calc(var(--gallery-offset-top, 40px) + 8px); /* push panel below header */
}
.gallery-grid { display:grid; gap:10px; grid-template-columns: repeat(3, 1fr); }
.gallery-grid .card { background:#eee; overflow:hidden; border-radius:6px; }
.gallery-grid img { width:100%; height:200px; object-fit:cover; display:block; }
.panel-close { position: absolute; right: 24px; top: 18px; background:#111;color:#fff;border:none;padding:8px 10px;border-radius:4px; cursor:pointer; }

@media (max-width: 1024px) { .gallery-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 768px) { .gallery-grid { grid-template-columns: repeat(1,1fr); } .gallery-grid img{height:220px;} }

/* Lightbox overlay and content - center and size responsively */
/* Lightbox overlay and inner container per spec */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999; /* must sit above header */
  background: rgba(0,0,0,0.75);
}
.lightbox-overlay.open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

.lightbox-inner {
  width: min(1100px, 100%);
  height: min(80vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: transparent; /* avoid white box */
  border-radius: 12px;
}

#lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

#lightbox-close {
  /* fixed so it cannot be overlapped by the header */
  position: fixed;
  top: calc(var(--lightbox-offset-top, 0px) + 12px);
  right: 12px;
  z-index: 2147483647;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
}

#lightbox-prev, #lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
}
#lightbox-prev { left: 12px; }
#lightbox-next { right: 12px; }

/* prevent body scroll when lightbox is open */
body.lightbox-open { overflow: hidden; }
/* prevent body scroll when gallery panel is open */
body.gallery-open { overflow: hidden; }
/* hide the fixed header while a gallery or lightbox is shown to avoid overlap */
body.gallery-open header,
body.lightbox-open header { visibility: hidden; pointer-events: none; }

/* ensure the gallery panel close button sits above header if needed */
.panel-close { z-index: 2147483647; }

/* Mobile/Tablet-specific adjustments required by spec */
@media (max-width: 1024px) {
  /* hide site title text on tablet as well */
  .site-title-text { display: none !important; }
}

@media (max-width: 768px) {
  /* hide the textual site title on mobile */
  .site-title-text { display: none !important; }

  /* Ensure the page fills the viewport height and footer sits at bottom */
  html, body { height: 100%; }
  body { display: flex; flex-direction: column; min-height: 100svh; }
  main { flex: 1 0 auto; }
  footer { margin-top: auto; }

  /* Hero logo: keep aspect ratio and avoid forced height on mobile */
  .hero img, .hero .logo, img.hero-logo {
    height: auto !important;
    width: min(86vw, 360px) !important;
    max-width: 360px !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }

  /* remove any fixed-height containers that may squeeze the hero on mobile */
  .hero { padding: 28px 16px; }
}

/* Ensure long artist names stay on a single line on small screens */
@media (max-width: 480px) {
  .artists-list { padding-left: 0.6rem; padding-right: 0.6rem; }
  .artists-list li {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* if it truly overflows, truncate gracefully */
    font-size: 1.05rem; /* slightly reduce size to help fit */
    line-height: 1.1;
  }
}
