/* ============================================
   Mark Glezin — Artist Portfolio
   ============================================ */

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

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #fff;
  color: #666;
  line-height: 1.7;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  min-height: 100vh;
  position: fixed;
  top: 0; left: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 48px 40px 40px;
  z-index: 100;
  flex-shrink: 0;
}

.site-title {
  font-family: 'Noto Sans', sans-serif;
  font-size: 27px;
  font-weight: 400;
  letter-spacing: 2px;
  color: #1f1f1f;
  margin-bottom: 56px;
  line-height: 1.2;
}
.site-title a { color: inherit; }
.site-title a:hover { color: #6792a2; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-nav a,
.sidebar-nav .nav-label {
  font-family: 'Noto Sans', sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: normal;
  color: #1f1f1f;
  padding: 6px 0;
  transition: color 0.2s;
  display: block;
}
.sidebar-nav a:hover { color: #6792a2; }
.sidebar-nav a.active,
.sidebar-nav .nav-label.active { color: #6792a2; }

.sidebar-nav .nav-gap { height: 20px; }

/* ── Work dropdown sub-nav ── */
.nav-group { display: block; }

.nav-sub {
  display: none;
  flex-direction: column;
  padding: 0 0 4px 14px;
}
/* Show on hover (non-works pages) or when .open class added (works page) */
.nav-group:hover .nav-sub,
.nav-group.open  .nav-sub { display: flex; }

.nav-sub a {
  font-family: 'Noto Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #999;
  padding: 4px 0;
  transition: color 0.2s;
  display: block;
}
.nav-sub a:hover  { color: #6792a2; }
.nav-sub a.active { color: #6792a2; }

/* Mobile overlay sub-links */
.mobile-sub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: -16px 0 8px;
}
.mobile-sub a {
  font-family: 'Noto Sans', sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #aaa;
}
.mobile-sub a:hover,
.mobile-sub a.active { color: #6792a2; }

.sidebar-social {
  display: flex;
  gap: 14px;
  margin-top: auto;
  padding-top: 32px;
}
.sidebar-social a {
  color: #bbb;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}
.sidebar-social a:hover { color: #1f1f1f; }
.sidebar-social svg { width: 16px; height: 16px; fill: currentColor; }

/* ── Mobile top bar (hidden on desktop) ── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  z-index: 200;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.mobile-header .mobile-title {
  font-family: 'Noto Sans', sans-serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 2px;
  color: #1f1f1f;
}
.mobile-header .mobile-title a { color: inherit; }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #1f1f1f;
}

/* ── Mobile Nav Overlay ── */
.mobile-nav {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}
.mobile-nav.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.mobile-nav a,
.mobile-nav .nav-label {
  font-family: 'Noto Sans', sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #1f1f1f;
}
.mobile-nav a:hover,
.mobile-nav a.active,
.mobile-nav .nav-label.active { color: #6792a2; }
.mobile-nav .close-btn {
  position: absolute;
  top: 16px; right: 20px;
  font-size: 32px;
  cursor: pointer;
  color: #1f1f1f;
  background: none;
  border: none;
  line-height: 1;
}

/* ── Main content wrapper ── */
.main {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  padding: 48px 80px 60px 30px;
}

/* ── HOME — Hero ── */
.hero {
  width: 100%;
}
.hero img {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 96px);
  object-fit: contain;
  display: block;
}

/* ── WORKS — Gallery ── */
/* 3 equal-width masonry columns; images keep natural aspect ratio,
   each image sits directly below the previous one in its column. */
.gallery-grid {
  display: flex;
  gap: 4px;
  padding: 0;
}

.gallery-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;        /* allow columns to shrink below content size */
}

.gallery-item {
  cursor: pointer;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  background: #f5f5f5;
}

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 500;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.lightbox.open { display: flex; }

.lightbox-img-wrap {
  position: relative;
  max-width: min(90vw, calc(100vw - 260px));
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  opacity: 1;
  transition: opacity 0.25s ease;
}
.lightbox-img-wrap img.fading { opacity: 0; }

/* Subtle spinner shown while next image loads */
.lightbox-img-wrap .lb-spinner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.6);
  border-radius: 50%;
  animation: lb-spin 0.7s linear infinite;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.lightbox-img-wrap .lb-spinner.visible { opacity: 1; }
@keyframes lb-spin { to { transform: rotate(360deg); } }

.lightbox-caption {
  color: rgba(255,255,255,0.7);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  margin-top: 14px;
  text-align: center;
  transition: opacity 0.25s ease;
}
.lightbox-caption.fading { opacity: 0; }

.lightbox-close {
  position: fixed;
  top: 18px; right: 24px;
  color: rgba(255,255,255,0.7);
  font-size: 34px;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  transition: color 0.2s;
}
.lightbox-close:hover { color: #fff; }

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 44px;
  cursor: pointer;
  padding: 16px;
  line-height: 1;
  transition: color 0.2s;
  user-select: none;
}
.lightbox-prev:hover,
.lightbox-next:hover { color: #fff; }
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

/* ── ABOUT ── */
.about-page {
  padding: 40px 60px 80px;
  max-width: 900px;
}

.about-photo {
  margin-bottom: 48px;
}
.about-photo img {
  max-height: 520px;
  width: auto;
  max-width: 100%;
  height: auto;
  display: block;
}

.about-text p {
  font-size: 15px;
  line-height: 1.85;
  color: #555;
  margin-bottom: 18px;
  max-width: 700px;
}

.section-label {
  font-family: 'Noto Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1f1f1f;
  margin: 40px 0 14px;
}

.cv-list {
  list-style: none;
  font-size: 13.5px;
  color: #666;
  line-height: 2;
  max-width: 700px;
}

.press-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.press-links a {
  font-size: 13px;
  color: #6792a2;
  transition: opacity 0.2s;
}
.press-links a:hover { opacity: 0.7; }

/* ── CONTACT ── */
.contact-page {
  padding: 48px 60px 80px;
  max-width: 600px;
}

.contact-intro {
  font-size: 15px;
  color: #666;
  line-height: 1.85;
  margin-bottom: 40px;
}
.contact-intro a {
  color: #6792a2;
  border-bottom: 1px solid rgba(103,146,162,0.3);
  transition: border-color 0.2s;
}
.contact-intro a:hover { border-color: #6792a2; }

.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaa;
}

.form-group input,
.form-group textarea {
  border: none;
  border-bottom: 1px solid #ddd;
  padding: 10px 0;
  font-family: inherit;
  font-size: 14px;
  color: #333;
  background: transparent;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  width: 100%;
}
.form-group input:focus,
.form-group textarea:focus { border-bottom-color: #6792a2; }
.form-group textarea { min-height: 110px; }

.submit-btn {
  align-self: flex-start;
  background: none;
  border: 1px solid #1f1f1f;
  color: #1f1f1f;
  font-family: 'Noto Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 11px 28px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin-top: 8px;
}
.submit-btn:hover { background: #1f1f1f; color: #fff; }

.form-success {
  display: none;
  background: #f0f7f4;
  border: 1px solid #c3ddd4;
  color: #2d6a55;
  padding: 14px 18px;
  font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  /* Hide desktop sidebar */
  .sidebar { display: none; }

  /* Show mobile top bar */
  .mobile-header { display: flex; }
  .hamburger { display: flex; }

  /* Content takes full width, offset for mobile header */
  .main {
    margin-left: 0;
    padding: 56px 8px 40px;
  }

  .hero img { max-height: none; }

  .gallery-grid { gap: 3px; }
  .gallery-col  { gap: 3px; }

  .about-page { padding: 28px 20px 60px; }
  .contact-page { padding: 28px 20px 60px; }
  .form-row { grid-template-columns: 1fr; }

  .lightbox-prev,
  .lightbox-next { display: none; }
  .lightbox-img-wrap { max-width: 96vw; }
}
