/*
 * CSP-Compliant Utility Classes
 * =============================
 * These utility classes replace inline styles to comply with Content Security Policy.
 * Generated during inline style refactoring.
 */

/* ==================== Spacing ==================== */

/* Margin Top */
.mt-0 {
    margin-top: 0;
}

.mt-05 {
    margin-top: 0.5rem;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-15 {
    margin-top: 1.5rem;
}

.mt-2 {
    margin-top: 2rem;
}

/* Margin Bottom */
.mb-0 {
    margin-bottom: 0;
}

.mb-05 {
    margin-bottom: 0.5rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-15 {
    margin-bottom: 1.5rem;
}

/* Margin Y (vertical) */
.my-1 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Padding */
.p-05 {
    padding: 0.5rem;
}

.p-1 {
    padding: 1rem;
}

.p-2 {
    padding: 2rem;
}

.py-05 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.px-1 {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ==================== Display & Layout ==================== */

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.d-inline-flex {
    display: inline-flex;
}

.d-grid {
    display: grid;
}

.flex-1 {
    flex: 1;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

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

.align-self-end {
    align-self: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-05 {
    gap: 0.5rem;
}

.gap-1 {
    gap: 1rem;
}

.grid-full {
    grid-column: 1 / -1;
}

/* ==================== Sizing ==================== */

.w-100 {
    width: 100%;
}

.max-w-400 {
    max-width: 400px;
}

.max-w-500 {
    max-width: 500px;
}

.max-h-200 {
    max-height: 200px;
}

.max-h-250 {
    max-height: 250px;
}

.overflow-x-auto {
    overflow-x: auto;
}

.overflow-y-auto {
    overflow-y: auto;
}

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

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

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

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

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.8rem;
}

.text-base {
    font-size: 0.85rem;
}

.text-md {
    font-size: 0.9rem;
}

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

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

.italic {
    font-style: italic;
}

.word-break-all {
    word-break: break-all;
}

/* ==================== Colors ==================== */
/* Using CSS variables for theme compatibility */

.text-muted {
    color: var(--text-primary);
    opacity: 0.6;
}

.text-muted-alt {
    color: var(--text-primary);
    opacity: 0.7;
}

.text-muted-light {
    color: var(--text-primary);
    opacity: 0.5;
}

.text-success {
    color: var(--pinstripe);
}

.text-info {
    color: var(--accent-lavender);
}

.text-danger {
    color: var(--accent-coral);
}

/* ==================== Borders ==================== */
/* Using CSS variables for theme compatibility */

.border-none {
    border: none;
}

.border-top-light {
    border-top: 1px solid var(--highlight-2);
}

.border-bottom-light {
    border-bottom: 1px solid var(--highlight-2);
}

.border-bottom-ddd {
    border-bottom: 1px solid var(--highlight-2);
}

.border-bottom-header {
    border-bottom: 2px solid var(--highlight-2);
}

.border-radius-4 {
    border-radius: 4px;
}

.border-radius-8 {
    border-radius: 8px;
}

/* ==================== Table Utilities ==================== */

.table-collapse {
    border-collapse: collapse;
}

.table-cell-header {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 2px solid var(--highlight-2);
}

.table-cell-header-lg {
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--highlight-2);
}

.table-cell {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--highlight-2);
}

.table-cell-lg {
    padding: 1rem;
}

/* ==================== Form Utilities ==================== */

.form-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--highlight-2);
    border-radius: 4px;
    background: var(--background);
    color: var(--text-primary);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-primary);
    opacity: 0.7;
}

/* ==================== Modal Utilities ==================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--background);
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-1);
    border: 1px solid var(--highlight-2);
}

/* ==================== Dividers ==================== */

.divider {
    margin: 1rem 0;
    border: none;
    border-top: 1px solid var(--highlight-2);
}

/* ==================== Position ==================== */

.sticky-top {
    position: sticky;
    top: 0;
    background: var(--highlight-1);
}

/* ==================== Additional Spacing ==================== */

