/* The overflow-wrap is meant to prevent long/large words from breaking the mobile responsiveness of a page (e.g. horizontal scrolling). It is preferred to reduce font sizes on mobile to address this, with this CSS specifically helping with extreme scenarios where a reduction in font size is not possible. */

body {
  /* Geometric system font stack (similar to Campton) */
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.4;
  overflow-wrap: break-word;
  /* Optimize for clean geometric rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
  text-rendering: optimizeLegibility;
}

/* Handles word breaking for a few specific languages which handle breaks in words differently. If your content is not translated into these languages, you can safely remove this.  */

html[lang^="ja"] body,
html[lang^="zh"] body,
html[lang^="ko"] body {
  line-break: strict;
  overflow-wrap: normal;
  word-break: break-all;
}

/* Paragraphs - Mobile optimized */

p {
  font-size: 1rem;
  margin: 0 0 1rem;
  /* Better mobile readability */
  line-height: 1.6;
  word-spacing: 0.05em;
}

/* Anchors */

a {
  cursor: pointer;
}

/* Headings - Mobile-first sizing */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 600; /* Slightly bolder for geometric fonts */
  margin: 0 0 1rem;
  line-height: 1.2;
  letter-spacing: -0.02em; /* Tighter tracking like Campton */
  /* Improve mobile readability */
  word-wrap: break-word;
  hyphens: auto;
}

/* Lists - Mobile spacing */

ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem; /* Less indent on mobile */
}

ul ul,
ol ul,
ul ol,
ol ol {
  margin: 0;
}

ul.no-list {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

/* Code blocks - Mobile optimized */

pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  background-color: #f8f9fa;
  padding: 0.75rem; /* Less padding on mobile */
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem; /* Smaller font on mobile */
  max-width: 100vw;
  margin-left: -15px;
  margin-right: -15px;
  padding-left: 15px;
  padding-right: 15px;
}

@media (min-width: 768px) {
  pre {
    padding: 1rem;
    font-size: 0.9375rem;
    margin-left: 0;
    margin-right: 0;
  }
}

code {
  vertical-align: bottom;
  background-color: #f8f9fa;
  color: #e83e8c;
  padding: 0.2em 0.4em;
  font-size: 0.875em;
  border-radius: 0.25rem;
  font-family: 'Courier New', Courier, monospace;
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* Blockquotes - Mobile first */

blockquote {
  border-left: 3px solid #0066cc;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem; /* Less padding on mobile */
  background-color: #f8f9fa;
  border-radius: 0.25rem;
  font-size: 1rem; /* Regular size on mobile */
}

@media (min-width: 768px) {
  blockquote {
    border-left-width: 4px;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
  }
}

blockquote footer {
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.5rem;
}

blockquote cite {
  font-style: italic;
}

/* Horizontal rules */

hr {
  border: none;
  border-bottom: 1px solid #CCC;
}

/* Image alt text */

img {
  font-size: 0.583rem;
  word-break: normal;
  max-width: 100%;
  height: auto;
}

/* Figure and captions */
figure {
  margin: 2rem 0;
}

figcaption {
  text-align: center;
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.5rem;
}

/* Lead paragraph - Mobile responsive */
.lead {
  font-size: 1.125rem; /* Smaller on mobile */
  font-weight: 300;
  line-height: 1.5;
  color: #495057;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .lead {
    font-size: 1.25rem;
    line-height: 1.6;
  }
}

/* Text utilities */
mark {
  background-color: #fff3cd;
  padding: 0.1em 0.2em;
  border-radius: 0.15rem;
}

small {
  font-size: 0.875em;
}

/* Cards - Mobile optimized */
.card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease; /* Only animate shadow on mobile */
  margin-bottom: 1rem;
}

/* No hover transform on mobile for better performance */
@media (hover: hover) and (min-width: 768px) {
  .card {
    transition: all 0.2s ease;
  }

  .card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
  }
}

/* Touch devices get tap feedback instead */
@media (hover: none) {
  .card:active {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }
}

.card.selected {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  border-color: #0066cc;
}

.card-content {
  padding: 1rem; /* Less padding on mobile */
}

@media (min-width: 768px) {
  .card-content {
    padding: 1.5rem;
  }
}

.card img {
  width: 100%;
  height: auto;
  display: block;
}
