/* Race page: every photographer's gallery for one race. Matches the dark
   sports look of the homepage (styles.css "ACTION REBRAND"). */
:root {
    --rc-bg: #030405;
    --rc-bg-soft: #081013;
    --rc-card: #0d1417;
    --rc-card-hover: #111c20;
    --rc-line: rgba(255, 255, 255, 0.10);
    --rc-text: #f7fff7;
    --rc-dim: #aebbb7;
    --rc-mute: #70807d;
    --rc-accent: #b7ff42;
    --rc-accent-ink: #071003;
    --rc-warn: #ffb547;
    --rc-error: #ff6b5e;
    --rc-radius: 12px;
    --rc-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--rc-bg);
    color: var(--rc-text);
    font-family: var(--rc-font);
    font-size: 16px;
    line-height: 1.5;
}
a { color: var(--rc-accent); }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--rc-accent); outline-offset: 2px; }

.rc-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px clamp(16px, 4vw, 40px);
    border-bottom: 1px solid var(--rc-line);
    background: rgba(3, 4, 5, 0.92);
    position: sticky; top: 0; z-index: 20;
    backdrop-filter: blur(8px);
}
.rc-brand { color: var(--rc-text); font-weight: 900; letter-spacing: .08em; text-decoration: none; font-size: 15px; }
.rc-top-links a { color: var(--rc-dim); text-decoration: none; font-size: 14px; font-weight: 600; }
.rc-top-links a:hover { color: var(--rc-text); }

