/*
 * The page shell: header, container, footer, and the album-page feed.
 *
 * Mobile-first — the guest is always on a phone — but every screen has to hold
 * up on a desktop too, so each piece here grows into the wider viewport rather
 * than being a separate design.
 */

/* ---- Page skeleton ----------------------------------------------------- */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.page__body {
  flex: 1;
  width: 100%;
}

/* The page margin. Named for the album, not for bootstrap. */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-margin);
}

/* The guest side is a single narrow column of paper. */
.container--reading {
  max-width: calc(var(--reading-max) + var(--container-margin) * 2);
}

.section {
  padding-block: var(--section-gap);
}

/* Vertical rhythm without margin collapsing surprises. */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stack--tight { gap: var(--space-2); }
.stack--loose { gap: var(--space-8); }
.stack--center { align-items: center; text-align: center; }

/* ---- The wordmark ------------------------------------------------------ *
 * "Foto & Festa", always with spaces around the ampersand, never in caps.
 * The ampersand is the brand's graphic element, so it carries the gold.      */

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28em;
  font-family: var(--font-display);
  font-size: var(--text-headline);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: var(--tracking-display);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

/* The ampersand is the brand's graphic element, not handwriting — it stays
   upright and lets Fraunces' own swash do the work. Italic is reserved for
   captions, where it plays the part of a note written on the print. */
.wordmark__amp {
  color: var(--gold);
}

.wordmark--sm { font-size: var(--text-body-lg); }
.wordmark--lg { font-size: var(--text-title); }

/* The ampersand alone, on a scrap of photographic paper — the app icon, the
   avatar, the seal on the QR card. Used where the full wordmark won't fit. */
.seal {
  display: inline-grid;
  place-items: center;
  inline-size: 2rem;
  block-size: 2rem;
  flex: none;
  background: var(--print);
  border: 1px solid var(--ink-edge);
  border-radius: var(--radius-chip);
  box-shadow: var(--shadow-surface);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}

.seal--lg {
  inline-size: 3.5rem;
  block-size: 3.5rem;
  font-size: 2rem;
}

/* ---- Site header ------------------------------------------------------- *
 * Three slots. On a phone the wordmark sits in the middle, flanked by a back
 * action and the account; from tablet up it moves left and the nav takes the
 * centre, which is how the organizer screens read on a desktop.              */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top, 0);
}

.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-3);
  min-block-size: 3.5rem;
}

.site-header__start {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-self: start;
}

.site-header__brand {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.site-header__end {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  justify-self: end;
}

.site-header__nav {
  display: none;
}

@media (min-width: 48rem) {
  /* Slots keep their DOM order and place themselves: an empty start collapses
     to nothing, the wordmark settles on the left, the nav takes the elastic
     middle, and the account holds the right. */
  .site-header__inner {
    grid-template-columns: auto auto 1fr auto;
    min-block-size: 4.5rem;
  }

  .site-header__brand {
    justify-self: start;
  }

  .site-header__nav {
    display: flex;
    justify-content: center;
    gap: var(--space-8);
  }
}

.nav-link {
  font-family: var(--font-ui);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--soft-ink);
  text-decoration: none;
  padding-block: var(--space-1);
  border-bottom: 2px solid transparent;
  transition: color var(--duration) var(--ease);
}

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

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

/* A back affordance and other bare icon actions in the header. */
.icon-button {
  display: inline-grid;
  place-items: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  border-radius: var(--radius-control);
  color: var(--ink);
  transition: background-color var(--duration) var(--ease);
}

.icon-button:hover {
  background: var(--ink-wash);
}

.icon-button svg {
  inline-size: 1.25rem;
  block-size: 1.25rem;
}

/* ---- Site footer ------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: var(--space-10);
  margin-top: var(--section-gap);
  color: var(--soft-ink);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}

.site-footer__links {
  display: flex;
  gap: var(--space-6);
}

.site-footer__links a {
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

@media (min-width: 48rem) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: start;
  }
}

/* ---- The feed: a gallery wall, not a grid ------------------------------ *
 * Varied heights, laid out in columns so prints of different shapes sit
 * together the way photographs do on an album page. CSS columns keep this
 * server-rendered and JS-free; the tradeoff is that reading order runs down
 * each column rather than across, which is right for a photo wall.          */

.feed {
  column-count: 2;
  column-gap: var(--gutter);
}

.feed > * {
  break-inside: avoid;
  margin-bottom: var(--gutter);
}

@media (min-width: 40rem) {
  .feed { column-count: 3; }
}

@media (min-width: 64rem) {
  .feed { column-count: 4; }
}

/* A plain grid for places that want equal cells — the organizer's photo tab,
   where scanning and counting matters more than the album feeling. */
.grid-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: var(--gutter);
}

@media (min-width: 48rem) {
  .grid-photos {
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  }
}

/* ---- Small helpers ----------------------------------------------------- */

/* A short centred hairline used as a breath between sections. */
.rule {
  inline-size: 6rem;
  block-size: 1px;
  background: var(--rule);
  border: none;
  margin-inline: auto;
}

/* Dividers stop short of the page edge, respecting the album's margins. */
.rule--full {
  inline-size: auto;
  margin-inline: var(--space-6);
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
