/* Typography Styles */
/* Headings, body text, links, and text utilities */

/* ===================================
   BASE TYPOGRAPHY
   =================================== */

body {
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-primary);
  background-color: var(--color-background);
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-headings);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-lg);
  font-weight: var(--font-weight-bold);
}

/* Fluid typography using clamp for smooth scaling */
h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--color-primary);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--color-primary);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  color: var(--color-dark-grey);
}

h4 {
  font-size: var(--font-size-h4);
  font-weight: var(--font-weight-semibold);
  color: var(--color-dark-grey);
}

h5 {
  font-size: var(--font-size-h5);
  font-weight: var(--font-weight-semibold);
  color: var(--color-dark-grey);
}

h6 {
  font-size: var(--font-size-h6);
  font-weight: var(--font-weight-semibold);
  color: var(--color-dark-grey);
}

/* ===================================
   PARAGRAPHS
   =================================== */

p {
  margin-bottom: var(--space-md);
  max-width: 70ch; /* Optimal line length for readability */
  line-height: var(--line-height-relaxed);
}

/* Remove bottom margin from last paragraph */
p:last-child {
  margin-bottom: 0;
}

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

a {
  color: var(--color-accent-bright);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

a:active {
  color: var(--color-deep-teal);
}

/* External links - add subtle indicator */
a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.85em;
  opacity: 0.7;
}

/* ===================================
   FOCUS-VISIBLE STATES (WCAG 2.2)
   =================================== */

/* Global focus-visible for all interactive elements */
:focus-visible {
  outline: 3px solid var(--color-turquoise);
  outline-offset: 3px;
  border-radius: var(--border-radius-sm);
}

/* Ensure focus is never hidden (WCAG 2.4.11) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  position: relative;
  z-index: var(--z-index-base);
}

/* ===================================
   SECTION TITLES
   =================================== */

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--color-primary);
  text-align: center;
  margin-bottom: var(--space-3xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

/* Optional gradient text effect */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===================================
   TEXT UTILITIES
   =================================== */

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

/* ===================================
   BLOCKQUOTES
   =================================== */

blockquote {
  font-style: italic;
  border-left: 4px solid var(--color-accent);
  padding-left: var(--space-lg);
  margin: var(--space-xl) 0;
  color: var(--color-text-secondary);
}

/* ===================================
   STRONG & EMPHASIS
   =================================== */

strong, b {
  font-weight: var(--font-weight-bold);
  color: var(--color-dark-grey);
}

em, i {
  font-style: italic;
}

/* ===================================
   SMALL TEXT
   =================================== */

small {
  font-size: var(--font-size-small);
}

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

ul, ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

li {
  margin-bottom: var(--space-xs);
}

/* Remove default list styling for nav lists (role="list") */
ul[role="list"] {
  list-style: none;
  padding-left: 0;
}
