/* ==========================================================================
   general.css — Site-wide styles for content pages
   ========================================================================== */

/* --- Custom Properties --- */

:root {
  /* Typography */
  --font-serif: 'CrimsonText', 'Crimson Text', Georgia, 'Times New Roman', serif;
  --font-sans: 'LatinModernSans10Regular', Arial, sans-serif;
  --font-math: 'ComputerModern', 'Latin Modern Math', 'STIX Two Math', serif;
  --font-display: 'Trajanus', var(--font-serif);
  --font-main: var(--font-sans);

  /* Font sizes */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1.125rem;  /* 18px */
  --text-lg: 1.25rem;    /* 20px */
  --text-xl: 1.375rem;   /* 22px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.75rem;   /* 28px */
  --text-4xl: 2rem;      /* 32px */
  --text-5xl: 2.25rem;   /* 36px */

  /* Colors */
  --color-bg: #f4f3f1;
  --color-bg-alt: #eae8e5;
  --color-surface: #fdfdfc;
  --color-text: #1a1a1a;
  --color-text-muted: #555;
  --color-border: #ccc;
  --color-border-dark: #1a1a1a;
  --color-accent: #8b7355;
  --color-textbox-bg: #edecea;
  --color-code-bg: #f7f6f4;
  --color-grey-green: #00ff00;

  --blue1: #90b7da;
  --blue2: #5fa0da;
  --blue3: #175994;
  --blue4: #2b4863;
  --blue5: #032b4f;
  --red1: #f5b09b;
  --red2: #f58261;
  --red3: #e54416;
  --red4: #99513c;
  --red5: #7a1e03;
  --green1: #8ddeb3;
  --green2: #58de96;
  --green3: #0fa153;
  --green4: #2a6c49;
  --green5: #025629;
  --yellow1: #f5cb9b;
  --yellow2: #f5b861;
  --yellow3: #e58f16;
  --yellow4: #99723c;
  --yellow5: #7a4903;
  --bluegrey1: #c4c6c9;
  --bluegrey2: #c2c5c9;
  --bluegrey3: #8d9094;
  --bluegrey4: #6b6d6e;
  --bluegrey5: #2d4860;
  --redgrey1: #f1eceb;
  --redgrey2: #f1eae8;
  --redgrey3: #e5e6d9;
  --redgrey4: #aba6a5;
  --redgrey5: #945746;
  --greengrey1: #cad0cd;
  --greengrey2: #c8d0cb;
  --greengrey3: #99a19d;
  --greengrey4: #747976;
  --greengrey5: #31684b;
  --yellowgrey1: #f1efeb;
  --yellowgrey2: #f1eee8;
  --yellowgrey3: #e5e0d9;
  --yellowgrey4: #aba8a5;
  --yellowgrey5: #947446;
  --grey1: #ffffff;
  --white: #ffffff;
  --grey2: #f1f1f1;
  --grey3: #e5e5e5;
  --grey4: #cbcbcb;
  --grey5: #b2b2b2;
  --grey6: #989898;
  --grey7: #7f7f7f;
  --grey8: #656565;
  --grey9: #4c4c4c;
  --grey10: #323232;
  --grey11: #191919;
  --grey12: #000000;
  --black: #000000;
  --alt_blue_light: #a1bbc7;
  --alt_blue_dark: #8599ae;
  --alt_green_light: #a2b8a8;
  --alt_green_dark: #748684;
  --alt_red_light: #aea4ae;
  --alt_red_dark: #90767a;
  --alt_yellow_light: #cdbfa7;
  --alt_yellow_dark: #ac9475;


  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 3rem;

  /* Layout */
  --document-max-width: 900px;
  --document-padding: 2.5rem;
  --document-padding-mobile: 1.25rem;

  /* Misc */
  --radius: 4px;
  --shadow: 0 1px 6px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.1);
}

/* --- Reset --- */

*, *::before, *::after {
  box-sizing: border-box;
}

