/* ShereheTickets storefront — the local layer on top of Bootstrap.
   Deliberately small: Bootstrap does the grid, forms, buttons and utilities;
   this adds only the brand, the typographic scale a buyer-facing page wants,
   and the few components Bootstrap has no opinion about. */

/* ── IBM Plex Sans ───────────────────────────────────────────────────────────
   The same face DashForge uses, so the storefront and the console read as one
   product.

   SELF-HOSTED, not pulled from Google Fonts. A third-party font request is a
   render-blocking dependency on somebody else's uptime, and on a slow Kenyan
   connection it is the request that decides whether a buyer sees text.

   THE LATIN1 SUBSET, not the complete face: 17 KB a weight against 56 KB, and
   Latin1 covers English and Swahili in full. Three weights only — 400 for
   body, 600 for headings and prices, 700 for the hero. Every italic and the
   other six weights are omitted because nothing here asks for them.

   `font-display: swap` so text paints immediately in the fallback and
   re-renders when the face arrives. A buyer reading a price should never wait
   on a font. */
@font-face {
    font-family: "IBM Plex Sans";
    src: url("../fonts/ibm-plex-sans/IBMPlexSans-Regular-Latin1.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("../fonts/ibm-plex-sans/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("../fonts/ibm-plex-sans/IBMPlexSans-Bold-Latin1.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Brand, matching the console. */
    --st-primary: #0088d2;
    --st-primary-dark: #0074b3;
    --st-secondary: #ce00e7;

    --st-ink: #16202f;
    --st-muted: #5b6b80;
    --st-line: #e3e8ef;
    --st-surface: #f7f9fc;

    /* Bootstrap's own custom properties, repointed rather than overridden with
       !important. Buttons, links, focus rings and spinners all follow. */
    --bs-primary: #0088d2;
    --bs-primary-rgb: 0, 136, 210;
    --bs-link-color: #0074b3;
    --bs-link-color-rgb: 0, 116, 179;
    --bs-link-hover-color: #005e93;
    --bs-body-color: #16202f;
    /* IBM Plex Sans first, then the system stack as the swap fallback — so the
       first paint uses a face that is already on the device. */
    --bs-body-font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont,
                           "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* A STOREFRONT READS BIGGER THAN A CONSOLE. The console runs at 13px for
   density; a buyer on a phone gets 16px, which is also what stops iOS zooming
   a form field when it is focused. */
body {
    font-size: 16px;
    line-height: 1.55;
    background: #fff;
    -webkit-text-size-adjust: 100%;
}

.btn-primary {
    --bs-btn-bg: var(--st-primary);
    --bs-btn-border-color: var(--st-primary);
    --bs-btn-hover-bg: var(--st-primary-dark);
    --bs-btn-hover-border-color: var(--st-primary-dark);
    --bs-btn-active-bg: var(--st-primary-dark);
    --bs-btn-active-border-color: var(--st-primary-dark);
    --bs-btn-disabled-bg: var(--st-primary);
    --bs-btn-disabled-border-color: var(--st-primary);
}

.x-small { font-size: 0.78rem; }

/* ── layout ──────────────────────────────────────────────────────────────── */
.st-wrap {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    /* 16px side gutter at phone width, so nothing touches the screen edge. */
    padding-left: 16px;
    padding-right: 16px;
}

.st-narrow {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* ── header and footer ───────────────────────────────────────────────────── */
.st-header {
    border-bottom: 1px solid var(--st-line);
    background: #fff;
}

.st-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 64px;
}

.st-logo img { height: 30px; width: auto; display: block; }

.st-footer {
    border-top: 1px solid var(--st-line);
    background: var(--st-surface);
    margin-top: 48px;
    padding: 28px 0;
    font-size: 0.84rem;
    color: var(--st-muted);
}

.st-footer a { color: var(--st-muted); }

/* ── hero and search ─────────────────────────────────────────────────────── */
.st-hero {
    background: linear-gradient(135deg, var(--st-primary) 0%, var(--st-secondary) 100%);
    color: #fff;
    padding: 44px 0 52px;
}

.st-hero-title {
    font-size: clamp(1.6rem, 5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}

.st-hero-sub { opacity: 0.92; margin: 0 0 22px; }

.st-search { display: flex; flex-wrap: wrap; gap: 8px; }
.st-search input { flex: 1 1 200px; min-width: 0; }
.st-search button { flex: 0 0 auto; }

.st-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── event cards ─────────────────────────────────────────────────────────── */
.st-card {
    border: 1px solid var(--st-line);
    border-radius: 10px;
    overflow: hidden;
    color: inherit;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.st-card:hover {
    box-shadow: 0 6px 20px rgba(22, 32, 47, 0.1);
    transform: translateY(-2px);
}

/* object-fit: cover is what stops a portrait poster distorting in a landscape
   slot. Lifted from DashForge's card-event, which had the same problem. */
.st-cover {
    display: block;
    width: 100%;
    height: 168px;
    object-fit: cover;
    background: var(--st-surface);
}

.st-cover-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--st-primary), var(--st-secondary));
}

.st-card-when {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--st-primary-dark);
}

.st-card-title {
    font-weight: 600;
    /* Two lines, then ellipsis: a long title must not push the price out of a
       card and make one card in a grid taller than its neighbours. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.st-card-where { color: var(--st-muted); }
.st-from-price { font-weight: 600; }

.st-eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--st-primary-dark);
    margin: 0;
}

/* ── event detail ────────────────────────────────────────────────────────── */
.st-event-hero { background: var(--st-surface); }

.st-event-cover {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
}

.st-event {
    display: grid;
    gap: 32px;
    padding-top: 28px;
    padding-bottom: 48px;
}

.st-event-title {
    font-size: clamp(1.5rem, 4.5vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 6px 0 10px;
}

.st-event-when { font-weight: 600; margin-bottom: 4px; }
.st-event-where { color: var(--st-muted); }

.st-prose { margin-top: 20px; }
.st-prose p { margin-bottom: 0.9rem; }

.st-ticket-panel {
    border: 1px solid var(--st-line);
    border-radius: 12px;
    padding: 18px;
    background: #fff;
}

/* Two columns from the tablet breakpoint up, with the ticket panel sticky —
   the pattern every ticketing site converges on, because the buy button
   should never scroll away from a long description. */
@media (min-width: 768px) {
    .st-event { grid-template-columns: minmax(0, 1fr) 340px; }
    .st-ticket-panel { position: sticky; top: 20px; }
}

/* ── ticket types ────────────────────────────────────────────────────────── */
.st-type {
    border: 1px solid var(--st-line);
    border-radius: 9px;
    padding: 12px;
    margin-bottom: 10px;
}

.st-type-out { opacity: 0.55; }

.st-type-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.st-type-name { font-weight: 600; }
.st-type-price { font-weight: 600; white-space: nowrap; }

.st-type-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.st-qty { width: auto; min-width: 78px; }

.st-total {
    border-top: 1px solid var(--st-line);
    margin-top: 14px;
    padding-top: 12px;
}

.st-total-amount { font-size: 1.2rem; font-weight: 700; }

/* ── checkout, clocks, payment ───────────────────────────────────────────── */
.st-clock {
    background: var(--st-surface);
    border: 1px solid var(--st-line);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 0.88rem;
}

.st-clock-label { color: var(--st-muted); }
.st-clock-time { font-weight: 700; font-variant-numeric: tabular-nums; }

/* The last two minutes, when the buyer is actually at the keypad. */
.st-clock-urgent { color: #b42318; }

.st-summary {
    background: var(--st-surface);
    border: 1px solid var(--st-line);
    border-radius: 9px;
    padding: 14px;
}

.st-paybill summary,
.st-terms summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.92rem;
}

.st-terms ul { padding-left: 1.1rem; margin-top: 0.6rem; font-size: 0.86rem; }
.st-terms li { margin-bottom: 0.35rem; }

.st-success p:first-child { font-weight: 700; }

/* ── the ticket ──────────────────────────────────────────────────────────── */
.st-ticket { max-width: 460px; margin: 0 auto; padding: 24px 16px 48px; }

.st-ticket-card {
    border: 1px solid var(--st-line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(22, 32, 47, 0.07);
}

.st-ticket-head {
    background: linear-gradient(135deg, var(--st-primary), var(--st-primary-dark));
    color: #fff;
    padding: 18px;
}

.st-ticket-head .st-eyebrow { color: rgba(255, 255, 255, 0.85); }

.st-ticket-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 18px;
    /* A dashed rule top and bottom, so it reads as the detachable stub. */
    border-top: 1px dashed var(--st-line);
    border-bottom: 1px dashed var(--st-line);
}

/* Pure white behind the code and never scaled below 200px: a scanner needs
   quiet margin and crisp edges, and this is read off cracked screens in bad
   light at a gate. */
.st-qr {
    display: block;
    width: 220px;
    height: 220px;
    max-width: 100%;
    background: #fff;
    image-rendering: pixelated;
}

.st-qr-void,
.st-qr-pending {
    text-align: center;
    color: var(--st-muted);
}

.st-ticket-body { padding: 16px 18px 18px; }

/* ── print: the ticket is the one page people print ──────────────────────── */
@media print {
    .st-header,
    .st-footer,
    .st-terms { display: none !important; }

    .st-ticket { max-width: none; padding: 0; }

    .st-ticket-card {
        border: 1px solid #000;
        box-shadow: none;
        break-inside: avoid;
    }

    /* Gradients print as muddy grey or not at all, so the header goes flat. */
    .st-ticket-head {
        background: none !important;
        color: #000 !important;
        border-bottom: 1px solid #000;
    }

    .st-ticket-head .st-eyebrow { color: #000 !important; }
}
