/* ── FONTS ──────────────────────────────────── */
@font-face {
  font-family: "Helvetica Neue";
  src: url("../assets/fonts/HelveticaNeueLight.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
}
@font-face {
  font-family: "Helvetica Neue";
  src: url("../assets/fonts/HelveticaNeueRoman.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "Helvetica Neue";
  src: url("../assets/fonts/HelveticaNeueBold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
}

/* ── RESET ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }
ul, ol, li { list-style-type: none; }
a { outline: none; text-decoration: none; cursor: pointer; color: #000000; }
a:hover { color: #999999 !important; }
h1, h2, h3, p, a { margin: 0; padding: 0; }

/* ── TYPOGRAPHY & BASE ──────────────────────── */
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 27px;
  line-height: 33px;
  background: #ffffff;
  color: #000000;
}
h1, h2, h3 {
  font-size: 27px;
  line-height: 33px;
  font-weight: 300;
}
p {
  font-size: 27px;
  line-height: 33px;
  font-weight: 300;
}
hr {
  height: 1px;
  background: #999999;
  border: 0;
  margin: 0; padding: 0;
}
.meta {
  font-size: 19px;
  line-height: 22px;
  color: #999999;
}

/* ── MENUBLOCK (fixed top-left, all pages) ──── */
#menublock {
  position: fixed;
  left: 0; top: 0;
  z-index: 9989;
}
#menublock-margin {
  margin: 22px;
  margin-top: 19px;
}
#menublock h1 {
  font-size: 35px;
  line-height: 43px;
  font-weight: 300;
}
#menublock h1 a { font-size: inherit; color: #000000; }
#menublock h1 a:hover { color: #999999; }
.site-role { color: #999999; font-size: 35px; line-height: 43px; font-weight: 300; }

/* Landing page: white text over gallery image; black when nav is open */
.body-landing #menublock h1 a { color: #ffffff; transition: color 0.4s ease; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.body-landing #menublock h1 a:hover { color: rgba(255,255,255,0.6); }
.body-landing #menublock .site-role { color: rgba(255,255,255,0.85); transition: color 0.4s ease; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.body-landing #menublock.nav-open h1 a { color: #000000; text-shadow: none; }
.body-landing #menublock.nav-open h1 a:hover { color: #999999; }
.body-landing #menublock.nav-open .site-role { color: #999999; text-shadow: none; }
#menublock .nav {
  margin-top: 33px;
}
#menublock .nav a {
  color: #999999;
  display: block;
  line-height: 33px;
}
#menublock .nav a:hover { color: #000000 !important; }
#menublock .nav li.li-active a { color: #000000; }

/* Search input */
#menublock .search-wrap {
  margin-top: 33px;
}
#menublock #proj-search {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 27px;
  line-height: 33px;
  color: #999999;
  background: transparent;
  border: none;
  border-bottom: 1px solid #d0d0d0;
  outline: none;
  width: 165px;
  padding: 0;
  display: block;
}
#menublock #proj-search::placeholder { color: #999999; }
#menublock #proj-search:focus { color: #000000; border-bottom-color: #000000; }
.project-index a.hidden { display: none; }

/* Back link — shown on project pages only (class added via body data-page) */
.nav-back {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 33px;
  font-size: 27px;
  line-height: 33px;
  color: #999999;
}
.nav-back::before {
  content: '';
  display: block;
  width: 27px;
  height: 18px;
  background: url("../assets/ui/arrow-prev.png") no-repeat center;
  background-size: contain;
  flex-shrink: 0;
}
.nav-back:hover { color: #000000 !important; }

/* ── MAIN WRAP ──────────────────────────────── */
#wrap {
  padding: 22px;
  padding-top: 22px;
  min-width: 760px;
}

/* ── HOME GALLERY ───────────────────────────── */
#home-gallery {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #d8d8d8;
}
#home-gallery::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, rgba(0,0,0,0.28) 0%, transparent 30%);
  z-index: 3;
  pointer-events: none;
}
#home-gallery img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top;
  transition: opacity 1.2s ease;
}
#hg-a { opacity: 1; z-index: 1; }
#hg-b { opacity: 0; z-index: 2; }
.hg-hidden { opacity: 0 !important; pointer-events: none; }
#home-gallery { transition: opacity 0.5s ease; }

