/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; }

/* ---------- Theme ---------- */
:root{
  --bg:#0b0b0c;
  --fg:#f3f3f3;
  --muted:rgba(255,255,255,.65);
  --line:rgba(255,255,255,.12);
  --card:rgba(255,255,255,.05);
  --shadow: 0 20px 60px rgba(0,0,0,.55);

  --sold:#ff4d4d;
  --avail:#43ff8a;
}

body{
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  letter-spacing: .2px;
}

a{ color: inherit; }

/* ---------- Header / Nav ---------- */
header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  background: linear-gradient(to bottom, rgba(11,11,12,.92), rgba(11,11,12,.55), rgba(11,11,12,0));
  backdrop-filter: blur(8px);
}

.nav{
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 18px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand{
  text-decoration: none;
  color: var(--fg);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 13px;
  opacity: .92;
  user-select: none;
}
.brand[aria-label]{ cursor: default; }

.links{
  display:flex;
  gap: 18px;
  font-size: 13px;
  letter-spacing: .02em;
}

.links a{
  text-decoration: none;
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 10px;
}
.links a:hover{
  background: rgba(255,255,255,.07);
  color: var(--fg);
  transform: translateY(-1px);
}

/* ---------- Page layout ---------- */
main{
  max-width: 1180px;
  margin: 0 auto;
  padding: 96px 18px 70px;
}

.page-title{
  margin: 10px 0 6px;
  font-size: 28px;
  letter-spacing: .02em;
}

.page-subtitle{
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--muted);
}

.small{ font-size: 13px; color: var(--muted); }

/* ---------- Cards / Prose ---------- */
.card{
  background: var(--card);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  padding: 18px;
}

.prose{ max-width: 980px; }
.prose p{ margin: 0 0 14px; line-height: 1.6; }
.prose h2{ margin: 22px 0 10px; font-size: 16px; letter-spacing: .02em; }
.prose ul{ margin: 0; padding-left: 18px; line-height: 1.7; }

/* ---------- Index hero (fixed: no blank bottom) ---------- */
.hero{
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}

.hero-img{
  display: block;
  width: 100%;
  height: auto;
  filter: contrast(1.02) saturate(1.02);
}

/* Signature overlay */
.signature{
  position: absolute;
  left: 32px;
  bottom: 28px;
  width: min(260px, 38vw);
  height: auto;
  opacity: .98;
  z-index: 120;
  pointer-events: none;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.70));
}

/* ---------- Lightbox (Gallery + Webshop) ---------- */
/* This matches the lightbox HTML that already exists in your gallery/webshop files. */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
}
.lightbox.open{ display: block; }

.lb-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.68);
  backdrop-filter: blur(6px);
}

.lb-panel{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  pointer-events: none;
}

.lb-frame{
  pointer-events: auto;
  width: min(1320px, 96vw);
  max-height: 92vh;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.lb-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.lb-title-wrap{
  display:flex;
  flex-direction:column;
  gap: 3px;
  padding-right: 12px;
  min-width: 0;
}

.lb-title{
  font-size: 14px;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-meta{
  font-size: 12px;
  color: var(--muted);
}

.lb-status{
  display: inline-block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.lb-status.sold{ color: var(--sold); }
.lb-status.available{ color: var(--avail); }

.lb-close{
  border: 0;
  background: rgba(255,255,255,.08);
  color: var(--fg);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
  flex: 0 0 auto;
}
.lb-close:hover{ background: rgba(255,255,255,.12); transform: translateY(-1px); }

.lb-body{
  display:grid;
  place-items:center;
  padding: 18px;
  height: calc(92vh - 56px);
}

.lb-body img{
  max-width: 100%;
  max-height: 78vh;
  display:block;
  border-radius: 12px;
  opacity: 0;
  transition: opacity .25s ease;
}
.lb-body img.loaded{ opacity: 1; }

.lb-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.35);
  color: var(--fg);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease, transform .15s ease;
}
.lb-nav:hover{ background: rgba(0,0,0,.5); transform: translateY(-50%) scale(1.03); }
.lb-prev{ left: 16px; }
.lb-next{ right: 16px; }

/* ---------- About underlay ---------- */
.about-card{ position: relative; overflow: hidden; }
.about-card.prose{ max-width: 1100px; margin: 0 auto; }
.about-underlay{
  position: absolute;
  inset: 0;
  background-image: url("images/about_johanna.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: .18;
  filter: contrast(1.05) saturate(1.02);
  transform: translateY(6px) scale(1.03);
  z-index: 0;
  pointer-events: none;
}
.about-content{ position: relative; z-index: 1; }

/* ---------- Projects cards (About) ---------- */
.projects{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 10px;
}
@media (max-width: 980px){ .projects{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px){ .projects{ grid-template-columns: 1fr; } }

.project-card{
  display:block;
  text-decoration:none;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.project-card:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.18);
}
.project-title{ font-size: 14px; letter-spacing: .01em; color: rgba(255,255,255,.92); }
.project-meta{ margin: 8px 0 0; font-size: 13px; color: rgba(255,255,255,.68); }

/* ---------- Coming exhibitions (About) ---------- */
.exhibitions{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 10px;
}
@media (max-width: 840px){ .exhibitions{ grid-template-columns: 1fr; } }

.exhibition-card{
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
}
.exhibition-title{ font-size: 14px; letter-spacing: .01em; color: rgba(255,255,255,.92); }
.exhibition-meta{ margin-top: 6px; font-size: 13px; color: rgba(255,255,255,.72); line-height: 1.5; }
.exhibition-link{
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- PDF Modal (About only) ---------- */
.pdf-modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 200;
}
.pdf-modal.open{ display: block; }

.pdf-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
}

.pdf-panel{
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(1080px, calc(100vw - 28px));
  height: min(86vh, 900px);
  transform: translate(-50%, -50%);
  background: rgba(16,16,18,.92);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.60);
}

