/*
 * Public calendar — mobile first.
 *
 * The month renders ONE DOM for both layouts. On a phone it is a vertical
 * agenda: days with nothing on them are hidden, so you scroll shows and not
 * blank squares. From 48rem it becomes a real seven-column month grid and the
 * empty days come back to hold their place.
 *
 * Everything here rides the house tokens (design/tokens.css). No JavaScript
 * is involved in any layout or state below.
 */

/* ---------------------------------------------------------------- shell -- */

:root {
  /* Shared by the sticky header and the sticky month bar that pins beneath
   * it. One number, read in both places, so they cannot drift apart. */
  --rb-header-h: 3.25rem;
}

body {
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Home-screen installs run edge to edge under the notch. */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.rb-skip {
  position: absolute;
  inset-inline-start: 0.5rem;
  inset-block-start: 0.5rem;
  z-index: 10;
}

.rb-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 5;
}

.rb-header__inner {
  max-width: 68rem;
  margin-inline: auto;
  padding: 0.6rem 1rem;
  /* The month bar sticks directly beneath this, and the two only line up if
   * the height is a number rather than whatever the content happens to make.
   * min-height, so a long brand or a wrapped link grows the header instead of
   * being clipped — it would then overlap the month bar by the difference,
   * which is a far smaller failure than cut-off chrome. */
  min-height: var(--rb-header-h);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rb-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-fg);
  text-decoration: none;
}

.rb-brand img { display: block; }

.rb-subscribe-link {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  text-decoration: none;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  white-space: nowrap;
}

.rb-subscribe-link:hover,
.rb-subscribe-link:focus-visible { color: var(--color-link-hover); }

.rb-main {
  flex: 1;
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding: 1rem 1rem 2.5rem;
}

.rb-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.25rem 1rem 2rem;
  max-width: 68rem;
  margin-inline: auto;
  width: 100%;
  color: var(--color-fg-muted);
  font-size: var(--font-size-sm);
}

.rb-footer p { margin: 0 0 0.4rem; }
.rb-footer__meta a { color: var(--color-link); }

/* ------------------------------------------------------------ month bar -- */

/*
 * The month bar follows you down the page: on a long month the step arrows
 * and the filter are the two controls you want without scrolling back to the
 * top for them.
 *
 * It pins BELOW the site header, which is itself sticky at top: 0. Two sticky
 * elements in different templates can only agree on where one ends and the
 * other begins if they share a number, so the header's height is declared
 * once as a token and both read it. Hard-coding `top: 3rem` here would drift
 * the first time the header gains a row.
 */
.rb-monthbar {
  position: sticky;
  top: var(--rb-header-h);
  z-index: 4; /* under the header's 5 — it must slide beneath, not over */
  /* Opaque: the grid scrolls underneath and would otherwise read through. */
  background: var(--color-bg);
  padding-top: 0.75rem;
  /* Cancels .rb-main's side padding so the background reaches the edges,
   * then puts it back on the contents. */
  margin-inline: -1rem;
  padding-inline: 1rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1rem;
}

/* Sticky costs vertical space, and on a short viewport in landscape it can
 * eat the content it is meant to help you navigate. Below that, let it go. */
@media (max-height: 26rem) {
  .rb-monthbar {
    position: static;
  }
}

.rb-monthnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.rb-monthnav__label {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.75rem;
  margin: 0;
  text-align: center;
  flex: 1;
}

.rb-monthnav__step {
  color: var(--color-accent);
  text-decoration: none;
  font-size: 1.5rem;
  line-height: 1;
  /* A 44px target: this is the primary control on a phone. */
  min-width: 2.75rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
}

/* --------------------------------------------------- filter: dropdown -- */
/*
 * <details> + checkboxes + a submit button. The browser opens and closes the
 * disclosure and the checkboxes hold their own state, so this is a multi-
 * select dropdown with no script at all. It replaced a row of single-select
 * chips, which could not express "WWE and AEW but not the rest" and which
 * wrapped onto two lines on a phone — costly now that the bar is sticky.
 */

.rb-filter {
  margin: 0 0 0.75rem;
}

.rb-filter__menu {
  position: relative;
  display: inline-block;
}

.rb-filter__summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem; /* the 44px target, same as the month steps */
  padding: 0.35rem 0.9rem;
  font-size: var(--font-size-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-fg);
  cursor: pointer;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  list-style: none; /* Firefox marker */
}

.rb-filter__summary::-webkit-details-marker {
  display: none; /* Safari/Chrome marker */
}

/* Drawn, not fetched: no icon font, no sprite, no request. */
.rb-filter__summary::after {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
  transform: rotate(45deg) translate(-0.1em, -0.1em);
  transition: transform var(--duration-base) var(--ease-standard);
}

.rb-filter__menu[open] > .rb-filter__summary {
  border-color: var(--color-accent);
}

