/* =========================================================================
   Robert Bassal Art — single responsive stylesheet.
   Replaces the old per-page CSS files and all IE8/IE9 hacks.
   ========================================================================= */

:root {
  --bg: #1a1a1a;
  --panel: #232323;
  --text: #e8e6e2;
  --muted: #a8a39b;
  --accent: #c9a96a;        /* warm gold, echoes the old gradient feel */
  --header-h: 64px;
  --maxw: 1100px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header / navigation ------------------------------------------------ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
  padding: 0 1.25rem;
  background: rgba(20, 20, 20, 0.96);
  border-bottom: 1px solid #333;
  backdrop-filter: blur(4px);
}

.site-title { flex: 0 0 auto; }
.site-title h1 {
  margin: 0;
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text);
}

#site-nav {
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: center;
  justify-content: center;
}

.nav-link {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.25rem 0;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Hamburger — hidden on desktop */
#nav-toggle {
  display: none;
  margin-left: auto;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 0;
  cursor: pointer;
}
#nav-toggle span {
  display: block;
  height: 2px;
  width: 24px;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}

/* ---- Main content ------------------------------------------------------- */
.content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.content h2 {
  font-style: italic;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.caption {
  color: var(--muted);
  margin: 0 0 1.75rem;
  font-size: 1.05rem;
}

/* ---- Prose pages (background / contact) --------------------------------- */
.prose { max-width: 760px; }
.prose p { margin: 0 0 1.2rem; }
.email { font-size: 1.2rem; }

/* ---- Gallery grid ------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.thumb {
  display: block;
  padding: 0;
  border: 1px solid #333;
  background: var(--panel);
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.thumb:hover { transform: translateY(-3px); border-color: var(--accent); }
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Home splash -------------------------------------------------------- */
.content.home { max-width: none; padding: 0; }
.home-stage {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-h));
  background: #000;
  overflow: hidden;
}
.home-img {
  position: absolute;
  inset: 2rem;
  width: calc(100% - 4rem);
  height: calc(100% - 4rem);
  object-fit: contain;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}
.home-img.visible { opacity: 1; }

/* ---- Lightbox ----------------------------------------------------------- */
body.lightbox-open { overflow: hidden; }

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}
#lightbox[hidden] { display: none; }

.lb-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.lb-nav, .lb-close {
  position: absolute;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: 0;
  cursor: pointer;
  line-height: 1;
  border-radius: 4px;
}
.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  padding: 0.4rem 0.8rem;
}
.lb-nav:hover { background: rgba(0, 0, 0, 0.7); }
.lb-prev { left: 2vw; }
.lb-next { right: 2vw; }
.lb-close {
  top: 1.2rem;
  right: 1.5rem;
  font-size: 2.2rem;
  padding: 0 0.6rem;
}
.lb-counter {
  position: absolute;
  bottom: 1.2rem;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---- Mobile ------------------------------------------------------------- */
@media (max-width: 760px) {
  #nav-toggle { display: flex; }

  #site-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    width: min(78vw, 320px);
    height: calc(100vh - var(--header-h));
    margin: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 1rem 1.25rem;
    background: var(--panel);
    border-left: 1px solid #333;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }
  body.nav-open #site-nav { transform: translateX(0); }

  .nav-link {
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 1px solid #2e2e2e;
    font-size: 1.05rem;
  }
  .nav-link.active { border-bottom-color: #2e2e2e; }

  body.nav-open #nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open #nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open #nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .lb-nav { font-size: 1.5rem; padding: 0.3rem 0.55rem; }
}
