/**
 * Typography Utilities
 * Comprehensive text styling for WYSIWYG content
 */

/* Base Typography */
.text-content {
  font-size: var(--fs-300);
  line-height: var(--lh-normal);
  color: var(--color-text);
}

/* Headings */
.text-content h1,
.text-content h2,
.text-content h3,
.text-content h4,
.text-content h5,
.text-content h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--color-text);
  margin-top: var(--space-32);
  margin-bottom: var(--space-16);
}

.text-content h1:first-child,
.text-content h2:first-child,
.text-content h3:first-child,
.text-content h4:first-child,
.text-content h5:first-child,
.text-content h6:first-child {
  margin-top: 0;
}

.text-content h1 { font-size: var(--fs-900); }
.text-content h2 { font-size: var(--fs-800); }
.text-content h3 { font-size: var(--fs-700); }
.text-content h4 { font-size: var(--fs-600); }
.text-content h5 { font-size: var(--fs-500); }
.text-content h6 { font-size: var(--fs-400); }

@media (max-width: 767px) {
  .text-content h1 { font-size: var(--fs-800); }
  .text-content h2 { font-size: var(--fs-700); }
  .text-content h3 { font-size: var(--fs-600); }
  .text-content h4 { font-size: var(--fs-500); }
  .text-content h5 { font-size: var(--fs-400); }
  .text-content h6 { font-size: var(--fs-300); }
}

/* Paragraphs */
.text-content p {
  margin-bottom: var(--space-16);
  line-height: var(--lh-normal);
}

.text-content p:last-child {
  margin-bottom: 0;
}

.text-content p.lead {
  font-size: var(--fs-400);
  font-weight: 400;
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-24);
}

/* Text Formatting */
.text-content strong,
.text-content b {
  font-weight: 700;
}

.text-content em,
.text-content i {
  font-style: italic;
}

.text-content u {
  text-decoration: underline;
}

.text-content s,
.text-content del {
  text-decoration: line-through;
}

.text-content mark {
  background-color: #ffeb3b;
  padding: 2px 4px;
}

.text-content small {
  font-size: var(--fs-200);
}

.text-content sub {
  vertical-align: sub;
  font-size: smaller;
}

.text-content sup {
  vertical-align: super;
  font-size: smaller;
}

/* Links */
.text-content a {
  color: var(--color-text);
  text-decoration: underline;
  transition: opacity 0.2s ease;
}

.text-content a:hover,
.text-content a:focus {
  opacity: 0.7;
}

/* Lists */
.text-content ul,
.text-content ol {
  margin-bottom: var(--space-24);
  padding-left: var(--space-32);
}

.text-content ul {
  list-style-type: disc;
}

.text-content ol {
  list-style-type: decimal;
}

.text-content li {
  margin-bottom: var(--space-12);
  line-height: var(--lh-normal);
}

.text-content li:last-child {
  margin-bottom: 0;
}

.text-content ul ul,
.text-content ul ol,
.text-content ol ul,
.text-content ol ol {
  margin-top: var(--space-12);
  margin-bottom: 0;
}

.text-content li > ul,
.text-content li > ol {
  margin-bottom: 0;
}

/* Blockquotes */
.text-content blockquote {
  border-left: 4px solid var(--color-text);
  padding-left: var(--space-24);
  margin: var(--space-32) 0;
  font-style: italic;
  color: #666;
}

.text-content blockquote p {
  margin-bottom: var(--space-12);
}

.text-content blockquote cite {
  display: block;
  margin-top: var(--space-12);
  font-size: var(--fs-200);
  font-style: normal;
  color: #999;
}

.text-content blockquote cite:before {
  content: '— ';
}

/* Code */
.text-content code {
  background-color: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  color: #c7254e;
}

.text-content pre {
  background-color: #f5f5f5;
  padding: var(--space-16);
  border-radius: var(--radius-4);
  overflow-x: auto;
  margin-bottom: var(--space-24);
  line-height: 1.4;
}

.text-content pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
  font-size: var(--fs-200);
}

/* Horizontal Rule */
.text-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-48) 0;
}

/* Images */
.text-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: var(--space-32) 0;
  border-radius: var(--radius-4);
}

.text-content figure {
  margin: var(--space-32) 0;
}

.text-content figcaption {
  margin-top: var(--space-12);
  font-size: var(--fs-200);
  color: #666;
  text-align: center;
  font-style: italic;
}

/* Tables */
.text-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-24);
  font-size: var(--fs-200);
}

.text-content table th,
.text-content table td {
  padding: var(--space-12) var(--space-16);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.text-content table th {
  font-weight: 700;
  background-color: #f5f5f5;
  border-bottom: 2px solid var(--color-border);
}

.text-content table tr:last-child td {
  border-bottom: none;
}

.text-content table tr:hover {
  background-color: #fafafa;
}

/* Definition Lists */
.text-content dl {
  margin-bottom: var(--space-24);
}

.text-content dt {
  font-weight: 700;
  margin-bottom: var(--space-8);
}

.text-content dd {
  margin-left: var(--space-24);
  margin-bottom: var(--space-16);
}

.text-content dd:last-child {
  margin-bottom: 0;
}

/* Address */
.text-content address {
  font-style: normal;
  line-height: var(--lh-normal);
  margin-bottom: var(--space-16);
}

/* Alignment Classes */
.text-content .alignleft {
  float: left;
  margin-right: var(--space-24);
  margin-bottom: var(--space-16);
}

.text-content .alignright {
  float: right;
  margin-left: var(--space-24);
  margin-bottom: var(--space-16);
}

.text-content .aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.text-content .text-left {
  text-align: left;
}

.text-content .text-center {
  text-align: center;
}

.text-content .text-right {
  text-align: right;
}

.text-content .text-justify {
  text-align: justify;
}

/* Size Utilities */
.text-content .text-small {
  font-size: var(--fs-200);
}

.text-content .text-large {
  font-size: var(--fs-500);
}

.text-content .text-xlarge {
  font-size: var(--fs-700);
}

/* Color Utilities */
.text-content .text-muted {
  color: #999;
}

.text-content .text-primary {
  color: var(--color-primary);
}

/* WordPress-specific */
.text-content .wp-caption {
  max-width: 100%;
  margin-bottom: var(--space-24);
}

.text-content .wp-caption-text {
  margin-top: var(--space-8);
  font-size: var(--fs-200);
  color: #666;
  text-align: center;
  font-style: italic;
}

.text-content .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-16);
  margin-bottom: var(--space-24);
}

.text-content .gallery-item {
  margin: 0;
}

/* Clear floats */
.text-content::after {
  content: "";
  display: table;
  clear: both;
}

