/* The script title is drawn large across the photo, so it waits for its font
   (font-display: block) rather than flashing a fallback face. */
@font-face {
  font-family: "La Belle Aurore";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/la-belle-aurore.woff2") format("woff2");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/montserrat-500.woff2") format("woff2");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/montserrat-700.woff2") format("woff2");
}

:root {
  --sea-salt: #F5F3E5;
  --ink: #22221F;
  --zinfandel: #72243A;
  --deep-water: #295A69;
  --olive: #5B5F38;
  --apricot: #FEC67C;

  --script: "La Belle Aurore", "Bradley Hand", cursive;
  --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;

  --radius-frame: 28px;
  /* Shared width of the coast photo and the photo pair. It follows the window's height
     so the date under the coast photo stays on the first screen of a laptop. */
  --measure: clamp(560px, (100svh - 256px) * 1.65, 1200px);
  /* Wide enough that the title's overhang never reaches the edge of the window */
  --gutter: clamp(24px, 5vw, 64px);
  /* The page fills the whole screen, including beside a phone's notch when it is held
     sideways, so the ribbon reaches both edges. Content keeps clear of the notch. */
  --side: max(var(--gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip; /* the title runs past the photo and must not cause sideways scroll */
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--sea-salt);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 700;
  font-synthesis: none;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--zinfandel);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--ink);
}

a:focus-visible {
  outline: 2px solid var(--deep-water);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Small capitals used for the navigation, the date and place, headings and the footer */
.nav,
.details,
.info h2,
.foot {
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* Navigation: names on the left, section links on the right, on the photo's width */
.nav {
  max-width: calc(var(--measure) + 2 * var(--side));
  margin: 0 auto;
  padding: 8px var(--side) 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0 24px;
  font-size: 0.75rem;
}

.nav nav {
  display: flex;
  gap: 0 28px;
}

.nav a {
  display: inline-block;
  padding: 16px 0; /* a finger-sized target */
  color: var(--deep-water);
  text-decoration: none;
}

.nav .nav-home {
  color: var(--ink);
}

.nav a:hover,
.nav a[aria-current] {
  color: var(--zinfandel);
}

.page {
  max-width: calc(var(--measure) + 2 * var(--side));
  margin: 0 auto;
  padding: 36px var(--side) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  container-type: inline-size;
}

.hero {
  position: relative;
  width: 100%;
  container-type: inline-size;
}

.title {
  position: absolute;
  left: 50%;
  top: 1vw;
  top: 1.2cqw;
  width: max-content;
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: 18vw; /* for browsers without container units */
  font-size: 21.5cqw;
  line-height: 0.94;
  word-spacing: -0.24em;
  white-space: nowrap;
  transform: translateX(-50%) rotate(-3deg);
  pointer-events: none;
  /* The script's swashes reach past the letters' own box. The padding widens the box to
     hold them, so the raised-title filter never cuts off a tail; the negative margin keeps
     the title where it was. */
  padding: 0.35em 0.5em;
  margin-top: -0.35em;
}

.title-ink {
  color: var(--ink);
  -webkit-text-stroke: 0.013em var(--ink);
}

.title-fill {
  color: var(--apricot);
  /* raised surface and soft shadow, drawn by the filter at the top of index.html */
  filter: url(#raised);
}

.filters {
  position: absolute;
}

.photo,
.pair img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-frame);
}

.photo {
  position: relative;
  aspect-ratio: 1.65 / 1;
  object-position: 45% 100%;
}

/* Travel page: a wide band of coast in the same frame, with the page's name under it in the
   capitals the home page uses for the date and place */
.band {
  aspect-ratio: 2.6 / 1;
  object-position: 50% 35%;
}

.page-title {
  margin: 28px 0 0;
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--zinfandel);
}

.page-title span {
  display: inline-block; /* the title breaks before "and", never mid-phrase */
  margin-right: -0.16em;
}

/* Date and place under the coast photo, stacked and centered */
.details {
  margin: 28px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--zinfandel);
}

/* Tracking adds space after the last letter; pull it back so the lines stay optically centered. */
.details > * {
  margin-right: -0.16em;
}

/* The details: three columns, each under a thin Ink rule, as on the Postcard mock-up */
.info {
  max-width: calc(var(--measure) + 2 * var(--side));
  margin: 96px auto 0;
  padding: 0 var(--side);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  text-align: left;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.6;
}

.info.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* Pages that open with a photo band and a short title sit a little closer to it */
.info.cols-2,
.info.questions {
  margin-top: 72px;
}

/* The home page's only section follows the hero at the full distance */
.page:has(.hero) + .info {
  margin-top: 96px;
}

.info section {
  border-top: 1.5px solid var(--ink);
  padding-top: 24px;
  scroll-margin-top: 24px;
}

/* A section that takes the full row (The Weekend, Things to Do) */
.info .wide {
  grid-column: span 2;
}

/* Running text keeps a readable line length inside a wide section */
.info .wide > p {
  max-width: 40rem;
}

.info .lede {
  margin-bottom: 28px;
}

/* Things to Do: four groups, two to a row, on the same columns as the sections above */
.groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 48px;
}

.groups h3 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(34, 34, 31, 0.2);
}

.info strong {
  font-weight: 700;
}

