/* Alessandro Casagli — portfolio
   Restrained gallery-white frame so the photography carries the color. */

:root {
  --ink: #111111;
  --muted: #8a8a8a;
  --hairline: #e8e8e8;
  --bg: #ffffff;
  --sidebar-w: 250px;
  --gap: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  padding: 44px 32px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.content { flex: 1; padding: 44px 40px 80px; min-width: 0; }

/* ---------- Brand + nav ---------- */
.brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.28em;
  line-height: 1.45;
  text-transform: uppercase;
}

.nav { margin-top: 40px; display: flex; flex-direction: column; gap: 14px; }
.nav a {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
  width: fit-content;
}
.nav a:hover, .nav a.active { color: var(--ink); }

.sidebar-foot { font-size: 11px; color: var(--muted); line-height: 1.7; }
.sidebar-foot .social { display: flex; gap: 12px; margin-bottom: 14px; font-size: 15px; }
.sidebar-foot .social a { color: var(--muted); transition: color 0.2s; }
.sidebar-foot .social a:hover { color: var(--ink); }

/* ---------- Gallery (masonry via columns) ---------- */
.gallery { columns: 3; column-gap: var(--gap); }

@media (max-width: 1100px) { .gallery { columns: 2; } }

.gallery figure {
  break-inside: avoid;
  margin: 0 0 var(--gap);
  background: #f3f3f3;
  cursor: zoom-in;
  overflow: hidden;
}
.gallery img,
.lightbox img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none; /* disables iOS long-press save menu */
}
.gallery img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.4s ease, transform 0.6s ease;
}
.gallery figure:hover img { transform: scale(1.02); }

/* graceful placeholder when an image file is missing */
.gallery figure.placeholder {
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery figure.placeholder span {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #bdbdbd;
}

/* ---------- Info page ---------- */
.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  max-width: 1000px;
}
.info-portrait { background: #f3f3f3; }
.info-portrait img { display: block; width: 100%; height: auto; }
.info-portrait .credit { font-size: 11px; color: var(--muted); margin-top: 10px; font-style: italic; }

.info-body h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin-bottom: 22px;
}
.info-body p { font-size: 15px; color: #2a2a2a; margin-bottom: 18px; max-width: 46ch; }

.contact { margin-top: 64px; }
.contact h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin-bottom: 18px;
}
.contact .lines { font-size: 15px; color: #2a2a2a; line-height: 2; }

/* ---------- Genre page heads (Headshots, Street, etc.) ---------- */
.page-head { max-width: 760px; margin-bottom: 40px; }
.page-head h1 {
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: 26px;
}
.page-head .tagline {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.page-head p { font-size: 15px; color: #2a2a2a; margin-bottom: 16px; }
.page-head p:last-child { margin-bottom: 0; }

/* ---------- Services pages (Digitech, Photo Assistant) ---------- */
.prose { max-width: 820px; }
.prose .display {
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
}
.prose .sub { font-size: 15px; color: var(--muted); margin-bottom: 28px; }
.prose .banner {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 8px 0 36px;
}
.prose h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.prose p { font-size: 15px; color: #2a2a2a; margin-bottom: 16px; }
.prose ul { list-style: none; }
.prose li { font-size: 15px; color: #2a2a2a; padding-left: 16px; position: relative; margin-bottom: 8px; }
.prose li::before { content: "·"; position: absolute; left: 0; color: var(--muted); }
.prose li ul { margin: 8px 0 8px 8px; }

.service-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  margin-top: 8px;
}
.service-lead { display: flex; gap: 48px; align-items: flex-start; margin-bottom: 44px; }
.service-lead .figure { flex: 0 0 44%; background: #f3f3f3; }
.service-lead .figure img { display: block; width: 100%; height: auto; }
.service-lead .figure.placeholder {
  aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center;
}
.service-lead .figure.placeholder span {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: #bdbdbd;
}

/* Email shown to humans, awkward for naive scrapers: source is reversed and
   flipped back with CSS, with a display:none decoy breaking the raw string. */
.email-obf { unicode-bidi: bidi-override; direction: rtl; }

@media (max-width: 760px) {
  .service-cols { grid-template-columns: 1fr; gap: 32px; }
  .service-lead { flex-direction: column; gap: 24px; }
  .service-lead .figure { width: 100%; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.87);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92%; max-height: 92%; object-fit: contain;
}
.lightbox .lb-close {
  position: absolute; top: 24px; right: 32px;
  font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
}
/* Injected prev/next arrows */
.lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 48px; line-height: 1; color: var(--muted);
  padding: 16px 20px; transition: color 0.2s ease;
  -webkit-user-select: none; user-select: none;
}
.lightbox .lb-nav:hover { color: var(--ink, #111); }
.lightbox .lb-prev { left: 8px; }
.lightbox .lb-next { right: 8px; }
@media (max-width: 760px) {
  .lightbox .lb-nav { font-size: 36px; padding: 12px; } /* swipe is primary on mobile */
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; justify-content: space-between; align-items: flex-start;
    padding: 28px 22px;
  }
  .nav { flex-direction: row; gap: 18px; margin-top: 0; align-self: center; }
  .sidebar-foot { display: none; }
  .content { padding: 8px 14px 60px; }
  .gallery { columns: 2; --gap: 10px; }
  .info-grid { grid-template-columns: 1fr; gap: 32px; }
}
