/* ─────────────────────────────────────────────────────────────
   Editorial motorsport layer (public pages: home + text pages).
   Loaded after ui.css. Colours, accent and the per-text styles chosen in
   admin → Appearance still apply (var(--tx-accent), inline font/size on the
   banner title and header name). Display type = --font-display (Rajdhani).
   ───────────────────────────────────────────────────────────── */
:root { --font-display: 'Rajdhani', 'Arial Narrow', sans-serif; --ed-w: 1320px; --ed-pad: max(24px, calc((100vw - var(--ed-w)) / 2)); --ed-cut: 22px; }
body.ed { font-family: var(--font-body, 'Barlow', sans-serif); }

/* ── header ── */
/* the menu bar is black on every page (home too) and stays at the top while scrolling */
body.ed header { position: sticky; top: 0; z-index: 50; overflow: visible; background: #08080A; }
body.ed .header-inner { background: transparent; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid rgba(255,255,255,.08); }
html { scroll-padding-top: 100px; }
body.ed .header-inner::after, body.ed .header-bg-overlay, body.ed .iracing-wordmark, body.ed .header-divider-v { display: none; }
body.ed .header-content { max-width: none; height: 84px; padding: 0 var(--ed-pad); }
body.ed .header-driver-name { font-family: var(--font-display); font-weight: 800; font-size: calc(24px * var(--tx-scale, 1)); letter-spacing: .12em; text-transform: uppercase; }
body.ed .header-driver-sub { font-family: var(--font-display); font-size: calc(12px * var(--tx-scale, 1)); letter-spacing: .3em; color: rgba(255,255,255,.6); margin-top: 2px; }
body.ed .hdr-btn { background: none; border: 0; box-shadow: none; padding: 8px 10px; border-radius: 0; flex-direction: row; gap: 0; min-width: 0; width: auto; height: auto; }
body.ed .hdr-btn svg, body.ed .hdr-btn img, body.ed .hdr-btn .menu-tint { display: none !important; }
body.ed .hdr-btn .hdr-lbl { max-width: none; overflow: visible; text-overflow: clip; font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .2em; text-transform: uppercase; color: #fff; }
body.ed .hdr-btn:hover .hdr-lbl { color: #fff; }
body.ed .hdr-btn.active .hdr-lbl { color: var(--tx-accent, var(--gold)); }
/* menu buttons: no frame at rest; on hover a tile like in Last Races (light fill + gold outline, cut corner); the active page keeps a soft gold outline */
body.ed .hdr-btn { padding: 12px 16px; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); transition: background .18s ease, box-shadow .18s ease; }
body.ed .hdr-btn:hover { background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px var(--tx-accent, var(--gold)); }
body.ed .hdr-btn.active { background: rgba(240,192,64,.10); box-shadow: inset 0 0 0 1px var(--tx-accent, var(--gold)); }
body.ed .hdr-btn.active:hover { background: rgba(240,192,64,.16); }
body.ed .header-right { gap: 14px; }

/* ── banner ── */
body.ed .hero-banner { height: auto; min-height: clamp(560px, 80vh, 800px); display: flex; align-items: flex-end; border: 0; overflow: hidden; }
body.ed .hero-banner::after { display: none; }
body.ed .hero-flags { display: none; }
body.ed .hero-bg { filter: saturate(1.05) contrast(1.05); }
body.ed .hero-gradient { background: linear-gradient(90deg, rgba(8,8,10,.92) 0%, rgba(8,8,10,.55) 45%, rgba(8,8,10,.12) 78%); }
/* the banner picture dissolves into the page instead of ending in a hard line */
body.ed .hero-bg, body.ed .hero-gradient { -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 100%); }
body.ed .hero-content { height: auto; width: 100%; justify-content: flex-end; padding: 130px var(--ed-pad) 150px; }
body.ed.ed-sub .hero-banner { min-height: 300px; }
body.ed.ed-sub .hero-content { padding: 110px var(--ed-pad) 56px; }
.hero-eyebrow { display: flex; align-items: center; gap: 14px; font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .34em; text-transform: uppercase; color: var(--tx-accent, var(--gold)); margin-bottom: 14px; }
.hero-eyebrow::before { content: ''; width: 46px; height: 3px; background: var(--red, #E5262D); flex: none; }
body.ed .hero-headline { font-family: var(--font-display); font-weight: 900; font-size: calc(clamp(36px, 6.2vw, 100px) * var(--tx-scale, 1)); line-height: 1; letter-spacing: -.005em; text-transform: uppercase; max-width: 1180px; text-wrap: balance; text-shadow: none; }
body.ed.ed-sub .hero-headline { font-size: calc(clamp(30px, 4.6vw, 68px) * var(--tx-scale, 1)); }
body.ed .hero-headline span { background: none; -webkit-text-fill-color: currentColor; color: var(--tx-accent, var(--gold)); }
.hero-sub { margin-top: 20px; max-width: none; text-shadow: 0 1px 14px rgba(0,0,0,.75); font-size: 19px; line-height: 1.5; color: var(--text2); letter-spacing: 0; }
body.ed.ed-sub .hero-sub, body.ed.ed-sub .hero-eyebrow { display: none; }

/* ── stats strip ── */
.hero-stats { position: relative; z-index: 3; margin: -92px var(--ed-pad) 0; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--tile); clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--ed-cut)), calc(100% - var(--ed-cut)) 100%, 0 100%); box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.hero-stats[hidden] { display: none; }
.hero-stats div { padding: 24px 28px; border-right: 1px solid rgba(255,255,255,.08); min-width: 0; text-align: center; }
.hero-stats div:last-child { border-right: 0; }
.hero-stats b { display: block; font-family: var(--font-display); font-weight: 900; font-size: clamp(40px, 4.6vw, 64px); line-height: 1; color: #fff; }
.hero-stats small { font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--text2); }

