/* Geist fonts are loaded via JavaScript to ensure proper loading in Shadow DOM */

:root {
  /* Colors */
  --primary-color: #0471a9;
  --primary-color-light: rgba(4, 113, 169, 0.1);
  --primary-color-lighter: rgba(4, 113, 169, 0.04);
  --primary-color-medium-light: rgba(4, 113, 169, 0.15);
  --primary-color-medium-light2: rgba(4, 113, 169, 0.2);
  --primary-color-medium: rgba(4, 113, 169, 0.5);
  --primary-color-dark: rgba(4, 113, 169, 0.9);
  --text-color: #03699b;
  --text-color-dark: #034972;
  --border-color: #e0e0e0;
  --highlight-color: #ed42cd;
  --background-light: #f9f9f9;
  --background-lighter: #f5f5f5;
  --background-lightest: #fafbfc;
}

/*=====  Global Resets  ======*/
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Helvetica, Arial, sans-serif;
  line-height: 1.4;
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.02em;
  font-feature-settings: "kern", "liga", "calt";
  text-rendering: optimizeLegibility;
  font-weight: 500;
  margin: 0;
  padding: 0;
  position: relative;
}

/*=====  Typography  ======*/
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Geist Mono", Courier, "Courier New", monospace !important;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--primary-color);
  line-height: 1.1;
}

h1 {
  font-size: 2.2rem;
  margin: 0 0 1.5rem 0;
  padding-top: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-color-light);
  text-transform: uppercase;
}

/* Author and Date */
.author-date {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-top: -0.5rem; /* Tighter to h1 */
  margin-bottom: 1.5rem; /* Space before banner */
  font-family: "Geist", sans-serif;
  font-size: 0.95rem;
  color: var(--text-color);
  opacity: 0.8;
}

.author-date .author {
  font-weight: 500;
}

.author-date .separator {
  color: var(--primary-color-medium);
}

.author-date .date {
  font-weight: 400;
}

/* Article Banner */
.article-banner {
  margin: 0;
  margin-top: 2rem;
  margin-bottom: 3rem;
  padding: 0;
  width: 100%;
  position: relative;
  overflow: hidden;
  border: none;
}

.article-banner img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 400px; /* Appropriate height for 800px container */
  border: none;
}

h2 {
  font-size: 2rem;
  padding-top: 2.5rem;
  padding-bottom: 0.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  border-top: 1px solid var(--primary-color-light);
  text-transform: uppercase;
}

h3 {
  font-size: 1.6rem;
  letter-spacing: -0.04rem;
  margin-top: 2.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.25rem;
  text-transform: uppercase;
  position: relative;
  display: flex;
  align-items: center;
}

h3::after {
  content: "";
  margin-left: 0.75rem;
  color: inherit;
  flex: 1;
  height: 1px;
  background: rgba(4, 113, 169, 0.18);
  opacity: 1;
}

h4 {
  font-size: 1.2rem;
  letter-spacing: -0.035em;
  margin-top: 1.75rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
}

h5 {
  font-size: 1rem;
  font-weight: 500;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  position: relative;
  display: flex;
  align-items: center;
}

p {
  font-family: Helvetica, Arial, sans-serif;
  text-align: justify;
  font-weight: 500;
  margin: 0 0 1.25rem 0;
  line-height: 1.6;
}

a {
  color: var(--primary-color);
  font-weight: 700;
  text-decoration: underline;
}

/* List styling */
ul,
ol {
  padding-left: 1.2rem;
  margin: 1rem 0;
}

ul {
  list-style-type: square;
}

li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
  font-weight: 500;
  color: rgba(3, 105, 155, 0.95);
}

li:last-child {
  margin-bottom: 0;
}

/* Nested lists */
li ul,
li ol {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

/* Spacing between headings and paragraphs */
h1 + p,
h2 + p,
h3 + p,
h4 + p,
h5 + p {
  margin-top: 0.5rem;
}

p + h2,
ul + h2,
ol + h2 {
  margin-top: 3rem;
}

img {
  max-width: 100%;
  height: auto;
  border: 2px solid var(--border-color);
  margin: 0;
}

/*=====  Utility Classes  ======*/

/* Font utilities */
.font-mono {
  font-family: "Geist Mono", monospace;
}

.font-sans {
  font-family: Helvetica, Arial, sans-serif;
}

/* Math inline styling */
.math-inline {
  display: inline;
  background-color: var(--background-light);
  padding: 0.1rem 0.25rem;
  font-size: 1em;
  border-radius: 2px;
  margin: 0 0.15rem;
  border: 1px solid var(--primary-color-light);
  vertical-align: baseline;
  line-height: inherit;
}

/* MathJax inline math specific adjustments */
.math-inline .MathJax,
.math-inline .mjx-chtml,
.math-inline .mjx-math {
  vertical-align: baseline !important;
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Small caps for acronyms */
.small-caps {
  font-variant: small-caps;
  letter-spacing: -0.01em;
  font-size: 0.995em;
  color: rgba(3, 105, 155, 0.9);
  font-feature-settings: "smcp", "c2sc";
  border-bottom: 0.5px dotted var(--primary-color-light);
  padding-bottom: 0.05em;
  text-rendering: geometricPrecision;
}

/* Accessibility utilities */
.visually-hidden-focusable {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.visually-hidden-focusable:active,
.visually-hidden-focusable:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  clip: auto;
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 9999;
  text-decoration: none;
  font-weight: bold;
}
