/**
 * ExtremeFood Typography
 * Typography System and Text Styles
 * 
 * @package ExtremeFood
 */

/* ==========================================
   FONT LOADING
   ========================================== */

/* Inter font is loaded via Google Fonts in enqueue-scripts.php */
/* font-display: swap is set via URL parameter */

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

body {
  font-family: var(--ef-font-family);
  font-size: var(--ef-font-size-base);
  font-weight: var(--ef-font-weight-normal);
  line-height: var(--ef-line-height-relaxed);
  color: var(--ef-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: var(--ef-font-weight-bold);
  line-height: var(--ef-line-height-tight);
  color: var(--ef-text-primary);
  margin: 0 0 var(--ef-spacing-4) 0;
}

h1, .h1 {
  font-size: var(--ef-font-size-hero-mobile);
  font-weight: var(--ef-font-weight-extrabold);
  letter-spacing: var(--ef-letter-spacing-tight);
  line-height: 1.1;
}

h2, .h2 {
  font-size: var(--ef-font-size-3xl);
  font-weight: var(--ef-font-weight-bold);
  line-height: var(--ef-line-height-snug);
  letter-spacing: var(--ef-letter-spacing-tight);
}

h3, .h3 {
  font-size: var(--ef-font-size-2xl);
  font-weight: var(--ef-font-weight-bold);
  line-height: var(--ef-line-height-snug);
}

h4, .h4 {
  font-size: var(--ef-font-size-xl);
  font-weight: var(--ef-font-weight-semibold);
  line-height: var(--ef-line-height-snug);
}

h5, .h5 {
  font-size: var(--ef-font-size-lg);
  font-weight: var(--ef-font-weight-semibold);
  line-height: var(--ef-line-height-normal);
}

h6, .h6 {
  font-size: var(--ef-font-size-base);
  font-weight: var(--ef-font-weight-semibold);
  line-height: var(--ef-line-height-normal);
  text-transform: uppercase;
  letter-spacing: var(--ef-letter-spacing-wide);
}

@media (min-width: 1024px) {
  h1, .h1 {
    font-size: var(--ef-font-size-hero-desktop);
  }
}

/* ==========================================
   PARAGRAPH & TEXT
   ========================================== */

p {
  margin: 0 0 var(--ef-spacing-4) 0;
  line-height: var(--ef-line-height-relaxed);
}

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

.ef-lead {
  font-size: var(--ef-font-size-md);
  line-height: var(--ef-line-height-relaxed);
  color: var(--ef-text-primary);
}

.ef-text-small {
  font-size: var(--ef-font-size-sm);
}

.ef-text-xs {
  font-size: var(--ef-font-size-xs);
}

.ef-text-large {
  font-size: var(--ef-font-size-lg);
}

/* ==========================================
   TEXT MODIFIERS
   ========================================== */

.ef-text-uppercase {
  text-transform: uppercase;
  letter-spacing: var(--ef-letter-spacing-wide);
}

.ef-text-muted {
  color: var(--ef-text-secondary);
}

.ef-text-subtle {
  color: var(--ef-text-muted);
}

.ef-text-lime {
  color: var(--ef-accent-lime);
}

.ef-text-orange {
  color: var(--ef-accent-orange);
}

.ef-text-white {
  color: var(--ef-white);
}

/* ==========================================
   TEXT ALIGNMENT
   ========================================== */

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

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

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

/* ==========================================
   FONT WEIGHTS
   ========================================== */

.ef-font-normal {
  font-weight: var(--ef-font-weight-normal);
}

.ef-font-medium {
  font-weight: var(--ef-font-weight-medium);
}

.ef-font-semibold {
  font-weight: var(--ef-font-weight-semibold);
}

.ef-font-bold {
  font-weight: var(--ef-font-weight-bold);
}

.ef-font-extrabold {
  font-weight: var(--ef-font-weight-extrabold);
}

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

a {
  color: var(--ef-accent-lime);
  text-decoration: none;
  transition: var(--ef-transition-fast);
}

a:hover,
a:focus {
  opacity: var(--ef-opacity-hover);
}

a:focus-visible {
  outline: 2px solid var(--ef-accent-lime);
  outline-offset: 2px;
}

.ef-link-underline {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.ef-link-subtle {
  color: var(--ef-text-secondary);
}

.ef-link-subtle:hover {
  color: var(--ef-text-primary);
}

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

ul, ol {
  margin: 0 0 var(--ef-spacing-4) 0;
  padding-left: var(--ef-spacing-6);
}

li {
  margin-bottom: var(--ef-spacing-2);
  line-height: var(--ef-line-height-relaxed);
}

ul ul,
ol ul,
ul ol,
ol ol {
  margin-top: var(--ef-spacing-2);
  margin-bottom: var(--ef-spacing-2);
}

.ef-list-unstyled {
  list-style: none;
  padding-left: 0;
}

.ef-list-inline {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ef-spacing-4);
}

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

blockquote {
  margin: 0 0 var(--ef-spacing-6) 0;
  padding-left: var(--ef-spacing-6);
  border-left: 4px solid var(--ef-accent-lime);
  font-size: var(--ef-font-size-lg);
  font-style: italic;
  color: var(--ef-text-secondary);
}

blockquote cite {
  display: block;
  margin-top: var(--ef-spacing-2);
  font-size: var(--ef-font-size-sm);
  font-style: normal;
  color: var(--ef-text-muted);
}

/* ==========================================
   CODE & PRE
   ========================================== */

code {
  font-family: var(--ef-font-family-mono);
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  background-color: var(--ef-surface);
  border-radius: var(--ef-radius-sm);
  color: var(--ef-accent-lime);
}

pre {
  font-family: var(--ef-font-family-mono);
  font-size: var(--ef-font-size-sm);
  margin: 0 0 var(--ef-spacing-4) 0;
  padding: var(--ef-spacing-4);
  background-color: var(--ef-surface);
  border-radius: var(--ef-radius-lg);
  overflow-x: auto;
  line-height: var(--ef-line-height-relaxed);
}

pre code {
  padding: 0;
  background-color: transparent;
  border-radius: 0;
}

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

hr {
  margin: var(--ef-spacing-8) 0;
  border: 0;
  border-top: 1px solid var(--ef-border-default);
}

/* ==========================================
   SELECTION
   ========================================== */

::selection {
  background-color: var(--ef-accent-lime);
  color: var(--ef-black);
}

::-moz-selection {
  background-color: var(--ef-accent-lime);
  color: var(--ef-black);
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.ef-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ef-line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ef-line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ef-nowrap {
  white-space: nowrap;
}

.ef-break-words {
  word-wrap: break-word;
  word-break: break-word;
}

/* ==========================================
   SCREEN READER ONLY
   ========================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
