/* stats_files/css/stats.css
   Stats section stylesheet (based on the VBA template layout) */

:root {
  --stats-primary: #5a0a87;
  --stats-green: #008000;
  --stats-red: #e61e1e;
  --stats-text-color: #333333;

  /* Positioning Controls */
  --stats-content-max-width: 1100px;
  --stats-content-padding-x: 0px;
  --stats-section-shift-x: 65px;
  --stats-main-content-shift-x: 0px;
  --stats-section-padding-top: 60px;
  --stats-section-padding-bottom: 20px;


  /* Local menu positioning */
  --stats-menu-top: 100px;
  --stats-menu-left: 20px;
  --stats-menu-width: 320px;
  --stats-menu-shift-x: 60px;
  --stats-menu-shift-y: 38px;

  /* Layering */
  --stats-menu-z: 2500;
  --stats-menu-nav-z: 2501;
  --stats-menu-title-z: 2502;

  /* Menu typography */
  --stats-menu-title-font-size: 20px;
  --stats-menu-item-font-size: 15px;
  --stats-menu-arrow-size: 40px;
  --stats-submenu-arrow-size: 26px;
  --stats-menu-item-padding-y: 6px;
  --stats-menu-item-padding-x: 6px;
  --stats-menu-hover-bg: #4a0870;

  /* Header alignment */
  --stats-header-margin-left: 0px;
  --stats-header-margin-right: 150px;
  --stats-divider-margin-top: -50px;
  --stats-divider-margin-bottom: 80px;

  /* Column widths (equal by default) */
  --stats-columns-gap: 12px;
  --stats-left-col-width: 42%;
  --stats-right-col-width: 42%;

  /* Bottom box */
  --stats-bottom-padding-y: 5px;
  --stats-bottom-padding-x: 0px;
}

/* Page wrapper */
.stats-section {
  max-width: var(--stats-content-max-width);
  margin: 0 auto;
  padding: var(--stats-section-padding-top) var(--stats-content-padding-x) var(--stats-section-padding-bottom);
  font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, sans-serif;
  transform: translateX(var(--stats-section-shift-x));
}

/* Local menu (dropdown style) */
#stats-local-menu {
  position: relative;
  max-width: var(--site-max-width, 1200px);
  width: 100%;
  margin: var(--stats-menu-top) auto 0;
  padding: 0 150px;
  z-index: var(--stats-menu-nav-z);
  isolation: isolate;
  transform: translate(var(--stats-menu-shift-x), var(--stats-menu-shift-y));
}

#stats-local-menu .stats-local-menu {
  position: relative;
  width: var(--stats-menu-width);
}

/* Correlation pages inject the local menu inline inside the PV header grid.
   Keep it visible without consuming the PV header-left column width. */
#stats-local-menu-inline {
  position: relative;
  width: 0;
  height: 0;
  z-index: var(--stats-menu-nav-z);
}

#stats-local-menu-inline .stats-local-menu {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--stats-menu-width);
}

.stats-menu-title {
  font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, sans-serif;
  font-size: var(--stats-menu-title-font-size);
  font-weight: 600;
  color: var(--stats-primary);
  margin: 0;
  padding: 8px 32px 8px 12px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 6px;
  border: 2px solid var(--stats-primary);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
  z-index: var(--stats-menu-title-z);
}

.stats-menu-title::after {
  content: "\25BE";
  font-size: var(--stats-menu-arrow-size);
  transition: transform 0.3s;
  position: absolute;
  right: 12px;
}

.stats-menu-title:hover {
  background: rgba(90, 10, 135, 0.05);
}

.stats-menu-nav {
  display: none;
  background: rgba(235, 222, 231, 0.98);
  border: 2px solid var(--stats-primary);
  border-radius: 6px;
  padding: 5px 0;
  margin-top: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  max-height: 400px;
  overflow-y: auto;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: var(--stats-menu-z);
  width: var(--stats-menu-width);
}

.stats-local-menu:hover .stats-menu-nav,
.stats-local-menu:focus-within .stats-menu-nav {
  display: block;
}

.stats-local-menu:hover .stats-menu-title::after,
.stats-local-menu:focus-within .stats-menu-title::after {
  transform: rotate(180deg);
}

.stats-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stats-menu-list li {
  margin: 0;
  padding: 0;
}

