/* Dragontail Photography
   Hand-written to match the previous Squarespace design. Measurements were taken
   from screenshots of the live site at a 1440px viewport:
     side gutter 42px · header logo 285x70 · gallery 2 columns / 16px gap
     accent #FCDB18 · black footer · Cormorant Garamond headings, grotesque body */

:root {
  --ink: #1a1a1a;
  --muted: #4a4a4a;
  --accent: #fcdb18;
  --bg: #fff;
  --serif: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --gutter: clamp(1.25rem, 2.92vw, 2.625rem);
  --grid-gap: clamp(0.625rem, 0.97vw, 0.875rem);
}

*,
*::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: clamp(1rem, 0.25vw + 0.94rem, 1.0625rem);
  line-height: 2.05;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

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

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--bg);
  color: var(--ink);
  padding: 0.5rem 1rem;
  border: 1px solid currentColor;
}

/* --- header ---------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  flex-wrap: wrap;
  padding: clamp(1.5rem, 2.9vw, 2.625rem) var(--gutter) clamp(1.75rem, 5.8vw, 5.25rem);
}

.logo img {
  width: clamp(190px, 19.8vw, 285px);
  height: auto;
}

.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.1rem, 2.3vw, 2.1rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header nav a {
  font-size: clamp(0.9375rem, 0.2vw + 0.9rem, 1.0625rem);
  line-height: 1.4;
  color: var(--ink);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  opacity: 0.6;
}

.site-header nav a[aria-current="page"] {
  border-bottom-color: currentColor;
}

/* Home: the header floats over the full-bleed hero. */
.page-home .site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  color: #fff;
  padding-bottom: clamp(1.5rem, 2.9vw, 2.625rem);
}

.page-home .site-header nav a {
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

/* --- main / footer --------------------------------------------------------- */

main {
  flex: 1;
  padding: 0 var(--gutter) clamp(3rem, 7vw, 6rem);
}

.page-home main {
  padding: 0;
}

.site-footer {
  background: #000;
  color: #fff;
  padding: clamp(1.5rem, 2.7vw, 2.4rem) var(--gutter);
}

.site-footer p {
  margin: 0;
  font-size: clamp(0.9375rem, 0.2vw + 0.9rem, 1.0625rem);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* --- home hero ------------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  /* minmax(0,1fr) stops the panel's contents from widening the track past the
     viewport — without it a fixed max-width on .tagline overflows on phones. */
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  /* Squarespace's banner section is taller than the viewport — 1211px at a
     1440px width. That extra height is what zooms and lowers the photo, so it
     has to be reproduced or the framing doesn't match. Falls back to a full
     viewport on tall windows and on phones. */
  min-height: max(100svh, 84.1vw);
  /* Heavier bottom padding lifts the panel to where Squarespace's fluid-engine
     grid places it — just above centre, not dead centre. */
  padding: clamp(6rem, 9vw, 7rem) var(--gutter) clamp(7rem, 11vw, 9.75rem);
  isolation: isolate;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Squarespace lays a flat 15% black wash over the whole banner — measured off
   the live site. It is what keeps the white logo and nav legible. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, 0.15);
}

.hero-panel {
  width: 100%;
  max-width: 1355px;
  background: rgba(0, 0, 0, 0.36);
  padding: clamp(1.75rem, 3vw, 2.75rem) clamp(1.25rem, 3vw, 2.5rem);
  text-align: center;
}

.tagline {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 2.9vw + 0.45rem, 2.95rem);
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  margin: 0 auto;
  max-width: min(900px, 100%);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1rem, 8.6vw, 7.75rem);
  margin: clamp(0.875rem, 1.1vw, 1rem) 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(216px, 100%);
  min-height: clamp(50px, 4.2vw, 61px);
  padding: 0.5rem 1.5rem;
  background: var(--accent);
  color: #000;
  font-size: clamp(0.875rem, 0.15vw + 0.85rem, 0.9375rem);
  font-weight: 500;
  line-height: 1.3;
  transition: filter 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  filter: brightness(0.92);
}

/* --- gallery grid ---------------------------------------------------------- */

/* Two masonry columns. The column split is decided in build.mjs; each tile
   carries a CSS `order` so the mobile single-column view keeps gallery order. */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gap);
  align-items: start;
}

.grid-col {
  display: grid;
  gap: var(--grid-gap);
  align-content: start;
}

.tile {
  position: relative;
  display: block;
  background: #f2f2f2;
  overflow: hidden;
}

.tile img {
  width: 100%;
}

.tile-title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.1vw + 0.85rem, 1.75rem);
  line-height: 1.25;
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tile:hover .tile-title,
.tile:focus-visible .tile-title {
  opacity: 1;
}

@media (max-width: 640px) {
  .grid {
    display: flex;
    flex-direction: column;
  }

  .grid-col {
    display: contents;
  }

  .tile-title {
    opacity: 1;
    align-items: flex-end;
    justify-content: flex-start;
    text-align: left;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 55%);
  }
}

/* --- photo page ------------------------------------------------------------ */

.photo figure {
  margin: 0;
}

.photo figure img {
  width: 100%;
}

/* Tighter to the image and a larger title than Squarespace had — the original
   left the caption block floating away from the photo it belongs to. */
.photo-text {
  margin-top: clamp(1.5rem, 2.6vw, 2.375rem);
}

.photo-text h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 2.9vw + 0.75rem, 3.125rem);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 clamp(1.125rem, 2vw, 1.75rem);
}

.prose h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 2.6vw + 0.7rem, 2.75rem);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 clamp(1.25rem, 2.2vw, 2rem);
}

.photo-text p {
  margin: 0 0 1.9em;
  max-width: 58ch;
  color: var(--muted);
}

.photo-text p:last-child {
  margin-bottom: 0;
}

/* --- text pages ------------------------------------------------------------ */

.prose {
  margin-top: clamp(1.5rem, 4vw, 3.5rem);
}

/* With no contact form there is no second column, so a left-aligned block just
   reads as a half-empty row. Centre it into a proper measure instead. The
   two-column .prose-split layout below is used when the form is switched on. */
.prose:not(.prose-split) .prose-body {
  max-width: 60ch;
  margin-inline: auto;
  text-align: center;
}

.prose:not(.prose-split) .prose-body p {
  max-width: none;
}

.prose-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.prose-body p {
  margin: 0 0 1.9em;
  max-width: 52ch;
}

.prose-body p:last-child {
  margin-bottom: 0;
}

.prose-body a {
  border-bottom: 1px solid rgba(26, 26, 26, 0.3);
  padding-bottom: 1px;
  transition: border-color 0.2s ease;
}

.prose-body a:hover,
.prose-body a:focus-visible {
  border-bottom-color: var(--ink);
}

/* --- contact form (only rendered when site.json has an endpoint) ----------- */

.contact-form {
  display: grid;
  gap: 1.25rem;
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.contact-form label span {
  color: #767676;
  font-size: 0.875rem;
}

.contact-form input,
.contact-form textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fafafa;
  border: 1px solid #d8d8d8;
  border-radius: 0;
  padding: 0.7rem 0.85rem;
  width: 100%;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form button {
  justify-self: start;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #fff;
  background: #000;
  border: 0;
  border-radius: 0;
  padding: 0.85rem 2.25rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.contact-form button:hover {
  opacity: 0.85;
}

@media (max-width: 820px) {
  .prose-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
