/*
 * The organizer's panel: a sidebar, a bar with the event's name, and the tab.
 *
 * On a phone the sidebar is not a sidebar — it becomes the brand, then a
 * scrolling row of tabs. Same markup, same order, no second navigation.
 */

.panel {
  min-block-size: 100svh;
  background: var(--paper);
}

@media (min-width: 64rem) {
  .panel {
    display: grid;
    grid-template-columns: 17rem 1fr;
    align-items: start;

    /* The sidebar sticks and is only ever a screen tall, so its colour is
       painted on the grid instead — otherwise the column runs out underneath
       it on a long album. */
    background:
      linear-gradient(
        to right,
        color-mix(in srgb, var(--print) 70%, var(--paper)) 0 17rem,
        var(--paper) 17rem
      );
  }
}

/* ---- The sidebar -------------------------------------------------------- */

.panel__side {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-5) var(--container-margin);
  background: color-mix(in srgb, var(--print) 70%, var(--paper));
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 64rem) {
  .panel__side {
    position: sticky;
    inset-block-start: 0;
    block-size: 100svh;
    padding: var(--space-8) var(--space-6);
    border-bottom: none;
    border-inline-end: 1px solid var(--rule);
  }
}

.panel__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.panel__brand-words {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-inline-size: 0;
}

.panel__brand-words .t-caption {
  color: var(--gold);
}

/* ---- The tabs ----------------------------------------------------------- */

.panel__nav {
  display: flex;
  gap: var(--space-6);
  overflow-x: auto;
  scrollbar-width: none;
}

.panel__nav::-webkit-scrollbar {
  display: none;
}

/* On a phone the tabs are bare text, so their labels start on the same left
   edge as the event's name and everything under it. A pill would inset every
   label by its own padding and nothing on the page would line up. */
.panel__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
  padding-block: var(--space-3);
  border-bottom: 2px solid transparent;
  font-family: var(--font-ui);
  font-size: var(--text-body);
  color: var(--soft-ink);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

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

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

@media (min-width: 64rem) {
  .panel__nav {
    flex-direction: column;
    gap: var(--space-1);
    overflow: visible;
  }

  .panel__link {
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: none;
    border-radius: var(--radius-control);
  }

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

  /* Down the column the mark moves to the edge, where it reads as a leaf of
     foil against the sidebar rather than an underline. */
  .panel__link[aria-current="page"] {
    background: var(--print);
    box-shadow: var(--shadow-surface);
    border-inline-end: 2px solid var(--gold);
  }
}

.panel__nav--secondary {
  display: none;
}

.panel__group {
  font-family: var(--font-ui);
  font-size: var(--text-fine);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--soft-ink);
  padding-inline: var(--space-4);
  margin-block-end: var(--space-2);
}

.panel__account {
  display: none;
}

@media (min-width: 64rem) {
  .panel__nav--secondary {
    display: block;
    margin-block-start: var(--space-4);
  }

  .panel__account {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-block-start: auto;
    padding-block-start: var(--space-6);
    border-top: 1px solid var(--rule);
  }

  .panel__email {
    overflow-wrap: anywhere;
  }
}

/* ---- The bar ------------------------------------------------------------ */

.panel__main {
  min-inline-size: 0;
}

.panel__bar {
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-header);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--container-margin);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.panel__titles {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-inline-size: 0;
}

.panel__event {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

/* The bar above is sticky, so the tab needs room to clear its rule rather than
   starting against it — the same reason .page-head carries its own. */
.panel__content {
  padding: var(--space-10) var(--container-margin) var(--space-16);
}

.panel-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
  max-inline-size: var(--container-max);
}

/* ---- The tally ---------------------------------------------------------- *
 * Two numbers, printed like a caption on a contact sheet.                     */