.rb-filter__menu[open] > .rb-filter__summary::after {
  transform: rotate(-135deg) translate(-0.1em, -0.1em);
}

.rb-filter__panel {
  position: absolute;
  inset-inline-start: 0;
  z-index: var(--z-dropdown);
  min-width: 14rem;
  margin-top: 0.35rem;
  padding: 0.5rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
}

.rb-filter__set {
  margin: 0;
  padding: 0;
  border: 0;
}

.rb-filter__option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.4rem;
  min-height: 2.5rem;
  font-size: var(--font-size-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-fg);
  cursor: pointer;
  border-radius: 0.35rem;
}

.rb-filter__option:hover {
  background: rgb(255 255 255 / 6%);
}

.rb-filter__option input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--color-accent);
  flex: none;
}

.rb-filter__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.rb-btn {
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  min-height: 2.5rem;
  padding: 0.4rem 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.4rem;
  cursor: pointer;
}

.rb-btn--go {
  flex: 1;
  color: var(--color-accent-fg);
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.rb-btn--clear {
  color: var(--color-fg-muted);
  background: transparent;
  border: 1px solid var(--color-border);
}

.rb-btn--clear:hover {
  color: var(--color-link);
}

/* ------------------------------------------------- timezone (enhanced) -- */
/*
 * Injected by localtime.js and styled here rather than there, so the toggle
 * matches the rest of the chrome and there is no inline style to fight a CSP.
 * It never exists on a page whose script did not run, which is the point:
 * Eastern is a real answer, not a control waiting to be pressed.
 *
 * Quiet on purpose. The times are the content; this is a preference.
 */
.rb-tz-toggle {
  font: inherit;
  font-size: var(--font-size-sm);
  color: var(--color-fg-muted);
  background: transparent;
  border: 0;
  border-bottom: 1px dotted currentColor;
  padding: 0.15rem 0;
  margin-bottom: 0.65rem;
  cursor: pointer;
}

.rb-tz-toggle:hover,
.rb-tz-toggle:focus-visible {
  color: var(--color-link);
}

/* Pressed means "showing your zone", which is the state worth marking — it is
 * the one where the number on screen no longer matches the poster. */
.rb-tz-toggle[aria-pressed="true"] {
  color: var(--color-accent);
}

.rb-event-page__when .rb-tz-toggle {
  display: block;
  margin-top: 0.35rem;
}

/* ------------------------------------------------- month: phone agenda -- */

.rb-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Nothing on this day, or a day belonging to the month either side: no
   reason to occupy a screen you have to scroll with your thumb. */
.rb-cell--empty,
.rb-cell--outside { display: none; }

.rb-cell {
  border: 1px solid var(--color-border);
  border-radius: 0.6rem;
  padding: 0.6rem 0.7rem;
  background: color-mix(in srgb, var(--color-bg-elevated) 45%, transparent);
}

.rb-cell--today {
  border-color: var(--color-accent);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

.rb-cell--past { opacity: 0.55; }

.rb-cell__date {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-fg-muted);
}

.rb-cell__num { font-size: 1.25rem; color: var(--color-fg); }

.rb-today-flag {
  font-family: var(--font-sans);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-accent);
}

.rb-event {
  display: grid;
  gap: 0.15rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.45rem;
  border-inline-start: 3px solid var(--color-border);
  background: var(--color-bg-elevated);
  text-decoration: none;
  color: inherit;
}

.rb-event + .rb-event { margin-top: 0.4rem; }

.rb-event:hover,
.rb-event:focus-visible { background: color-mix(in srgb, var(--color-bg-elevated) 70%, var(--color-accent)); }

.rb-event__promo {
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-accent);
}

.rb-event__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.15;
  text-transform: uppercase;
}

