.site-top {
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header {
  background: linear-gradient(
    180deg,
    var(--color-raid-blue) 0%,
    var(--color-raid-blue-deep) 100%
  );
  border-bottom: 3px solid #ffffff;
  box-shadow: 0 8px 24px rgba(0, 35, 90, 0.35);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #ffffff;
}

.brand:hover {
  color: #ffffff;
  text-decoration: none;
}

.site-header a:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.35rem;
  background: #ffffff;
  border: 2px solid var(--color-accent);
  box-shadow: 2px 2px 0 var(--color-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--color-raid-blue);
  font-size: 1rem;
  line-height: 1;
}

.brand-text {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 1.15rem;
  color: #ffffff;
  line-height: 1.1;
}

.brand-tagline {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

/* Only style the active nav list — [hidden] alone is overridden by display:flex otherwise */
.site-nav ul[hidden] {
  display: none !important;
}

.site-nav ul:not([hidden]) {
  --gap: 0.1rem;
  list-style: none;
  display: flex;
  gap: var(--gap);
  padding: 0.15rem;
  margin: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.site-nav a:hover {
  color: #ffffff;
}

.site-nav a.is-active {
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-raid-blue);
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  padding: 0;
}

.nav-toggle-bar {
  width: 1.1rem;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
  margin: 2px 0;
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .site-nav {
    position: fixed;
    inset-inline: 0.75rem;
    top: 4.1rem;
    transform: translateY(-150%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s ease-out, opacity 0.18s ease-out;
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav ul:not([hidden]) {
    flex-direction: column;
    align-items: stretch;
    background: rgba(0, 53, 128, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
  }

  .site-nav a {
    padding-block: 0.65rem;
  }

  .site-nav a.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }
}

.site-footer {
  border-top: 3px solid var(--color-raid-blue);
  background: linear-gradient(180deg, #f8fafc 0%, #e8ecf2 100%);
  padding: 1.5rem 1rem 2.25rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-meta {
  opacity: 0.9;
}

.footer-archive-link {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-archive-link:hover {
  text-decoration: underline;
}

/* Header account control */

.header-account {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.page-header {
  margin-bottom: var(--space-lg);
}

/* Archive mode persistent bar */

#archive-bar[hidden] {
  display: none;
}

#archive-bar {
  background: #fffbeb;
  border-bottom: 2px solid #d97706;
  font-size: 0.875rem;
}

.archive-bar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: var(--space-sm) var(--space-md);
}

.archive-label {
  flex: 1;
  font-weight: 600;
  color: #92400e;
  white-space: nowrap;
}

.archive-link {
  white-space: nowrap;
  color: #92400e;
  text-decoration: none;
  font-size: 0.8125rem;
  opacity: 0.8;
}

.archive-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.archive-exit {
  margin-left: auto;
  white-space: nowrap;
  color: #92400e;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  opacity: 0.8;
}

.archive-exit:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Archive overview record */

.archive-record {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.archive-record > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3rem;
}

.archive-record dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.archive-record dd {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}

.page-header h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: 0.1em;
  color: var(--color-raid-blue);
}

.page-header p {
  max-width: 40rem;
}

/* Home hero */

.home-hero {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: calc(-1 * var(--space-xl));
  margin-bottom: var(--space-xl);
  min-height: min(52vh, 28rem);
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 4px solid #ffffff;
  box-shadow: 0 12px 40px rgba(0, 35, 90, 0.2);
}

.home-hero-media {
  position: absolute;
  inset: 0;
}

.home-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

.home-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 35, 90, 0.15) 0%,
    rgba(0, 35, 90, 0.55) 55%,
    rgba(0, 20, 50, 0.88) 100%
  );
}

.home-hero-content {
  position: relative;
  z-index: 1;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

.home-hero-eyebrow {
  margin: 0 0 var(--space-xs);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.home-hero-title {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.25rem, 10vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 0.14em;
  color: #ffffff;
  text-shadow: 0 2px 0 var(--color-accent), 0 4px 24px rgba(0, 0, 0, 0.45);
}

.home-hero-sub {
  margin: 0;
  max-width: 26rem;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
}

@media (max-width: 639.98px) {
  .home-hero {
    min-height: min(42vh, 22rem);
    margin-bottom: var(--space-lg);
  }

  .home-hero-sub {
    font-size: 0.95rem;
  }
}

/* Home layout */

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr);
  gap: var(--space-lg);
  align-items: flex-start;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background: linear-gradient(165deg, #ffffff 0%, #f0f4fa 100%);
  box-shadow: var(--shadow-soft);
  padding: var(--space-md);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.panel-header h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  color: var(--color-raid-blue);
}

.panel-footer-link {
  margin-top: var(--space-sm);
  text-align: right;
}

.link-inline {
  font-size: 0.85rem;
  color: var(--color-primary);
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Grid utilities */

.grid {
  display: grid;
  gap: var(--space-md);
}

.roster-grid {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
  .roster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .roster-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Tables */

.table-wrapper {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background: linear-gradient(165deg, #ffffff 0%, #f0f4fa 100%);
  box-shadow: var(--shadow-soft);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: rgba(0, 71, 171, 0.08);
}

thead th {
  text-align: left;
  padding: 0.7rem 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

tbody td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

tbody tr:nth-child(even) {
  background: rgba(0, 71, 171, 0.04);
}

tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.9);
}

.sortable {
  cursor: pointer;
}

.sortable::after {
  content: "⇅";
  font-size: 0.7rem;
  margin-left: 0.25rem;
  opacity: 0.6;
}

.sortable.active-sort::after {
  content: "↓";
  opacity: 1;
}

/* History layout */

.history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr);
  gap: var(--space-lg);
  align-items: flex-start;
}

.seasons-panel {
  padding: var(--space-md);
}

.season-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: var(--space-sm);
}

.season-details {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background: linear-gradient(165deg, #ffffff 0%, #f0f4fa 100%);
  padding: var(--space-md);
  box-shadow: var(--shadow-soft);
}

.season-header {
  margin-bottom: var(--space-md);
}

/* Events sidebar: desktop only */
.panel-upcoming {
  display: none;
}

@media (min-width: 960px) {
  .panel-upcoming {
    display: block;
  }
}

@media (max-width: 959.98px) {
  .home-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .history-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 639.98px) {
  main {
    padding-inline: 0.9rem;
  }

  .panel {
    padding-inline: 0.85rem;
  }

  .table-wrapper {
    border-radius: var(--radius-md);
  }
}

