/**
 * Utility Classes
 * Premium Editorial Design System
 *
 * @package Messlier
 */

/* ========================================
   TEXT ALIGNMENT
   ======================================== */

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

/* ========================================
   TEXT COLORS
   ======================================== */

.text-primary { color: var(--text); }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-accent { color: var(--accent); }
.text-invert { color: var(--text-invert); }

/* ========================================
   FONT SIZES
   ======================================== */

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

/* ========================================
   FONT WEIGHTS
   ======================================== */

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ========================================
   FONT FAMILIES
   ======================================== */

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

/* ========================================
   LINE HEIGHT
   ======================================== */

.leading-none { line-height: var(--leading-none); }
.leading-tight { line-height: var(--leading-tight); }
.leading-normal { line-height: var(--leading-normal); }
.leading-relaxed { line-height: var(--leading-relaxed); }
.leading-loose { line-height: var(--leading-loose); }

/* ========================================
   LETTER SPACING
   ======================================== */

.tracking-tight { letter-spacing: var(--tracking-tight); }
.tracking-normal { letter-spacing: var(--tracking-normal); }
.tracking-wide { letter-spacing: var(--tracking-wide); }
.tracking-wider { letter-spacing: var(--tracking-wider); }

/* ========================================
   MARGINS
   ======================================== */

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }
.mb-16 { margin-bottom: var(--space-16); }

.my-0 { margin-top: 0; margin-bottom: 0; }
.my-4 { margin-top: var(--space-4); margin-bottom: var(--space-4); }
.my-8 { margin-top: var(--space-8); margin-bottom: var(--space-8); }

/* ========================================
   PADDING
   ======================================== */

.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

/* ========================================
   DISPLAY
   ======================================== */

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* ========================================
   FLEXBOX
   ======================================== */

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

.flex-1 { flex: 1; }
.flex-none { flex: none; }

/* ========================================
   GAP
   ======================================== */

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ========================================
   WIDTH & HEIGHT
   ======================================== */

.w-full { width: 100%; }
.w-auto { width: auto; }
.max-w-content { max-width: var(--content-max); }
.max-w-container { max-width: var(--container-max); }

.h-full { height: 100%; }
.h-auto { height: auto; }

.mx-auto { margin-left: auto; margin-right: auto; }

/* ========================================
   BORDERS
   ======================================== */

.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-light { border-color: var(--border-light); }

.rounded { border-radius: var(--radius-md); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* ========================================
   BACKGROUNDS
   ======================================== */

.bg-surface { background-color: var(--surface); }
.bg-surface-2 { background-color: var(--surface-2); }
.bg-accent { background-color: var(--accent); }
.bg-accent-soft { background-color: var(--accent-soft); }

/* ========================================
   SHADOWS
   ======================================== */

.shadow-soft { box-shadow: var(--shadow-soft); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ========================================
   VISIBILITY
   ======================================== */

.invisible { visibility: hidden; }
.visible { visibility: visible; }

@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none !important; }
}

/* ========================================
   TRANSITIONS
   ======================================== */

.transition { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }
.transition-slow { transition: all var(--transition-slow); }

/* ========================================
   CURSOR
   ======================================== */

.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* ========================================
   OVERFLOW
   ======================================== */

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

/* ========================================
   SKIP LINK
   ======================================== */

.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-3) var(--space-6);
    background-color: var(--accent);
    color: var(--text-invert);
    text-decoration: none;
    border-radius: var(--radius-md);
    z-index: 9999;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-4);
    color: var(--text-invert);
}

/* ========================================
   WORDPRESS CLASSES
   ======================================== */

.alignnone {
    margin: var(--space-4) 0;
}

.aligncenter {
    display: block;
    margin: var(--space-8) auto;
}

.alignleft {
    float: left;
    margin: var(--space-2) var(--space-6) var(--space-6) 0;
}

.alignright {
    float: right;
    margin: var(--space-2) 0 var(--space-6) var(--space-6);
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: var(--text-sm);
    color: var(--text-light);
    margin-top: var(--space-2);
    text-align: center;
    font-style: italic;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
    margin: var(--space-8) 0;
}

.gallery-item {
    margin: 0;
}

.gallery-icon img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* ========================================
   STICKY POST
   ======================================== */

.sticky .post-card {
    border-left: 3px solid var(--accent);
    padding-left: var(--space-4);
}

/* ========================================
   POST PASSWORD FORM
   ======================================== */

.post-password-form {
    max-width: 400px;
    margin: var(--space-10) auto;
    padding: var(--space-8);
    background-color: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    text-align: center;
}

.post-password-form label {
    display: block;
    margin-bottom: var(--space-4);
    font-weight: 500;
}

.post-password-form input[type="password"] {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
}

.post-password-form input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.post-password-form input[type="submit"] {
    padding: var(--space-3) var(--space-6);
    background-color: var(--accent);
    color: var(--text-invert);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.post-password-form input[type="submit"]:hover {
    background-color: var(--accent-hover);
}
