/**
 * Custom Styles for CoburnicusMind Theme
 * Complements Tailwind CSS with theme-specific styles
 */

/* Base styles - visible fallback */
html {
    background: #0f172a !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #f1f5f9 !important;
    min-height: 100vh;
    position: relative;
}

/* Ensure content is above Three.js background */
#page {
    position: relative;
    z-index: 1;
}

.site-main {
    position: relative;
    z-index: 1;
}

/* Force text colors */
h1, h2, h3, h4, h5, h6 {
    color: #ffffff !important;
}

p {
    color: #cbd5e1;
}

a {
    color: #60a5fa;
    text-decoration: none;
}

a:hover {
    color: #93c5fd;
}

/* Header styles */
.site-header {
    background: rgba(15, 23, 42, 0.8) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Content areas */
.content-area {
    color: #f1f5f9 !important;
}

/* Sections */
section {
    padding: 4rem 0;
}

.hero-section {
    padding: 8rem 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-section p {
    font-size: 1.5rem;
    max-width: 48rem;
    margin: 0 auto 2rem;
}

/* Buttons */
.bg-blue-600,
.inline-block.bg-blue-600,
button,
input[type="submit"] {
    background-color: #2563eb !important;
    color: #ffffff !important;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    display: inline-block;
    font-weight: 500;
    transition: background-color 0.2s;
}

.bg-blue-600:hover,
button:hover,
input[type="submit"]:hover {
    background-color: #1d4ed8 !important;
}

/* Layout */
.max-w-6xl,
.max-w-7xl {
    max-width: 80rem;
    margin: 0 auto;
}

.max-w-4xl {
    max-width: 56rem;
    margin: 0 auto;
}

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

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.py-16 {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.py-20 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

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

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

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

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

/* Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .grid.md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid.md\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid.lg\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Cards */
article {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.3s;
    overflow: hidden;
}

article:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-4px);
}

article h2,
article h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

article h2 a,
article h3 a {
    color: #ffffff;
}

article h2 a:hover,
article h3 a:hover {
    color: #60a5fa;
}

/* Fix image sizes - comprehensive */
article img,
.entry-content img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Aspect ratio containers */
.aspect-video {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

.aspect-video img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Project card thumbnails */
article img.attachment-project-thumbnail,
article img.wp-post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gallery grid */
.project-gallery .grid > * {
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 0.5rem;
}

.project-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Featured image hero */
.project-hero img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
}

/* Content images */
.entry-content img {
    margin: 2rem auto;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Ensure proper spacing */
.entry-thumbnail {
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.entry-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* Prose styling for post content */
.prose {
    color: #cbd5e1;
    line-height: 1.75;
}

.prose h2 {
    color: #ffffff !important;
    margin-top: 2em;
    margin-bottom: 1em;
    font-size: 1.875rem;
    font-weight: 700;
}

.prose h3 {
    color: #ffffff !important;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-size: 1.5rem;
    font-weight: 600;
}

.prose p {
    color: #cbd5e1;
    margin-bottom: 1.25em;
}

.prose ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.25em;
    color: #cbd5e1;
}

.prose li {
    margin-bottom: 0.5em;
    color: #cbd5e1;
}

.prose li strong {
    color: #ffffff;
}

.prose a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.2s;
}

.prose a:hover {
    color: #93c5fd;
}

.prose code {
    background-color: rgba(100, 181, 246, 0.1);
    color: #93c5fd;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.prose pre {
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
}

.prose img {
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.prose blockquote {
    border-left: 4px solid #60a5fa;
    padding-left: 1rem;
    font-style: italic;
    color: #94a3b8;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Magnetic button effect */
.magnetic-btn {
    transition: transform 0.2s ease;
}

.magnetic-btn:hover {
    transform: scale(1.05);
}

/* Card hover effects */
.project-card,
.post-card {
    transition: all 0.3s ease;
}

.project-card:hover,
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.6);
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* Category and tag chips */
.chip {
    display: inline-block;
    font-weight: 500;
    transition: all 0.2s;
}

.chip:hover {
    transform: scale(1.05);
}

/* Navigation */
.main-navigation a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
}

.main-navigation a:hover,
.main-navigation a.current-menu-item {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Mobile menu */
#mobile-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: background-color 0.2s;
}

#mobile-menu a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Footer links */
.site-footer a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: #ffffff;
}

/* Loading state */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #60a5fa;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive utilities */
@media (max-width: 768px) {
    .prose {
        font-size: 1rem;
    }

    .prose h1 {
        font-size: 2rem;
    }

    .prose h2 {
        font-size: 1.5rem;
    }

    /* Fix mobile header covering content */
    body.has-fixed-header {
        padding-top: 320px;
    }

    main,
    .site-main,
    #primary {
        padding-top: 320px;
    }
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

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

/* 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;
    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: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Form styling */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 8px;
    color: #f1f5f9;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
    width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(96, 165, 250, 0.6);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

/* Comment form specific */
.comment-form {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3rem;
}

.comment-form-comment label,
.comment-form-author label,
.comment-form-email label,
.comment-form-url label {
    color: #cbd5e1;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.comment-form .required {
    color: #f87171;
}

.comment-notes,
.comment-form-cookies-consent label {
    color: #94a3b8;
    font-size: 0.875rem;
    line-height: 1.5;
}

.comment-form-cookies-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1rem;
}

.comment-form-cookies-consent input[type="checkbox"] {
    margin-top: 0.25rem;
    width: auto;
    accent-color: #3b82f6;
}

.comment-form-cookies-consent label {
    flex: 1;
    margin: 0;
}

.form-submit {
    margin-top: 1.5rem;
}

.form-submit input[type="submit"],
input[type="submit"].submit {
    background: #2563eb;
    color: #ffffff;
    padding: 12px 32px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.form-submit input[type="submit"]:hover,
input[type="submit"].submit:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Checkbox and radio styling */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    accent-color: #3b82f6;
    cursor: pointer;
}

/* Placeholder text */
::placeholder {
    color: #64748b;
    opacity: 1;
}

:-ms-input-placeholder {
    color: #64748b;
}

::-ms-input-placeholder {
    color: #64748b;
}
