/* ============================================================
   Steven Steinhardt — Destination Wedding Photography
   Global stylesheet
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --ink: #1a1a1a;          /* soft black for primary text */
  --ink-soft: #6b6b6b;     /* muted grey for secondary text */
  --line: #e7e5e1;         /* hairline rules */
  --overlay: rgba(20, 20, 20, 0.92);

  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;

  --maxw: 1600px;
  --gutter: clamp(18px, 4vw, 48px);
  --header-h: 112px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

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

/* ============================================================
   Header / Navigation
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  transition: transform 0.45s var(--ease);
}

/* hide-on-scroll */
.site-header.is-hidden { transform: translateY(-100%); }

.brand {
  grid-column: 2;
  justify-self: center;
  display: block;
  line-height: 0;
}

.brand-logo {
  display: block;
  width: clamp(240px, 28vw, 380px);
  height: auto;   /* transparent PNG — sits cleanly on any background */
}

.nav {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: clamp(20px, 4vw, 44px);
}

.nav a {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color 0.3s var(--ease);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}

.nav a:hover,
.nav a[aria-current="page"] { color: var(--ink); }

.nav a:hover::after,
.nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* On narrow screens, keep the wordmark centered and drop the nav beneath it */
@media (max-width: 680px) {
  :root { --header-h: 128px; }
  .site-header {
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: center;
    gap: 8px;
  }
  .brand { grid-column: 1; }
  .brand-logo { width: min(74vw, 300px); }
  .nav { grid-column: 1; justify-self: center; gap: 32px; }
}

/* ============================================================
   Layout helpers
   ============================================================ */
main { padding-top: var(--header-h); }

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 120px) var(--gutter) clamp(60px, 8vw, 120px);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.2rem;
}

/* ============================================================
   Homepage — masonry gallery
   ============================================================ */
/* JS distributes .tile figures into .gallery-col columns (block flow),
   which keeps geometry reliable for lazy-loading in every browser
   (unlike CSS multi-column, which reorders and breaks Safari's loading). */
.gallery {
  padding: calc(var(--header-h) + 6px) var(--gutter) var(--gutter);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.gallery-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Hide the flat list until JS builds the columns (prevents a layout flash) */
.gallery:not(.is-masonry) .tile { display: none; }

.tile {
  margin: 0;
  cursor: zoom-in;
  overflow: hidden;
  background: #f4f2ee;
}

.tile img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), filter 0.4s var(--ease);
  will-change: opacity, transform;
}

.tile img.is-loaded {
  opacity: 1;
  transform: scale(1);
}

@media (hover: hover) {
  .tile img:hover { filter: brightness(1.04); }
}

@media (max-width: 820px) { .gallery, .gallery-col { gap: 5px; } }

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;                 /* framed-print padding */
  background: var(--overlay);
  opacity: 0;
  visibility: hidden;
  cursor: zoom-out;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.4s var(--ease);
}

.lightbox.is-open img {
  transform: scale(1);
  opacity: 1;
}

/* ============================================================
   About page
   ============================================================ */
.about-split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: stretch;   /* portrait matches the bio's height, never exceeds it */
}

.about-portrait {
  position: relative;
  background: linear-gradient(135deg, #efece7, #e2ded7);
  overflow: hidden;
}

/* Absolutely-filled image contributes no intrinsic height, so the row height
   is driven by the bio text — capping the portrait at the text box's height. */
.about-portrait img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }

.about-portrait .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.about-bio h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.08;
  margin: 0 0 1.5rem;
  letter-spacing: 0.01em;
}

.about-bio p {
  font-size: 1.05rem;
  color: #2e2e2e;
  max-width: 54ch;
  margin: 0 0 1.3rem;
}

.about-bio .signature {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--ink);
  margin-top: 2rem;
}

@media (max-width: 780px) {
  .about-split { grid-template-columns: 1fr; align-items: start; }
  /* Stacked: give the portrait its own height via aspect ratio */
  .about-portrait { aspect-ratio: 4 / 5; max-width: 420px; }
}

/* ---------- Published In banner ---------- */
.published {
  margin-top: clamp(60px, 10vw, 130px);
  padding-top: clamp(40px, 6vw, 70px);
  border-top: 1px solid var(--line);
  text-align: center;
}

.accolade {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  max-width: 32ch;
  margin: 1.6rem auto 0;
}

.accolade em {
  font-style: italic;
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 6vw, 72px);
  margin-top: clamp(48px, 7vw, 84px);
}

.logo {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2.4vw, 1.55rem);
  letter-spacing: 0.04em;
  color: #4a4a4a;
  filter: grayscale(100%);
  opacity: 0.55;
  transition: opacity 0.4s var(--ease), filter 0.4s var(--ease);
}

.logo.small-caps { text-transform: uppercase; letter-spacing: 0.22em; font-family: var(--sans); font-size: clamp(0.85rem, 2vw, 1.05rem); }

.logo:hover { opacity: 1; filter: grayscale(0%); }

/* ============================================================
   Contact page
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 7vw, 96px);
  align-items: start;
}

.contact-intro h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 1.4rem;
}

.contact-intro p {
  color: var(--ink-soft);
  max-width: 42ch;
  margin: 0 0 1rem;
}

.contact-detail {
  margin-top: 2.4rem;
  font-size: 0.95rem;
}

.contact-detail a { border-bottom: 1px solid var(--line); }
.contact-detail a:hover { border-color: var(--ink); }

/* Form */
.field { margin-bottom: 1.6rem; }

.field label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.55rem;
}

.field input,
.field textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink);
  padding: 0.55rem 0;
  transition: border-color 0.3s var(--ease);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.field textarea { resize: vertical; min-height: 120px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4vw, 36px);
}

.btn {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.95rem 2.6rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.btn:hover { background: transparent; color: var(--ink); }

.form-note {
  margin-top: 1.4rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  min-height: 1.2em;
}

@media (max-width: 780px) {
  .contact-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ============================================================
   Scroll-jump arrow (homepage)
   ============================================================ */
.scroll-jump {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 150;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  visibility: hidden;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease),
              visibility 0.35s var(--ease), background 0.3s var(--ease);
}

.scroll-jump.is-visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.scroll-jump:hover { background: #ffffff; }

.scroll-jump svg {
  transition: transform 0.4s var(--ease);
}

/* Flip the arrow to point up once near the bottom */
.scroll-jump.point-up svg { transform: rotate(180deg); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: clamp(28px, 5vw, 44px) var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.site-footer a { transition: color 0.3s var(--ease); }
.site-footer a:hover { color: var(--ink); }
.site-footer .sep { opacity: 0.4; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; }
  .tile img { opacity: 1; transform: none; }
}