/* ── content area ── */
body.ed .main { max-width: none; padding-left: var(--ed-pad); padding-right: var(--ed-pad); }
body.ed.ed-home .main { padding-top: 1.5rem; }
body.ed .section-header { align-items: center; gap: 20px; margin: 64px 0 24px; }   /* the gold rule runs through the middle of the heading, like on every page title */
body.ed .section-title { font-family: var(--font-display); font-weight: 900; font-size: clamp(34px, 4.4vw, 56px); line-height: 1; letter-spacing: .01em; text-transform: uppercase; color: var(--text); display: block; }
body.ed .section-title::before { display: none; }
body.ed .section-line { height: 1px; background: linear-gradient(90deg, var(--tx-accent, var(--gold)), transparent); }

/* next event: big poster + angled corner */
body.ed .event-banner { border: 0; border-radius: 0; background: var(--tile); min-height: 440px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%); box-shadow: none; margin-bottom: 8px; }   /* the cut corner is bottom right, so the poster is never touched */
/* the poster is shown whole (any shape); the space around it is filled with a blurred, darkened copy of the same poster */
body.ed .event-banner-posterbox, body.ed .event-banner-poster-placeholder { width: min(36%, 460px); height: 440px; flex-shrink: 0; position: relative; overflow: hidden; background: #0b0b0e; }
body.ed .event-banner-posterbox::before { content: ''; position: absolute; inset: -30px; background: var(--poster) center / cover no-repeat; filter: blur(24px) brightness(.55) saturate(1.2); }
body.ed .event-banner-posterbox .event-banner-poster { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
body.ed .event-banner-body { padding: 40px 44px; }
body.ed .event-banner-eyebrow { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 15px; letter-spacing: .3em; color: var(--tx-accent, var(--gold)); }
body.ed .event-banner-eyebrow::before { content: ''; width: 36px; height: 3px; background: var(--red, #E5262D); }
body.ed .event-banner-title { font-family: var(--font-display); font-weight: 900; font-size: clamp(40px, 5vw, 68px); line-height: .95; text-transform: uppercase; margin: 8px 0 10px; }
body.ed .event-banner-dates { font-size: 15px; color: var(--text); }
body.ed .event-banner-desc { font-size: 14px; color: var(--text2); }
body.ed .event-countdown { gap: 18px; }
body.ed .event-countdown-unit { background: none; border: 0; padding: 0; min-width: 0; text-align: center; }
body.ed .event-countdown-num { display: block; min-width: 2ch; font-variant-numeric: tabular-nums; text-align: center; }
body.ed .event-countdown-label { display: block; text-align: center; margin-right: -.22em; }   /* the trailing letter-spacing would push the label off-centre */
body.ed .event-countdown-num { font-family: var(--font-display); font-weight: 900; font-size: 52px; color: #fff; }
body.ed .event-countdown-label { font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: .22em; color: var(--tx-accent, var(--gold)); margin-top: 4px; }
body.ed .event-countdown-sep { display: none; }

/* upcoming sessions + last races */
body.ed .up-card, body.ed .lr-card, body.ed .sp-tile { border-radius: 0; border: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.1); background: var(--tile); }
body.ed .up-card::before { display: none; }
body.ed .up-cards { gap: 0; }
body.ed .up-card { padding: 22px 26px; }
body.ed .up-card { clip-path: none; }
body.ed .up-card-series, body.ed .lr-series { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .05em; text-transform: uppercase; line-height: 1.15; }
body.ed .up-card-lbl { font-family: var(--font-display); letter-spacing: .2em; color: var(--tx-accent, var(--gold)); }
body.ed .lr-cards { gap: 0; }
body.ed .lr-card { display: grid; grid-template-columns: 1fr; grid-template-areas: 'res' 'logo' 'main'; align-content: start; gap: 8px; padding: 24px 26px 28px; align-items: start; justify-items: center; text-align: center; height: 100%; }
body.ed .lr-card:hover { transform: none; box-shadow: 0 0 0 1px var(--tx-accent, var(--gold)); }
body.ed .lr-res { grid-area: res; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
body.ed .lr-logo { grid-area: logo; }
/* the series logo is the tile's backdrop: large, centred, faint; 'contain' keeps any logo shape (wide, tall, small artwork) whole */
body.ed .lr-logo { display: none; }
body.ed .lr-card { position: relative; overflow: hidden; isolation: isolate; }
body.ed .lr-card.has-logo::before { content: ''; position: absolute; inset: 4% 6%; z-index: -1; background: var(--logo) center / contain no-repeat; opacity: .17; filter: saturate(.9) brightness(1.15); transition: opacity .2s; }
body.ed .lr-card.has-logo:hover::before { opacity: .26; }
body.ed .lr-card .lr-res, body.ed .lr-card .lr-main { text-shadow: 0 2px 14px rgba(0,0,0,.65); }
body.ed .lr-main { grid-area: main; display: flex; flex-direction: column; align-items: center; }
body.ed .lr-res .pos-badge { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; width: auto; height: auto; font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 4.7vw, 68px); line-height: .95; color: #fff; }
body.ed .lr-res .pos-badge.pc-p1, body.ed .lr-res .pos-badge.pc-p2, body.ed .lr-res .pos-badge.pc-p3 { color: var(--tx-accent, var(--gold)); }
body.ed .lr-pts { font-family: var(--font-display); font-size: 15px; letter-spacing: .12em; text-transform: uppercase; }
body.ed .lr-date { order: -1; font-family: var(--font-display); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--tx-accent, var(--gold)); font-size: 13px; }

/* partners, button, text pages */
body.ed .sp-tile { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%); }
body.ed .all-results .btn-gold { border-radius: 0; clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%); padding: 16px 40px; font-family: var(--font-display); font-size: 16px; letter-spacing: .2em; box-shadow: none; }
body.ed .page-card { border-radius: 0; border: 0; background: transparent; box-shadow: none; padding-left: 0; padding-right: 0; }   /* no dark panel behind page content (same as Results) */
/* one title style on every page: Rajdhani (same as the section titles on the home page), content always in the body font */
body.ed .page-title, body.ed #resultsView .section-title { font-family: var(--font-display, 'Rajdhani'), sans-serif; font-weight: 700; font-size: clamp(34px, 4.4vw, 56px); line-height: 1.05; text-transform: uppercase; letter-spacing: .02em; }
body.ed .page-content, body.ed .page-content [style*="font-family"] { font-family: var(--font-body, 'Barlow', sans-serif) !important; }
body.ed .page-content h2, body.ed .page-content h3 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
body.ed .page-content h2 { font-size: 32px; }

/* ── phone ── */
@media (max-width: 860px) {
  body.ed .header-content { height: auto; min-height: 64px; padding: 10px 16px; flex-wrap: wrap; }
  body.ed .header-right { flex: 1 1 100%; flex-wrap: wrap; gap: 4px; justify-content: flex-start; }
  body.ed .hdr-btn { padding: 6px 8px; }
  body.ed .hdr-btn .hdr-lbl { font-size: 13px; letter-spacing: .14em; }
  body.ed .hero-banner { min-height: 600px; }
  body.ed .hero-content { padding: 150px 20px 120px; }
  body.ed.ed-sub .hero-banner { min-height: 260px; }
  body.ed.ed-sub .hero-content { padding: 130px 20px 40px; }
  .hero-sub { font-size: 16px; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); margin: -64px 16px 0; }
  .hero-stats div { padding: 16px 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .hero-stats small { letter-spacing: .1em; font-size: 11px; }
  body.ed .main { padding-left: 16px; padding-right: 16px; }
  body.ed .event-banner { flex-direction: column; }
  body.ed .event-banner-posterbox, body.ed .event-banner-poster-placeholder { width: 100%; height: 280px; }
  body.ed .event-banner-body { padding: 24px 22px 30px; }
  body.ed .lr-res .pos-badge { font-size: 56px; }
  body.ed .up-cards, body.ed .lr-cards { grid-template-columns: 1fr; }
}
/* an intro line typed as a heading (e.g. Contact) reads like normal content text, not like a section heading */
body.ed .page-content h3:has(> span[style*="font-family"]) { font-family: var(--font-body, 'Barlow', sans-serif); text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 15px; line-height: 1.7; }

/* admin.html wears the same header + banner as the public site, only more compact; its own panels keep their tools look */
body.ed-admin .hero-banner { min-height: 200px; }
body.ed-admin .hero-content { padding: 100px var(--ed-pad) 36px; }
body.ed-admin .hero-headline { font-size: calc(clamp(24px, 3.4vw, 46px) * var(--tx-scale, 1)); }
body.ed-admin .section-title { font-size: 22px; letter-spacing: .12em; }
body.ed-admin .header-right .btn-gold { clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); border-radius: 0; margin-left: 8px; }

/* footer: copyright + social links (index.html, page.html) */
.site-foot { border-top: 1px solid rgba(255,255,255,.08); margin-top: 40px; background: #08080A; }
.site-foot-in { max-width: var(--ed-w); margin: 0 auto; padding: 22px 24px; display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text3); }
.site-foot nav { display: flex; gap: 22px; }
.site-foot nav a { font-family: var(--font-display); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; font-size: 14px; color: var(--text2); text-decoration: none; }
.site-foot nav a:hover { color: var(--tx-accent, var(--gold)); }

/* Rajdhani for all text (set in admin → Appearance → body font): it runs a little small, so the base size is raised a notch */
body.ed { font-size: 17px; }
body.ed .page-content { font-size: 19px; font-weight: 500; line-height: 1.75; }
body.ed input, body.ed select, body.ed textarea, body.ed button { font-family: inherit; }
body.ed-admin .header-driver-name { white-space: nowrap; font-size: calc(22px * var(--tx-scale, 1)); }
body.ed-admin .ap-hint, body.ed-admin .ap-badge, body.ed-admin .up-row label { font-size: 13px; }
body.ed-admin .ap-input, body.ed-admin .ap-btn, body.ed-admin .ap-tab, body.ed-admin .ap-name { font-size: 15px; }

/* bigger series icons everywhere */
body.ed .up-card-logo .series-logo, body.ed .up-card-logo .series-logo-placeholder { width: 76px; height: 76px; padding: 5px; }
body.ed .res-head .series-logo, body.ed .res-head .series-logo-placeholder, body.ed .cr-card-h .series-logo, body.ed .cr-card-h .series-logo-placeholder { width: 68px; height: 68px; padding: 5px; border-radius: 12px; }
@media (max-width: 860px) { body.ed .res-head .series-logo, body.ed .cr-card-h .series-logo { width: 56px; height: 56px; } }

/* page images: one picture = a wide cinematic banner with a cut corner and a gold edge; several in a row = a gallery (js/page.js) */
body.ed .page-content p > img:only-child:not([data-a]) { display: block; width: 100% !important; max-width: 100%; aspect-ratio: 21 / 9; max-height: 520px; object-fit: cover; object-position: center 30%; margin: 8px 0; border: 0; border-radius: 0; box-shadow: none;
  /* the picture dissolves into the page on all four sides instead of ending in a hard edge */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 18%, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 18%, #000 78%, transparent 100%); mask-composite: intersect; }
body.ed .page-content p:has(> img:only-child:not([data-a])) { margin: 22px 0; }
.pg-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0 30px; align-items: start; }
.pg-gallery figure { margin: 0; background: var(--tile); border-top: 3px solid var(--tx-accent, var(--gold)); display: flex; flex-direction: column; min-width: 0; }
.pg-gallery img { display: block; width: 100% !important; height: auto !important; aspect-ratio: auto; object-fit: contain; border-radius: 0; margin: 0; }   /* the whole picture, never cropped */
.pg-gallery figcaption { padding: 12px 14px 14px; font-size: 14px; line-height: 1.4; color: var(--text2); font-style: normal; }
.pg-gallery figcaption b { display: block; font: 700 12px var(--font-display); letter-spacing: .2em; color: var(--tx-accent, var(--gold)); margin-bottom: 4px; }
@media (max-width: 860px) { .pg-gallery { grid-template-columns: 1fr; } body.ed .page-content p > img:only-child { aspect-ratio: 16 / 9; } }

/* Upcoming races: same centred tile as Last Races (countdown as the big figure, series logo as the backdrop) */
body.ed .up-card { display: grid; grid-template-columns: 1fr; align-content: start; justify-items: center; text-align: center; gap: 10px; padding: 24px 26px 28px; height: 100%; position: relative; overflow: hidden; isolation: isolate; }
body.ed .up-card-logo { display: none; }
body.ed .up-card.has-logo::before { content: ''; display: block; position: absolute; inset: 4% 6%; width: auto; border-radius: 0; z-index: -1; background: var(--logo) center / contain no-repeat; opacity: .17; filter: brightness(1.15); transition: opacity .2s; }
body.ed .up-card.has-logo:hover::before { opacity: .26; }
body.ed .up-big { display: flex; flex-direction: column; align-items: center; gap: 6px; text-shadow: 0 2px 14px rgba(0,0,0,.65); }
body.ed .up-big b { display: flex; align-items: baseline; justify-content: center; gap: 4px 7px; flex-wrap: nowrap; white-space: nowrap; font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 4.7vw, 68px); line-height: .95; color: #fff; text-transform: uppercase; letter-spacing: .01em; }
body.ed .up-big b .cd-n { font-size: clamp(38px, 3.6vw, 52px); }
body.ed .up-big b .cd-u { font-size: 18px; letter-spacing: .08em; color: rgba(255,255,255,.7); margin-right: 8px; }
body.ed .up-big b .cd-u:last-child { margin-right: 0; }
body.ed .up-big small { font-family: var(--font-display); font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--tx-accent, var(--gold)); }
body.ed .up-card-main { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; text-shadow: 0 2px 14px rgba(0,0,0,.65); }
body.ed .up-card-when { order: -1; font-family: var(--font-display); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--tx-accent, var(--gold)); font-size: 13px; }
body.ed .up-card-series { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
body.ed .up-card-yt { justify-self: center; margin-top: 8px; }

/* Partners: one flat colour for every logo (js/sponsors.js builds the silhouette), original colours on hover */
body.ed .sp-logo { position: relative; height: 88px; padding: 0; background: none; }
body.ed .sp-logo img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; opacity: 1; transition: opacity .25s; }
body.ed .sp-logo.mono img { opacity: 0; }
body.ed .sp-mono { display: none; }
body.ed .sp-logo.mono .sp-mono { display: block; position: absolute; inset: 10px; background: #d6d6dc; opacity: .88; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; transition: opacity .25s; }
body.ed .sp-tile:hover .sp-logo.mono img { opacity: 1; }
body.ed .sp-tile:hover .sp-logo.mono .sp-mono { opacity: 0; }
body.ed .sp-name { font-family: var(--font-display); letter-spacing: .16em; text-transform: uppercase; font-size: 13px; color: var(--text2); }

/* Partners always span the full width: 3 partners = 3 equal columns, more simply wrap */
body.ed .sp-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; }

