/* 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; transition: opacity .3s; }
.cover-hover { position: absolute; inset: 0; opacity: 0; transition: opacity .4s; }
.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;
}
@media (hover: hover) {
  .cover:hover .cover-title { opacity: 1; }
}
.cover:focus-visible .cover-title { opacity: 1; }

.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; transition: opacity .3s, transform .6s; }
.gallery a:hover img { opacity: .88; }
/* 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); color: var(--muted); cursor: pointer;
  transition: color .2s;
}
.back-to-top:hover { color: var(--text); }

/* ---------- lightbox (PhotoSwipe) on white, like the original ---------- */
.pswp {
  --pswp-bg: #fff;
  --pswp-placeholder-bg: #f3f3f3;
  --pswp-icon-color: #444;
  --pswp-icon-color-secondary: #fff;
  --pswp-icon-stroke-color: #fff;
  --pswp-icon-stroke-width: 1px;
  --pswp-preloader-color: rgba(0, 0, 0, .2);
}
.pswp__button { transition: opacity .3s; }
.pswp--idle .pswp__button { opacity: 0; }

/* ---------- 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 { position: relative; z-index: 21; font-size: 26px; line-height: 1.2; margin: 0; }
  .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 .25s, visibility .25s;
  }
  .sidebar.open nav { opacity: 1; visibility: visible; }
  .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; }
}