/* ── NAV REVEAL (landing page) ───────────────── */
#nav-reveal {
  position: fixed;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 500;
}
#nav-reveal.nav-reveal--on {
  opacity: 1;
  pointer-events: all;
}
.nav-reveal-list {
  position: absolute;
  left: 22px;
  top: 85px;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-top: 33px;
}
.nav-reveal-list a {
  color: #999999;
  font-size: 20px;
  font-weight: 300;
  line-height: 40px;
  text-decoration: none;
  display: block;
}
.nav-reveal-list a:hover { color: #000000; }

/* ── HOME PAGE ──────────────────────────────── */
.home-content {
  float: right;
  width: 537px;
  padding-top: 19px;
}
#wrap.home-wrap::after {
  content: '';
  display: table;
  clear: both;
}

/* Home project listing */
.otherways-label {
  font-size: 19px;
  line-height: 22px;
  font-weight: 300;
  color: #999999;
  padding-top: 33px;
  margin-bottom: 112px;
  border-top: 1px solid #999999;
}
.project-index a {
  display: block;
  margin-bottom: 112px;
  color: #000000;
  overflow: hidden;
}
.project-index a:hover .proj-name { color: #999999; }
.project-fifty-left {
  float: left;
  width: 250px;
}
.project-fifty-right {
  float: right;
  width: 265px;
}
.proj-name {
  display: block;
  font-size: 27px;
  line-height: 33px;
  font-weight: 300;
  color: #000000;
}
.proj-meta {
  font-size: 19px;
  line-height: 22px;
  color: #999999;
  margin-top: 3px;
}
.proj-thumb {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
}
.proj-medium {
  display: block;
  font-size: 19px;
  line-height: 22px;
  font-weight: 300;
  font-style: italic;
  color: #999999;
  padding-top: 3px;
}

/* ── PROJECT PAGE ────────────────────────────── */
.proj-content {
  float: right;
  width: 537px;
  padding-top: 19px;
}
#wrap.proj-wrap::after {
  content: '';
  display: table;
  clear: both;
}

/* Title + meta */
.proj-meta-block {
  margin-top: 33px;
}
.proj-meta-block h2 {
  margin-bottom: 3px;
}

/* Description */
.proj-desc {
  margin-top: 33px;
  max-width: 537px;
  color: #999999;
}
.proj-desc p {
  font-size: 27px;
  line-height: 33px;
  color: #999999;
  margin-bottom: 33px;
}
.proj-desc .proj-credits {
  margin-top: 33px;
  margin-bottom: 0;
  font-size: 19px;
  line-height: 22px;
}

/* Gallery */
.proj-gallery {
  position: relative;
  display: block;
  width: 450px;
}
.gallery-clip {
  position: relative;
  width: 400px;
  overflow: hidden;
  aspect-ratio: 4/3;
}
.proj-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3Ccircle cx='10' cy='10' r='2' fill='%23000'/%3E%3Cline x1='15.5' y1='15.5' x2='21' y2='21' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") 10 10, zoom-in;
}

/* Gallery arrows */
.a-left-btn, .a-right-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  user-select: none;
  padding: 12px;
}
.proj-gallery:hover .a-left-btn,
.proj-gallery:hover .a-right-btn { opacity: 1; }
.a-left-btn { left: -4px; }
.a-right-btn { left: 406px; }
.a-left-btn::after {
  content: '';
  display: block;
  width: 27px; height: 18px;
  background: url("../assets/ui/arrow-prev.png") no-repeat center;
  background-size: contain;
}
.a-right-btn::after {
  content: '';
  display: block;
  width: 27px; height: 18px;
  background: url("../assets/ui/arrow-next.png") no-repeat center;
  background-size: contain;
}

/* Zoom indicator — + symbol centered on image, appears on hover */
.gallery-zoom {
  position: absolute;
  top: 50%; left: 200px;
  transform: translate(-50%, -50%);
  width: 20px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cline x1='10' y1='2' x2='10' y2='18' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3Cline x1='2' y1='10' x2='18' y2='10' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  user-select: none;
}
.proj-gallery:hover .gallery-zoom { opacity: 1; }
.gallery-zoom.lb-disabled { display: none; }