/* Reset margin/padding on standard HTML elements only — NOT on MathJax internals */
body, h1, h2, h3, h4, h5, h6, p, blockquote, pre,
figure, figcaption, dl, dd, ol, ul, hr {
  margin: 0;
  padding: 0;
}

img, video, audio {
  display: block;
  max-width: 100%;
  height: auto;
}


/* --- Base --- */
body {
  font-family: var(--font-main);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-text);
  text-decoration-color: var(--color-accent);
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--color-accent);
}

/* --- Page Background Wrapper --- */
.background {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: var(--space-lg) var(--space-sm);
}

/* --- Document Container --- */
.document {
  width: 100%;
  max-width: var(--document-max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--document-padding);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* --- Headings --- */
.document h1,
.document h2,
.document h3 {
  text-align: center;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.25;
}
.document h1 {
  font-size: var(--text-5xl);
  margin-top: var(--space-sm);
  margin-bottom: var(--space-lg);
  letter-spacing: 0.01em;
}
.document h2 {
  font-size: var(--text-xl);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
}
.document h3 {
  font-size: var(--text-lg);
  margin-top: var(--space-xs);
  margin-bottom: var(--space-xs);
}

/* --- Paragraphs --- */
.document p {
  margin: 0 0 var(--space-md) 0;
  padding: 0 var(--document-padding);
  text-align: justify;
  line-height: 1.6;
  white-space: pre-line;
}
.document p.signature {
  font-style: italic;
}

/* --- Images & Figures --- */
figure {
  margin: 0 0 var(--space-md) 0;
  margin-left: auto;
  margin-right: auto;
  width: fit-content;
}
figcaption {
  text-align: left;
  font-family: var(--font-main);
  font-size: var(--text-base);
  font-style: italic;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
  margin-left: auto;
  margin-right: auto;
  white-space: pre-line;
}
figure img {
  vertical-align: top;
}
.document img,
.document video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: var(--space-sm) auto;
}

/* --- Layout Helpers --- */
.border {
  border: 1px solid var(--color-border-dark);
}

.center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.float_left,
.float_right {
  margin-bottom: var(--space-sm);
  max-width: calc(50% - var(--space-sm));
}
.float_left img,
.float_right img {
  width: 100%;
  height: auto;
}
.float_left {
  float: left;
  margin-right: var(--space-sm);
}
.float_right {
  float: right;
  margin-left: var(--space-sm);
}
.clear {
  clear: both;
}
.line {
  width: 80%;
  height: 1px;
  border: none;
  background: var(--color-border-dark);
  margin: var(--space-md) auto;
}

.gap_small  { height: 0.625rem; }
.gap        { height: 1.25rem; }
.gap_mid    { height: 3rem; }
.gap_large  { height: 6rem; }
.gap_top    { height: 1.5rem; }
.gap_bottom { height: 2rem; }

/*.caption, .caption_right, .caption_left, .caption__no_width{
	font-family: var(--font-serif);
  	font-size: var(--text-base);
  	font-style: italic;
  	color: var(--color-text-muted);
  	margin-top: var(--space-xs);
  	margin-left: auto;
    margin-right: auto;
  	white-space: pre-line;
}
.caption_left{
	text-align: left;
}
.caption_right{
	text-align: right;
}
.caption{
	text-align:justify;
}*/


/* --- Text Boxes --- */
.text_box,
.text_box_left,
.text_box_right {
  max-width: 420px;
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-md) auto;
  border: 1px solid var(--grey8);
  border-radius: var(--radius);
  background-color: var(--color-textbox-bg);
}
.text_box p,
.text_box_left p,
.text_box_right p {
  font-size: 1rem;
  text-align: justify;
  margin: var(--space-xs) 0;
  padding: 0;
}
.text_box_left {
  float: left;
  margin-right: var(--space-md);
}
.text_box_right {
  float: right;
  margin-left: var(--space-md);
}