/*
 * LevelBee Theme Customizations
 * Additional styling for specific WordPress features
 */

/* WordPress Core Styles */
.alignleft {
    float: left;
    margin: 0 2rem 1rem 0;
}

.alignright {
    float: right;
    margin: 0 0 1rem 2rem;
}

.aligncenter {
    display: block;
    margin: 1rem auto;
    text-align: center;
}

.alignwide {
    width: 120%;
    max-width: 120%;
    margin-left: -10%;
    margin-right: -10%;
}

.alignfull {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: none;
}

/* Caption styles */
.wp-caption {
    max-width: 100%;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.wp-caption-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Gallery styles */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.gallery-item {
    position: relative;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    font-size: 0.8rem;
    text-align: center;
}

/* Embeds */
.wp-block-embed {
    margin: 2rem 0;
}

.wp-block-embed iframe,
.wp-block-embed object,
.wp-block-embed video {
    width: 100%;
    height: auto;
}

/* Block editor compatibility */
.has-text-align-center {
    text-align: center;
}

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

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

/* Custom background colors for blocks */
.has-primary-background-color {
    background-color: var(--primary-color);
}

.has-secondary-background-color {
    background-color: var(--secondary-color);
}

.has-light-background-color {
    background-color: var(--bg-light);
}

/* Custom text colors for blocks */
.has-primary-color {
    color: var(--primary-color);
}

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

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

/* Sticky posts */
.sticky {
    position: relative;
}

.sticky::before {
    content: '📌';
    position: absolute;
    top: -0.5rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
}

/* Screen reader text */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Skip link */
.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    position: absolute;
    left: 6px;
    top: 7px;
    z-index: 999999;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
}

/* Print styles */
@media print {
    .sidebar,
    .navigation,
    .social-links,
    .newsletter-widget,
    .search-widget {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --border-color: #000000;
        --bg-white: #ffffff;
        --primary-color: #0066cc;
    }
    
    .tool-card,
    .sidebar-widget {
        border: 2px solid #000000;
    }
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body.respect-user-preference {
        --bg-white: #1a1a1a;
        --bg-light: #2a2a2a;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --text-muted: #999999;
        --border-color: #444444;
    }
}