.tally {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.tally__figures {
  display: flex;
  gap: var(--space-10);
}

.tally__figure {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.tally__number {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: var(--tracking-display);
}

/* ---- Taking the album home ---------------------------------------------- *
 * A quiet card on the paper, not a system notice. It is the same card whether
 * it is offering, working or done.                                           */

.keepsake {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-5);
  padding: var(--space-6);
  background: var(--print);
  border: 1px solid var(--ink-edge);
  border-radius: var(--radius-print);
  box-shadow: var(--shadow-surface);
}

@media (min-width: 48rem) {
  .keepsake {
    padding: var(--space-8);
  }
}

.keepsake__words {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  inline-size: 100%;
}

.keepsake__mark {
  margin-block-end: var(--space-2);
}

.keepsake__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

/* ---- juntando tudo... --------------------------------------------------- *
 * A hairline filling with gold, the way a print comes up in the tray.        */

.progress {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  inline-size: 100%;
  margin-block-start: var(--space-4);
}

.progress__label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-caption);
  color: var(--gold);
  white-space: nowrap;
}

.progress__track {
  flex: 1;
  block-size: 2px;
  background: var(--rule);
  border-radius: 1px;
  overflow: hidden;
}

.progress__bar {
  display: block;
  block-size: 100%;
  background: var(--gold);
  transition: inline-size var(--duration-slow) var(--ease);
}

.progress__figure {
  font-family: var(--font-ui);
  font-size: var(--text-label);
  font-variant-numeric: tabular-nums;
  color: var(--soft-ink);
}

/* ---- The gallery -------------------------------------------------------- */

.gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.gallery__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block-end: var(--space-4);
  border-bottom: 1px solid var(--rule);
}

/* Two readings of the same album, offered as a pair rather than a control. */
.segmented {
  display: inline-flex;
  padding: 0.2rem;
  background: var(--paper-shade);
  border-radius: var(--radius-control);
}

.segmented__option {
  padding: var(--space-2) var(--space-4);
  border-radius: calc(var(--radius-control) - 2px);
  font-family: var(--font-ui);
  font-size: var(--text-label);
  color: var(--soft-ink);
  text-decoration: none;
  transition:
    background-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.segmented__option--on {
  background: var(--print);
  box-shadow: var(--shadow-surface);
  color: var(--ink);
}

.timeline__day {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-block-end: var(--space-10);
}

.timeline__date {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-headline);
  font-weight: var(--weight-regular);
  color: var(--soft-ink);
}

/* ---- QR e link ---------------------------------------------------------- */

.qr-page {
  display: grid;
  gap: var(--space-10);
}

@media (min-width: 64rem) {
  .qr-page {
    grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
    align-items: start;
    column-gap: var(--space-16);
  }

  .qr-page__rule,
  .steps {
    grid-column: 1 / -1;
  }
}

.qr-page__code {
  display: flex;
  justify-content: center;
}

/* The svg has no intrinsic size of its own, so the print sets the width. On a
   phone it spans the column, so its edges line up with the words underneath
   instead of floating in the middle of them. */
.qr-print {
  inline-size: 100%;
}

@media (min-width: 48rem) {
  .qr-print {
    max-inline-size: 20rem;
  }
}

.qr-print .print__well {
  background: var(--print);
  padding: var(--space-4);
}

.qr-print svg {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

.qr-print .print__caption {
  color: var(--gold);
}

.qr-page__link {
  display: flex;
  gap: var(--space-2);
}

.qr-page__link input {
  font-family: var(--font-ui);
  font-size: var(--text-body);
}

.qr-page__copy {
  flex: none;
  background: var(--ink);
  color: var(--print);
}

.qr-page__copy:hover {
  background: color-mix(in srgb, var(--ink) 88%, var(--paper));
}

.qr-page__rule {
  margin-block: var(--space-4);
}

/* ---- Escaneie, capture, celebre ----------------------------------------- */

.steps {
  display: grid;
  gap: var(--space-8);
  text-align: center;
}

@media (min-width: 48rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.steps__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.steps__mark {
  display: grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border-radius: var(--radius-control);
  background: var(--gold-wash);
  color: var(--gold);
  margin-block-end: var(--space-2);
}

.steps__mark svg {
  inline-size: 1.375rem;
  block-size: 1.375rem;
}
