/* templates.css — rider-managed content (results, galleries, sponsors, about),
   the decoupled top bar, and a FULLY SELF-CONTAINED link page with 3 templates.
   Loaded after style.css on rider.html + link.html. The link page (.ls-*) does
   not depend on style.css. Additive: absent fields render nothing. */

/* ============================================================
   PROFILE CONTENT SECTIONS
   ============================================================ */
.results-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.results-item {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: baseline;
  padding: 10px 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); border-radius: 10px;
}
.results-year { font-weight: 700; color: var(--rx-accent, #38bdf8); font-variant-numeric: tabular-nums; }
.results-event { color: #e6edf7; }
.results-place { font-size: 13px; font-weight: 600; color: #04121f; background: var(--rx-accent, #38bdf8); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }

.photo-gallery { column-count: 3; column-gap: 10px; }
.photo-gallery .photo-item { display: block; margin: 0 0 10px; border-radius: 10px; overflow: hidden; break-inside: avoid; background: rgba(255,255,255,.05); }
.photo-gallery .photo-item img { width: 100%; display: block; transition: transform .25s ease; }
.photo-gallery .photo-item:hover img { transform: scale(1.04); }
@media (max-width: 640px) { .photo-gallery { column-count: 2; } }

.video-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.video-item { aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.video-item iframe { width: 100%; height: 100%; border: 0; }

.sponsor-logos { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.sponsor-link { display: inline-flex; align-items: center; }
.sponsor-logo { max-height: 34px; max-width: 110px; object-fit: contain; filter: brightness(0) invert(1); opacity: .85; transition: opacity .2s; }
.sponsor-link:hover .sponsor-logo { opacity: 1; }
.sponsor-name { color: #cbd5e1; font-weight: 600; }

.profile-about p { color: #cbd5e1; line-height: 1.7; white-space: pre-wrap; }

/* ============================================================
   DECOUPLED TOP BAR
   ============================================================ */
.rider-topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: rgba(9,16,28,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.rider-topbar-back { color: #cbd5e1; font-weight: 600; font-size: 14px; text-decoration: none; }
.rider-topbar-back:hover { color: #38bdf8; }
.rider-topbar-all { color: #94a3b8; font-size: 13px; text-decoration: none; }
.rider-topbar-all:hover { color: #e6edf7; }

/* ============================================================
   PROFILE THEMES (accent + light surfaces + gallery layout)
   ============================================================ */
body.theme-bold-dark { --rx-accent: #22d3ee; }
body.theme-bold-dark .profile-eyebrow { color: #22d3ee; }
body.theme-photo-hero { --rx-accent: #38bdf8; }

/* The profile page stays the consistent dark Lineup design regardless of theme —
   only the accent colour changes. (Light/dark "templates" apply to the link page,
   which is self-contained.) This avoids dark-text-on-dark-hero breakage. */
body.profile-body.theme-clean-light { --rx-accent: #38bdf8; }
/* Profile photo gallery: clean-light uses a tidy uniform grid; others mosaic. */
body.profile-body.theme-clean-light .photo-gallery { column-count: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
body.profile-body.theme-clean-light .photo-gallery .photo-item { margin: 0; aspect-ratio: 1 / 1; }
body.profile-body.theme-clean-light .photo-gallery .photo-item img { height: 100%; object-fit: cover; }

/* Profile hero banner — the rider's action shot behind the name/photo, with a
   strong gradient scrim so the eyebrow/name/tags stay readable, fading into the
   page background at the bottom. Content below the hero sits on the solid page. */
.profile-hero.has-bg { position: relative; background-size: cover; background-position: center 30%; }
.profile-hero.has-bg::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(7,12,22,.45) 0%, rgba(7,12,22,.72) 55%, var(--base-deep, #0b1120) 100%);
}
.profile-hero.has-bg .container { position: relative; z-index: 1; }
.profile-hero.has-bg .profile-eyebrow,
.profile-hero.has-bg .profile-name { text-shadow: 0 2px 16px rgba(0,0,0,.5); }

/* ============================================================
   LINK PAGE — self-contained base (.ls-*)
   ============================================================ */
body.linkstack-body { min-height: 100vh; margin: 0; background: #0b1120; color: #e6edf7;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex; justify-content: center; padding: 0 16px 56px; }
.ls-card { width: 100%; max-width: 460px; }

.ls-cover { height: 300px; margin: 0 -16px; background-size: cover; background-position: center 25%; position: relative; }
.ls-cover::after { content:''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,17,32,0) 40%, rgba(11,17,32,.65) 100%); }
.ls-cover--placeholder { background: linear-gradient(135deg, #0ea5e9 0%, #0b3a5e 60%, #0b1120 100%); }

.ls-head { text-align: center; margin-top: -54px; position: relative; z-index: 1; }
.ls-avatar { width: 108px; height: 108px; border-radius: 50%; overflow: hidden; margin: 0 auto 14px;
  border: 4px solid #0b1120; background: #18233c; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.ls-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ls-avatar svg { width: 56%; height: 56%; margin: 22% auto 0; display: block; color: #38bdf8; }
.ls-name { font-size: 1.6rem; font-weight: 800; margin: 0 0 4px; letter-spacing: -.02em; line-height: 1.15; }
.ls-flag { font-size: 1.1rem; }
.ls-disc { font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--rx-accent, #38bdf8); font-weight: 600; }
.ls-intro { color: #94a3b8; font-size: .95rem; line-height: 1.5; margin: 10px auto 0; max-width: 38ch; }

.ls-stack { display: flex; flex-direction: column; gap: 11px; margin: 26px 0 0; }
.ls-btn { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #fff;
  text-decoration: none; font-weight: 600; font-size: .96rem; transition: transform .12s, background .15s, border-color .15s; }
.ls-btn:hover { transform: translateY(-2px); background: rgba(56,189,248,.14); border-color: rgba(56,189,248,.5); }
.ls-btn-icon { display: inline-flex; width: 22px; height: 22px; flex: 0 0 22px; }
.ls-btn-icon svg { width: 22px; height: 22px; fill: currentColor; }
.ls-btn-label { flex: 1; text-align: left; }
.ls-btn--primary { background: var(--rx-accent-deep, #0ea5e9); border-color: var(--rx-accent-deep, #0ea5e9); color: #04121f; }
.ls-btn--primary:hover { background: var(--rx-accent, #38bdf8); border-color: var(--rx-accent, #38bdf8); color: #04121f; }
.ls-btn--profile { background: transparent; border-color: rgba(56,189,248,.45); color: #7dd3fc; }

.ls-sponsors { margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); text-align: center; }
.ls-sponsors-label { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #94a3b8; margin-bottom: 12px; }
.ls-sponsors-row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: center; }
.ls-sponsors-row img { max-height: 30px; max-width: 100px; object-fit: contain; filter: brightness(0) invert(1); opacity: .82; }
.ls-sponsor-name { font-weight: 700; color: #cbd5e1; font-size: .95rem; padding: 4px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; }
.ls-footer { margin-top: 30px; text-align: center; font-size: .78rem; color: #64748b; }
.ls-footer a { color: #94a3b8; }

/* ============================================================
   LINK PAGE — TEMPLATE 1 · BOLD DARK (default)
   ============================================================ */
body.linkstack-body.theme-bold-dark { background: radial-gradient(ellipse at top, #0d2540 0%, #0b1120 60%, #050a13 100%); --rx-accent: #22d3ee; --rx-accent-deep: #06b6d4; }
body.linkstack-body.theme-bold-dark .ls-avatar { border-color: #06b6d4; }
body.linkstack-body.theme-bold-dark .ls-cover--placeholder { background: linear-gradient(135deg, #22d3ee 0%, #0b3a5e 55%, #0b1120 100%); }

/* ============================================================
   LINK PAGE — TEMPLATE 2 · CLEAN LIGHT
   ============================================================ */
body.linkstack-body.theme-clean-light { background: #eef3f9; color: #0b1120; --rx-accent: #0284c7; --rx-accent-deep: #0ea5e9; }
body.linkstack-body.theme-clean-light .ls-cover::after { background: linear-gradient(180deg, rgba(238,243,249,0) 40%, rgba(238,243,249,.7) 100%); }
body.linkstack-body.theme-clean-light .ls-cover--placeholder { background: linear-gradient(135deg, #7dd3fc 0%, #0ea5e9 100%); }
body.linkstack-body.theme-clean-light .ls-avatar { border-color: #fff; box-shadow: 0 10px 30px rgba(2,132,199,.22); }
body.linkstack-body.theme-clean-light .ls-name { color: #0b1120; }
body.linkstack-body.theme-clean-light .ls-intro { color: #475569; }
body.linkstack-body.theme-clean-light .ls-btn { background: #fff; border: 1px solid #d8e0ea; color: #0b1120; box-shadow: 0 1px 4px rgba(2,8,20,.06); }
body.linkstack-body.theme-clean-light .ls-btn:hover { background: #f3f8fd; border-color: #0ea5e9; }
body.linkstack-body.theme-clean-light .ls-btn--primary { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }
body.linkstack-body.theme-clean-light .ls-btn--profile { background: transparent; color: #0284c7; border-color: rgba(2,132,199,.4); }
body.linkstack-body.theme-clean-light .ls-sponsors { border-top-color: rgba(2,8,20,.1); }
body.linkstack-body.theme-clean-light .ls-sponsors-row img { filter: none; opacity: .9; }
body.linkstack-body.theme-clean-light .ls-sponsor-name { color: #334155; border-color: rgba(2,8,20,.18); }
body.linkstack-body.theme-clean-light .ls-footer { color: #64748b; }
body.linkstack-body.theme-clean-light .ls-footer a { color: #0284c7; }

/* ============================================================
   LINK PAGE — TEMPLATE 3 · PHOTO HERO (big cover, frosted buttons)
   ============================================================ */
body.linkstack-body.theme-photo-hero { background: #07101d; --rx-accent: #ffffff; --rx-accent-deep: #38bdf8; }
body.linkstack-body.theme-photo-hero .ls-cover { height: 330px; }
body.linkstack-body.theme-photo-hero .ls-cover::after { background: linear-gradient(180deg, rgba(7,16,29,.05) 0%, rgba(7,16,29,.45) 55%, rgba(7,16,29,.96) 100%); }
body.linkstack-body.theme-photo-hero .ls-cover--placeholder { background: linear-gradient(160deg, #1e3a5f 0%, #0ea5e9 45%, #07101d 100%); }
body.linkstack-body.theme-photo-hero .ls-head { margin-top: -72px; }
body.linkstack-body.theme-photo-hero .ls-avatar { width: 124px; height: 124px; border-color: rgba(255,255,255,.9); }
body.linkstack-body.theme-photo-hero .ls-name { font-size: 2rem; text-shadow: 0 2px 18px rgba(0,0,0,.5); }
body.linkstack-body.theme-photo-hero .ls-disc { color: #e2e8f0; }
body.linkstack-body.theme-photo-hero .ls-btn { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.28); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
body.linkstack-body.theme-photo-hero .ls-btn:hover { background: rgba(255,255,255,.2); border-color: #fff; }
body.linkstack-body.theme-photo-hero .ls-btn--primary { background: #fff; border-color: #fff; color: #06121f; }
body.linkstack-body.theme-photo-hero .ls-btn--profile { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; }