.stats-menu-list li.stats-menu-separator {
  list-style: none;
  height: 2px;
  margin: 2px 2px;
  background: rgba(59, 4, 92, 0.35);
}

.stats-menu-list li a {
  display: block;
  padding: var(--stats-menu-item-padding-y) var(--stats-menu-item-padding-x);
  font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, sans-serif;
  font-size: var(--stats-menu-item-font-size);
  font-weight: 500;
  color: var(--stats-primary);
  text-decoration: none;
  transition: background 0.2s;
  line-height: 1.4;
  text-align: left;
}

.stats-menu-list li a:hover {
  background: var(--stats-menu-hover-bg);
  color: #ffffff;
}

.stats-menu-list li a.active {
  background: var(--stats-primary);
  color: #ffffff;
  font-weight: 600;
}

.stats-menu-divider {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #5f5f5f;
  background: #f4f4f4;
  border-top: 1px solid #dedede;
  border-bottom: 1px solid #dedede;
}

.stats-menu-group {
  position: relative;
}

.stats-menu-group-title {
  display: block;
  padding: var(--stats-menu-item-padding-y) var(--stats-menu-item-padding-x);
  font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, sans-serif;
  font-size: var(--stats-menu-item-font-size);
  font-weight: 600;
  color: var(--stats-primary);
  text-align: left;
  cursor: pointer;
  line-height: 1.4;
  user-select: none;
  position: relative;
  padding-right: 36px;
}

.stats-menu-group-title::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: calc(var(--stats-submenu-arrow-size) * 0.32) solid transparent;
  border-bottom: calc(var(--stats-submenu-arrow-size) * 0.32) solid transparent;
  border-left: calc(var(--stats-submenu-arrow-size) * 0.48) solid #4f4f4f;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.2s ease;
}

.stats-menu-group:hover > .stats-menu-group-title,
.stats-menu-group:focus-within > .stats-menu-group-title {
  background: #f3ebfa;
}

.stats-menu-sublist {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0 0 4px 0;
  background: #fbf9fd;
  border-top: 1px solid #ece3f7;
  border-bottom: 1px solid #ece3f7;
}

.stats-menu-group:hover > .stats-menu-sublist,
.stats-menu-group:focus-within > .stats-menu-sublist,
.stats-menu-group:has(a.active) > .stats-menu-sublist {
  display: block;
}

.stats-menu-group:hover > .stats-menu-group-title::after,
.stats-menu-group:focus-within > .stats-menu-group-title::after,
.stats-menu-group:has(a.active) > .stats-menu-group-title::after {
  transform: translateY(-50%) rotate(90deg);
}

.stats-menu-sublist li a {
  padding-left: 18px;
  font-size: 15px;
}

.stats-menu-sublist li a::before {
  content: "· ";
  color: #7b46a2;
}

.stats-menu-nav::-webkit-scrollbar {
  width: 6px;
}

.stats-menu-nav::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.stats-menu-nav::-webkit-scrollbar-thumb {
  background: var(--stats-primary);
  border-radius: 3px;
}

.stats-menu-nav::-webkit-scrollbar-thumb:hover {
  background: #4a0870;
}

/* Keep long code/formula blocks inside PV content boxes */
.pv-leftbox pre,
.pv-rightbox pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
  box-sizing: border-box;
}

.pv-leftbox pre code,
.pv-rightbox pre code {
  font-size: 14px;
  line-height: 1.45;
}

/* Header section */
.stats-header-section {
  margin: -79px var(--stats-header-margin-right) 30px var(--stats-header-margin-left);
  padding: 0;
  text-align: right;
  max-width: 100%;
}

.stats-header-title {
  font-family: "Arial Narrow", Arial, sans-serif;
  font-size: 44px;
  font-weight: 350;
  color: var(--stats-primary);
  margin: 0;
  line-height: 1.2;
}

.stats-header-divider {
  margin: var(--stats-divider-margin-top) 0 var(--stats-divider-margin-bottom) 0;
  border: none;
  border-top: 2px solid var(--stats-primary);
  width: 100%;
}

.stats-header-subtitle {
  font-family: "Arial Narrow", Arial, sans-serif;
  font-size: 44px;
  font-weight: 350;
  color: var(--stats-primary);
  margin: 0;
  line-height: 1.2;
}

