/* Font declarations */
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/CormorantGaramond-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/CormorantGaramond-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/CormorantGaramond-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/CormorantGaramond-LightItalic.ttf') format('truetype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/CormorantGaramond-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/CormorantGaramond-MediumItalic.ttf') format('truetype');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/CormorantGaramond-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/CormorantGaramond-SemiBoldItalic.ttf') format('truetype');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/CormorantGaramond-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/CormorantGaramond-BoldItalic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* Roboto Variable Fonts */
@font-face {
  font-family: 'Roboto';
  src: url('fonts/Roboto-VariableFont_wdth,wght.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url('fonts/Roboto-Italic-VariableFont_wdth,wght.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-stretch: 75% 100%;
  font-style: italic;
  font-display: swap;
}

/* Roboto Slab Variable Font */
@font-face {
  font-family: 'Roboto Slab';
  src: url('fonts/RobotoSlab-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Base styles and CSS reset */
:root {
  --primary-font: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --heading-font: 'Cormorant Garamond', serif;
  --mono-font: "SF Mono", Consolas, Monaco, "Andale Mono", monospace;
  --text-color: #2d3748;
  --link-color: #4a5568;
  --heading-color: #1a202c;
  --code-bg: #f7fafc;
  --quote-border: #e2e8f0;
  --bg-color: #fff8dd;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 100%; /* 16px by default */
}

body {
  font-family: var(--primary-font);
  font-size: 1.125em; /* 18px */
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--bg-color);
  padding: 1rem;
}

/* Layout */
.container {
  max-width: 45rem; /* 720px at default font size */
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  color: var(--heading-color);
  line-height: 1.3;
  margin: 2rem 0 1rem;
}

h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: italic;
  font-size: 3rem;
  padding-bottom: 0.5rem;
}

h2, h3, h4, h5, h6 {
  font-family: 'Roboto Slab', serif;
  font-weight: 500;
}

h2 { 
  font-size: 2rem;
  font-weight: 600;
}

h3 { 
  font-size: 1.75rem;
  font-weight: 500;
}

h4 {
  font-size: 1.5rem;
  font-weight: 500;
}

h5 {
  font-size: 1.25rem;
  font-weight: 600;
}

h6 {
  font-size: 1.1rem;
  font-weight: 600;
}

p {
  margin-bottom: 1.5rem;
}

/* Links */
a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

a:hover {
  border-bottom-color: currentColor;
}

/* Code blocks */
pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 0.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

code {
  font-family: var(--mono-font);
  font-size: 0.9em;
}

/* Lists */
ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--quote-border);
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  font-weight: 300;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

th, td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--quote-border);
  text-align: left;
}

/* Media queries */
@media (min-width: 48rem) { /* 768px */
  body {
    font-size: 1.25em; /* 20px */
    padding: 2rem;
    line-height: 1.7;
  }

  .container {
    padding: 0 2rem;
  }

  p {
    margin-bottom: 1.75rem;
  }

  h1 { 
    font-size: 4rem;
    margin-top: 3rem;
  }
  
  h2 { 
    font-size: 2.25rem;
    margin-top: 2.5rem;
  }
  
  h3 { 
    font-size: 1.875rem;
    margin-top: 2rem;
  }

  h4 {
    font-size: 1.625rem;
  }

  h5 {
    font-size: 1.375rem;
  }

  h6 {
    font-size: 1.25rem;
  }
}

/* Print styles */
@media print {
  body {
    font-size: 12pt;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  pre, blockquote {
    page-break-inside: avoid;
  }
}

/* Footnotes */
.footnote {
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
  text-decoration: underline;
  color: #004ac9;
  margin: 0 0.2em;
  padding: 0 0.1em;
  border-bottom: none;
}

.footnote:hover {
  color: #ffffff;
  background-color: #003d7a;
  text-decoration: none;
  border-radius: 2px;
  border-bottom: none;
}

/* Ensure superscript doesn't mess up line height */
sup, sub {
  vertical-align: baseline;
  position: relative;
  top: -0.4em;
}

sub { 
  top: 0.4em; 
} 

img.main-image {
  width: 100%;
  height: auto;
  margin-bottom: 2rem;
}

.chart-container {
    height: 300px;
    width: 100%;
    margin: 20px 0;
    position: relative;
}

#chart_div {
    width: 100% !important;
    height: 100% !important;
}

/* Privacy popup */
.privacy-popup {
    position: fixed;
    bottom: 0; /* Change from -100px to 0 */
    left: 0;
    right: 0;
    background-color: #1a202c;
    color: white;
    padding: 1rem 2rem;
    text-align: center;
    z-index: 1000;
    font-size: 0.9rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(100%); /* Start transformed down instead */
    animation: slideInOut 9s ease-in-out forwards;
}

@keyframes slideInOut {
    0% {
        transform: translateY(100%);
    }
    5% {
        transform: translateY(0);
    }
    85% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100%);
    }
}

/* Adjust for mobile */
@media (max-width: 48rem) {
    .privacy-popup {
        font-size: 0.8rem;
        padding: 0.75rem 1rem;
    }
}
