/* =============================================================
   Studio Glazebrook — Stylesheet
   ============================================================= */

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-y: scroll; }
html, body { height: 100%; }

/* Skjul den overflødige viewport-scrollbaren på produktsider (desktop) */
@media (min-width: 769px) {
  html:has(body.page-product) { overflow-y: hidden; }
}

/* --- Scrollbar-stil (tynnere og lysere) --- */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }
* { scrollbar-width: thin; scrollbar-color: #d0d0d0 transparent; }

/* --- Typografi og base --- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  font-size: 13px;
  line-height: 1.7;
  color: #111;
  background: #fff;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* --- Navigasjon --- */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 72px;
  background: rgba(255,255,255,0.96);
}
.nav-logo {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 44px;
}
.nav-links a {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.nav-links a:hover { opacity: 0.4; }

/* --- Hamburger --- */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 1px;
  background: #111;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

.nav-mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.98);
  z-index: 199;
  padding: 28px 16px 32px;
  flex-direction: column;
  gap: 24px;
}
.nav-mobile-menu a {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.nav-mobile-menu.open { display: flex; }

/* --- Forside: slideshow --- */
body.page-home { overflow: hidden; }

#slideshow {
  position: fixed;
  left: 48px;
  right: 80px;
  top: 80px;
  bottom: 48px;
  z-index: 0;
}
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 2.5s ease;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
.slide.active { opacity: 1; }

/* --- Works: produktgrid --- */
.page-content {
  padding-top: 80px;
}
.page-title {
  padding: 48px 72px 32px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #999;
}
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0 72px 72px;
}
.work-card {
  cursor: pointer;
  overflow: hidden;
}
.work-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f0ede9;
  overflow: hidden;
}
.work-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.work-card:hover .work-card-image img { transform: scale(1.03); }
.work-card-info {
  padding: 14px 0 28px;
}
.work-card-name {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
}
.work-card-year {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

/* --- Produktside --- */
.product-layout {
  position: relative;
  height: calc(100vh - 60px);
  margin-top: 60px;
  overflow: hidden;
}

.product-sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  width: 320px;
  height: calc(100vh - 60px);
  padding: 48px 72px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 100;
  background: rgba(255,255,255,0.92);
}

.product-title {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
}
.product-meta {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product-year {
  font-size: 11px;
  color: #999;
  letter-spacing: 0.06em;
}
.product-nav-gap {
  display: inline-block;
  width: 8px;
}
.product-description {
  font-size: 13px;
  line-height: 1.8;
  color: #444;
}
.product-price {
  font-size: 13px;
  margin-top: 8px;
}

.product-images {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 48px 72px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
  z-index: 50;
  scrollbar-gutter: stable;
}

.product-images img {
  width: 35%;
  height: auto;
  display: block;
  cursor: zoom-in;
  transition: opacity 0.2s;
}
.product-images img:hover { opacity: 0.85; }

/* --- Prosjektnavigasjon --- */
.product-nav-prev,
.product-nav-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.product-nav-prev:hover,
.product-nav-next:hover { opacity: 1; }
.product-nav-prev svg,
.product-nav-next svg {
  width: 7px;
  height: 7px;
}

#overlay-info {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: default;
}

/* Forespørsel-knapp */
.btn-inquiry {
  display: inline-block;
  margin-top: 24px;
  padding: 10px 28px;
  border: 1px solid #111;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  background: transparent;
  color: #111;
  transition: background 0.2s, color 0.2s;
}
.btn-inquiry:hover { background: #111; color: #fff; }

/* --- About / Contact --- */
.text-page {
  padding-top: 80px;
  max-width: 640px;
  margin: 0 auto;
  padding-left: 72px;
  padding-right: 72px;
}
.text-page h1 {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #999;
  margin: 48px 0 32px;
}
.text-page p {
  margin-bottom: 20px;
  line-height: 1.9;
}

/* Kontaktskjema */
.contact-form { margin-top: 40px; }
.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: #666;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 10px 0;
  border: none;
  border-bottom: 1px solid #ccc;
  font-family: inherit;
  font-size: 13px;
  font-weight: 300;
  outline: none;
  background: transparent;
  transition: border-color 0.2s;
}
.form-field input:focus,
.form-field textarea:focus { border-color: #111; }
.form-field textarea { height: 100px; resize: none; }

/* --- Lightbox overlay --- */
#overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.96);
  z-index: 500;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#overlay-img-wrapper {
  position: relative;
  z-index: 2;
  cursor: default;
}
#overlay-img {
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  object-fit: contain;
  display: block;
}
#overlay-left,
#overlay-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 3;
  opacity: 0;
}
#overlay-left { left: 0; cursor: w-resize; }
#overlay-right { right: 0; cursor: e-resize; }

/* --- Status-prikker --- */
.dot-full, .dot-half, .dot-empty {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid #111;
  vertical-align: middle;
  margin-left: auto;
  flex-shrink: 0;
}
.dot-full  { background: #111; }
.dot-half  { background: linear-gradient(to right, #111 50%, transparent 50%); }
.dot-empty { background: transparent; }

.status-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.status-list li {
  display: flex;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #666;
}
.status-list li .dot-full,
.status-list li .dot-half,
.status-list li .dot-empty {
  margin-left: 0;
  margin-right: 10px;
  flex-shrink: 0;
}

/* --- Responsiv (mobil) --- */
@media (max-width: 768px) {
  #nav { padding: 16px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  #slideshow { left: 16px; right: 16px; top: 52px; bottom: 16px; }
  .nav-mobile-menu { top: 52px; }

  .page-content { scrollbar-gutter: auto; }
  .page-title { padding: 24px 16px 16px; }
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 16px 16px;
    gap: 8px;
  }
  .work-card-info { padding: 10px 0 20px; }
  .text-page { padding-left: 16px; padding-right: 16px; }
  .text-page h1 { margin: 32px 0 24px; }

  .product-layout { height: auto; margin-top: 52px; overflow: visible; }
  .product-sidebar {
    position: relative;
    top: 0;
    width: 100%;
    height: auto;
    padding: 24px 16px;
    background: rgba(255,255,255,0.95);
  }
  .product-images {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    height: auto;
    overflow-y: visible;
    overflow-x: hidden;
    padding: 16px;
    gap: 16px;
  }
  .product-images img { width: 90%; }
  #overlay-img {
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }
  .product-nav-prev,
  .product-nav-next { opacity: 0.4; }
  #overlay-info { bottom: 16px; }
}