/* Main content */
.stats-main-content {
  display: grid;
  grid-template-columns: var(--stats-left-col-width) var(--stats-right-col-width);
  gap: var(--stats-columns-gap);
  margin: 30px 0;
  align-items: start;
  max-width: 100%;
  transform: translateX(var(--stats-main-content-shift-x));
}

.stats-leftbox,
.stats-rightbox {
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #ddd;
  min-width: 0;
}

.stats-leftbox h2 {
  font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, sans-serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--stats-primary);
  text-align: center;
  margin: 0 0 20px 0;
}

.stats-leftbox ul {
  font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.8;
  color: var(--stats-text-color);
  margin: 0 0 20px 0;
  padding-left: 25px;
}

.stats-leftbox ul li {
  margin-bottom: 15px;
}

.stats-leftbox p {
  font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--stats-text-color);
  margin-bottom: 15px;
}

.stats-quote-line {
  font-weight: 700;
}

.stats-leftbox img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-rightbox h2 {
  font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, sans-serif;
  font-size: 32px;
  font-weight: 500;
  color: var(--stats-green);
  text-align: center;
  margin: 0 0 20px 0;
}

.stats-rightbox ul {
  font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.8;
  color: var(--stats-text-color);
  margin: 20px 0;
  padding-left: 25px;
}

.stats-rightbox ul li {
  margin-bottom: 12px;
}

.stats-rightbox img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-rightbox .stats-zoom-img {
  cursor: pointer;
  transition: transform 0.2s ease;
  transform-origin: center center;
}

.stats-rightbox .stats-zoom-img:hover {
  transform: scale(1.5);
}

.stats-rightbox p {
  font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--stats-text-color);
}

/* Bottom box */
.stats-bottombox {
  width: calc(var(--stats-left-col-width) + var(--stats-right-col-width) + var(--stats-columns-gap));
  margin: 30px 0;
  margin-right: auto;
  padding: var(--stats-bottom-padding-y) var(--stats-bottom-padding-x);
  background: #ffffff;
  border: 3px solid var(--stats-primary);
  border-radius: 8px;
  text-align: center;
}

.stats-bottombox h1,
.stats-bottombox h2 {
  font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, sans-serif;
  font-size: 26px;
  font-weight: 500;
  color: var(--stats-primary);
  margin: 0;
  line-height: 1.35;
}

.stats-bottombox p {
  font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, sans-serif;
  font-size: 20px;
  line-height: 1.6;
  color: var(--stats-text-color);
  margin: 10px 0 0 0;
}

/* Text emphasis */
.stats-highlight-strong {
  color: var(--stats-red);
  font-weight: 700;
}

.stats-highlight-purple {
  color: var(--stats-primary);
  font-weight: 600;
}

.stats-highlight-green {
  color: var(--stats-green);
  font-weight: 600;
}

.stats-highlight-red {
  color: var(--stats-red);
  font-weight: 600;
}

/* Responsive */
@media (max-width: 900px) {
  .stats-main-content {
    grid-template-columns: 1fr;
  }

  .stats-bottombox {
    width: 100%;
  }

  .stats-section {
    padding-left: 14px;
    padding-right: 14px;
    transform: none;
  }

  #stats-local-menu {
    position: static;
    margin: calc(var(--header-height, 88px) + 8px) 0 20px 0;
    max-width: 100%;
    width: 100%;
    padding: 0 14px;
    transform: none;
  }

  #stats-local-menu .stats-local-menu {
    width: 100%;
  }

  .stats-menu-title {
    width: 100%;
  }

  .stats-menu-nav {
    display: none;
    position: static;
    width: 100%;
    margin-top: 6px;
    max-height: none;
    box-shadow: none;
  }

  .stats-local-menu.is-open .stats-menu-nav {
    display: block;
  }

  .stats-local-menu.is-open .stats-menu-title::after {
    transform: rotate(180deg);
  }

  .stats-menu-sublist {
    display: block;
  }

  .stats-menu-group-title::after {
    transform: translateY(-50%) rotate(90deg);
  }

  .stats-header-section {
    margin: 0 0 18px 0;
    text-align: left;
  }
}

@media (max-width: 900px) {
  .stats-header-title {
    font-size: 35px;
  }

  .stats-header-subtitle {
    font-size: 35px;
  }
}

