/* Raven's Occasions - campaign pages (event gallery + digital photo booth).
 *
 * These pages are not part of the main site chrome. A digital photo booth
 * campaign is branded to the paying client, so nothing here assumes the
 * Raven's Occasions palette beyond the fallbacks below - the generated page
 * overrides the custom properties inline with the client's colours.
 *
 * Mobile first throughout. Guests open these on a phone, one-handed, in a
 * dark room, usually on venue wifi.
 */

@font-face { font-family: 'Cinzel'; src: url('fonts/cinzel-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('fonts/cinzel-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('fonts/cormorant-garamond-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Raleway'; src: url('fonts/raleway-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Raleway'; src: url('fonts/raleway-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  /* Raven's Occasions defaults. A client campaign overwrites these. */
  --bg:      #F4F0E5;
  --ink:     #201A17;
  --primary: #8B0101;
  --accent:  #6C605A;
  /* Oxblood on a dark band fails contrast, so dark bands get their own tone.
     Never substitute --primary here. */
  --on-dark: #D9736B;

  --panel:   #FFFFFF;
  --rule:    rgba(32, 26, 23, 0.14);
  --shadow:  0 1px 2px rgba(32, 26, 23, .06), 0 8px 24px rgba(32, 26, 23, .08);

  --display: 'Cinzel', Georgia, serif;
  --serif:   'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:    'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --maxw: 1180px;
  --pad:  18px;
  --tap:  44px;
  --r:    10px;
}

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

/* Several things here are toggled with the hidden attribute while also
 * carrying a display of their own (.btn is inline-flex, .btn-row is flex,
 * img is block). Without this the attribute does nothing. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a { color: var(--primary); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 16px;
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Header -------------------------------------------------------------- */

.c-head {
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.c-head__logo {
  max-height: 76px; width: auto; margin: 0 auto 12px;
}
.c-head__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.35rem, 5.5vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: .01em;
  margin: 0;
  color: var(--primary);
}
.c-head__date {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: .04em;
  color: var(--accent);
  margin: 6px 0 0;
}
.c-head__kicker {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}
.c-head__intro {
  font-family: var(--serif);
  font-size: 1.15rem;
  max-width: 46ch;
  margin: 10px auto 0;
  color: var(--ink);
}

main { flex: 1 0 auto; padding: 22px 0 40px; }

/* Buttons ------------------------------------------------------------- */

.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 12px 20px;
  border: 1px solid var(--primary); border-radius: var(--r);
  background: var(--primary); color: #fff;
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--primary); }
.btn--quiet { background: transparent; color: var(--accent); border-color: var(--rule); }
.btn--wide { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row > .btn { flex: 1 1 160px; }

/* Notices ------------------------------------------------------------- */

.note {
  border: 1px solid var(--rule); border-left: 4px solid var(--primary);
  background: var(--panel); border-radius: var(--r);
  padding: 14px 16px; margin: 0 0 18px;
}
.note--bad { border-left-color: #8B0101; }
.note p:first-child { margin-top: 0; }
.note p:last-child { margin-bottom: 0; }

.state {
  text-align: center; padding: 46px 18px;
  border: 1px dashed var(--rule); border-radius: var(--r);
  background: var(--panel);
}
.state h2 { font-family: var(--display); font-size: 1.3rem; margin: 0 0 8px; }
.state p { font-family: var(--serif); font-size: 1.12rem; margin: 0 auto; max-width: 42ch; }

.spinner {
  width: 28px; height: 28px; margin: 0 auto 14px;
  border: 3px solid var(--rule); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Gallery grid -------------------------------------------------------- */

.g-bar {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 0 0 14px;
}
.g-count { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0; }
.g-live { font-size: .82rem; color: var(--accent); margin: 0; }
.g-live::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); margin-right: 7px; vertical-align: baseline;
}

.g-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none; margin: 0; padding: 0;
}
@media (min-width: 560px)  { .g-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 860px)  { .g-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .g-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.g-cell { margin: 0; }
.g-cell button {
  display: block; width: 100%; padding: 0; cursor: pointer;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--panel); overflow: hidden;
}
.g-cell img {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover;
  background: var(--rule);
}
.g-cell--new { animation: pop 420ms ease-out; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .g-cell--new { animation: none; } }

/* Lightbox ------------------------------------------------------------ */

.lb {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(16, 13, 11, .94);
  display: flex; flex-direction: column;
}
.lb__stage {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
  padding: 12px; min-height: 0;
}
.lb__stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb__bar {
  flex: 0 0 auto; display: flex; gap: 10px; align-items: center;
  padding: 12px calc(var(--pad) + env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) calc(var(--pad) + env(safe-area-inset-left, 0px));
  background: rgba(0, 0, 0, .35);
}
.lb__bar .btn { border-color: var(--on-dark); background: var(--on-dark); color: #1A1512; }
.lb__bar .btn--quiet { background: transparent; color: var(--on-dark); border-color: var(--on-dark); }
.lb__nav {
  min-width: var(--tap); min-height: var(--tap);
  background: transparent; border: 1px solid var(--on-dark); border-radius: var(--r);
  color: var(--on-dark); font-size: 1.2rem; cursor: pointer;
}
.lb__nav:disabled { opacity: .35; }
.lb__spacer { flex: 1 1 auto; }

/* Booth --------------------------------------------------------------- */

.b-stage {
  position: relative; width: 100%; max-width: 520px; margin: 0 auto 16px;
  background: #16110F; border-radius: var(--r); overflow: hidden;
}
.b-stage video, .b-stage canvas, .b-stage img { width: 100%; display: block; }
.b-stage video { transform: scaleX(-1); }        /* front camera reads as a mirror */
.b-stage video.is-rear { transform: none; }
.b-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; pointer-events: none;
}

.b-panel {
  max-width: 520px; margin: 0 auto;
}
.b-consent {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--panel); padding: 14px; margin: 0 0 14px;
}
.b-consent input {
  width: 22px; height: 22px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--primary);
}
.b-consent span { font-size: .95rem; }

