/* Rugby Stock Car Club. Colours: night-time track navy, club cyan, and the
   BriSCA roof grade colours (white, yellow, blue, red) used once, as the stripe under the header. */
:root{
  --navy:#101b30; --navy-2:#1a2a47; --ink:#1c2433; --muted:#556074;
  --paper:#f3f5f8; --card:#ffffff; --line:#d9dee7;
  --cyan:#33bfe9; --link:#0a6c94;
  --roof-white:#ffffff; --roof-yellow:#f3c22f; --roof-blue:#2a63c8; --roof-red:#d42a3c;
  --display:"Saira Extra Condensed","Arial Narrow",sans-serif;
  --body:"Saira",system-ui,-apple-system,"Segoe UI",sans-serif;
  --measure:70ch;
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--paper);color:var(--ink);font:400 1.0625rem/1.6 var(--body)}
img{max-width:100%;height:auto}
a{color:var(--link);text-underline-offset:.15em}
a:hover{color:var(--navy)}
:focus-visible{outline:3px solid var(--roof-yellow);outline-offset:2px}
.skip{position:absolute;left:-999px;top:0;background:var(--roof-yellow);color:var(--navy);padding:.5rem 1rem;z-index:10}
.skip:focus{left:1rem}

/* masthead */
.masthead{background:var(--navy);color:#fff;position:relative;z-index:5}
.masthead__inner{max-width:72rem;margin:0 auto;padding:.75rem 1rem;display:flex;align-items:center;gap:1rem;flex-wrap:wrap}
.wordmark{font:italic 800 1.9rem/1 var(--display);color:#fff;text-decoration:none;letter-spacing:.01em;margin-right:auto}
.wordmark__rugby{color:var(--cyan)}
.roofs{display:grid;grid-template-columns:repeat(4,1fr);height:6px}
.roofs i:nth-child(1){background:var(--roof-white)}.roofs i:nth-child(2){background:var(--roof-yellow)}
.roofs i:nth-child(3){background:var(--roof-blue)}.roofs i:nth-child(4){background:var(--roof-red)}
.nav ul{list-style:none;margin:0;padding:0}
.nav>ul{display:flex;flex-wrap:wrap;gap:.1rem}
.nav a{display:block;color:#fff;text-decoration:none;font:600 1.15rem/1 var(--display);letter-spacing:.02em;padding:.7rem .7rem}
.nav a:hover,.nav .is-current>a{color:var(--cyan)}
.nav li{position:relative}
.nav .has-sub>a::after{content:"";display:inline-block;margin-left:.35em;border:4px solid transparent;border-top-color:currentColor;transform:translateY(2px)}
.nav li ul{position:absolute;left:0;top:100%;min-width:15rem;background:var(--navy-2);padding:.4rem 0;display:none;box-shadow:0 10px 24px rgba(0,0,0,.35)}
.nav li:hover>ul,.nav li:focus-within>ul{display:block}
.nav li ul a{font:400 1rem/1.3 var(--body);padding:.5rem 1rem}
.navtoggle{display:none;background:none;border:2px solid var(--cyan);color:#fff;font:600 1.1rem/1 var(--display);padding:.45rem .8rem;border-radius:3px}

@media (max-width:52rem){
  .navtoggle{display:block}
  .nav{display:none;width:100%}
  .nav.is-open{display:block}
  .nav>ul{flex-direction:column}
  .nav li ul{position:static;display:block;box-shadow:none;background:none;padding:0 0 .4rem 1rem}
  .nav .has-sub>a::after{display:none}
}

/* page title */
.titlebar{background:var(--card);border-bottom:1px solid var(--line)}
.titlebar .wrap{padding-top:2.2rem;padding-bottom:1.6rem}
h1,h2,h3{font-family:var(--display);line-height:1.05;color:var(--navy)}
.titlebar h1{font-weight:800;font-style:italic;font-size:clamp(2.4rem,6vw,3.8rem);margin:0;letter-spacing:.005em}
.crumb{margin:0 0 .4rem;font-size:.95rem;color:var(--muted)}
.crumb a{color:var(--muted)}
.dateline{margin:.6rem 0 0;color:var(--muted)}

.wrap{max-width:calc(var(--measure) + 2rem);margin:0 auto;padding:0 1rem}
.wrap--wide{max-width:72rem}
.prose{padding-top:2rem;padding-bottom:3rem;overflow-wrap:anywhere}
.prose h2{font-size:2rem;margin:2.2rem 0 .6rem}
.prose h3{font-size:1.55rem;margin:1.8rem 0 .5rem}
.prose p,.prose ul,.prose ol{margin:0 0 1rem}
.prose blockquote{margin:0 0 1rem;padding:.2rem 0 .2rem 1rem;border-left:4px solid var(--roof-yellow)}
.prose img{display:inline-block;margin:.3rem .3rem .3rem 0;border-radius:2px;vertical-align:top}
.prose table{border-collapse:collapse;margin:0 0 1.5rem;width:100%;font-size:.95rem;display:block;overflow-x:auto}
.prose td,.prose th{border:1px solid var(--line);padding:.35rem .6rem;text-align:left;vertical-align:top}
.prose th{background:var(--navy);color:#fff;font-weight:600}
.prose tr:nth-child(even) td{background:#fff}
.prose figure{margin:0}
.prose hr{border:0;border-top:1px solid var(--line);margin:2rem 0}

/* home */
.hero{background:var(--navy);color:#e9eef6;border-bottom:1px solid var(--navy-2)}
.hero__inner{max-width:72rem;margin:0 auto;padding:3.5rem 1rem 3.5rem;display:grid;grid-template-columns:1.6fr 1fr;gap:3rem;align-items:start}
.hero h1{color:#fff;font-weight:800;font-style:italic;font-size:clamp(3rem,8vw,5.6rem);line-height:.92;margin:0 0 1.2rem;max-width:12ch}
.hero__copy p{max-width:52ch;font-size:1.1rem}
.hero__links{display:flex;flex-wrap:wrap;gap:.75rem;margin-top:1.5rem}
.btn{display:inline-block;background:var(--cyan);color:var(--navy);font:800 1.25rem/1 var(--display);padding:.75rem 1.1rem;text-decoration:none;border-radius:3px}
.btn:hover{background:#fff;color:var(--navy)}
.btn--ghost{background:none;color:#fff;box-shadow:inset 0 0 0 2px rgba(255,255,255,.5)}
.btn--ghost:hover{background:none;color:var(--cyan);box-shadow:inset 0 0 0 2px var(--cyan)}
.raceday{background:var(--navy-2);border-top:6px solid var(--roof-yellow);padding:1.4rem 1.5rem 1rem}
.raceday h2{color:#fff;font-size:2rem;margin:0 0 .8rem}
.raceday dl{margin:0}
.raceday dt{font:600 1.05rem/1 var(--display);color:var(--cyan);margin-top:.9rem}
.raceday dd{margin:.25rem 0 0}
.raceday a{color:#fff}
@media (max-width:52rem){.hero__inner{grid-template-columns:1fr;gap:2rem;padding:2.5rem 1rem}}
.latest{padding-bottom:3rem}
.latest h2{font-size:2.4rem;font-style:italic;font-weight:800;margin:0 0 1rem}

/* listings */
.yearblock{display:grid;grid-template-columns:6.5rem 1fr;gap:1.5rem;padding:2rem 0;border-top:1px solid var(--line)}
.yearblock:first-child{border-top:0}
.yearblock__year{margin:0;font-size:2.8rem;font-weight:800;font-style:italic;color:var(--navy);line-height:.9;position:sticky;top:1rem;align-self:start}
@media (max-width:40rem){.yearblock{grid-template-columns:1fr;gap:.8rem}.yearblock__year{position:static}}
.postlist{list-style:none;margin:0;padding:0}
.postlist li{display:flex;justify-content:space-between;gap:1rem;padding:.5rem 0;border-bottom:1px solid var(--line)}
.postlist time{color:var(--muted);white-space:nowrap;font-size:.95rem}
.filters{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:1rem}
.filters a{padding:.3rem .8rem;border:1px solid var(--line);border-radius:999px;text-decoration:none;color:var(--ink);font-size:.95rem}
.filters a[aria-current]{background:var(--navy);border-color:var(--navy);color:#fff}

/* galleries */
.galleryindex{margin-top:-1rem}
.prose .galleryindex{max-width:none}
.gcards{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(13.5rem,1fr));gap:1.25rem}
.gcard{display:block;text-decoration:none;color:var(--ink);background:var(--card);border-bottom:4px solid var(--navy)}
.gcard img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;margin:0;border-radius:0}
.gcard__title{display:block;font:800 1.35rem/1.05 var(--display);color:var(--navy);padding:.7rem .8rem 0}
.gcard__count{display:block;font-size:.9rem;color:var(--muted);padding:.25rem .8rem .7rem}
.gcard:hover{border-bottom-color:var(--cyan)}
.gcard:hover .gcard__title{color:var(--link)}
.thumbs{list-style:none;margin:2rem 0 3rem;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(11rem,1fr));gap:.5rem}
.thumbs a{display:block;background:var(--navy-2)}
.thumbs img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover}
.thumbs a:hover img{opacity:.85}

.lightbox{border:0;padding:0;margin:0;width:100vw;height:100vh;max-width:none;max-height:none;background:rgba(8,13,24,.96);color:#fff}
.lightbox::backdrop{background:rgba(8,13,24,.9)}
.lightbox figure{margin:0;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 4rem}
.lightbox img{max-width:100%;max-height:calc(100vh - 7rem);object-fit:contain}
.lightbox figcaption{margin-top:.8rem;min-height:1.2em}
.lightbox button{position:absolute;background:none;border:0;color:#fff;font-size:3rem;line-height:1;padding:.5rem 1rem;cursor:pointer}
.lightbox button:hover{color:var(--cyan)}
.lb-prev{left:0;top:50%;transform:translateY(-50%)}.lb-next{right:0;top:50%;transform:translateY(-50%)}
.lb-close{top:0;right:0}
.lb-count{position:absolute;top:1rem;left:1rem;margin:0;font-size:.95rem;color:#b9c3d4}
@media (max-width:40rem){.lightbox figure{padding:3rem .5rem}.lb-prev,.lb-next{top:auto;bottom:0;transform:none}}

/* footer */
.foot{background:var(--navy);color:#c6cfdd;margin-top:2rem}
.foot__inner{max-width:72rem;margin:0 auto;padding:2rem 1rem;display:flex;flex-wrap:wrap;justify-content:space-between;gap:1rem 3rem}
.foot p{margin:0 0 .3rem}
.foot a{color:#fff}
.foot__name{font:800 1.5rem/1 var(--display);font-style:italic;color:#fff}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* photos side by side inside a page */
.photo-row{display:flex;flex-wrap:wrap;gap:.75rem;margin:0 0 1.5rem}
.photo-row a{display:block;line-height:0}
.prose .photo-row img{margin:0;border-radius:2px}
.prose table{display:table;width:100%}

/* full-width photo with caption */
.feature-photo{margin:0 0 2rem}
.prose .feature-photo img{display:block;width:100%;height:auto;margin:0;border-radius:2px}
.feature-photo figcaption{font-size:.95rem;color:var(--muted);margin-top:.5rem}

/* Phones and small tablets: keep the header (name, Menu button, stripe) pinned to the top */
@media (max-width:52rem){
  .masthead{position:sticky;top:0}
  .masthead__inner{padding-top:.55rem;padding-bottom:.55rem}
  .wordmark{font-size:clamp(1.25rem,6.2vw,1.6rem);white-space:nowrap}
  .navtoggle{font-size:1rem;padding:.35rem .7rem}
  .masthead__inner{gap:.5rem 1rem}
  .nav.is-open{max-height:calc(100vh - 4.5rem);max-height:calc(100dvh - 4.5rem);overflow-y:auto;overscroll-behavior:contain}
  html{scroll-padding-top:4.5rem}
  .yearblock__year{top:4.75rem}
}

/* "Coming up" special meeting panel on the home page */
.event{display:grid;grid-template-columns:minmax(0,15rem) 1fr;gap:1.5rem;align-items:start;background:var(--navy);color:#e9eef6;border-top:6px solid var(--roof-yellow);padding:1.25rem;margin:0 0 2.5rem;border-radius:2px}
.event__poster{display:block;line-height:0}
.prose .event__poster img{margin:0;width:100%;height:auto;border-radius:2px;box-shadow:0 6px 18px rgba(0,0,0,.35)}
.prose .event h2{color:#fff;margin:.2rem 0 .6rem;font-size:2.1rem;font-style:italic;font-weight:800}
.event__label{margin:0;color:var(--roof-yellow);font:600 1.15rem/1 var(--display)}
.event__when{font-weight:600;color:#fff}
.event a{color:var(--cyan)}
@media (max-width:40rem){.event{grid-template-columns:1fr;gap:1rem}.event__text{order:-1}.event__poster{max-width:13rem}}

/* Venue page */
.venue{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:2.5rem;align-items:start}
.venue h2{margin-top:1.8rem}
.venue address{font-style:normal;font-size:1.1rem;line-height:1.5;margin:0 0 .75rem}
.nextrace{background:var(--navy);color:#e9eef6;border-left:6px solid var(--roof-yellow);padding:.9rem 1.1rem;margin:0 0 .5rem;display:grid;gap:.2rem}
.nextrace strong{font:800 1.6rem/1.1 var(--display);font-style:italic;color:#fff}
.nextrace__special{color:var(--roof-yellow);font-weight:600}
.nextrace__sub{font-size:.95rem;color:#c6cfdd}
.nextrace a{color:var(--cyan)}
.copybtn{background:none;border:1px solid var(--line);border-radius:3px;padding:.35rem .8rem;font:inherit;font-size:.95rem;color:var(--ink);cursor:pointer}
.copybtn:hover{border-color:var(--navy)}
.dirbtns{display:flex;flex-wrap:wrap;gap:.6rem;margin-bottom:.4rem}
.prose .dirbtns .btn{color:var(--navy);font-size:1.15rem}
.small{font-size:.92rem;color:var(--muted)}
.steps{counter-reset:step;list-style:none;padding:0}
.steps li{counter-increment:step;position:relative;padding:.15rem 0 .6rem 2.6rem}
.steps li::before{content:counter(step);position:absolute;left:0;top:0;width:1.8rem;height:1.8rem;border-radius:50%;background:var(--navy);color:#fff;font:800 1.1rem/1.8rem var(--display);text-align:center}
.venue__map{position:sticky;top:1rem}
.maploader{position:relative;aspect-ratio:4/3;background:var(--navy);overflow:hidden;border-radius:2px;display:grid;place-items:center}
.prose .maploader img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;margin:0;opacity:.45}
.maploader .btn{position:relative;z-index:1}
.maploader__note{position:absolute;bottom:.4rem;left:0;right:0;margin:0;text-align:center;color:#fff;font-size:.85rem;z-index:1;text-shadow:0 1px 2px #000}
.maploader iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
@media (max-width:52rem){.venue{grid-template-columns:1fr;gap:1rem}.venue__map{position:static}.venue h2:first-of-type{margin-top:1.2rem}}
/* the next race night banner inside the home page's Race night box */
.nextrace--hero{background:var(--navy);margin:0 0 .4rem}
.nextrace--hero strong{font-size:1.35rem}

/* Fixtures calendar */
.fixtures{margin-top:1rem}
.fixmonth h2{font-size:1.8rem;font-style:italic;font-weight:800;margin:1.8rem 0 .5rem}
.fixmonth ul{list-style:none;margin:0;padding:0;border-top:1px solid var(--line)}
.fix{display:grid;grid-template-columns:11.5rem 1fr;gap:.25rem 1rem;padding:.6rem .75rem;border-bottom:1px solid var(--line);background:var(--card);border-left:5px solid transparent}
.fix__date{font-weight:600}
.fix__what{color:var(--ink)}
.fix__time{display:block;font-size:.9rem;color:var(--muted)}
.fix--club .fix__what{color:var(--muted)}
.fix--round{border-left-color:var(--roof-blue)}
.fix--special{border-left-color:var(--roof-yellow)}
.fix--special .fix__what{font-weight:600}
.fix--finals,.fix--shootout{border-left-color:var(--roof-red)}
.fix.is-off{background:transparent;border-left-color:var(--line)}
.fix.is-off .fix__date,.fix.is-off .fix__what{color:var(--muted);text-decoration:line-through;text-decoration-thickness:1px}
.fix.is-next{background:var(--navy);border-left-color:var(--roof-yellow)}
.fix.is-next .fix__date,.fix.is-next .fix__what{color:#fff}
.fix.is-next .fix__date::after{content:"Next";margin-left:.6rem;font:600 .8rem/1 var(--body);background:var(--roof-yellow);color:var(--navy);padding:.15rem .4rem;border-radius:2px;vertical-align:.1rem}
@media (max-width:40rem){.fix{grid-template-columns:1fr}}

/* Ticker tape over the champions photo */
.celebrate a{position:relative;display:block}
.tickertape{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
[hidden]{display:none!important}
.fix{grid-template-columns:14rem 1fr}
@media (max-width:40rem){.fix{grid-template-columns:1fr}}

/* information panel, e.g. at the top of News and results */
.notice{margin:2rem 0 .5rem;padding:.9rem 1.1rem;background:var(--card);border-left:6px solid var(--roof-yellow);max-width:none}

/* Phones: show each table row as a small card, with the column name above each detail */
@media (max-width:40rem){
  .prose table:not(.gradestable),.prose table:not(.gradestable) tbody,.prose table:not(.gradestable) tr,.prose table:not(.gradestable) td{display:block;width:auto}
  .prose table:not(.gradestable){border:0;margin:0 0 1.5rem}
  .prose table:not(.gradestable) thead{display:none}
  .prose table:not(.gradestable) tr{background:var(--card);border:1px solid var(--line);border-left:4px solid var(--navy);margin:0 0 .6rem;padding:.55rem .8rem}
  .prose table:not(.gradestable) tr:nth-child(even) td{background:none}
  .prose table:not(.gradestable) td{border:0;padding:.15rem 0}
  .prose table:not(.gradestable) td:first-child{font-weight:600}
  .prose table:not(.gradestable) td:empty{display:none}
  .prose table:not(.gradestable) td[data-label]:not(:first-child)::before{content:attr(data-label);display:block;font-size:.8rem;color:var(--muted);text-transform:none}
}

/* Grading list */
.grades h2{margin-top:1.5rem}
.prose .gradestable{width:100%;font-size:.95rem;font-variant-numeric:tabular-nums}
.prose .gradestable th{background:var(--navy);color:#fff;white-space:nowrap;text-align:center;font-size:.85rem}
.prose .gradestable td{text-align:center;border:1px solid rgba(0,0,0,.15);padding:.3rem .45rem;font-weight:600}
.prose .gradestable td.name{text-align:left;white-space:nowrap}
.prose .gradestable td.best{background:#3ec43e !important;color:#08310a}
.prose .gradestable td.best.cbdg{font-size:.8rem;letter-spacing:.03em}
.prose .gradestable tr.gap td{background:transparent !important;border:0;padding:.2rem}
.prose .gradestable tr td{background:#fff}
.prose .gradestable tr.g-silver td{background:#b8bcc2;color:#111}
.prose .gradestable tr.g-superstar td{background:#c8101a;color:#ffe03a}
.prose .gradestable tr.g-superstar-dark td{background:#8e0c12;color:#ffe03a}
.prose .gradestable tr.g-red td{background:#e3262e;color:#3a0004}
.prose .gradestable tr.g-blue td{background:#4f86de;color:#0d1f40}
.prose .gradestable tr.g-yellow td{background:#f8e81c;color:#2a2400}
.prose .gradestable tr.g-white td{background:#fff;color:#111}
.prose .gradestable tr.t-light td{color:#ffe4e4}
.prose .gradestable tr.t-light td.best{color:#08310a}
@media (max-width:40rem){
  .prose .gradestable .opt{display:none}
  .prose .gradestable{font-size:.88rem}
  .prose .gradestable td{padding:.3rem .3rem}
}
@media (max-width:40rem) and (orientation:landscape){.prose .gradestable .opt{display:table-cell}}
.grades{overflow-x:auto}
.prose .gradestable{width:auto;min-width:100%}
.prose .gradestable td,.prose .gradestable th{white-space:nowrap}
@media (max-width:40rem){
  .prose .gradestable{font-size:.8rem;min-width:0;width:100%}
  .prose .gradestable td,.prose .gradestable th{padding:.3rem .25rem}
  .prose .gradestable td.name{white-space:normal}
}