.ml-05 {
    margin-left: 0.5rem;
}

.mr-05 {
    margin-right: 0.5rem;
}

.mt-025 {
    margin-top: 0.25rem;
}

.mb-025 {
    margin-bottom: 0.25rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.py-025 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.px-05 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* ==================== Grid Layouts ==================== */

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* ==================== Min Heights ==================== */

.min-h-vh-60 {
    min-height: 60vh;
}

/* ==================== Max Sizes ==================== */

.max-w-200 {
    max-width: 200px;
}

.max-w-300 {
    max-width: 300px;
}

.max-h-400 {
    max-height: 400px;
}

/* ==================== Font Sizes ==================== */

.text-5rem {
    font-size: 5rem;
}

/* ==================== Opacity ==================== */

.opacity-05 {
    opacity: 0.5;
}

.opacity-07 {
    opacity: 0.7;
}

.opacity-08 {
    opacity: 0.8;
}

/* ==================== Issue/Status Colors ==================== */

.text-warning {
    color: var(--accent-coral);
}

.text-primary-dark {
    color: var(--text-primary);
}

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

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

.code-inline {
    background: var(--highlight-1);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    color: var(--text-primary);
}

.code-inline-alt {
    background: var(--focus-section);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    color: var(--text-primary);
}

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

.list-unstyled {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ==================== Buttons ==================== */

.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-blue);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* ==================== Flex Center ==================== */

.flex-center-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ==================== Overflow ==================== */

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

/* ==================== Background ==================== */

.bg-white {
    background: white;
}

.bg-semi-white {
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== Cursors ==================== */

.cursor-default {
    cursor: default;
}

/* ==================== Widths ==================== */

.w-50 {
    width: 50px;
}

/* ==================== Opacity ==================== */
.opacity-06 {
    opacity: 0.6;
}

/* ==================== Accessibility ==================== */

/* Screen reader only - visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--text-primary);
    color: var(--background);
    padding: 8px 16px;
    z-index: 9999;
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible styles - replaces removed outlines */
:focus-visible {
    outline: 2px solid var(--accent-coral);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --highlight-1: transparent;
        --highlight-2: var(--text-primary);
    }
}

/* ==================== Loading States ==================== */

/* Skeleton loading animation */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Base skeleton class */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--highlight-1) 25%,
        var(--highlight-2) 37%,
        var(--highlight-1) 63%
    );
    background-size: 200px 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Skeleton text line */
.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    width: 100%;
}

.skeleton-text.short {
    width: 40%;
}

.skeleton-text.medium {
    width: 70%;
}

/* Skeleton title */
.skeleton-title {
    height: 1.5em;
    margin-bottom: 0.75em;
    width: 60%;
}

/* Skeleton avatar/circle */
.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Skeleton card */
.skeleton-card {
    padding: 1rem;
    border: 1px solid var(--highlight-2);
}

/* Skeleton image placeholder */
.skeleton-image {
    width: 100%;
    height: 150px;
}

/* Loading spinner container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 200px;
}

.loading-container .spinner {
    margin-bottom: 1rem;
}

.loading-text {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    opacity: 0.7;
}

/* ARIA live region for loading announcements */
.loading-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading overlay for async operations */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Timeout message */
.loading-timeout {
    text-align: center;
    padding: 1rem;
    color: var(--text-primary);
    opacity: 0.8;
}

.loading-timeout-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ============================================
   PUBLISHER BADGE - Newspaper Byline Style
   ============================================ */
.pub-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-headline);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    white-space: nowrap;
    text-decoration: none;
}

.pub-badge img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.85;
}

.pub-badge:hover {
    color: var(--text-primary);
}

.pub-badge:hover img {
    opacity: 1;
}

.pub-badge--compact {
    font-size: 0.65rem;
    gap: 0.25rem;
}

.pub-badge--compact img {
    width: 14px;
    height: 14px;
}

.pub-badge--inline {
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

.pub-badge--block {
    display: block;
    margin-top: 0.5rem;
    text-align: center;
}
