/* Marcus Robertson Photography — public site styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@500;600;700&display=swap');

:root {
  --bg: #0f1012;
  --surface: #17181b;
  --line: #2a2b30;
  --text: #f2efe8;
  --muted: #a3a19b;
  --gold: #d4a945;
  --gold-soft: rgba(212, 169, 69, .14);
  --radius: 14px;
  --head: 'Poppins', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  transition: background .3s, padding .3s;
}
.nav.scrolled { background: rgba(15, 16, 18, .9); backdrop-filter: blur(10px); padding-block: .65rem; }
.brand {
  font-family: var(--head); font-weight: 600; text-decoration: none;
  letter-spacing: .02em; font-size: 1.02rem; white-space: nowrap;
}
.brand span { color: var(--gold); }
.nav-links { display: flex; gap: clamp(.9rem, 3vw, 2rem); }
.nav-links a {
  text-decoration: none; font-size: .88rem; font-weight: 500;
  color: rgba(242, 239, 232, .82); padding: .25rem 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); border-bottom-color: var(--gold); }

/* Menu button — phones and small tablets */
.nav-toggle {
  display: none; position: relative; z-index: 2;
  width: 44px; height: 44px; margin-right: -10px; border: none; background: none; cursor: pointer;
}
.nav-toggle span {
  position: absolute; left: 11px; right: 11px; height: 2px; border-radius: 2px; background: var(--text);
  transition: transform .25s, opacity .2s;
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.nav.open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav.open { background: #0f1012; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: #0f1012;
    padding: .25rem clamp(1rem, 4vw, 2.5rem) 1.25rem;
    border-bottom: 1px solid var(--line);
    max-height: calc(100svh - 70px); overflow-y: auto;
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { font-size: 1.05rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--line); }
}

/* ---------- Hero ----------
   The photo is an <img> with object-fit: cover. Its object-position is the
   focal point set in the admin, so every screen shape crops around the subject. */
.hero {
  position: relative; overflow: hidden;
  height: 100vh; height: 100svh;
  min-height: 300px;
  display: flex;
  background: #000;
}
.hero.short { height: 82vh; height: 82svh; }
.hero > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(0,0,0,var(--shade, .55)) 0%, rgba(0,0,0,0) 60%),
    linear-gradient(to bottom, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 22%);
}
.hero-content {
  position: relative; z-index: 2;
  align-self: flex-end;
  width: 100%;
  padding: 0 clamp(1.25rem, 6vw, 5rem) clamp(2.5rem, 9vh, 6rem);
  max-width: 1400px; margin: 0 auto;
}
.hero-content > * { max-width: 40rem; }
.hero[data-align="center"] .hero-content { text-align: center; }
.hero[data-align="center"] .hero-content > * { margin-inline: auto; }
.hero[data-align="right"] .hero-content { text-align: right; }
.hero[data-align="right"] .hero-content > * { margin-left: auto; }

.eyebrow {
  display: inline-block;
  font-size: .74rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .8rem;
}
.hero h1, .hero h2 {
  font-family: var(--head); font-weight: 700;
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 1.05; margin: 0 0 .9rem;
  text-shadow: 0 2px 24px rgba(0,0,0,.35);
}
.hero p { font-size: clamp(1rem, 1.6vw, 1.2rem); color: rgba(242,239,232,.88); margin: 0 0 1.6rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--gold); color: #17140c;
  font-weight: 600; font-size: .92rem; text-decoration: none;
  padding: .8rem 1.4rem; border-radius: 999px;
  transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); background: #e2b955; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid rgba(242,239,232,.45); }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold); }

.scroll-cue {
  position: absolute; z-index: 3; left: 50%; bottom: 1.1rem; transform: translateX(-50%);
  width: 26px; height: 40px; border: 2px solid rgba(242,239,232,.55); border-radius: 14px;
}
.scroll-cue::after {
  content: ''; position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px;
  background: var(--gold); border-radius: 2px; animation: cue 1.8s infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* Short, wide screens (phones in landscape): tighten the text so the photo stays the star */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-content { padding-bottom: 1.5rem; }
  .hero h1, .hero h2 { font-size: clamp(1.5rem, 4.5vw, 2.4rem); margin-bottom: .5rem; }
  .hero p { display: none; }
  .eyebrow { margin-bottom: .35rem; }
  .btn { padding: .55rem 1.1rem; }
  .scroll-cue { display: none; }
}

