/*
 * Modern WordPress Theme CSS
 * Video Vlog Pro - Accessibility and Performance Improvements
 */

/* CSS Custom Properties for better maintainability */
:root {
    --color-primary: #f0473c;
    --color-secondary: #8fa4b4;
    --color-dark: #212529;
    --color-light: #f8f9fa;
    --color-white: #ffffff;
    --color-gray: #6c757d;
    
    --font-family-base: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-heading: inherit;
    
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 3rem;
    
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    
    --transition-base: all 0.15s ease-in-out;
}

/* Focus management for accessibility */
*:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.skip-link:focus {
    clip: auto !important;
    clip-path: none !important;
    height: auto !important;
    width: auto !important;
    position: absolute !important;
    z-index: 100000;
    background: var(--color-dark);
    color: var(--color-white);
    padding: var(--spacing-md);
    text-decoration: none;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    border-radius: var(--border-radius);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #000000;
        --color-secondary: #000000;
        --box-shadow: 0 0 0 2px #000000;
    }
}

/* Reduced motion support */
@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;
    }
}

/* Modern form styles */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
textarea,
select {
    appearance: none;
    background-color: var(--color-white);
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    transition: var(--transition-base);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(240, 71, 60, 0.25);
}

/* Button improvements */
.btn,
.button,
input[type="submit"],
input[type="button"],
button {
    background-color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: var(--border-radius);
    color: var(--color-white);
    cursor: pointer;
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    padding: 0.75rem 1.5rem;
    text-align: center;
    text-decoration: none;
    transition: var(--transition-base);
    vertical-align: middle;
}

.btn:hover,
.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
button:hover {
    background-color: #d63627;
    border-color: #d63627;
    color: var(--color-white);
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:focus,
.button:focus,
input[type="submit"]:focus,
input[type="button"]:focus,
button:focus {
    box-shadow: 0 0 0 0.2rem rgba(240, 71, 60, 0.5);
}

/* Card component */
.card {
    background-color: var(--color-white);
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.card-body {
    padding: var(--spacing-lg);
}

.card-title {
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.card-text {
    margin-bottom: var(--spacing-md);
}

/* Navigation improvements */
.nav-link {
    color: var(--color-dark);
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    transition: var(--transition-base);
}

.nav-link:hover,
.nav-link:focus {
    color: var(--color-primary);
    text-decoration: underline;
}

.nav-link.active {
    color: var(--color-primary);
    font-weight: 600;
}

/* Modern grid system */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(-1 * var(--spacing-md));
}

.col {
    flex: 1 0 0%;
    padding: 0 var(--spacing-md);
}

.col-auto {
    flex: 0 0 auto;
    width: auto;
}

/* Responsive utilities */
@media (max-width: 767.98px) {
    .d-none-mobile {
        display: none !important;
    }
    
    .col {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (min-width: 768px) {
    .d-none-desktop {
        display: none !important;
    }
    
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --color-dark: #ffffff;
        --color-light: #1a1a1a;
        --color-white: #2d2d2d;
        --color-gray: #a0a0a0;
    }
    
    body {
        background-color: var(--color-light);
        color: var(--color-dark);
    }
    
    .card {
        background-color: var(--color-white);
        border-color: #444;
    }
    
    input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
    textarea,
    select {
        background-color: var(--color-white);
        border-color: #444;
        color: var(--color-dark);
    }
}

/* Print styles */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]::after {
        content: " (" attr(title) ")";
    }
    
    img {
        page-break-inside: avoid;
    }
    
    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }
    
    h2,
    h3 {
        page-break-after: avoid;
    }
    
    .no-print {
        display: none !important;
    }
}

/* WordPress specific improvements */
.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: var(--color-gray);
    margin-top: var(--spacing-xs);
    text-align: center;
}

.alignwide {
    margin-left: calc(25% - 25vw);
    margin-right: calc(25% - 25vw);
    width: auto;
    max-width: 1000%;
}

.alignfull {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: auto;
    max-width: 1000%;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--color-primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error states */
.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: var(--border-radius);
    color: #721c24;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: var(--border-radius);
    color: #155724;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

/* Performance optimizations */
img {
    height: auto;
    max-width: 100%;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}
