/* =========================
   Base layout
   ========================= */
body {
  margin: 0;
  padding: 0;
  background-color: #dcdcdc; /* light gray side margins */
  font-family: monospace;
}

/* Page frame */
.wrapper {
  display: grid;
  grid-template-columns: 250px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "header header"
    "sidebar-left main";
  width: 75%;            /* 75% width, centered on desktop */
  margin: 0 auto;
  min-height: 100vh;
  border: 4px solid #333;  /* desktop border */
  box-sizing: border-box;
  background: #fff;
}

/* Force desktop border & width in case other rules creep in */
@media (min-width: 769px) {
  .wrapper {
    width: 75%;
    border: 4px solid #333;
    margin: 0 auto;
  }
}

header {
  grid-area: header;
  background: #e0e0e0;
  padding: 1rem;
  border-bottom: 4px solid #333;
}

header h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: bold;
}

.sidebar-left {
  grid-area: sidebar-left;
  border-right: 4px solid #333;
  background: #fff;
  padding: 1rem;
}

.sidebar-left .vertical-text {
  /* If you want vertical text, uncomment the two lines below */
  /* writing-mode: vertical-rl;
  transform: rotate(180deg); */
  font-weight: bold;
  margin-bottom: 1rem;
  margin-top: 0.25rem;
  padding-left: 0.75rem;
}

.sidebar-left ol {
  list-style-position: inside; /* bring numbers inside */
  margin: 0;
  padding: 0;
}

.sidebar-left li {
  margin: 0.5rem 0;
  padding-left: 0.75rem; /* pushes team names away from border */
}

main {
  grid-area: main;
  padding: 1rem;
  background: #fff;
}

/* Methodology section box */
.methodology {
  border: 2px solid #333;
  padding: 1rem;
  margin-bottom: 2rem;
}

.methodology a {
  color: #000;
  text-decoration: underline;
}

.linkbox {
  border: 2px solid #333;
  padding: 1rem;
  margin-bottom: 2rem;
}

.linkbox a {
  color: #00F;
  text-decoration: underline;
}

/* Index links section box */
.index-links {
  border: 2px solid #333;
  padding: 1rem;
}

.index-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.index-links li {
  margin: 0.5rem 0;
}

.index-links a {
  color: #000;
  text-decoration: underline;
  font-weight: bold;
}

/* =========================
   Rankings Sheets (CFR) Layout
   ========================= */
/* Your CFR pages use .wrapper (same as index) but have no sidebar.
   They put the sheet in: main.fullspan > pre  */
main.fullspan {
  grid-column: 1 / -1; /* span full grid width */
}

/* The preformatted rankings block on desktop */
main.fullspan pre {
  font-family: monospace;
  white-space: pre;
  margin: 1em;
  padding: 1em;
  background: #fff;
  border: 2px solid #333; /* inner sheet border on desktop */
}

/* =========================
   Responsive Fixes (phones)
   ========================= */
@media (max-width: 768px) {
  /* Collapse all wrapper-based pages (index, archive, CFR) */
  .wrapper {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "sidebar-left"
      "main";
    width: 100vw;     /* full width on mobile */
    border: none;    /* remove big outer border on mobile */
    margin: 0;
    padding: 0;
  }

  .sidebar-left {
    border-right: none;               /* remove side split */
    border-bottom: 4px solid #333;    /* keep separation */
  }

  header h1 {
    font-size: 1.1rem;
    text-align: center;
  }

  /* Rankings pages: remove inner borders/margins so they fill width */
  main.fullspan {
    /* grid-column: 1 / -1; */
    width: 100vw;
    border: none;
    padding: 0.5rem;
  }

  main.fullspan pre {
    border: none;
    margin: 0;
    padding: 0.5rem;
    width: 100vw;
    line-height: 1.2;
    background: #fff;
    box-sizing: border-box;
    white-space: pre;     /* keep formatting, no wrapping */
    overflow-x: auto;     /* fallback scroll if needed */
  }
}
