/**
 * Typography Styles
 * Open Sans font with optimized text rendering and consistent spacing
 */

/* ============================================================================
   FONT IMPORT
   ============================================================================ */

/* Import Open Sans from Google Fonts (Open Source, Apache License 2.0) */
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800&display=swap");

/* ============================================================================
   BASE TEXT OPTIMIZATION
   ============================================================================ */

body {
  font-family:
    "Open Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen-Sans,
    Ubuntu,
    Cantarell,
    "Helvetica Neue",
    sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1a1a1a;

  /* Text rendering optimizations */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
  font-kerning: normal;
}

/* ============================================================================
   HEADINGS
   ============================================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Open Sans", sans-serif;
  font-weight: 600;
  line-height: 1.2;
  color: #1a1a1a;
  margin-top: 0;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

h4 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

h5 {
  font-size: 1.25rem;
  margin-bottom: 0.875rem;
}

h6 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* ============================================================================
   PARAGRAPHS & TEXT BLOCKS
   ============================================================================ */

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Last paragraph in container should have no bottom margin */
p:last-child {
  margin-bottom: 0;
}

/* ============================================================================
   LINKS
   ============================================================================ */

a {
  color: #1f4b75;
  text-decoration: underline;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: #143554;
  text-decoration: underline;
}

/* ============================================================================
   LISTS
   ============================================================================ */

ul,
ol {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
}

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

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

/* Definition lists */
dl {
  margin-top: 0;
  margin-bottom: 1rem;
}

dt {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

dd {
  margin-left: 2rem;
  margin-bottom: 0.75rem;
}

/* ============================================================================
   INLINE TEXT ELEMENTS
   ============================================================================ */

strong,
b {
  font-weight: 700;
}

em,
i {
  font-style: italic;
}

small {
  font-size: 0.875rem;
}

mark {
  background-color: #fff3cd;
  padding: 0.125rem 0.25rem;
  color: inherit;
}

code {
  font-family: "Monaco", "Courier New", monospace;
  font-size: 0.875em;
  background-color: #f5f5f5;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  color: #d63384;
}

kbd {
  font-family: "Monaco", "Courier New", monospace;
  font-size: 0.875em;
  background-color: #1a1a1a;
  color: #ffffff;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
  border-bottom: none;
}

sub,
sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* ============================================================================
   BLOCKQUOTE
   ============================================================================ */

blockquote {
  margin: 0 0 1rem;
  padding: 1rem 1.5rem;
  border-left: 4px solid #1f4b75;
  background-color: #f5f5f5;
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-style: normal;
  color: #666666;
}

blockquote cite::before {
  content: "— ";
}

/* ============================================================================
   CODE BLOCKS
   ============================================================================ */

pre {
  font-family: "Monaco", "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  background-color: #1a1a1a;
  color: #f5f5f5;
  padding: 1rem;
  margin: 0 0 1rem;
  overflow-x: auto;
  border-radius: 4px;
}

pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ============================================================================
   HORIZONTAL RULE
   ============================================================================ */

hr {
  margin: 2rem 0;
  border: none;
  border-top: 1px solid #e0e0e0;
}

/* ============================================================================
   WORDPRESS BLOCK CONTEXT RULES
   ============================================================================ */

/* Headings inside columns should have no bottom margin by default */
.wp-block-column > h1,
.wp-block-column > h2,
.wp-block-column > h3,
.wp-block-column > h4,
.wp-block-column > h5,
.wp-block-column > h6 {
  margin-bottom: 0;
}

/* If there's content after the heading in a column, restore some margin */
.wp-block-column > h1:not(:last-child),
.wp-block-column > h2:not(:last-child),
.wp-block-column > h3:not(:last-child),
.wp-block-column > h4:not(:last-child),
.wp-block-column > h5:not(:last-child),
.wp-block-column > h6:not(:last-child) {
  margin-bottom: 0.75rem;
}

/* Heading right after a spacer - reduce top margin */
.wp-block-spacer + h1,
.wp-block-spacer + h2,
.wp-block-spacer + h3,
.wp-block-spacer + h4,
.wp-block-spacer + h5,
.wp-block-spacer + h6 {
  margin-top: 0;
}

/* First heading in a group shouldn't have top margin */
.wp-block-group > h1:first-child,
.wp-block-group > h2:first-child,
.wp-block-group > h3:first-child,
.wp-block-group > h4:first-child,
.wp-block-group > h5:first-child,
.wp-block-group > h6:first-child {
  margin-top: 0;
}

/* Last element in a group shouldn't have bottom margin */
.wp-block-group > *:last-child {
  margin-bottom: 0;
}

/* Paragraph spacing in columns */
.wp-block-column > p:not(:last-child) {
  margin-bottom: 1rem;
}

/* Lists in WordPress blocks */
.wp-block-list {
  margin-top: 0;
  margin-bottom: 1rem;
}

.wp-block-list li {
  margin-bottom: 0.5rem;
}

/* Quote blocks */
.wp-block-quote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid #1f4b75;
  background-color: #f5f5f5;
}

.wp-block-quote p {
  font-style: italic;
}

.wp-block-quote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-style: normal;
  color: #666666;
}

/* Pullquote */
.wp-block-pullquote {
  margin: 2rem 0;
  padding: 2rem;
  border-top: 4px solid #1f4b75;
  border-bottom: 4px solid #1f4b75;
  text-align: center;
}

.wp-block-pullquote blockquote {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.wp-block-pullquote cite {
  margin-top: 1rem;
  font-size: 1rem;
  color: #666666;
}

/* ============================================================================
   RESPONSIVE TYPOGRAPHY
   ============================================================================ */

@media (max-width: 768px) {
  body {
    font-size: 0.9375rem; /* 15px */
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  h4 {
    font-size: 1.25rem;
  }

  h5 {
    font-size: 1.125rem;
  }

  h6 {
    font-size: 1rem;
  }

  .wp-block-pullquote blockquote {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }
}