/* ---------- Album section (portfolio) ---------- */
.album {
  max-width: 1400px; margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 5vw, 4rem);
}
.album-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1rem 2rem; margin-bottom: 1.75rem;
}
.album-head h2 {
  font-family: var(--head); font-weight: 600;
  font-size: clamp(1.5rem, 3.2vw, 2.3rem); line-height: 1.15; margin: .2rem 0 .4rem;
}
.album-meta { color: var(--gold); font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.album-desc { color: var(--muted); max-width: 46rem; margin: 0; }
.album-grid {
  display: grid; gap: clamp(.5rem, 1vw, .9rem);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 900px) { .album-grid { grid-template-columns: repeat(3, 1fr); } }
.album-grid button {
  all: unset; cursor: zoom-in; position: relative; overflow: hidden;
  border-radius: 10px; aspect-ratio: 3 / 2; background: var(--surface);
}
.album-grid button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.album-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.album-grid button:hover img { transform: scale(1.04); }
/* Lead photo: 2x2 on desktop (only when it fills clean rows), full width on phones when the count is odd */
@media (min-width: 900px) {
  .album-grid button.feature { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
}
@media (max-width: 899px) {
  .album-grid button.wide { grid-column: span 2; }
}
.album + .album { border-top: 1px solid var(--line); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(8, 8, 10, .96);
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 86vh; max-height: 86svh; object-fit: contain; border-radius: 4px; }
.lb-btn {
  all: unset; cursor: pointer; position: absolute; color: var(--text);
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(255,255,255,.08); font-size: 1.4rem;
}
.lb-btn:hover { background: var(--gold); color: #17140c; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: .85rem; }
@media (hover: none) { .lb-prev, .lb-next { display: none; } }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem clamp(1.25rem, 5vw, 4rem);
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: .88rem;
}
.footer a { color: var(--text); text-decoration: none; }
.footer a:hover { color: var(--gold); }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }

.loading { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }

/* ---------- Album archive page ---------- */
.hero.archive { height: 64vh; height: 64svh; min-height: 340px; }
.hero.archive.h-short  { height: 50vh; height: 50svh; }
.hero.archive.h-tall   { height: 80vh; height: 80svh; }
.hero.archive.h-full   { height: 100vh; height: 100svh; }
@media (max-height: 500px) and (orientation: landscape) { .hero.archive[class*="h-"] { height: 100vh; height: 100svh; } }
.hero.archive .hero-content { padding-bottom: clamp(2rem, 6vh, 4rem); }

.atoolbar {
  position: sticky; top: var(--navh, 56px); z-index: 40;
  background: rgba(15, 16, 18, .94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.atoolbar-inner {
  max-width: 1400px; margin: 0 auto;
  padding: .75rem clamp(1.25rem, 5vw, 4rem);
  display: flex; gap: .75rem; align-items: center;
}
.asearch {
  flex: 0 0 min(280px, 100%);
  font: inherit; font-size: .9rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: .55rem 1rem;
}
.asearch:focus { outline: none; border-color: var(--gold); }
.asearch::placeholder { color: var(--muted); }
.achips { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; min-width: 0; }
.achips::-webkit-scrollbar { display: none; }
.achip {
  all: unset; cursor: pointer; white-space: nowrap;
  font-size: .82rem; font-weight: 500; color: rgba(242,239,232,.85);
  padding: .45rem .85rem; border-radius: 999px; border: 1px solid var(--line);
}
.achip:hover { border-color: var(--gold); color: var(--gold); }
.achip:focus-visible { outline: 2px solid var(--gold); }
@media (max-width: 700px) {
  .atoolbar { position: static; }
  .atoolbar-inner { flex-direction: column; align-items: stretch; gap: .6rem; padding-block: .75rem; }
  .asearch { flex: none; }
  .asection { scroll-margin-top: calc(var(--navh, 56px) + 8px); }
}
.acard-thumb.noimg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, #1b1c20, #111214);
}

.alist { max-width: 1400px; margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 4rem) 2rem; }
.asection { padding-top: clamp(2rem, 5vw, 3rem); scroll-margin-top: calc(var(--navh, 56px) + var(--toolh, 64px) + 8px); }
.asection-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .6rem; }
.asection-head h2 { font-family: var(--head); font-weight: 600; font-size: clamp(1.25rem, 2.4vw, 1.6rem); margin: 0; }
.asection-head span { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.agrid { display: grid; gap: clamp(.75rem, 1.4vw, 1.25rem); grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
@media (max-width: 560px) { .agrid { grid-template-columns: 1fr 1fr; gap: .65rem; } }

.acard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s, transform .2s; }
.acard:hover { border-color: rgba(212,169,69,.55); transform: translateY(-2px); }
.acard-thumb { position: relative; display: block; aspect-ratio: 3 / 2; background: #0b0b0c; overflow: hidden; }
.acard-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.acard:hover .acard-thumb img { transform: scale(1.04); }
.acard-date, .acard-count {
  position: absolute; font-size: .72rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px;
  background: rgba(10,10,12,.72); backdrop-filter: blur(6px); color: var(--text);
}
.acard-date { left: .55rem; top: .55rem; }
.acard-count { right: .55rem; bottom: .55rem; color: var(--gold); }
.acard-body { display: flex; align-items: flex-start; gap: .5rem; padding: .75rem .85rem .85rem; flex: 1; }
.acard-title { flex: 1; text-decoration: none; font-family: var(--head); font-weight: 500; font-size: .95rem; line-height: 1.3; }
.acard-title:hover { color: var(--gold); }
.acard-ext {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center; text-decoration: none;
  border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .9rem;
}
.acard-ext:hover { border-color: var(--gold); color: var(--gold); }
@media (max-width: 560px) {
  .acard-body { padding: .6rem .65rem .7rem; }
  .acard-title { font-size: .84rem; }
  .acard-ext { display: none; }
  .acard-date { font-size: .66rem; }
}
.aempty { color: var(--muted); padding: 3rem 0; text-align: center; }

/* Album viewer */
.adetail { max-width: 1400px; margin: 0 auto; padding: calc(var(--navh, 56px) + 1.25rem) clamp(1rem, 4vw, 3rem) 2rem; }
.adetail-head h1 { font-family: var(--head); font-weight: 600; font-size: clamp(1.4rem, 3.2vw, 2.2rem); line-height: 1.15; margin: .3rem 0 .5rem; }
.adetail-head .eyebrow { display: block; margin: 1.5rem 0 0; }
.adetail-meta { color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-bottom: 1.1rem; }
.adetail-meta a { color: var(--gold); text-decoration: none; }
.adetail-meta a:hover { text-decoration: underline; }
.aback { padding: .5rem 1rem; font-size: .85rem; }
.adetail-frame { height: 78vh; height: 78svh; min-height: 420px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; }
.adetail-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
body.viewing-album .nav { background: rgba(15, 16, 18, .94); }