.pdf-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.pdf-title-wrap{
  display:flex;
  flex-direction:column;
  gap: 3px;
  min-width: 0;
}
.pdf-title{
  font-size: 14px;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-hint{
  font-size: 12px;
  color: var(--muted);
}

.pdf-close{
  border: 0;
  background: rgba(255,255,255,.08);
  color: var(--fg);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
  flex: 0 0 auto;
}
.pdf-close:hover{ background: rgba(255,255,255,.12); transform: translateY(-1px); }

.pdf-body{
  position: absolute;
  inset: 56px 0 0 0;
}
.pdf-body iframe{
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(0,0,0,.10);
}

body.modal-open{ overflow: hidden; }

/* ---------- Contact background (prepare for images/shop.jpg) ---------- */
body.contact-page::before{
  content:"";
  position: fixed;
  inset: 0;
  background-image: url("images/shop.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: .16;
  filter: contrast(1.05) saturate(1.05);
  pointer-events: none;
  z-index: -1;
}

/* ---------- Gallery thumbs (matches gallery.html script) ---------- */
.thumb{
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.thumb:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.05);
}
.thumb img{
  width: 100%;
  height: 360px;
  object-fit: cover;
  display:block;
  opacity: 0;
  transition: opacity .25s ease;
}
.thumb img.loaded{ opacity: 1; }

/* ---------- Index: floating hero, no scroll ---------- */
body.index-page {
  overflow: hidden;
  height: 100vh;
}

.index-stage {
  position: fixed;
  inset: 0;
  background: var(--bg);
}

.index-stage header {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,.12);
  backdrop-filter: none;
  z-index: 10;
}

.hero-img-float {
  position: absolute;
  width: 34vw;
  height: auto;
  left: 33vw;
  top: 130px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  display: block;
  object-fit: cover;
  z-index: 5;
}

.signature-float {
  position: absolute;
  z-index: 20;
  display: block;
  filter: drop-shadow(0 2px 16px rgba(0,0,0,.9));
}

@media (max-width: 640px){
  .hero-img-float { width: 80vw; left: 10vw; top: 80px; }
}

/* ---------- Gallery masonry grid ---------- */
.grid {
  columns: 3 260px;
  column-gap: 14px;
  margin-top: 10px;
}
.grid .thumb {
  break-inside: avoid;
  margin-bottom: 14px;
  height: auto;
}
.grid .thumb img {
  width: 100%;
  height: auto;
  object-fit: unset;
}
@media (max-width: 600px) {
  .grid { columns: 2 140px; column-gap: 8px; }
  .grid .thumb { margin-bottom: 8px; }
}

/* ---------- Webshop ---------- */
.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 860px) { .shop-grid { grid-template-columns: 1fr; } }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead th {
  text-align: left;
  padding: 8px 10px 8px 0;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}
.table tbody td {
  padding: 9px 10px 9px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  vertical-align: middle;
  color: var(--fg);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(255,255,255,.03); }

.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-thumb {
  border: none;
  background: rgba(255,255,255,.06);
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  transition: transform .15s ease, background .15s ease;
}
.shop-thumb:hover { transform: scale(1.06); background: rgba(255,255,255,.1); }
.shop-thumb img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .25s ease;
}
.shop-thumb img.loaded { opacity: 1; }

.footer-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
.footer-note a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.footer-note a:hover { color: var(--muted); }

/* ---------- Contact page image ---------- */
body.contact-page main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
body.contact-page .page-title,
body.contact-page .page-subtitle {
  grid-column: 1 / -1;
}
.contact-photo {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
}
.contact-photo img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
@media (max-width: 700px) {
  body.contact-page main { grid-template-columns: 1fr; }
}

/* ---------- Brand as link ---------- */
a.brand {
  text-decoration: none;
  color: var(--fg);
}
a.brand:hover {
  opacity: 0.75;
}

/* ---------- Gallery opening hours ---------- */
.gallery-meta {
  margin-bottom: 2rem;
}
.opening-hours {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  padding: 12px 20px 10px;
  background: rgba(255,255,255,.03);
}
.oh-label {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.oh-row {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  font-size: 13px;
  color: var(--fg);
}
.oh-address {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 8px;
}