/* a picture set to "wrap" (editor: image beside the text) is a tall portrait that also dissolves into the page */
body.ed .page-content img[data-a="wrapr"], body.ed .page-content img[data-a="wrapl"] { width: min(38%, 480px) !important; height: auto; aspect-ratio: auto; max-width: 100%; border: 0; border-radius: 0; box-shadow: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 22%, #000 100%), linear-gradient(to bottom, transparent 0, #000 10%, #000 84%, transparent 100%); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 22%, #000 100%), linear-gradient(to bottom, transparent 0, #000 10%, #000 84%, transparent 100%); mask-composite: intersect; }
body.ed .page-content img[data-a="wrapr"] { margin: 0 0 8px 32px; }
body.ed .page-content img[data-a="wrapl"] { margin: 0 32px 8px 0; -webkit-mask-image: linear-gradient(to left, transparent 0, #000 22%, #000 100%), linear-gradient(to bottom, transparent 0, #000 10%, #000 84%, transparent 100%); mask-image: linear-gradient(to left, transparent 0, #000 22%, #000 100%), linear-gradient(to bottom, transparent 0, #000 10%, #000 84%, transparent 100%); }
body.ed .page-content p:has(> img:only-child:not([data-a])) + p:has(> em:only-child) { text-align: center; font-size: 13px; color: var(--text3); margin-top: -16px; }
@media (max-width: 860px) { body.ed .page-content img[data-a="wrapr"], body.ed .page-content img[data-a="wrapl"] { float: none; width: 100% !important; margin: 12px 0; } }

/* Upcoming tiles react like Last Races: no lift, just a gold outline */
body.ed .up-card:hover { transform: none; box-shadow: 0 0 0 1px var(--tx-accent, var(--gold)); }

/* Upcoming, Last Races and Partners share one type scale */
body.ed .up-big small, body.ed .lr-pts { font-weight: 600; font-size: 15px; letter-spacing: .12em; }
body.ed .up-card-round, body.ed .lr-track { font-size: 14px; color: var(--text2); }
body.ed .sp-name { font-size: 14px; font-weight: 600; letter-spacing: .12em; color: var(--text2); }

/* series logos in Results / Career: no dark plate, the artwork stands free with a soft shadow */
body.ed .res-head .series-logo, body.ed .cr-card-h .series-logo { background: transparent; padding: 0; border-radius: 0; width: 96px; height: 72px; object-fit: contain; object-position: center; filter: drop-shadow(0 4px 12px rgba(0,0,0,.55)); }
body.ed .res-head .series-logo-placeholder, body.ed .cr-card-h .series-logo-placeholder { width: 96px; height: 72px; background: transparent; border: 1px dashed rgba(255,255,255,.14); }
@media (max-width: 860px) { body.ed .res-head .series-logo, body.ed .cr-card-h .series-logo, body.ed .res-head .series-logo-placeholder, body.ed .cr-card-h .series-logo-placeholder { width: 60px; height: 60px; } }

/* logos are trimmed + lightened by js/logofit.js; hidden until ready so they never jump */
body.ed .res-head img.series-logo:not(.fit), body.ed .cr-card-h img.series-logo:not(.fit) { opacity: 0; }
body.ed .res-head img.series-logo, body.ed .cr-card-h img.series-logo { transition: opacity .2s; }
@media (max-width: 860px) { body.ed .res-head .series-logo, body.ed .cr-card-h .series-logo, body.ed .res-head .series-logo-placeholder, body.ed .cr-card-h .series-logo-placeholder { width: 72px; height: 54px; } }

/* every page title uses the Results look: white Rajdhani heading with a gold rule running to the right edge */
body.ed .page-title { display: grid; grid-template-columns: fit-content(80%) 1fr; align-items: center; column-gap: 20px; color: var(--text); }
body.ed .page-title::after { content: ''; height: 1px; background: linear-gradient(90deg, var(--tx-accent, var(--gold)), transparent); }
@media (max-width: 860px) { body.ed .page-title::after { display: none; } }

/* Results title sits at exactly the same height as the title on every other subpage (main padding 32px + card padding 32px) */
body.ed #resultsView .section-header { margin-top: 32px; margin-bottom: 20px; }
@media (max-width: 860px) { body.ed #resultsView .section-header { margin-top: 20px; } }

/* Last Races: the whole tile still opens the results (stretched link); the stream button sits above it */
body.ed .lr-card { cursor: pointer; }
.lr-hit { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.lr-hit:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
body.ed .lr-yt, body.ed .up-card-btns .btn { position: relative; z-index: 2; }
body.ed .lr-yt { grid-column: 1 / -1; justify-self: center; margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; }
.lr-yt .up-yt-ico { flex-shrink: 0; }
/* Upcoming: two small buttons side by side, centred */
body.ed .up-card-btns { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; }
body.ed .up-card-btns .up-card-yt { margin-top: 0; }
@media (min-width: 861px) and (max-width: 1280px) { body.ed .hdr-btn { padding: 10px 11px; } body.ed .hdr-btn .hdr-lbl { letter-spacing: .14em; font-size: 14px; } }

/* Upcoming and Last Races tiles are always exactly the same size (fixed height), with or without a stream button */
body.ed .up-card, body.ed .lr-card { box-sizing: border-box; min-height: 340px; height: auto; }   /* tiles in one row always have the same height; more stream buttons make the whole row taller */
body.ed .lr-card { grid-template-areas: 'res' 'logo' 'main' 'btn'; align-content: start; padding-top: 34px; }
body.ed .lr-yt { grid-area: btn; }
body.ed .up-card { justify-content: center; }
/* all Upcoming tiles share one layout: countdown, date, series name (room for two lines), round, and the YouTube button pinned to the bottom */
body.ed .up-card { grid-template-rows: auto auto 1fr; align-content: stretch; justify-content: stretch; }
body.ed .up-card-series { min-height: 2.3em; align-content: center; }
body.ed .up-card-btns { align-self: end; margin-top: 0; }

/* ── banner slideshow (js/hero-slides.js) ── */
.hero-banner.has-slides .hero-bg { visibility: hidden; }
.hero-slides { position: absolute; inset: 0; overflow: hidden; background: #08080a; }
body.ed .hero-slides { filter: saturate(1.05) contrast(1.05); -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 100%); }
.hs-img, .hs-in { position: absolute; inset: 0; background-size: cover; background-repeat: no-repeat; }
.hs-fade { opacity: 0; transition: opacity 1.2s ease; } .hs-fade.go { opacity: 1; }
.hs-in-right { transform: translateX(100%); transition: transform 1s cubic-bezier(.7,0,.2,1); } .hs-in-right.go { transform: none; }
.hs-cur { transition: transform 1s cubic-bezier(.7,0,.2,1); } .hs-cur.hs-out-left { transform: translateX(-30%); }
.hs-bricks { position: absolute; inset: 0; perspective: 1400px; }
.hs-b { position: absolute; transform-style: preserve-3d; transition: transform .85s cubic-bezier(.45,.05,.2,1); }
.hs-bricks.go .hs-b { transform: rotateY(180deg); }
.hs-f { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.hs-back { transform: rotateY(180deg); }
.hs-in { inset: auto; }

/* page background layer (js/page-bg.js): colour / texture / gradient, under all content */
#pgbg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* tiles must stand out from a dark page background (colour / texture / photo): one lighter tile colour for all of them */
body.ed { --tile: #16161c; }

/* Media Kit portrait on phones: keep its own proportions (the generic 16:9 rule for single pictures squashed it) */
@media (max-width: 860px) { body.ed .page-content img[data-a="wrapr"], body.ed .page-content img[data-a="wrapl"] { aspect-ratio: auto !important; height: auto !important; object-fit: contain; } }

/* phones: the sticky menu bar is compact - name on top, the menu in one row you can swipe sideways */
@media (max-width: 860px) {
  body.ed .header-content { min-height: 0; padding: 8px 16px 0; gap: 2px; }
  body.ed .header-driver-sub { display: none; }
  body.ed .header-right { flex-wrap: nowrap; overflow-x: auto; gap: 0; margin: 0 -16px; padding: 0 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  body.ed .header-right::-webkit-scrollbar { display: none; }
  body.ed .hdr-btn { flex: 0 0 auto; white-space: nowrap; padding: 10px 10px; }
  html { scroll-padding-top: 90px; }
}

/* stream buttons: one under another, on the Upcoming and the Last Races tiles */
body.ed .lr-streams { grid-area: btn; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; position: relative; z-index: 2; }
body.ed .lr-streams .lr-yt { margin-top: 0; grid-area: auto; }