.b-status { min-height: 1.4em; margin: 12px 0 0; font-size: .95rem; color: var(--accent); }
.b-status[data-tone="bad"] { color: #8B0101; font-weight: 600; }
.b-status[data-tone="good"] { color: var(--primary); font-weight: 600; }

.b-file { display: block; margin: 12px 0 0; font-size: .92rem; color: var(--accent); }

/* Footer -------------------------------------------------------------- */

.c-foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--rule);
  padding: 18px 0 calc(22px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: .84rem;
  color: var(--accent);
}
.c-foot a { color: var(--accent); }
.c-foot p { margin: 4px 0; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}


/* Guided capture (welcome, countdown, flash) ---------------------------------
   All three sit inside .b-stage, above the overlay, so the guest sees the
   finished frame before they have taken anything. */
.b-stage { min-height: 120px; }
.b-overlay { z-index: 2; }
.b-welcome {
  position: absolute; inset: 0; z-index: 3; width: 100%; border: 0; padding: 0 0 16%;
  display: flex; align-items: flex-end; justify-content: center;
  background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.b-welcome[hidden] { display: none; }
.b-welcome__tap {
  font-family: 'Cinzel', Georgia, serif; font-size: clamp(1.3rem, 5vw, 2.4rem); letter-spacing: .12em;
  text-transform: uppercase; color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.75);
  padding: .5em 1.1em; border: 1px solid rgba(255,255,255,.7); border-radius: 2px;
  background: rgba(22,17,15,.45); animation: b-pulse 1.8s ease-in-out infinite;
}
.b-count {
  position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', Georgia, serif; font-size: clamp(6rem, 34vw, 18rem); line-height: 1; color: #fff;
  text-shadow: 0 4px 40px rgba(0,0,0,.7); pointer-events: none;
  /* A soft dark pool behind the number, so it reads over pale artwork and
     bright rooms alike. */
  background: radial-gradient(circle at center, rgba(0,0,0,.55) 0, rgba(0,0,0,.28) 38%, rgba(0,0,0,0) 68%);
  -webkit-text-stroke: 1px rgba(0,0,0,.35);
}
.b-count[hidden] { display: none; }
.b-count.is-pop { animation: b-pop .95s ease-out both; }
.b-flash { position: absolute; inset: 0; z-index: 5; background: #fff; pointer-events: none; animation: b-flash .38s ease-out both; }
.b-flash[hidden] { display: none; }
@keyframes b-pulse { 0%, 100% { opacity: .65; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes b-pop { 0% { opacity: 0; transform: scale(1.6); } 25% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.9); } }
@keyframes b-flash { 0% { opacity: .95; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .b-welcome__tap, .b-count.is-pop, .b-flash { animation: none; }
}

/* Camera on ---------------------------------------------------------------------
   While the camera is open on a guest's own phone the booth takes over the
   screen: the page header and footer step aside and the stage grows to the full
   width, or as tall as leaves room for the buttons, whichever comes first. */
html.is-live:not(.kiosk) .c-head, html.is-live:not(.kiosk) .c-foot, html.is-live:not(.kiosk) .skip-link { display: none !important; }
html.is-live:not(.kiosk) .wrap { max-width: none; padding: 0; }
html.is-live:not(.kiosk) .b-stage { width: min(100vw, calc(72vh * var(--ar, 0.6667))); width: min(100vw, calc(72svh * var(--ar, 0.6667))); max-width: none; height: auto; margin: 0 auto; border-radius: 0; }
html.is-live:not(.kiosk) .b-stage video, html.is-live:not(.kiosk) .b-stage #preview { width: 100%; height: 100%; }
html.is-live:not(.kiosk) .b-panel { padding: 12px 16px 28px; }
html.is-live:not(.kiosk) main { padding-top: 0; }

/* Kiosk ------------------------------------------------------------------------
   Add ?kiosk=1 to a booth link for a mirror booth, a TV-sized touchscreen or a
   tablet on a stand: no page chrome, a preview as tall as the screen allows,
   and controls sized for an arm's-length tap rather than a thumb. */
.kiosk body { overflow-x: hidden; }
.kiosk .c-head, .kiosk .c-foot, .kiosk .skip-link, .kiosk .b-file, .kiosk #start, .kiosk #flip, .kiosk .b-panel hr { display: none !important; }
.kiosk .wrap { max-width: none; padding: 0 2vw; }
/* As large as fits in BOTH directions while keeping the print's true shape:
   a portrait print is limited by height, a landscape one by width. */
.kiosk .b-stage { width: min(96vw, calc(54vh * var(--ar, 0.6667))); max-width: none; height: auto; margin: 1.5vh auto; }
.kiosk .b-stage video, .kiosk .b-stage #preview { width: 100%; height: 100%; }
.kiosk .b-panel { max-width: min(96vw, 1100px); margin: 0 auto; padding: 1.5vh 2vw; }
.kiosk .btn { min-height: 6.5vh; font-size: clamp(1.3rem, 2.2vh, 2.4rem); }
.kiosk .b-panel > p.b-file, .kiosk .b-panel > .btn-row:last-child { margin-top: 1vh; }
.kiosk .btn-row { gap: 1.5vw; }
.kiosk .b-consent { font-size: clamp(1.05rem, 1.9vh, 1.9rem); }
.kiosk .b-consent input { width: 1.6em; height: 1.6em; }
.kiosk .b-status { font-size: clamp(1.05rem, 1.9vh, 1.9rem); }
.kiosk #cGate { max-width: min(92vw, 1000px); margin: 4vh auto; font-size: clamp(1.1rem, 2vh, 2rem); }
.kiosk #cGate input[type="text"], .kiosk #cGate input[type="email"] { font-size: inherit !important; padding: .8em 1em !important; }
.kiosk #cGate input[type="radio"], .kiosk #cGate input[type="checkbox"] { width: 1.5em; height: 1.5em; }

/* Proudly Canadian goose ----------------------------------------------------------
   One sticker, used everywhere the Canadian mark appears. Six poses sit side by
   side in one small image; the animation steps through them: two little steps,
   wings up, the honk, the maple-leaf burst, hold, then back to standing and a
   rest - about five seconds a lap, so it is not honking all day. Size it with
   --goose. Anyone who asks their device for less motion gets the still mark. */
.ro-goose {
  --goose: 64px;
  display: inline-block; width: var(--goose); height: calc(var(--goose) * 0.9);
  vertical-align: middle; margin: -6px 2px -2px 0;
  background: url("RavensOccasions-Sticker_ProudlyCanadianGoose_20260921_v1.webp") 0 0 / 600% 100% no-repeat;
  font-size: 0; line-height: 0; color: transparent; overflow: hidden;
  animation: ro-goose 4.8s step-end infinite;
}
@keyframes ro-goose {
  0%   { background-position:   0% 0; transform: translateX(-5px); }
  6%   { background-position:  20% 0; transform: translateX(-3px); }
  12%  { background-position:   0% 0; transform: translateX(-1px); }
  18%  { background-position:  20% 0; transform: translateX(0); }
  24%  { background-position:  40% 0; transform: none; }
  32%  { background-position:  60% 0; transform: none; }
  40%  { background-position:  80% 0; transform: scale(1.14); }
  44%  { background-position: 100% 0; transform: scale(1.04); }
  48%  { background-position: 100% 0; transform: none; }
  80%  { background-position:   0% 0; transform: translateX(-5px); }
  100% { background-position:   0% 0; transform: translateX(-5px); }
}
@media (prefers-reduced-motion: reduce) {
  .ro-goose { animation: none; background-position: 100% 0; }
}

/* The consent box gets a short shake when a guest tries to skip past it. */
.b-consent--nudge { animation: ro-nudge .5s ease 2; outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
@keyframes ro-nudge { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-5px); } 70% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .b-consent--nudge { animation: none; } }
