/* ==========================================================================
   Typography Utilities
   ========================================================================== */

/* Legacy MD3-style classes (being phased out) */
.text-display-small {
    font-size: var(--font-size-large);
}

.text-label-small {
    font-size: var(--font-size-x-small);
}

/* Text Alignment */
.text-align-left {
    text-align: left;
}

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

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

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

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

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

/* Text Properties */
.text-decoration-none {
    text-decoration: none;
}

.text-decoration-underline {
    text-decoration: underline;
}

.text-decoration-line-through {
    text-decoration: line-through;
}

.text-transform-uppercase {
    text-transform: uppercase;
}

.text-transform-lowercase {
    text-transform: lowercase;
}

.text-transform-capitalize {
    text-transform: capitalize;
}

.text-transform-none {
    text-transform: none;
}

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

.text-wrap {
    white-space: normal;
}

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

.text-ellipsis {
    text-overflow: ellipsis;
}

.text-clip {
    text-overflow: clip;
}

/* Font Weight */
.font-weight-thin {
    font-weight: 100;
}

.font-weight-light {
    font-weight: 300;
}

.font-weight-regular {
    font-weight: 400;
}

.font-weight-medium {
    font-weight: 500;
}

.font-weight-semibold {
    font-weight: 600;
}

.font-weight-bold {
    font-weight: 700;
}

.font-weight-black {
    font-weight: 900;
}

/* Font Style */
.font-style-normal {
    font-style: normal;
}

.font-style-italic {
    font-style: italic;
}

/* Font Family */
.font-family-sans {
    font-family: var(--font-sans);
}

.font-family-serif {
    font-family: var(--font-serif);
}

.font-family-mono {
    font-family: var(--font-mono);
}

/* Line Height */
.line-height-none,
.line-height-1 {
    line-height: 1;
}

.line-height-tight {
    line-height: 1.25;
}

.line-height-snug {
    line-height: 1.375;
}

.line-height-normal {
    line-height: 1.5;
}

.line-height-relaxed {
    line-height: 1.625;
}

.line-height-loose {
    line-height: 2;
}

/* Letter Spacing */
.letter-spacing-tighter {
    letter-spacing: -0.05em;
}

.letter-spacing-tight {
    letter-spacing: -0.025em;
}

.letter-spacing-normal {
    letter-spacing: 0;
}

.letter-spacing-wide {
    letter-spacing: 0.025em;
}

.letter-spacing-wider {
    letter-spacing: 0.05em;
}

.letter-spacing-widest {
    letter-spacing: 0.1em;
}

/* Text Color */
.text-color-primary {
    color: var(--primary);
}

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

.text-color-tertiary {
    color: var(--tertiary);
}

.text-color-surface {
    color: var(--on-surface);
}

.text-color-error {
    color: var(--error);
}

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

.text-color-muted {
    color: var(--on-surface-variant);
}

/* Links */
.link {
    text-decoration: underline;
    color: var(--primary);
}

.link:visited {
    color: var(--primary-variant);
}

.link:hover {
    color: var(--primary-container);
}

.no-link {
    text-decoration: none;
    color: inherit;
}

.no-link:hover {
    text-decoration: underline;
}

/* Headings - Visual styling classes only */
.hdg--xx-large {
    font-size: var(--font-size-xx-large);
    font-weight: var(--font-weight-7);
    line-height: 1.2;
    margin: 0 0 var(--size-4);
}

.hdg--x-large {
    font-size: var(--font-size-x-large);
    font-weight: var(--font-weight-7);
    line-height: 1.25;
    margin: 0 0 var(--size-3);
}

.hdg--large {
    font-size: var(--font-size-large);
    font-weight: var(--font-weight-6);
    line-height: 1.3;
    margin: 0 0 var(--size-3);
}

.hdg--medium {
    font-size: var(--font-size-medium);
    font-weight: var(--font-weight-6);
    line-height: 1.35;
    margin: 0 0 var(--size-2);
}

.hdg--small {
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-5);
    line-height: 1.4;
    margin: 0 0 var(--size-2);
}

.hdg--x-small {
    font-size: var(--font-size-x-small);
    font-weight: var(--font-weight-5);
    line-height: 1.5;
    margin: 0 0 var(--size-2);
}

/* Headline component class (legacy support) */
.headline {
    font-size: var(--font-size-xx-large);
    font-weight: 700;
    line-height: var(--line-height-tight);
    color: var(--color-ink--canvas);
    margin: 0 0 1.5rem;
}

/* Responsive heading adjustments */
@media (max-width: 40em) {
    h1, .hdg--xx-large {
        font-size: var(--font-size-x-large);
    }

    h2, .hdg--x-large {
        font-size: var(--font-size-large);
    }

    h3, .hdg--large {
        font-size: var(--font-size-medium);
    }

    .headline {
        font-size: var(--font-size-x-large);
    }
}

/* List Style */
.list-style-none {
    list-style: none;
}

.list-style-disc {
    list-style-type: disc;
}

.list-style-decimal {
    list-style-type: decimal;
}

/* Text Overflow with Line Clamping */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

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

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

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

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