/**
 * Custom CSS for Elegance Theme (Light Mode Only)
 *
 * Additional styling beyond Tailwind CSS classes
 */

/**
 * Typography Enhancements
 */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 0;
}

/* Consistent vertical rhythm */
p, ul, ol, dl, blockquote {
    margin-bottom: 1.5rem;
}

/* Make links more accessible */
a {
    transition: color 0.2s ease-in-out;
    text-underline-offset: 0.15em;
}

a:hover {
    text-decoration-thickness: 0.1em;
}

/**
 * Header Styles
 */
.site-header {
    transition: all 0.3s ease;
}

.site-header.sticky-header-scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
}

.site-header.sticky-header-scrolled .site-branding img {
    max-height: 40px;
}

/* Animate primary menu interactions */
.main-navigation a {
    position: relative;
    padding: 0.5rem 0;
    font-weight: 500;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after {
    width: 100%;
}

/**
 * Reading Progress Bar Enhancement
 */
.reading-progress-container {
    height: 4px;
    background-color: transparent;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
}

.reading-progress {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.1s ease;
}

/**
 * Post Content Enhancements
 */

/* Improved Blockquotes */
.entry-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    background-color: #f8fafc;
    font-style: italic;
    margin: 1.5rem 0;
    border-radius: 0.25rem;
}

/* Code Blocks */
.entry-content pre {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.entry-content code {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, 'Andale Mono', monospace;
    background-color: #f1f5f9;
    color: #475569;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

.entry-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

/* Table Styling */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.entry-content th {
    background-color: #f1f5f9;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem;
}

.entry-content td {
    padding: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

/* Table of Contents */
.toc-container {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.toc-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.toc-list {
    padding: 1rem;
}

.toc-list a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    padding: 0.25rem 0;
    transition: color 0.2s ease;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--primary-color);
}

/* Images and Captions */
.wp-caption {
    max-width: 100%;
    margin-bottom: 1.5rem;
}

.wp-caption img {
    border-radius: 0.5rem;
    overflow: hidden;
}

.wp-caption-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
    font-style: italic;
}

/* Featured Image */
.featured-image {
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/**
 * Card Animations
 */
.post-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
}

/**
 * Comment Styling
 */
.comment-list {
    list-style: none;
    padding-left: 0;
}

.comment-list ol {
    list-style: none;
    padding-left: 2rem;
}

.comment-author .avatar {
    border-radius: 50%;
}

.comment-metadata {
    font-size: 0.875rem;
    color: #64748b;
}

.comment-respond {
    margin-top: 2rem;
}

#reply-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

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

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background-color: #f8fafc;
    margin-bottom: 1rem;
}

.comment-form input[type="submit"] {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.comment-form input[type="submit"]:hover {
    background-color: #1d4ed8;
}

/**
 * Newsletter Form
 */
.newsletter-form {
    margin-bottom: 1rem;
}

.newsletter-form input[type="email"] {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background-color: #f8fafc;
}

.newsletter-form button {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.newsletter-form button:hover {
    background-color: #1d4ed8;
}

/**
 * Social Share Buttons
 */
.social-sharing a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.social-sharing a:hover {
    transform: translateY(-2px);
}

/**
 * Author Bio Section
 */
.author-bio {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 0.5rem;
    background-color: #f8fafc;
}

.author-bio img {
    border-radius: 50%;
}

/**
 * Pagination
 */
.pagination,
.page-links,
.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
}

.pagination .page-numbers,
.page-links a,
.page-links span,
.nav-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    margin: 0 0.25rem;
    border-radius: 0.375rem;
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination .page-numbers.current,
.page-links span.current {
    background-color: var(--primary-color);
    color: white;
}

.pagination a.page-numbers:hover,
.page-links a:hover,
.nav-links a:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

/**
 * Page Header Styling
 */
.page-header {
    margin-bottom: 2rem;
    text-align: center;
}

.page-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.archive-description {
    color: #64748b;
    max-width: 42rem;
    margin: 0 auto;
}

/**
 * Search Modal
 */
.search-form {
    position: relative;
}

.search-form input[type="search"] {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background-color: #f8fafc;
}

/**
 * Skip Links
 */
.skip-link {
    background-color: #f8fafc;
    color: #0f172a;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 0.375rem;
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(-100%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
    z-index: 100;
}

/**
 * WooCommerce Specific Styles
 */
.woocommerce span.onsale {
    background-color: var(--primary-color);
    color: white;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.woocommerce .button.alt {
    background-color: var(--primary-color) !important;
}

.woocommerce .button.alt:hover {
    background-color: #1d4ed8 !important;
}

/**
 * Animations and Micro-interactions
 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.slide-in-up {
    animation: slideInUp 0.4s ease forwards;
}

.single .entry-content > * {
    animation: fadeIn 0.5s ease forwards;
}

/**
 * Dark Mode Toggle Effect
 */
.dark-mode-toggle {
    position: relative;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    transform: rotate(10deg);
}

/**
 * Additional theme-specific styles
 */
.breadcrumbs {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.site-footer {
    font-size: 0.875rem;
}

.site-footer .widget-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Navigation Menus */
.footer-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav li {
    margin-bottom: 0.5rem;
}

.footer-nav a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-nav a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Category List in Footer */
.footer-categories li {
    margin-bottom: 0.5rem;
}

.footer-categories a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-categories a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Related Posts */
.related-post {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* Main Navigation Styling */
#primary-menu,
#primary-menu-mobile {
    list-style: none;
    margin: 0;
    padding: 0;
}

#primary-menu li,
#primary-menu-mobile li {
    position: relative;
}

#primary-menu > li {
    display: inline-block;
    margin-right: 1.5rem;
}

#primary-menu-mobile li {
    margin-bottom: 0.75rem;
}

#primary-menu a,
#primary-menu-mobile a {
    color: #1f2937;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

#primary-menu a:hover,
#primary-menu-mobile a:hover {
    color: var(--primary-color);
}

/* Sub-menus */
#primary-menu .sub-menu,
#primary-menu-mobile .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background-color: white;
    padding: 0.75rem 0;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

#primary-menu .sub-menu li,
#primary-menu-mobile .sub-menu li {
    padding: 0.5rem 1rem;
}

#primary-menu li:hover > .sub-menu {
    display: block;
}

#primary-menu-mobile .sub-menu {
    position: static;
    background-color: transparent;
    box-shadow: none;
    padding-left: 1rem;
    margin-top: 0.5rem;
}

/* Social Menu Icons */
.social-links {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    color: #64748b;
    transition: all 0.2s ease;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Post Formats */
.format-quote blockquote {
    font-size: 1.25rem;
    line-height: 1.5;
    position: relative;
    padding-top: 3rem;
}

.format-quote blockquote::before {
    content: '"';
    font-size: 5rem;
    color: var(--primary-color);
    opacity: 0.2;
    position: absolute;
    top: -1rem;
    left: -1rem;
    font-family: serif;
}

/* Comment Navigation */
.comment-navigation {
    display: flex;
    justify-content: space-between;
    margin: 1.5rem 0;
}

.comment-navigation .nav-previous,
.comment-navigation .nav-next {
    max-width: 48%;
}

.comment-navigation a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.comment-navigation a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Print Styles */
@media print {
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .site-header,
    .site-footer,
    .social-sharing,
    .newsletter-signup,
    .related-posts,
    .comments-area,
    .post-navigation {
        display: none;
    }
}
