/* Shared Berexco website styles */
:root {
  --brand: #173b67;
  --brand-dark: #0f2948;
  --accent: #9f1f2d;
  --text: #202830;
  --muted: #5f6973;
  --surface: #ffffff;
  --surface-alt: #f4f6f8;
  --border: #d8dee5;
  --focus: #005fcc;
  --max-width: 1280px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: #eef1f4;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a { color: #124f8c; }
a:hover { color: #0b3764; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
img { max-width: 100%; height: auto; }

.site-header {
  background: var(--surface);
  border-bottom: 4px solid var(--accent);
}
.header-inner {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { width: 110px; height: auto; display: block; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 9px 12px;
  border-radius: 5px;
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 700;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--surface-alt); }

main {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 28px auto;
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(18, 35, 52, .06);
}
h1, h2, h3 { color: var(--brand-dark); line-height: 1.25; }
h1 { margin-top: 0; font-size: clamp(1.8rem, 3vw, 2.45rem); }
h2 { margin-top: 1.8rem; font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { max-width: 78ch; }
.lead { font-size: 1.08rem; color: #37424c; }
.muted { color: var(--muted); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 22px 0;
}
.card {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-alt);
  padding: 18px;
}
.card h2, .card h3 { margin-top: 0; }
.contact-photo { width: min(100%, 560px); border-radius: 6px; border: 1px solid var(--border); }
.address { font-style: normal; }
.call-link { white-space: nowrap; }

.notice {
  border-left: 4px solid var(--accent);
  background: #fff8f8;
  padding: 12px 16px;
  margin: 18px 0;
}

/* SDS page */
.sds-tools {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 20px 0 24px;
  padding: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.sds-tools label { display: block; font-weight: 700; margin-bottom: 6px; }
.sds-search {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #9ea9b4;
  border-radius: 5px;
  font: inherit;
}
.sds-summary { margin: 8px 0 0; color: var(--muted); font-size: .95rem; }
.sds-group { margin: 28px 0; }
.sds-group h2 { border-bottom: 2px solid var(--border); padding-bottom: 7px; }
.sds-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 8px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.sds-item a {
  display: block;
  padding: 5px 0;
  overflow-wrap: anywhere;
}
.sds-empty { display: none; padding: 14px; background: #fff8e8; border: 1px solid #efd899; border-radius: 5px; }

.scholarship-logo { display: block; max-height: 175px; width: auto; margin: 10px auto 20px; }
.download-list { list-style: none; padding: 0; }
.download-list li { margin: 12px 0; }

.site-footer {
  color: #e7edf3;
  background: var(--brand-dark);
  margin-top: 36px;
}
.footer-inner {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0;
  text-align: center;
  font-size: .9rem;
}
.footer-inner p { margin: 0 auto; max-width: none; }



/* Main content with right-side energy market panel */
.page-layout {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 28px auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 22px;
}
.page-layout > main {
  width: auto;
  margin: 0;
}
.market-sidebar {
  min-width: 0;
}
.market-panel {
  position: sticky;
  top: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(18, 35, 52, .06);
}
.market-panel h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}
.market-card {
  margin-bottom: 14px;
  padding: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.market-card:last-of-type {
  margin-bottom: 10px;
}
.market-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--brand-dark);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
}
.market-label:hover {
  text-decoration: underline;
}
.market-card tv-single-ticker {
  display: block;
  min-height: 44px;
}
.market-chart-link {
  display: inline-block;
  margin-top: 4px;
  font-size: .78rem;
}
.market-attribution {
  max-width: none;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.45;
}

@media (max-width: 1020px) {
  .page-layout {
    grid-template-columns: 1fr;
  }
  .market-sidebar {
    order: 2;
  }
  .market-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .header-inner { align-items: flex-start; flex-direction: column; }
  .site-nav ul { justify-content: flex-start; }
  .site-nav a { padding-left: 0; margin-right: 12px; }
  .page-layout { margin: 16px auto; }
  main { padding: 20px; }
  .sds-list { grid-template-columns: 1fr; }
}