/* Hero */
.rc-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--rc-line); }
.rc-hero-bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    opacity: .28; filter: grayscale(.2);
}
.rc-hero::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(3,4,5,.35) 0%, rgba(3,4,5,.85) 70%, var(--rc-bg) 100%);
}
.rc-hero-inner {
    position: relative; z-index: 1;
    max-width: 960px; margin: 0 auto;
    padding: clamp(48px, 9vw, 96px) 16px clamp(36px, 6vw, 64px);
    text-align: center;
}
.rc-kicker {
    display: inline-block; padding: 4px 10px; border-radius: 999px;
    background: var(--rc-accent); color: var(--rc-accent-ink);
    font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.rc-hero h1 {
    margin: 14px 0 8px;
    font-size: clamp(34px, 7vw, 68px); line-height: 1; font-weight: 900;
    text-transform: uppercase; letter-spacing: -.01em; text-wrap: balance;
}
.rc-meta { margin: 0; color: var(--rc-dim); font-size: 15px; }
.rc-meta span + span::before { content: '·'; margin: 0 8px; color: var(--rc-mute); }
.rc-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.rc-note { color: var(--rc-dim); font-size: 14px; max-width: 520px; margin: 18px auto 0; }

/* Buttons */
.rc-btn {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 48px; padding: 10px 22px; border-radius: 999px;
    border: 1px solid var(--rc-line); background: transparent; color: var(--rc-text);
    font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; text-align: center;
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.rc-btn:hover { border-color: rgba(255,255,255,.3); }
.rc-btn:active { transform: translateY(1px); }
.rc-btn:disabled { opacity: .45; cursor: not-allowed; }
.rc-btn-primary { background: var(--rc-accent); color: var(--rc-accent-ink); border-color: var(--rc-accent); }
.rc-btn-primary:hover { background: #c6ff6a; border-color: #c6ff6a; }
.rc-btn-ghost { background: rgba(255,255,255,.04); }
.rc-btn-main { font-size: 17px; font-weight: 800; }
.rc-btn-sub { font-size: 12px; font-weight: 600; opacity: .75; }
.rc-btn-wide { width: 100%; }
.rc-icon-btn {
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--rc-line); background: transparent; color: var(--rc-dim); cursor: pointer;
}

/* Search panels */
.rc-panel {
    max-width: 640px; margin: 24px auto 0; padding: 22px 20px;
    background: var(--rc-card); border: 1px solid var(--rc-line); border-radius: var(--rc-radius);
}
@media (max-width: 680px) { .rc-panel { margin: 16px 16px 0; } }
.rc-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rc-panel h2 { margin: 0; font-size: 20px; font-weight: 800; }
.rc-panel-lead { color: var(--rc-dim); margin: 8px 0 18px; }
.rc-upload-row { display: flex; flex-wrap: wrap; gap: 10px; }
.rc-upload-row .rc-btn { flex: 1 1 160px; }
.rc-preview { margin-top: 18px; }
.rc-preview-stage { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; }
.rc-preview-stage img { max-height: 360px; width: auto; border-radius: 10px; }
.rc-face-boxes { position: absolute; inset: 0; }
.rc-face-choice {
    position: absolute; border: 2px solid rgba(255,255,255,.85); border-radius: 8px;
    background: rgba(0,0,0,.08); cursor: pointer; padding: 0;
}
.rc-face-choice::after {
    content: attr(data-label); position: absolute; left: 0; top: -24px;
    font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
    background: rgba(0,0,0,.75); color: #fff; white-space: nowrap;
}
.rc-face-choice.is-selected { border-color: var(--rc-accent); box-shadow: 0 0 0 3px rgba(183,255,66,.35); }
.rc-face-choice.is-selected::after { background: var(--rc-accent); color: var(--rc-accent-ink); content: attr(data-label) ' ✓'; }
.rc-status { min-height: 1.5em; margin: 12px 0; color: var(--rc-dim); font-size: 14px; text-align: center; }
.rc-status.is-error { color: var(--rc-error); }
.rc-status.is-ok { color: var(--rc-accent); }
.rc-privacy { margin: 14px 0 0; font-size: 12px; color: var(--rc-mute); text-align: center; }
.rc-bib-form { display: flex; gap: 10px; margin-top: 16px; }
.rc-bib-form input {
    flex: 1; min-width: 0; min-height: 48px; padding: 0 16px; border-radius: 999px;
    border: 1px solid var(--rc-line); background: var(--rc-bg-soft); color: var(--rc-text); font-size: 17px;
}

/* Sections */
.rc-results, .rc-galleries { max-width: 1120px; margin: 0 auto; padding: 40px 16px 8px; }
.rc-section-head h2 { margin: 0; font-size: clamp(22px, 3.4vw, 30px); font-weight: 900; text-transform: uppercase; }
.rc-section-head p { margin: 6px 0 20px; color: var(--rc-dim); }

/* Result groups (one per gallery) */
.rc-result-groups { display: grid; gap: 14px; }
.rc-group {
    display: grid; gap: 14px; padding: 16px;
    background: var(--rc-card); border: 1px solid var(--rc-line); border-radius: var(--rc-radius);
}
.rc-group-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rc-group-head .rc-who { flex: 1 1 220px; min-width: 0; }
.rc-who-name { font-weight: 800; }
.rc-who-sub { color: var(--rc-dim); font-size: 14px; }
.rc-badge {
    display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
    border: 1px solid rgba(255,181,71,.45); color: var(--rc-warn); margin-left: 6px; vertical-align: middle;
}
.rc-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.rc-strip img, .rc-strip .rc-more {
    width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--rc-bg-soft);
}
.rc-more {
    display: flex; align-items: center; justify-content: center;
    color: var(--rc-text); font-weight: 800; text-decoration: none; border: 1px solid var(--rc-line);
}
.rc-group .rc-btn { justify-self: start; }
@media (max-width: 520px) { .rc-group .rc-btn { justify-self: stretch; } }

/* Avatars */
.rc-avatar {
    width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: #1b2a24; color: var(--rc-accent); font-weight: 800; font-size: 14px;
}
.rc-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Gallery grid */
.rc-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.rc-gallery {
    display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit;
    background: var(--rc-card); border: 1px solid var(--rc-line); border-radius: var(--rc-radius);
    transition: border-color .12s ease, background .12s ease;
}
.rc-gallery:hover { border-color: rgba(183,255,66,.4); background: var(--rc-card-hover); }
.rc-gallery-cover { aspect-ratio: 16 / 10; background: var(--rc-bg-soft); overflow: hidden; }
.rc-gallery-cover img { width: 100%; height: 100%; object-fit: cover; }
.rc-gallery-body { display: grid; gap: 6px; padding: 14px; }
.rc-gallery-who { display: flex; align-items: center; gap: 10px; }
.rc-gallery-who .rc-avatar { width: 32px; height: 32px; font-size: 12px; }
.rc-gallery-title { color: var(--rc-dim); font-size: 14px; }
.rc-gallery-count { font-variant-numeric: tabular-nums; }
.rc-gallery-price { color: var(--rc-text); font-size: 14px; }
.rc-gallery-flag { color: var(--rc-mute); font-size: 12px; }
.rc-empty, .rc-error-box { color: var(--rc-dim); padding: 20px; border: 1px dashed var(--rc-line); border-radius: var(--rc-radius); text-align: center; }
.rc-skeleton { min-height: 280px; border-radius: var(--rc-radius); background: linear-gradient(90deg, var(--rc-card), var(--rc-card-hover), var(--rc-card)); background-size: 200% 100%; animation: rc-shimmer 1.4s infinite; }
@keyframes rc-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .rc-skeleton { animation: none; } .rc-btn { transition: none; } }