.rb-event__meta {
  font-size: var(--font-size-sm);
  color: var(--color-fg-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
}

.rb-event__watch::before { content: "· "; }

.rb-event--ppv { border-inline-start-color: var(--color-accent); }
.rb-event--wwe { border-inline-start-color: #c8102e; }
.rb-event--aew { border-inline-start-color: #d4af37; }
.rb-event--tna { border-inline-start-color: #1f9ad6; }
.rb-event--roh { border-inline-start-color: #8e2f8e; }
.rb-event--nwa { border-inline-start-color: #b8941f; }

/* Weekday headers label grid columns, and there are no columns on a phone.
   Declared BEFORE the media query so the grid rule below wins the cascade. */
.rb-weekdays { display: none; }

/* --------------------------------------------------- month: real grid -- */

@media (min-width: 48rem) {
  .rb-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.35rem;
  }

  /* Whole weeks: empty days hold their place, and the adjacent months'
     days return, dimmed, exactly as a wall calendar prints them. */
  .rb-cell--empty,
  .rb-cell--outside { display: block; }

  .rb-cell--outside {
    background: none;
    border-style: dashed;
    opacity: 0.5;
  }

  .rb-cell {
    min-height: 7.5rem;
    padding: 0.35rem;
    border-radius: 0.4rem;
  }

  .rb-cell__date { display: block; margin-bottom: 0.3rem; }
  .rb-cell__dow { display: none; }  /* the column header says it */
  .rb-cell__num { font-size: 1rem; }
  .rb-today-flag { display: none; }

  .rb-event { padding: 0.35rem 0.4rem; }
  .rb-event__title { font-size: 0.9rem; }
  .rb-event__meta { font-size: var(--font-size-xs); }

  .rb-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    padding: 0;
    list-style: none;
  }

  .rb-weekdays li {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: var(--font-size-sm);
    color: var(--color-fg-muted);
    text-align: center;
  }
}

/* -------------------------------------------------------- event page --- */

.rb-event-page { max-width: 44rem; }

.rb-crumb { margin-bottom: 1rem; }
.rb-crumb a { color: var(--color-link); text-decoration: none; }

.rb-event-page__promo {
  font-size: var(--font-size-sm);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin: 0;
}

.rb-event-page h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(1.9rem, 7vw, 3rem);
  line-height: 1.05;
  margin: 0.2rem 0 0.5rem;
}

.rb-event-page__when {
  font-size: var(--font-size-lg);
  margin: 0 0 1rem;
}

.rb-alert {
  border-inline-start: 3px solid var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  padding: 0.6rem 0.8rem;
  border-radius: 0.4rem;
}

.rb-poster {
  width: 100%;
  height: auto;
  border-radius: 0.6rem;
  border: 1px solid var(--color-border);
  margin-bottom: 1.25rem;
}

.rb-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem 1rem;
  margin: 0 0 1.5rem;
}

.rb-facts dt {
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-fg-muted);
  margin-top: 0.75rem;
}

.rb-facts dd { margin: 0; }

@media (min-width: 36rem) {
  .rb-facts { grid-template-columns: 10rem 1fr; }
  .rb-facts dt { margin-top: 0; }
}

.rb-muted { color: var(--color-fg-muted); font-size: var(--font-size-sm); }

/* --------------------------------------------------------- disclosure -- */

.rb-detail {
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.6rem 0.85rem;
  margin-bottom: 1rem;
}

.rb-detail > summary {
  cursor: pointer;
  font-weight: 700;
  /* A tap target, not a 16px word. */
  padding: 0.35rem 0;
}

.rb-detail ul { margin: 0.5rem 0 0; padding-inline-start: 1.1rem; }
.rb-detail li { color: var(--color-fg-muted); }

/* -------------------------------------------------------------- prose -- */

.rb-prose { max-width: 42rem; }

.rb-prose h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(2rem, 8vw, 3rem);
  margin: 0 0 0.75rem;
}

.rb-prose h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.4rem;
  margin: 2rem 0 0.5rem;
}

.rb-feed {
  border: 1px solid var(--color-border);
  border-radius: 0.6rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.rb-feed h2 { margin: 0 0 0.6rem; font-size: 1.2rem; }

.rb-feed__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.rb-feed__actions .btn { flex: 1 1 auto; min-height: 2.75rem; }

.rb-feed__url label {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-fg-muted);
  margin-bottom: 0.25rem;
}

.rb-feed__url input {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  /* 16px minimum stops iOS Safari zooming when the field takes focus. */
  font-size: max(16px, var(--font-size-sm));
}

.rb-warn {
  border-inline-start: 3px solid var(--color-accent);
  padding-inline-start: 0.75rem;
  color: var(--color-fg-muted);
}

.rb-empty { color: var(--color-fg-muted); padding: 2rem 0; }

.rb-cta { margin-top: 1.5rem; }
.rb-cta .btn { min-height: 2.75rem; display: inline-flex; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------- flyer gallery -- */

/* Promotions publish a flyer per announced match. On a phone that is a
   horizontal scroll-snap strip rather than a column you scroll past; from
   36rem it becomes a grid. Pure CSS — no carousel script. */
.rb-flyers {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: 0.6rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  scrollbar-width: thin;
}

.rb-flyers--single { grid-auto-columns: 100%; overflow-x: visible; }

.rb-flyer {
  margin: 0;
  scroll-snap-align: start;
}

.rb-flyer img {
  width: 100%;
  height: auto;
  border-radius: 0.6rem;
  border: 1px solid var(--color-border);
  display: block;
}

.rb-flyer figcaption {
  font-size: var(--font-size-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-fg-muted);
  padding-top: 0.3rem;
}

@media (min-width: 36rem) {
  .rb-flyers {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    grid-auto-columns: auto;
    overflow-x: visible;
  }
}

.rb-evidence a { color: var(--color-link); }