/* Play button overlay — video items only (JS toggles display) */
.gallery-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Ccircle cx='22' cy='22' r='20' fill='none' stroke='%23999' stroke-width='1.5'/%3E%3Cpolygon points='17,14 17,30 33,22' fill='%23999'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: auto;
  user-select: none;
  display: none;
}
.proj-gallery:hover .gallery-play { opacity: 1; }

/* Video container inside lightbox stage */
.lb-video-wrap {
  position: absolute;
  inset: 0;
  display: none;
}
.lb-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── STUDIO PAGE ─────────────────────────────── */
.studio-body {
  display: flex;
  align-items: flex-start;
  gap: 44px;
  margin-left: 187px;
  padding-top: 19px;
}
.studio-photo {
  flex-shrink: 0;
}
.studio-photo img {
  display: block;
  width: 360px;
  height: auto;
}
.studio-bio {
  flex: 1;
}

/* ── CONTACT PAGE ────────────────────────────── */
.contact-body {
  float: right;
  width: 537px;
  padding-top: 19px;
}
#wrap.contact-wrap::after {
  content: '';
  display: table;
  clear: both;
}
.contact-body a { color: #999999; }
.contact-body a:hover { color: #000000 !important; }

/* ── RESPONSIVE — DESKTOP (≥1440px) ─────────── */
@media (min-width: 1440px) {
  body, h1, h2, h3, p, a, li { font-size: 25px; line-height: 37px; }
  #menublock h1 { font-size: 33px; line-height: 48px; }
  #menublock .nav a { line-height: 37px; }
  #menublock #proj-search { font-size: 25px; line-height: 37px; }
  .meta, .proj-meta, .otherways-label, .proj-medium, .proj-desc .proj-credits { font-size: 19px; line-height: 27px; }
  .proj-desc p { font-size: 25px; line-height: 37px; }
  .nav-back { font-size: 25px; }
}

/* ── RESPONSIVE — TABLET (768–1439px) ────────── */
@media (min-width: 768px) and (max-width: 1439px) {
  body, h1, h2, h3, p, a, li { font-size: 17px; line-height: 25px; }
  #menublock h1 { font-size: 22px; line-height: 33px; }
  #menublock .nav a { line-height: 25px; }
  #menublock #proj-search { font-size: 17px; line-height: 25px; }
  .meta, .proj-meta, .otherways-label, .proj-medium, .proj-desc .proj-credits { font-size: 13px; line-height: 19px; }
  .proj-desc p { font-size: 17px; line-height: 25px; }
  .nav-back { font-size: 17px; }

  /* Studio: reduce photo width so bio text isn't squashed at narrow tablet widths */
  .studio-photo img { width: 240px; }

  /* Arrows always visible on touch tablets */
  @media (hover: none) {
    .a-left-btn, .a-right-btn { opacity: 1; }
    .gallery-zoom { display: none; }
    .lb-prev, .lb-next { opacity: 1; }
  }
}

/* ── RESPONSIVE — MOBILE (<768px) ───────────── */
@media (max-width: 767px) {
  /* Font sizes */
  body, h1, h2, h3, p, a, li { font-size: 14px; line-height: 21px; }
  .meta, .proj-meta, .otherways-label, .proj-medium, .proj-desc .proj-credits { font-size: 12px; line-height: 18px; }
  .proj-desc p { font-size: 14px; line-height: 21px; }

  /* Wrap: clear fixed bar, single column, no min-width */
  #wrap {
    padding: 72px 20px 40px;
    min-width: 0;
  }

  /* Menublock → fixed top bar */
  #menublock {
    left: 0; right: 0; top: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e8e8e8;
  }
  #menublock-margin {
    margin: 0;
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 20px;
  }
  #menublock h1 { font-size: 21px; line-height: 1.3; }
  #menublock .site-role { font-size: 21px; line-height: 1.3; }
  .body-landing #menublock h1 a { color: #000000; text-shadow: none; }
  .body-landing #menublock .site-role { color: #999999; text-shadow: none; }
  #menublock .nav {
    margin-top: 0;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
  }
  #menublock .nav a {
    display: inline;
    font-size: 14px;
    line-height: 1.4;
  }
  #menublock .search-wrap {
    width: 100%;
    margin-top: 4px;
  }
  #menublock #proj-search {
    font-size: 14px;
    line-height: 1.4;
    width: 100%;
  }
  .nav-back {
    margin-top: 0;
    font-size: 14px;
  }

  /* Float layout → block */
  .home-content,
  .proj-content,
  .contact-body {
    float: none;
    width: 100%;
    padding-top: 10px;
  }

  /* Home project grid → single column */
  .project-fifty-left,
  .project-fifty-right {
    float: none;
    width: 100%;
  }
  .project-index a { margin-bottom: 60px; }
  .proj-thumb { height: 160px; }

  /* Gallery → full width */
  .proj-gallery { width: 100%; }
  .gallery-clip { width: 100%; }
  .proj-gallery img { width: 100%; height: 100%; }
  /* Right arrow stays outside image — relative right edge */
  .a-right-btn { left: auto; right: -34px; }
  /* Arrows always visible on touch (no hover state on mobile) */
  .a-left-btn, .a-right-btn { opacity: 1; }
  .gallery-zoom { display: none; }
  /* Lightbox nav arrows always visible on touch */
  .lb-prev, .lb-next { opacity: 1; }

  /* Studio → stacked */
  .studio-body {
    flex-direction: column;
    margin-left: 0;
    gap: 24px;
    padding-top: 10px;
  }
  .studio-photo img { width: 100%; }

}

