/* === Luigi Visconti Photography — replica === */

@import url('https://fonts.googleapis.com/css2?family=Quattrocento+Sans:ital,wght@0,400;0,700;1,400;1,700&family=Lato:ital,wght@0,300;0,400;0,700;1,300;1,400&display=swap');

:root {
  --sidebar-w: 25vw;
  --content-pad: 160px;
  --sidebar-pad-left: 96px;
  --page-pad-left: 80px;
  --gap: 10px;
  --ink: #555;
  --ink-strong: #2b2b2b;
  --ink-muted: #9a9a9a;
  --link: #555;
  --link-hover: #2b2b2b;
  --bg: #ffffff;
  --row-h: 210px;
  --font-display: 'Optima', 'Optima Nova LT', 'Quattrocento Sans', 'Helvetica Neue', Helvetica, sans-serif;
  --font-body: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Cross-document View Transitions (Chrome/Edge) */
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: vt-fade-out 420ms cubic-bezier(.4, 0, .2, 1) both;
}
::view-transition-new(root) {
  animation: vt-fade-in 520ms cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes vt-fade-out {
  to { opacity: 0; }
}
@keyframes vt-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Fallback fade-in on page load (Firefox/Safari) */
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main, .page {
  animation: page-fade-in 520ms cubic-bezier(.4, 0, .2, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  main, .page { animation: none; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 180ms ease;
}
a:hover { color: var(--link-hover); }
a:focus-visible { outline: 1px dotted #888; outline-offset: 2px; }

img { display: block; max-width: 100%; height: auto; }

/* === Sidebar === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  padding: 56px 28px 40px var(--sidebar-pad-left);
  background: var(--bg);
  z-index: 10;
  overflow-y: auto;
}

.logo {
  font-family: var(--font-display);
  font-weight: 300;
  color: var(--ink-muted);
  margin: 0 0 56px 0;
  white-space: nowrap;
  line-height: 1.5;
}
.logo a {
  color: var(--ink-muted);
  display: inline-block;
}
.logo .logo-name {
  display: block;
  font-family: var(--font-display);
  letter-spacing: 0.22em;
  font-size: 26px;
  color: #8d8d8d;
  font-weight: 400;
}
.logo .logo-sub {
  display: block;
  font-family: var(--font-display);
  letter-spacing: 0.36em;
  font-size: 18px;
  color: #b8b8b8;
  margin-top: 4px;
  font-weight: 300;
}
.logo .logo-img {
  display: block;
  width: 160px;
  height: 160px;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  object-fit: contain;
  animation: logo-fade-in 2000ms cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes logo-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .logo .logo-img { animation: none; }
}

nav.main-nav { margin-bottom: 36px; }
nav.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
nav.main-nav > ul > li {
  margin-bottom: 4px;
}

nav.main-nav .group-label {
  font-weight: 400;
  color: var(--ink-strong);
  font-size: 21px;
  letter-spacing: 0.02em;
  margin-bottom: 9px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
nav.main-nav .group-label.active { color: #1a1a1a; font-weight: 600; }
nav.main-nav .group-label::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform 600ms cubic-bezier(.2,.8,.2,1);
}
nav.main-nav .group-label[aria-expanded="true"]::after {
  transform: translateY(2px) rotate(-135deg);
}

.subnav {
  list-style: none;
  margin: 0 0 0 0;
  padding: 0 0 0 48px;
}
.subnav li {
  margin: 1px 0;
}
.subnav a {
  font-size: 19.5px;
  color: #8a8a8a;
  font-weight: 300;
  letter-spacing: 0.01em;
}
.subnav a:hover { color: #1a1a1a; }
.subnav li.active > a {
  color: #1a1a1a;
  font-weight: 600;
}

.secondary-nav {
  margin-top: 28px;
  list-style: none;
  padding: 0;
}
.secondary-nav li { margin: 2px 0; }
.secondary-nav a {
  font-size: 21px;
  color: #8a8a8a;
  font-weight: 300;
}
.secondary-nav a:hover { color: #1a1a1a; }
.secondary-nav li.active > a {
  color: #1a1a1a;
  font-weight: 600;
}

/* === Page wrapper === */
.page {
  margin-left: var(--sidebar-w);
  padding: 56px var(--content-pad) 80px var(--page-pad-left);
  min-height: 100vh;
}

/* === Gallery (Fit layout) === */
.gallery {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  width: 100%;
}
.gallery .row {
  display: flex;
  gap: var(--gap);
  width: 100%;
  justify-content: center;
}
.gallery .row .item {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  height: var(--row-h);
}
.gallery .row .item {
  cursor: zoom-in;
}
.gallery .row .item img {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(.2,.8,.2,1), opacity 400ms ease;
  will-change: transform;
}
.gallery .row .item:hover img {
  transform: scale(1.05);
}

/* === Gallery (3-column masonry variant) === */
.gallery.gallery-cols {
  display: block;
  column-count: 3;
  column-gap: var(--gap);
}
.gallery.gallery-cols .item {
  display: block;
  position: relative;
  overflow: hidden;
  margin: 0 0 var(--gap) 0;
  break-inside: avoid;
  cursor: zoom-in;
}
.gallery.gallery-cols .item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 700ms cubic-bezier(.2,.8,.2,1), opacity 400ms ease;
  will-change: transform;
}
.gallery.gallery-cols .item:hover img {
  transform: scale(1.05);
}

/* === Lightbox === */
.lightbox {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--sidebar-w);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1000ms cubic-bezier(.2,.8,.2,1), visibility 0s linear 1000ms;
  cursor: zoom-out;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 1000ms cubic-bezier(.2,.8,.2,1), visibility 0s linear 0s;
}
.lightbox.is-open .lb-stage {
  transform: scale(1);
  opacity: 1;
}
.lightbox .lb-stage {
  width: 80%;
  height: 80%;
  max-width: calc((100vw - var(--sidebar-w)) * 0.8);
  max-height: 80vh;
  background: #ffffff;
  border-radius: 2px;
  box-shadow:
    0 28px 60px -10px rgba(0, 0, 0, 0.28),
    0 12px 28px -8px rgba(0, 0, 0, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.06);
  position: relative;
  cursor: default;
  padding: 28px;
  box-sizing: border-box;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 1000ms cubic-bezier(.2,.8,.2,1), transform 1000ms cubic-bezier(.2,.8,.2,1);
}
.lightbox .lb-stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: calc(100% - 56px);
  max-height: calc(100% - 56px);
  width: auto;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  transition: opacity 1200ms cubic-bezier(.4,0,.2,1);
}
.lightbox .lb-stage img.is-active { opacity: 1; }
.lightbox .lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 28px;
  font-weight: 300;
  width: 56px;
  height: 56px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 180ms ease, transform 180ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.lightbox .lb-btn:hover { opacity: 1; }
.lightbox .lb-prev { left: 12px; }
.lightbox .lb-next { right: 12px; }
.lightbox .lb-close {
  top: 18px;
  right: 18px;
  transform: none;
  font-size: 22px;
  width: 44px;
  height: 44px;
}
.lightbox .lb-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #9a9a9a;
  font-size: 12px;
  letter-spacing: 0.16em;
  font-weight: 300;
  user-select: none;
}
.lightbox .lb-caption {
  position: absolute;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  color: #4a4a4a;
  font-size: 13px;
  letter-spacing: 0.04em;
  font-weight: 300;
  font-style: italic;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.lb-locked { overflow: hidden; }

@media (max-width: 900px) {
  .lightbox { left: 0; }
  .lightbox .lb-stage,
  .lightbox img { max-width: 96vw; }
}

/* === Text pages (About / Exhibitions / Contact) === */
.content-narrow {
  max-width: 860px;
}
.content-narrow h2 {
  font-family: var(--font-body);
  font-weight: 400;
  font-style: italic;
  font-size: 20px;
  color: #1a1a1a;
  letter-spacing: 0.01em;
  margin: 32px 0 12px 0;
}
.content-narrow p {
  margin: 0 0 16px 0;
  color: #4a4a4a;
  font-size: 16px;
  line-height: 1.7;
}
.content-narrow a { color: #2b6cb0; border-bottom: 0; font-weight: 700; }
.content-narrow a:hover { color: #1a4a85; }

.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 60px;
  align-items: start;
  max-width: 1100px;
}
.about-grid .portrait {
  width: 100%;
  height: auto;
}
.about-grid .portrait img {
  width: 100%;
  height: auto;
  display: block;
}
.about-grid .portrait img + img {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
}
.about-grid .content-narrow h2:first-of-type {
  margin-top: 0;
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 400;
  font-size: 34px;
  letter-spacing: 0.18em;
  color: #4a4a4a;
  text-transform: uppercase;
  margin-bottom: 28px;
}

/* === Exhibitions (multi-column) === */
.exhibitions h1 {
  font-weight: 400;
  font-size: 28px;
  color: #1a1a1a;
  letter-spacing: 0.02em;
  margin: 0 0 36px 0;
}
.exhibitions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 40px;
  align-items: start;
}
.exh-col { display: flex; flex-direction: column; gap: 30px; }
.year-divider {
  font-size: 19px;
  color: #000000;
  letter-spacing: 0.04em;
  text-align: left;
  margin: 12px 0;
}
.exh {
  font-size: 15px;
  line-height: 1.6;
}
.exh .gallery-name {
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: #1f1f1f;
  font-size: 14px;
}
.exh .show-title {
  display: block;
  font-style: italic;
  color: #2b2b2b;
  margin-top: 2px;
  font-size: 15px;
}
.exh .city {
  display: block;
  color: #8a8a8a;
  font-size: 14px;
  margin-top: 2px;
}

/* === Contact === */
.contact h1 {
  font-weight: 600;
  font-size: 20px;
  color: #1a1a1a;
  letter-spacing: 0.01em;
  margin: 0 0 24px 0;
}
.contact .info p { margin: 8px 0; font-size: 16px; line-height: 1.7; }
.contact .info strong { font-weight: 400; color: #1a1a1a; }

.newsletter {
  max-width: 980px;
  margin-top: 32px;
}
.newsletter label {
  display: block;
  font-size: 16px;
  color: #1a1a1a;
  margin-bottom: 10px;
}
.newsletter label .req {
  color: #b8b8b8;
  margin-left: 4px;
  font-size: 15px;
}
.newsletter input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d8d8d8;
  background: #fbfbfb;
  font-family: inherit;
  font-size: 16px;
  color: #2b2b2b;
  outline: none;
  transition: border-color 150ms ease, background 150ms ease;
}
.newsletter input[type="email"]:focus {
  border-color: #888;
  background: #fff;
}
.newsletter button {
  margin-top: 22px;
  background: #b683d0;
  color: #fff;
  border: 0;
  padding: 16px 40px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}
.newsletter button:hover { background: #a26ec1; }
.newsletter button:active { transform: translateY(1px); }

/* === Page title (for project pages) === */
.page-title {
  font-weight: 400;
  font-size: 20px;
  color: #1a1a1a;
  letter-spacing: 0.04em;
  margin: 0 0 24px 0;
}

/* === Responsive === */
@media (max-width: 900px) {
  :root { --sidebar-w: 100%; --content-pad: 24px; }
  .sidebar {
    position: relative;
    height: auto;
    padding: 32px 24px;
    border-bottom: 1px solid #eee;
  }
  .page {
    margin-left: 0;
    padding: 32px 24px 60px;
  }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .exhibitions-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 24px; }
}
@media (max-width: 520px) {
  .exhibitions-grid { grid-template-columns: 1fr; }
}
