/* ==========================================
   Cosmo Text Preview Styles
   
   Styles for rendering Cosmo Text output in a preview panel
   that mimics the LinkedIn Learning classroom-multimedia appearance.
   
   All styles target HTML tags directly within .classroom-multimedia__content
   so that clean Cosmo markup (without classes) renders correctly.
   ========================================== */

/* CSS Variables for Cosmo styling */
:root {
    --hue-web-color-background: #ffffff;
    --hue-web-color-background-neutral-soft: #f3f3f3;
    --hue-web-color-text: #333333;
    --hue-web-color-text-meta: #666666;
    --hue-web-color-link: #0066cc;
    --hue-web-color-accent-1: #e74c3c;
    --hue-web-color-accent-1-active: #c0392b;
    --hue-web-color-accent-3: #27ae60;
    --hue-web-color-accent-4: #95a5a6;
    --hue-web-color-accent-7: #9b59b6;
    --hue-web-color-accent-7-active: #8e44ad;
    
    --hue-web-dimension-spacing-2xsmall: 2px;
    --hue-web-dimension-spacing-xsmall: 4px;
    --hue-web-dimension-spacing-small: 8px;
    --hue-web-dimension-spacing-medium: 16px;
    --hue-web-dimension-spacing-large: 24px;
    --hue-web-dimension-spacing-xlarge: 32px;
    --hue-web-dimension-spacing-3xlarge: 48px;
    
    --hue-web-font-size-medium: 16px;
    --hue-web-font-size-large: 18px;
    --hue-web-font-size-xlarge: 24px;
    
    --hue-web-font-weight-bold: 700;
    --hue-web-line-height-open: 1.5;
}

/* ==========================================
   Classroom Multimedia Container
   ========================================== */

.classroom-multimedia {
    container-type: inline-size;
    container-name: classroom-multimedia;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--hue-web-color-background);
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding-top: 16px;
}

.classroom-multimedia__content {
    margin: var(--hue-web-dimension-spacing-xlarge) 0 var(--hue-web-dimension-spacing-xlarge);
    max-width: 100%;
    width: 100%;
}

/* ==========================================
   Headings (h2-h6, h1 reserved per Cosmo spec)
   ========================================== */

.classroom-multimedia__content h2 {
    font-size: var(--hue-web-font-size-xlarge);
    font-weight: var(--hue-web-font-weight-bold);
    line-height: var(--hue-web-line-height-open);
    margin-bottom: var(--hue-web-dimension-spacing-xsmall);
}

.classroom-multimedia__content h3 {
    font-size: var(--hue-web-font-size-large);
    font-weight: var(--hue-web-font-weight-bold);
    line-height: var(--hue-web-line-height-open);
    margin-bottom: var(--hue-web-dimension-spacing-xsmall);
}

.classroom-multimedia__content h4,
.classroom-multimedia__content h5,
.classroom-multimedia__content h6 {
    font-size: var(--hue-web-font-size-medium);
    font-weight: var(--hue-web-font-weight-bold);
    line-height: var(--hue-web-line-height-open);
    margin-bottom: var(--hue-web-dimension-spacing-xsmall);
}

/* ==========================================
   Paragraph
   ========================================== */

.classroom-multimedia__content p {
    margin-bottom: var(--hue-web-dimension-spacing-xlarge);
    line-height: var(--hue-web-line-height-open);
}

/* ==========================================
   Text Formatting
   ========================================== */

.classroom-multimedia__content b,
.classroom-multimedia__content strong {
    font-weight: var(--hue-web-font-weight-bold);
}

.classroom-multimedia__content i,
.classroom-multimedia__content em {
    font-style: italic;
}

.classroom-multimedia__content u {
    text-decoration: underline;
}

/* ==========================================
   Links
   ========================================== */

.classroom-multimedia__content a {
    color: var(--hue-web-color-link);
    text-decoration: underline;
}

.classroom-multimedia__content a:hover {
    text-decoration: none;
}

/* ==========================================
   Images
   ========================================== */

.classroom-multimedia__content img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

/* ==========================================
   Lists
   ========================================== */

.classroom-multimedia__content ul,
.classroom-multimedia__content ol {
    margin-bottom: var(--hue-web-dimension-spacing-xlarge);
    line-height: var(--hue-web-line-height-open);
}

.classroom-multimedia__content li {
    margin-left: var(--hue-web-dimension-spacing-large);
}

/* Unordered list styles */
.classroom-multimedia__content ul > li {
    list-style-type: disc;
}

.classroom-multimedia__content ul ul > li {
    list-style-type: circle;
}

.classroom-multimedia__content ul ul ul > li {
    list-style-type: square;
}

/* Ordered list styles */
.classroom-multimedia__content ol > li {
    list-style-type: decimal;
}

.classroom-multimedia__content ol ol > li {
    list-style-type: lower-alpha;
}

.classroom-multimedia__content ol ol ol > li {
    list-style-type: lower-roman;
}

/* Nested list spacing */
.classroom-multimedia__content li > ol,
.classroom-multimedia__content li > ul,
.classroom-multimedia__content li > p {
    margin-bottom: 0;
}

.classroom-multimedia__content p + ol,
.classroom-multimedia__content p + ul {
    margin-top: calc(-1 * var(--hue-web-dimension-spacing-large));
}

/* ==========================================
   Code - Inline
   ========================================== */

.classroom-multimedia__content code {
    padding: var(--hue-web-dimension-spacing-2xsmall);
    background: var(--hue-web-color-background-neutral-soft);
    font-size: 0.875em;
    font-family: monospace;
    border-radius: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ==========================================
   Code - Block
   ========================================== */

.classroom-multimedia__content pre {
    margin-bottom: var(--hue-web-dimension-spacing-xlarge);
    line-height: var(--hue-web-line-height-open);
}

.classroom-multimedia__content pre code {
    display: block;
    background: var(--hue-web-color-background-neutral-soft);
    padding: var(--hue-web-dimension-spacing-medium);
    white-space: pre-wrap;
    font-size: 0.875em;
    border-radius: 4px;
    overflow-x: auto;
    color: var(--hue-web-color-text);
    text-align: left;
    word-spacing: normal;
    tab-size: 2;
    hyphens: none;
}

/* ==========================================
   Error Highlighting for Preview
   ========================================== */

.cosmo-error-highlight {
    background-color: rgba(220, 53, 69, 0.15) !important;
    border-left: 3px solid #dc3545;
    padding-left: 8px;
    margin-left: -11px;
}
