/* ==========================================================================
   MJWPhoto — base styles
   ========================================================================== */
@import url('panchang.css');
:root {
  --ink: #131313;
  --paper: #ffffff;
  --grey: #8a8a8a;
  --grey-light: #d9d9d9;
  --hairline: #e6e6e6;
  --max-width: 1680px;
  --gutter: clamp(16px, 3vw, 40px);
  --nav-height: 84px;

  /* Free stand-ins for Purista (title) and Europa (body) — see README for
     how to switch to the real Adobe Fonts versions if you license them. */
  --font-title: "Panchang-Medium", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Jost", "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
  padding: 26px var(--gutter);
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  font-family: var(--font-title);
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
  white-space: nowrap;
}

.logo a { display: inline-block; }

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 40px);
}

.main-nav a {
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--grey);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--ink);
}

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

.header-social {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-social a {
  display: inline-flex;
  color: var(--ink);
  opacity: 0.85;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.header-social a:hover { opacity: 1; transform: translateY(-1px); }
.header-social svg { width: 20px; height: 20px; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
  margin: -8px;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }

.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }

  .main-nav {
    position: fixed;
    inset: var(--nav-height) 0 0 0;
    background: var(--paper);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    padding: 12px var(--gutter) 40px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 50;
  }

  .nav-open .main-nav {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .main-nav a {
    width: 100%;
    padding: 16px 0;
    border-bottom: 1px solid var(--hairline);
    font-size: 18px;
  }
}

/* ==========================================================================
   Portfolio grid
   ========================================================================== */

.gallery {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4px var(--gutter) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gallery-row {
  display: flex;
  width: 100%;
  gap: 6px;
}

.gallery-item {
  display: block;
  overflow: hidden;
  background: #f2f2f2;
  cursor: zoom-in;
  flex: 0 0 auto;
  /* width/height are set in px by js/justified-gallery.js so each row
     lines up edge-to-edge using each photo's real aspect ratio. */
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.015);
}

.gallery-item img[loading="lazy"] {
  opacity: 0;
  animation: fade-in 0.4s ease forwards;
}

@keyframes fade-in {
  to { opacity: 1; }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

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

.lightbox-figure {
  max-width: 92vw;
  max-height: 88vh;
  margin: 0;
}

.lightbox-figure img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  padding: 12px;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  opacity: 1;
}

.lightbox-close { top: 12px; right: 12px; }
.lightbox-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 4px; top: 50%; transform: translateY(-50%); }
.lightbox-close svg,
.lightbox-prev svg,
.lightbox-next svg { width: 28px; height: 28px; }

.lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink);
  opacity: 0.55;
  font-size: 13px;
  letter-spacing: 0.05em;
}

@media (max-width: 560px) {
  .lightbox-prev, .lightbox-next { padding: 8px; }
  .lightbox-prev svg, .lightbox-next svg { width: 22px; height: 22px; }
}

/* ==========================================================================
   Generic page layout (About / Contact / Travels)
   ========================================================================== */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px var(--gutter) 80px;
}

.page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

@media (min-width: 900px) {
  .page-grid.has-media {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}

.page-media img {
  width: 100%;
  height: auto;
}

/* About-page photo only — smaller than the default full-column size,
   centered within the column. Adjust max-width to make it bigger/smaller. */
.about-photo {
  max-width: 380px;
  margin: 0 auto;
}

.page h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

.page p { color: #333; max-width: 60ch; }
.page p + p { margin-top: 1em; }

.lede { font-size: 18px; color: var(--ink); }

/* ==========================================================================
   Contact form
   ========================================================================== */

.contact-intro p { margin: 0 0 6px; font-weight: 600; }
.contact-intro { margin-bottom: 32px; }

.form-grid {
  display: grid;
  gap: 20px;
}

.form-row {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .form-row.two-up { grid-template-columns: 1fr 1fr; }
}

.field label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--ink);
  margin-bottom: 8px;
}

.field label .req {
  font-weight: 400;
  color: var(--grey-light);
  margin-left: 4px;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--hairline);
  background: #fafafa;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  border-radius: 2px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

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

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

.submit-btn {
  justify-self: start;
  background: var(--ink);
  color: #fff;
  border: 0;
  padding: 14px 32px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: opacity 0.15s ease;
}

.submit-btn:hover { opacity: 0.85; }
.submit-btn:disabled { opacity: 0.5; cursor: progress; }

.form-status {
  font-size: 14px;
  margin-top: 4px;
  min-height: 1.4em;
}

.form-status[data-state="success"] { color: #1b7a3d; }
.form-status[data-state="error"] { color: #b3261e; }

.contact-direct {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}

.contact-direct h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey);
  margin: 0 0 12px;
}

.contact-direct-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 15px;
}

.contact-direct-links a {
  border-bottom: 1px solid var(--grey-light);
  padding-bottom: 2px;
}

.contact-direct-links a:hover { border-color: var(--ink); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 28px var(--gutter) 40px;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-footer small {
  color: var(--grey);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.footer-social {
  display: flex;
  gap: 16px;
}

.footer-social a { color: var(--ink); opacity: 0.8; }
.footer-social a:hover { opacity: 1; }
.footer-social svg { width: 18px; height: 18px; }
