/* ============================================================
   Tony Webster Photography — clean, framework-free rebuild
   ============================================================ */

/* --- Font (Inter, self-hosted, standing in for Adobe "Ballinger") --- */
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #a8a6a1;
  --gutter: 8px;        /* masonry gap + page edge padding */
  --header-h: 106px;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

/* Accessible/SEO-only text: present for search engines & screen readers,
   visually hidden without using display:none. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.003em;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   Header (fixed, transparent, overlays the hero)
   ============================================================ */
.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.site-header__logo img {
  width: 190px;
  height: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-nav a {
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  padding: 4px 0;
  line-height: 1;
  opacity: 0.92;
  transition: opacity 0.15s ease;
}
.site-nav a:hover { opacity: 1; }
.site-nav a.is-active {
  border-bottom: 1px solid var(--text);
  padding-bottom: 3px;
  opacity: 1;
}

/* ============================================================
   Hero banner (full-bleed dark image behind the header)
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  height: clamp(200px, 22vw, 300px);
  background-color: #000;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}
/* Homepage/photography hero: anchor to the aurora's focal point (near the top
   of the image) — matches the live site's object-position 52.3% / 6.5%. */
.hero--home {
  background-position: 52% 7%;
}
.hero--contact {
  height: clamp(300px, 33vw, 460px);
  background-position: center 30%;
}

/* Cortana memorial hero: dog photo with an overlaid caption (name + dates). */
.hero--cortana {
  height: clamp(200px, 19vw, 300px);
  background-position: 53% 5%;
}
.hero--cortana .hero__caption {
  position: absolute;
  left: 0;
  right: 0;
  top: 56%;                 /* ~halfway between the logo and the photo grid */
  transform: translateY(-50%);
  padding: 0 32px;          /* left edge aligns with the logo (header padding) */
  color: #fff;
}
.hero--cortana .hero__caption h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
}
.hero__dates {
  margin: 6px 0 0;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ============================================================
   Masonry gallery — 3 cols desktop / 2 cols mobile
   Columns are laid out by JS (shortest-column packing).
   ============================================================ */
.gallery {
  padding: var(--gutter);
  background: var(--bg);
}
.gallery__columns {
  display: flex;
  gap: var(--gutter);
  align-items: flex-start;
}
.gallery__col {
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
  flex: 1 1 0;
  min-width: 0;
}
.gallery__item {
  position: relative;
  display: block;
  width: 100%;
  cursor: zoom-in;
  overflow: hidden;
  background: #0a0a0a;
  /* Reveal-on-scroll: start faded + slightly shrunk, grow to fill the slot. */
  opacity: 0;
  transform: scale(0.9);
  transform-origin: center center;
  transition: opacity 0.65s ease, transform 0.7s cubic-bezier(0.16, 0.7, 0.2, 1);
}
.gallery__item.is-revealed {
  opacity: 1;
  transform: scale(1);
}
.gallery__item::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--thumb, none);
  background-size: cover;
  background-position: center;
  transform: scale(1.1);
  filter: blur(14px);
  z-index: 0;
}
.gallery__item img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.gallery__item img.loaded { opacity: 1; }
.gallery__item:hover img.loaded { opacity: 0.9; }

/* Respect users who prefer no motion: show images immediately. */
@media (prefers-reduced-motion: reduce) {
  .gallery__item {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--bg);
  color: var(--muted);
  text-align: center;
  padding: 42px 24px 60px;
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: 0.01em;
}
.site-footer p { margin: 0; }

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto; height: auto;
  object-fit: contain;
  box-shadow: 0 10px 60px rgba(0,0,0,0.6);
}
.lightbox__caption {
  position: absolute;
  bottom: 22px; left: 0; right: 0;
  text-align: center;
  color: var(--text);
  font-size: 14px;
  padding: 0 20px;
  opacity: 0.85;
}
.lightbox__btn {
  position: absolute;
  top: 0; bottom: 0;
  width: 15%;
  min-width: 60px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 34px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.lightbox__btn:hover { opacity: 1; }
.lightbox__btn--prev { left: 0; justify-content: flex-start; padding-left: 24px; }
.lightbox__btn--next { right: 0; justify-content: flex-end; padding-right: 24px; }
.lightbox__close {
  position: absolute;
  top: 18px; right: 24px;
  width: 44px; height: 44px;
  border: 0; background: transparent;
  color: #fff; font-size: 30px; line-height: 1;
  cursor: pointer; opacity: 0.7;
}
.lightbox__close:hover { opacity: 1; }

/* ============================================================
   Contact page
   ============================================================ */
.contact {
  padding: 0 32px 80px;
  max-width: 1400px;
  margin: 0 auto;
}
.contact__title {
  font-size: 31px;
  font-weight: 500;
  margin: 8px 0 60px;
  letter-spacing: -0.01em;
}
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.contact__h {
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}
.contact__email a { text-decoration: none; }
.contact__email a:hover { opacity: 0.8; }

.field { margin-bottom: 22px; }
.field > label {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
}
.field .req { color: var(--muted); font-size: 13px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-row .sub label { font-size: 13px; color: #e0e0e0; display:block; margin-bottom:6px; }
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  background: #fafafa;
  color: #111;
  border: 1px solid #000;
  border-radius: 0;
  padding: 14px 10px;
  font-family: var(--sans);
  font-size: 16px;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid #555; outline-offset: 0; }

.file-note { color: var(--muted); font-size: 13px; margin: 10px 0 20px; }
.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--muted);
  border: 2px solid var(--muted);
  border-radius: 5px;
  padding: 15px 28px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--sans);
  transition: color 0.15s, border-color 0.15s;
}
.btn-secondary:hover { color: #fff; border-color: #fff; }
.btn-submit {
  margin-top: 28px;
  padding: 16px 30px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  :root { --header-h: 84px; }
  .site-header { padding: 0 18px; }
  .hero--cortana .hero__caption { padding: 0 18px; }
  .site-header__logo img { width: 150px; }
  .contact__grid { grid-template-columns: 1fr; gap: 40px; }
  .contact { padding: 0 18px 60px; }
}
@media (max-width: 480px) {
  .site-nav a { font-size: 14px; }
  .field-row { grid-template-columns: 1fr; }
}