.rc-spinner { width: 28px; height: 28px; margin: 6px auto; border: 3px solid var(--rc-line); border-top-color: var(--rc-accent); border-radius: 50%; animation: rc-spin .8s linear infinite; }
@keyframes rc-spin { to { transform: rotate(360deg); } }

.rc-footer { max-width: 1120px; margin: 48px auto 0; padding: 24px 16px 40px; color: var(--rc-mute); font-size: 13px; border-top: 1px solid var(--rc-line); }
.rc-footer a { color: var(--rc-dim); text-decoration: none; }

/* "Notify me" card under the results */
.rc-alert {
    display: grid; gap: 12px; margin-top: 16px; padding: 18px;
    background: var(--rc-card); border: 1px solid rgba(183,255,66,.25); border-radius: var(--rc-radius);
}
.rc-alert h3 { margin: 0; font-size: 18px; font-weight: 800; }
.rc-alert p { margin: 4px 0 0; color: var(--rc-dim); }
.rc-alert-row { display: flex; gap: 10px; flex-wrap: wrap; }
.rc-alert-row input {
    flex: 1 1 220px; min-width: 0; min-height: 48px; padding: 0 16px; border-radius: 999px;
    border: 1px solid var(--rc-line); background: var(--rc-bg-soft); color: var(--rc-text);
}
.rc-alert-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--rc-dim); }
.rc-alert-consent input { margin-top: 3px; flex: 0 0 auto; }
.rc-alert .rc-status { text-align: left; margin: 0; }

/* Checkpoint chips and labels */
.rc-checkpoints { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.rc-chip {
    min-height: 36px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--rc-line); background: rgba(255,255,255,.04); color: var(--rc-text); font-weight: 700; font-size: 14px;
}
.rc-chip.is-active { background: var(--rc-accent); color: var(--rc-accent-ink); border-color: var(--rc-accent); }
.rc-spot {
    display: inline-block; padding: 1px 8px; margin-right: 2px; border-radius: 999px;
    border: 1px solid rgba(183,255,66,.35); color: var(--rc-accent); font-size: 12px; font-weight: 700;
}
.rc-seo { color: var(--rc-mute); font-size: 13px; margin-top: -10px; }
.rc-seo:empty { display: none; }
.rc-top-links a + a { margin-left: 16px; }
.rc-page-title { margin: 0; font-size: clamp(30px, 6vw, 56px); font-weight: 900; text-transform: uppercase; line-height: 1; }

/* Pick photos into the cart */
.rc-pick { position: relative; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 8px; }
.rc-free-pick { position: relative; display: block; border-radius: 8px; text-decoration: none; }
.rc-free-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--rc-bg-soft); display: block; }
.rc-free-tag { position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 999px; background: var(--rc-accent); color: var(--rc-accent-ink); font-size: 11px; font-weight: 800; }
.rc-free-note { align-self: center; font-weight: 700; color: var(--rc-accent); }
.rc-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--rc-bg-soft); }
.rc-pick-mark {
    position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.9); background: rgba(0,0,0,.35);
}
.rc-pick.is-picked img { outline: 3px solid var(--rc-accent); outline-offset: -3px; }
.rc-pick.is-picked .rc-pick-mark { background: var(--rc-accent); border-color: var(--rc-accent); }
.rc-pick.is-picked .rc-pick-mark::after { content: '✓'; display: block; text-align: center; line-height: 20px; font-weight: 900; color: var(--rc-accent-ink); font-size: 14px; }
button.rc-more { cursor: pointer; font: inherit; font-weight: 800; }
.rc-group-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 520px) { .rc-group-actions .rc-btn { flex: 1 1 100%; } }
.rc-select-all { display: flex; justify-content: flex-end; }

/* Sticky cart bar */
.rc-cartbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px clamp(16px, 4vw, 40px) calc(12px + env(safe-area-inset-bottom));
    background: rgba(8, 16, 19, .96); border-top: 1px solid rgba(183,255,66,.3); backdrop-filter: blur(8px);
}
.rc-cartbar-info { min-width: 0; }
.rc-cartbar-info small { display: block; color: var(--rc-dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#rc-cart-total { color: var(--rc-accent); font-weight: 800; margin-left: 6px; }
body:has(.rc-cartbar:not([hidden])) .rc-footer { padding-bottom: 96px; }