/* ── LIGHTBOX ────────────────────────────────── */
#lightbox {
  display: none;
  position: fixed; inset: 0;
  background: #ffffff;
  z-index: 10000;
}
#lightbox.on { display: flex; }

.lb-stage {
  position: relative;
  flex: 1;
  align-self: stretch;
  overflow: hidden;
}
#lightbox .lb-photo {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: left center;
  display: block;
}
.lb-close {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  right: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none; border: none;
  font: 36px/1 "Helvetica Neue", Helvetica, Arial;
  font-weight: 300;
  color: #333333;
  cursor: pointer;
  padding: 0;
  z-index: 10002;
  transition: color 0.2s;
}
.lb-close:hover { color: #000000; }
.lb-prev, .lb-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: none; border: none;
  display: flex; align-items: center;
  cursor: pointer;
  padding: 16px 24px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10001;
}
.lb-stage:hover .lb-prev,
.lb-stage:hover .lb-next { opacity: 1; }
.lb-prev { left: 0; }
.lb-next { right: 44px; }
.lb-prev::after {
  content: '';
  display: block;
  width: 27px; height: 18px;
  background: url("../assets/ui/arrow-prev.png") no-repeat center;
  background-size: contain;
}
.lb-next::after {
  content: '';
  display: block;
  width: 27px; height: 18px;
  background: url("../assets/ui/arrow-next.png") no-repeat center;
  background-size: contain;
}

/* ── LANGUAGE TOGGLE ─────────────────────────── */
body.lang-it .text-en { display: none; }
body.lang-en .text-it { display: none; }
.lang-toggle {
  margin-top: 33px;
  font-size: 27px;
  line-height: 33px;
  color: #999999;
}
.lang-toggle.hidden { display: none; }
.lt-btn { cursor: pointer; color: #999999; }
.lt-btn:hover { color: #000000; }
body.lang-it .lt-it { color: #000000; }
body.lang-en .lt-en { color: #000000; }

@media (min-width: 1440px) {
  .lang-toggle { font-size: 25px; line-height: 37px; margin-top: 37px; }
}
@media (min-width: 768px) and (max-width: 1439px) {
  .lang-toggle { font-size: 17px; line-height: 25px; margin-top: 25px; }
}
@media (max-width: 767px) {
  .lang-toggle { font-size: 14px; line-height: 1.4; margin-top: 0; }
  .contact-body { float: none; width: 100%; padding-top: 10px; }
  #wrap.contact-wrap { padding-top: 120px; }
}
