/**
 * Smort Text Block Styles
 */

.smort-text {
  width: 100%;
  background-color: var(--secondary-foreground) !important;
}

/* Container widths */
.smort-text__container {
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.smort-text--width-narrow .smort-text__container {
  max-width: 700px;
}

.smort-text--width-medium .smort-text__container {
  max-width: 900px;
}

.smort-text--width-wide .smort-text__container {
  max-width: 1200px;
}

.smort-text--width-full .smort-text__container {
  max-width: 1600px;
}

/* Padding options */
.smort-text--padding-none {
  padding-top: 0;
  padding-bottom: 0;
}

.smort-text--padding-small {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

.smort-text--padding-medium {
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
}

.smort-text--padding-large {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

/* Text alignment */
.smort-text--align-center {
  text-align: center;
}

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

/* Header */
.smort-text__header {
  margin-bottom: var(--space-8);

  @media (max-width: 768px) {
    margin-bottom: var(--space-3);
  }
}

.smort-text__title {
  font-size: var(--h2-lg-size);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 var(--space-2) 0;
  line-height: var(--h2-lg-height);
  text-transform: uppercase;
}

.smort-text__subtitle {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin: 0;
}

/* Content / Prose styles */
.smort-text__content.prose {
  color: var(--text);
  line-height: 1.75;
  font-size: var(--text-base);
}

.smort-text__content.prose > * {
  margin-top: 0;
  margin-bottom: 0;
}

.smort-text__content.prose > * + * {
  margin-top: var(--space-4);
}

.smort-text__content.prose h1 {
  font-size: var(--h1-lg-size);
  line-height: var(--h1-lg-height);
  font-weight: 600;
  margin-top: var(--space-8);
  color: var(--text);
}

.smort-text__content.prose h2 {
  font-size: var(--h2-lg-size);
  line-height: var(--h2-lg-height);
  font-weight: 600;
  margin-top: var(--space-8);
  color: var(--text);
}

.smort-text__content.prose h3 {
  font-size: var(--h3-lg-size);
  line-height: var(--h3-lg-height);
  font-weight: var(--font-weight-heading);
  margin-top: var(--space-6);
  color: var(--text);
}

.smort-text__content.prose h4 {
  font-size: var(--h4-lg-size);
  line-height: var(--h4-lg-height);
  font-weight: var(--font-weight-heading);
  margin-top: var(--space-4);
  color: var(--text);
}

.smort-text__content.prose > h1:first-child,
.smort-text__content.prose > h2:first-child,
.smort-text__content.prose > h3:first-child,
.smort-text__content.prose > h4:first-child {
  margin-top: 0;
}

.smort-text__content.prose p {
  color: var(--text);
}

.smort-text__content.prose ul,
.smort-text__content.prose ol {
  padding-left: var(--space-6);
}

.smort-text__content.prose ul {
  list-style: disc;
}

.smort-text__content.prose ol {
  list-style: decimal;
}

.smort-text__content.prose li {
  margin-top: var(--space-2);
}

.smort-text__content.prose a {
  color: var(--primary);
  text-decoration: underline;
}

.smort-text__content.prose a:hover {
  color: var(--primary-dark);
}

.smort-text__content.prose blockquote {
  border-left: 4px solid var(--primary);
  padding-left: var(--space-4);
  margin: var(--space-6) 0;
  font-style: italic;
  color: var(--text-muted);
}

.smort-text__content.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-6) 0;
}

.smort-text__content.prose th,
.smort-text__content.prose td {
  border: 1px solid var(--border);
  padding: var(--space-3);
  text-align: left;
}

.smort-text__content.prose th {
  background-color: var(--bg-secondary);
  font-weight: var(--font-weight-heading);
}

/* Placeholder in editor */
.smort-text__placeholder {
  padding: var(--space-8);
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  border-radius: var(--border-radius-smort);
  text-align: center;
  color: var(--text-muted);
}

/* Mobile */
@media (max-width: 768px) {
  .smort-text__content.prose {
    font-size: var(--text-sm);
    line-height: 1.65;
  }

  .smort-text__content.prose > * + * {
    margin-top: var(--space-3);
  }

  .smort-text__content.prose h1,
  .smort-text__content.prose h2 {
    margin-top: var(--space-6);
  }

  .smort-text__title {
    font-size: var(--h2-sm-size);
    line-height: var(--h2-sm-height);
  }

  .smort-text__content.prose h1 {
    font-size: var(--h1-sm-size);
    line-height: var(--h1-sm-height);
  }

  .smort-text__content.prose h2 {
    font-size: var(--h2-sm-size);
    line-height: var(--h2-sm-height);
  }

  .smort-text__content.prose h3 {
    font-size: var(--h3-sm-size);
    line-height: var(--h3-sm-height);
  }

  .smort-text__content.prose h4 {
    font-size: var(--h4-sm-size);
    line-height: var(--h4-sm-height);
  }

  .smort-text--padding-medium {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }

  .smort-text--padding-large {
    padding-top: var(--space-10);
    padding-bottom: var(--space-10);
  }
}