.info h2 {
  margin: 0 0 16px;
  font-size: 1.0625rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--zinfandel);
}

.info h3 {
  margin: 20px 0 4px;
  font-size: 0.8125rem;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--deep-water);
}

.info h2 + h3 {
  margin-top: 0;
}

.info p {
  margin: 0 0 12px;
}

.info :last-child {
  margin-bottom: 0;
}

/* Airport and drive time on one row, the time kept together on the right */
.drives {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.drives li {
  display: flex;
  justify-content: space-between; /* the time always stays on the airport's row */
  gap: 0 16px;
  padding: 8px 0;
  border-top: 1px solid rgba(34, 34, 31, 0.2);
}

.drives li span:first-child {
  font-weight: 700;
}

.drives li span:last-child {
  white-space: nowrap;
}

/* The ways from the home page to the other pages, as plain bordered buttons */
.more {
  margin: 64px 0 0;
  padding: 0 var(--side);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.more a {
  display: inline-block;
  padding: 14px 24px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--zinfandel);
}

.more a:hover {
  background: var(--zinfandel);
  border-color: var(--zinfandel);
  color: var(--sea-salt);
}

/* One photo, the proposal, with a Zinfandel ribbon running behind it */
.pair {
  position: relative;
  margin: 104px 0 88px;
  padding: 0 var(--side);
}

.pair::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 34%;
  transform: translateY(-50%);
  background: var(--zinfandel);
  /* thin Sea Salt lines set in from each edge */
  box-shadow: inset 0 7px 0 var(--zinfandel), inset 0 9px 0 var(--sea-salt),
              inset 0 -7px 0 var(--zinfandel), inset 0 -9px 0 var(--sea-salt);
}

/* Narrower than the coast photo, so the ribbon shows on both sides */
.pair-inner {
  position: relative;
  max-width: calc(var(--measure) * 0.7);
  margin: 0 auto;
  container-type: inline-size;
}

.pair img {
  aspect-ratio: 3 / 2;
}

/* The postmark from the save-the-date, set on the ribbon like a wax seal.
   It and the title are the only tilted things on the page. */
.seal {
  --wax: var(--apricot);
  --print: var(--zinfandel);
  position: absolute;
  /* on the photo's right edge, where the ribbon comes out from behind it */
  left: 100%;
  top: 50%;
  width: 104px; /* for browsers without container units */
  width: clamp(88px, 24cqw, 184px); /* a little taller than the ribbon */
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(-11deg);
  font-family: var(--sans);
  font-weight: 700;
}

.seal-wax {
  fill: var(--wax);
  stroke: var(--ink);
  stroke-width: 1;
}

.seal-ring {
  fill: none;
  stroke: var(--print);
  stroke-width: 1.25;
}

.seal text {
  fill: var(--print);
  text-anchor: middle;
}

.seal-arc {
  font-size: 8px;
  letter-spacing: 1.5px;
}

/* "R&T" in the title script, as written on the back of the save-the-date */
.seal-mark {
  font-family: var(--script);
  font-weight: 400;
  font-size: 30px;
  stroke: var(--print);
  stroke-width: 0.3px; /* +0.01em, the heaviest the title face is allowed */
}

.seal-amp {
  font-size: 0.7em;
}

.nowrap {
  white-space: nowrap;
}

/* On a page that ends with text rather than the photo and ribbon, the footer keeps its distance */
.info + .foot {
  margin-top: 96px;
}

/* One quiet line to close the page */
.foot {
  padding: 0 var(--side) 56px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--deep-water);
}

.foot time::after {
  content: "\00B7";
  margin: 0 0.9em;
}

/* Narrow laptops and tablets: the three columns get tight before the phone layout starts */
@media (max-width: 60rem) {
  .info,
  .info.cols-2,
  .groups {
    grid-template-columns: 1fr;
  }

  .info {
    gap: 40px;
    max-width: calc(34rem + 2 * var(--side));
  }

  .info .wide {
    grid-column: auto;
  }
}

/* Phones */
@media (max-width: 40rem) {
  :root {
    --gutter: 20px;
    --radius-frame: 20px;
  }

  .nav {
    justify-content: center;
    padding-top: 4px;
  }

  .nav nav {
    gap: 0 20px;
  }

  .page {
    padding-top: 28px;
  }

  .info,
  .info.cols-2,
  .info.questions,
  .page:has(.hero) + .info {
    margin-top: 64px;
  }

  .more {
    margin-top: 48px;
  }

  .band {
    aspect-ratio: 16 / 9;
  }

  .page-title {
    font-size: 0.875rem;
  }

  .photo {
    aspect-ratio: 4 / 3;
  }

  .title {
    top: 4vw;
    top: 4.5cqw;
  }

  .title-ink {
    -webkit-text-stroke-width: 0.02em; /* keeps the outline visible at this size */
  }

  .title-fill {
    filter: url(#raised-small);
  }

  .details {
    font-size: 0.875rem;
  }

  .pair {
    margin: 64px 0 104px;
  }

  /* The ribbon runs behind the photo's lower edge and shows below it, with the seal on it. */
  .pair::before {
    top: 100%;
    height: 72px;
  }

  .pair-inner {
    max-width: none;
  }

  .seal {
    left: 78%;
    top: 100%;
    width: 96px;
  }
}
