/* Layout and look modelled on the old Adobe Portfolio site (lhr.myportfolio.com). */
:root {
  /* Rosario: the closest free match to Adobe's Freight Neo Pro. Weight 350 for text,
     SemiBold (600) for the name and headings, like Freight Neo Book / Semibold. */
  --font: "Rosario", "Helvetica Neue", Arial, sans-serif;
  --text: #222;
  --muted: #999;
  --accent: #012b55;         /* "You may also like", phone menu button */
  --border: #dde1e7;
  --bg: #fff;
  --gap: 8px;                /* space between album photos */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  animation: page-in .25s ease-in both;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 350;
  font-size-adjust: 0.48;  /* scale Rosario to Freight Neo's letter size and width */
  font-size: 16px;
  line-height: 1.4;
}
a { color: inherit; text-decoration: none; }

/* Page transitions, as on Adobe: fade in on load, fade out when following a link. */
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes page-out { from { opacity: 1; } to { opacity: 0; } }
body.page-leaving { animation: page-out .25s ease-out both; }
@media (prefers-reduced-motion: reduce) { body, body.page-leaving { animation: none; } }
img { display: block; max-width: 100%; height: auto; }

.site {
  /* Same proportions as Adobe: 92% of the window (4% margin each side), at most 1656px;
     sidebar gets 25% of that, photos 75%. */
  display: flex;
  align-items: flex-start;
  width: 92%;
  max-width: 1656px;
  min-height: 100vh;
  margin: 0 auto;
}

/* ---------- sidebar ---------- */
.sidebar {
  flex: 0 0 25%;
  min-width: 0;
  padding: 48px 24px 40px 0;
}
.logo { display: block; font-size: 26px; font-weight: 600; line-height: 34px; margin-bottom: 37px; }
.sidebar nav { display: flex; flex-direction: column; align-items: flex-start; }
.nav-heading { font-size: 17px; font-weight: 600; color: var(--muted); line-height: 22px; transition: color .2s; }
.nav-heading.active, .nav-heading:hover { color: var(--text); }
.sidebar ul { list-style: none; margin: 13px 0 14px; padding: 0; }
.sidebar li a { display: block; color: var(--muted); line-height: 21px; margin-bottom: 8px; transition: color .2s; }
.sidebar li a:hover { color: var(--text); }
.sidebar li a.active { color: var(--text); font-weight: 600; }
.sidebar .social { margin-top: 30px; }
.menu-toggle { display: none; }

.social { display: flex; gap: 18px; align-items: center; }
.social a { opacity: .9; transition: opacity .2s; }
.social a:hover { opacity: .5; }

/* ---------- main ---------- */
main { flex: 0 0 75%; min-width: 0; }

