/* Minimal site stylesheet: typography, layout, responsive media, tables, code, utilities */

:root{
  --content-width: 880px;
  --body-bg: #ffffff;
  --text-color: #222;
  --muted: #666;
  --accent: #0a66c2;
  --border: #e6e6e6;
  --radius: 6px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
  --ui-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

html,body{
  height:100%;
  margin:0;
  padding:0;
  background:var(--body-bg);
  color:var(--text-color);
  font-family:var(--ui-sans);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-size:16px;
}

a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }

.container, .site {
  max-width:var(--content-width);
  margin:0 auto;
  padding:1.25rem;
}

/* Headings */
h1,h2,h3,h4{ color:var(--text-color); margin:1.25rem 0 0.5rem; line-height:1.2; }
h1{ font-size:2rem; }
h2{ font-size:1.5rem; }
h3{ font-size:1.125rem; font-weight:600; }

/* Paragraphs and lists */
p{ margin:0 0 1rem; }
ul,ol{ margin:0 0 1rem 1.25rem; }

/* Main content area */
main[role="main"]{
  background:transparent;
}

/* Images */
img{ max-width:100%; height:auto; display:block; }

/* Tables */
table{
  width:100%;
  border-collapse:collapse;
  margin:0 0 1rem;
  font-size:0.95rem;
}
th,td{
  padding:0.5rem 0.75rem;
  border:1px solid var(--border);
  text-align:left;
}
th{ background:#fafafa; font-weight:600; }

/* Code and pre */
code, kbd, samp{ font-family:var(--mono); background:#f6f8fa; padding:0.15rem 0.3rem; border-radius:4px; font-size:0.95em; }
pre{ background:#0f1724; color:#e6eef8; padding:0.9rem; overflow:auto; border-radius:6px; font-family:var(--mono); font-size:0.9rem; }

/* Blockquote */
blockquote{
  margin:0 0 1rem;
  padding:0.5rem 1rem;
  border-left:4px solid var(--border);
  background:#fbfbfb;
  color:var(--muted);
}

/* Footer */
.site-footer, footer{
  margin-top:2rem;
  padding-top:1rem;
  border-top:1px solid var(--border);
  color:var(--muted);
  font-size:0.95rem;
}

/* Simple responsive nav placeholder */
.site-header, header{
  margin-bottom:1rem;
  padding-bottom:0.5rem;
  border-bottom:1px solid var(--border);
}

/* Utility */
.center{ text-align:center; }
.small{ font-size:0.9rem; color:var(--muted); }

/* Responsive tweaks */
@media (max-width:640px){
  :root{ --content-width:calc(100% - 2rem); }
  th,td{ padding:0.5rem; font-size:0.9rem; }
  h1{ font-size:1.5rem; }
}

/* --- Page container (ensure visible max width and comfortable side padding) --- */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.25rem; /* side padding for all viewports */
  box-sizing: border-box;
}

/* Allow full-bleed sections if needed by using a .full-width wrapper (optional) */
.full-width {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* --- Header / navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(20,20,20,0.03);
  backdrop-filter: blur(4px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

/* Brand */
.site-title{
  font-weight: 700;
  color: var(--text-color);
  font-size: 1.05rem;
  text-decoration: none;
}
.site-title:hover { text-decoration: underline; }

/* Nav */
.site-nav ul{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.site-nav a{
  color: var(--text-color);
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover{
  background: #f5f7fb;
  color: var(--accent);
}

/* Small-screen adjustments: stack brand + menu, collapse spacing */
@media (max-width: 720px) {
  .header-inner { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .site-nav ul { justify-content: center; flex-wrap: wrap; gap: 0.5rem; }
  .container { padding-left: 1rem; padding-right: 1rem; }
}

/* Ensure main content doesn't get hidden behind sticky header on very small screens:
   if header height changes, the sticky header still occupies layout space so no offset needed.
*/

/* -------------------------
   Polas Spectrum — page-specific improvements
   ------------------------- */

/* Stronger, clearer heading hierarchy */
h1 {
  font-size: 2.25rem;
  margin: 1rem 0 0.75rem;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.5rem;
  margin: 1.75rem 0 0.6rem;
  padding-bottom: 0.25rem;
  color: var(--text-color);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
h3 {
  font-size: 1.125rem;
  margin: 1.25rem 0 0.5rem;
  font-weight: 600;
  color: #0f1724;
}

/* Clear section spacing so the eye can separate blocks */
.section {
  margin-bottom: 1.75rem;
  padding-top: 0.25rem;
}

/* Style chart images used on the Polas Spectrum pages so each image reads as a card */
img[src*="/polas-spectrum/assets/"] {
  display: block;
  width: 100%;
  max-width: 760px; /* comfortable reading width for these wide charts */
  height: auto;
  margin: 0.5rem 0 0.35rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(12,20,30,0.06);
}

/* Download links that point to chart assets: make them clearly attached to the image */
a[href*="/polas-spectrum/assets/"] {
  display: inline-block;
  margin: 0.25rem 0 1.25rem;
  color: var(--accent);
  background: rgba(10,102,194,0.04);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(10,102,194,0.08);
}
a[href*="/polas-spectrum/assets/"]:hover {
  background: rgba(10,102,194,0.09);
  text-decoration: none;
}

/* Make small portrait thumbnails in the tables compact and visually neutral */
table img[src*="/polas-spectrum/assets/"] {
  width: 100px !important;
  max-width: 100px !important;
  height: auto !important;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  box-shadow: none;
  border: none;
}

/* Improve paragraph spacing after images/links so each graphic block is a self-contained unit */
img[src*="/polas-spectrum/assets/"] + br + a[href*="/polas-spectrum/assets/"],
img[src*="/polas-spectrum/assets/"] + a[href*="/polas-spectrum/assets/"] {
  margin-top: 0.25rem;
  display: inline-block;
}

/* Make lists, tables, and code blocks easier to scan in long analytic pages */
.container p, .container ul, .container ol, .container table {
  max-width: var(--content-width);
}

/* Responsive tweaks: keep charts readable on small screens */
@media (max-width: 720px) {
  img[src*="/polas-spectrum/assets/"] {
    max-width: 100%;
    border-radius: 6px;
    box-shadow: 0 6px 14px rgba(12,20,30,0.05);
  }
  table img[src*="/polas-spectrum/assets/"] {
    width: 72px !important;
    max-width: 72px !important;
  }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.15rem; }
}

/* Accessibility: ensure focus styles on chart download links */
a[href*="/polas-spectrum/assets/"]:focus {
  outline: 3px solid rgba(10,102,194,0.15);
  outline-offset: 3px;
}
