/* Laid out for an iPad Air 13" (1366 × 1024 CSS px in landscape, 1024 × 1366 in portrait). */

:root {
  --red: #e10600;
  --ink: #111111;
  --muted: #5d5f63;
  --line: rgba(17, 17, 17, 0.08);
  --paper: #f6f5f2;
  --card: #ffffff;
  --radius: 24px;
  --pad: 48px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Kiosk: no zooming, selecting, long-press menus or rubber-band scrolling. */
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-x pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: max(env(safe-area-inset-top), 28px) var(--pad) 0;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

h1, h2, p { margin: 0; }

.qr { display: block; flex: none; line-height: 0; }
.qr svg { width: 100%; height: auto; }

/* Header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
}

.logo { height: 30px; width: auto; }

.event {
  font-size: 17px;
  font-weight: 600;
  color: var(--muted);
}

/* Layout: library on the left, booking on the right (stacked in portrait). */

.layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  min-height: 0;
}

.library {
  min-height: 0;
  overflow-y: auto;
  padding-bottom: var(--pad);
  scrollbar-width: none;
}

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

h1 {
  font-size: 46px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.intro {
  margin-top: 12px;
  font-size: 19px;
  line-height: 1.4;
  color: var(--muted);
}

.section { margin-top: 36px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title::before {
  content: "";
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--red);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
}

/* Cards */

.card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 22px 22px 26px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.card:active,
.booking-open:active { transform: scale(0.985); }

.card-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.card-title {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 15.5px;
  line-height: 1.4;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-action {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--red);
}

.card-action::after { content: " →"; }

.card .qr { width: 136px; }

/* Booking */

.booking {
  margin-bottom: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 36px 32px 32px;
  border-radius: 28px;
  background: var(--ink);
  color: #fff;
}

.booking-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}

.booking h2 {
  font-size: 36px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.booking-text {
  font-size: 17px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}

.booking-open {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 10px;
  transition: transform 120ms ease;
}

.booking-open .qr {
  width: 100%;
  max-width: 280px;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
}

.booking-action {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
}

.booking-missing {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--red);
  font-weight: 700;
}

@media (orientation: portrait) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    gap: 0;
  }

  .booking {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto 1fr;
    column-gap: 32px;
    row-gap: 10px;
    margin: 0 calc(-1 * var(--pad));
    padding: 32px var(--pad) max(env(safe-area-inset-bottom), 32px);
    border-radius: 28px 28px 0 0;
  }

  .booking > :not(.booking-open) { grid-column: 1; }

  .booking-open {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin: 0;
    padding: 0;
  }

  .booking-open .qr { width: 190px; }
}

/* Viewer */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: #1d1d1f;
  animation: rise 220ms ease-out;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
}

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: max(env(safe-area-inset-top), 16px) 24px 16px;
  background: var(--ink);
  color: #fff;
}

.viewer-qr {
  width: 84px;
  padding: 3px;
  border-radius: 10px;
  background: #fff;
}

.viewer-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.viewer-title span {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.viewer-title strong {
  font-size: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.close {
  min-height: 52px;
  padding: 0 28px;
  border-radius: 26px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}

.close:active { background: #e6e6e6; }

.viewer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 32px 32px 64px;
}

.viewer-body .page {
  height: auto;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.viewer-body iframe {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  border: 0;
  border-radius: 16px;
  background: #fff;
}

.viewer-status {
  margin: auto;
  max-width: 520px;
  text-align: center;
  font-size: 20px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);
}