.covers { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35vw .5%; }
.cover { position: relative; display: block; overflow: hidden; background: #f3f3f3; }
.cover img { width: 100%; aspect-ratio: 1200 / 676; object-fit: cover; }
.cover-hover { position: absolute; inset: 0; opacity: 0; }  /* swaps instantly, as on Adobe */
.cover:hover .cover-hover, .cover:focus-visible .cover-hover { opacity: 1; }
/* Album name on a white band over the cover while the mouse is over it (as on Adobe). */
.cover-title {
  position: absolute; inset: 8.6% 0; display: flex; align-items: center; justify-content: center;
  padding: 0 18px; text-align: center; background: rgba(255, 255, 255, .9);
  color: var(--text); font-size: 26px; font-weight: 600; line-height: 33px;
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
/* Under the band, a white wash fades the whole photo, including the strips above and below it. */
.cover::after {
  content: ""; position: absolute; inset: 0; z-index: 1; background: #fff;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.cover-title { z-index: 2; }
@media (hover: hover) {
  .cover:hover .cover-title { opacity: 1; }
  .cover:hover::after { opacity: .85; }
}
.cover:focus-visible .cover-title { opacity: 1; }
.cover:focus-visible::after { opacity: .85; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.gallery a { display: block; overflow: hidden; background: #f3f3f3; cursor: zoom-in; }
.gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }  /* no hover effect, just the zoom cursor (as on Adobe) */
/* Set by site.js: rows of uncropped photos sharing one height, like Adobe Portfolio. */
.gallery.justified { display: flex; flex-wrap: wrap; }
.gallery.justified a { flex: none; }
.gallery.justified img { height: 100%; aspect-ratio: auto; }

.more { margin-top: 77px; }
.more h3 { margin: 0 0 39px; text-align: center; color: var(--accent); font-size: 24px; font-weight: 700; line-height: 24px; }
.main-covers { margin-top: 3px; }

footer { min-height: 172px; }

.empty { color: var(--muted); padding: 60px 0; }
.empty code { background: #f4f4f4; padding: 1px 5px; border-radius: 3px; font-size: 14px; }

/* ---------- back to top ---------- */
.back-to-top {
  position: fixed; right: 40px; bottom: 40px; width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 5px; background: rgba(0, 0, 0, .05); cursor: pointer;
}
.back-to-top svg { width: 20px; height: 20px; fill: var(--muted); }

/* ---------- full-screen viewer (as on Adobe Portfolio) ---------- */
html.lb-lock, html.lb-lock body { overflow: hidden; }
.lb {
  position: fixed; inset: 0; z-index: 1000; background: rgba(255, 255, 255, .94);
  visibility: hidden;  /* opens and closes instantly; only the photo fades in (as on Adobe) */
}
.lb.lb-open { visibility: visible; }
.lb-stage { position: absolute; inset: 0; }
.lb-img {
  position: absolute; inset: 0; margin: auto;
  max-width: 100vw; max-height: 100vh; max-height: 100dvh;
  opacity: 0; transition: opacity .4s; user-select: none; -webkit-user-select: none;
}
.lb-img.lb-visible { opacity: 1; }
.lb button {
  position: absolute; z-index: 1; padding: 0; border: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lb button:focus { outline: none; }
.lb button:focus-visible svg { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 50%; }
/* Arrows: invisible hover zones over the left/right 30% of the screen, each with a round button. */
.lb-prev, .lb-next { top: 0; width: 30vw; height: 100%; opacity: 0; }
.lb-prev { left: 0; }
.lb-next { right: 0; }
.lb-prev svg, .lb-next svg { position: absolute; top: calc(50% - 30px); }
.lb-prev svg { left: 20px; }
.lb-next svg { right: 20px; }
.lb-icon-bg { fill: #696969; opacity: .2; }
.lb svg:hover .lb-icon-bg { opacity: .4; }
.lb-icon { fill: #fff; }
.lb-close { top: 20px; right: 20px; width: 40px; height: 40px; }
.lb-close svg { display: block; width: 40px; height: 40px; }
.lb-close .lb-icon-bg { fill: #fff; }
.lb-close polygon { fill: #000; }
@media (hover: hover) and (min-width: 1025px) {
  .lb-prev:hover, .lb-next:hover, .lb-prev:focus-visible, .lb-next:focus-visible { opacity: 1; }
}
/* No mouse movement for a while: controls fade out (the arrows can't be shown by hovering either). */
.lb.lb-idle .lb-close, .lb.lb-idle .lb-prev, .lb.lb-idle .lb-next { opacity: 0; transition: opacity 1s; }
@media (max-width: 1024px) {
  .lb-close { top: 0; right: 0; }
  .lb-close circle { display: none; }
}

/* ---------- smaller screens ---------- */
/* Tablets and phones (up to 932px, Adobe's breakpoint): header bar with a menu button,
   photos edge to edge, menu as a full-screen overlay. */
@media (max-width: 932px) {
  .site { display: block; width: auto; }
  .sidebar, main { flex: none; }
  .sidebar {
    display: flex; align-items: center; justify-content: space-between;
    height: 110px; padding: 0 5%;
  }
  .logo { font-size: 26px; line-height: 1.2; margin: 0; }  /* hidden under the open menu, as on Adobe */
  .menu-toggle {
    position: relative; z-index: 21;
    display: flex; flex-direction: column; justify-content: space-between;
    width: 24px; height: 14px; padding: 0; border: 0; background: none; cursor: pointer;
  }
  .menu-toggle::before { content: ""; position: absolute; inset: -30px -14px; } /* bigger tap area */
  .menu-toggle span { display: block; height: 2px; background: var(--accent); transition: transform .25s, opacity .25s; }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .sidebar nav {
    position: fixed; inset: 0; z-index: 20; background: var(--bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .2s;
  }
  .sidebar.open nav { opacity: 1; visibility: visible; transition: opacity .2s; }
  .nav-heading, .sidebar li a { font-size: 22px; line-height: 29px; }
  .sidebar ul { margin: 33px 0; text-align: center; }
  .sidebar li a { margin-bottom: 33px; }
  .sidebar li:last-child a { margin-bottom: 0; }
  .main-covers { margin-top: 0; }
  .covers { gap: 0 4px; }
  .cover img { aspect-ratio: 382 / 223; }
  .more { margin-top: 51px; }
  .more h3 { padding: 0 5%; margin-bottom: 20px; font-size: 18px; line-height: 18px; }
  footer { min-height: 102px; }
  .empty { padding: 60px 5%; }
  .back-to-top { display: none; }
}

/* Phones (up to 540px): smaller header, one column of covers, one related album. */
@media (max-width: 540px) {
  .sidebar { height: 82px; }
  .logo { font-size: 22px; }
  .covers { grid-template-columns: 1fr; gap: 0; }
  .cover img { aspect-ratio: 375 / 218.5; }
  .more h3 { margin-bottom: 18px; font-size: 15px; line-height: 15px; }
  .more .cover:nth-child(n + 2) { display: none; }
  footer { min-height: 92px; }
}
