/* ===============================================================
   FILE: /css/gsu_css_overrides.css | VERSION: v1.0 (2026-08-31)
   =============================================================== */

/*
 * Purpose:
 *   Presentation overrides for UTS Optimizely WYSIWYG tables and lists.
 *
 * Responsibilities:
 *   - Adjust table spacing and automatic column sizing.
 *   - Remove redundant table margins at accordion content boundaries.
 *   - Improve table-cell spacing and vertical alignment.
 *   - Apply lower-alpha markers to ordered lists.
 *   - Adjust list and child-element spacing inside table cells.
 *
 * Used by:
 *   UTS public website Optimizely front end.
 *
 * Deployment:
 *   Load after the primary UTS website stylesheet.
 */

:root {
    --uts-gsu-css-overrides-version: "1.0-20260831";
}

/* Add space around tables and remove fixed, equal-width column layout. */
.wysiwyg-user-content-output table {
    margin-block: 2em;
    table-layout: auto;
}

/*
 * Remove redundant table spacing when the table is the first, last or
 * only element in accordion WYSIWYG content.
 * Replace with margin-trim when it has suitable baseline browser support.
 */
.accordion__content .wysiwyg-user-content-output table:first-child {
    margin-block-start: 0;
}

.accordion__content .wysiwyg-user-content-output table:last-child {
    margin-block-end: 0;
}

.accordion__content .wysiwyg-user-content-output table:only-child {
    margin-block: 0;
}

/* Improve table-cell spacing and align content to the top of each cell. */
.wysiwyg-user-content-output table td {
    padding-block: 1em;
    vertical-align: top;
}

/* Use lower-alpha markers for ordered lists in WYSIWYG content. */
.wysiwyg-user-content-output ol {
    list-style-type: lower-alpha;
}

/* Remove the default inline-start padding from unordered lists in table cells. */
.wysiwyg-user-content-output table td ul {
    padding-inline-start: 0;
}

/*
 * Remove external margins from the first and last direct child elements
 * inside a table cell. The child combinator prevents nested content from
 * being changed unintentionally.
 * Replace with margin-trim when it has suitable baseline browser support.
 */
.wysiwyg-user-content-output table td > :first-child {
    margin-block-start: 0;
}

.wysiwyg-user-content-output table td > :last-child {
    margin-block-end: 0;
}
