/* Custom Theme Styles */

/* Fix for Another Read Plugin Grid Layout */
/* Override the plugin's single-column restriction and limit to 2 columns */
.ar-content-list .ar-content-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
}

/* Responsive grid adjustments */
@media (max-width: 640px) {
    .ar-content-list .ar-content-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Ensure content items take full width within their grid cell */
.ar-content-list .ar-content-grid .ar-content-item {
    width: 100%;
}

/* Paragraph Spacing Fix */
/* Add proper spacing between paragraphs for better readability */
p {
    margin-bottom: 1.5rem;
}

/* Remove bottom margin from last paragraph in containers */
p:last-child {
    margin-bottom: 0;
}

/* BookBuy Plugin Button Styling */
/* Style the "Buy This Book" section */
.ar-bookbuy-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(to-br, rgba(59, 130, 246, 0.05), rgba(16, 185, 129, 0.05));
    border-radius: 0.75rem;
    border: 1px solid #E8E6E3;
}

.ar-bookbuy-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4A4A4A;
    margin-bottom: 1rem;
    font-family: 'Inter', system-ui, sans-serif;
}

/* Style the buy-link container */
.buy-link {
    position: relative;
    display: inline-block;
}

/* Style the main "Buy" button */
.buy-link button {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    font-family: 'Inter', system-ui, sans-serif;
}

.buy-link button:hover {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.buy-link button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

/* Style the dropdown container */
.buy-link>div {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 200px;
    background: white;
    border: 1px solid #E8E6E3;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 100;
}

/* Style the retailer links */
.buy-link>div a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    color: #4A4A4A;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-bottom: 1px solid #F5F5F5;
    transition: all 0.2s ease;
}

.buy-link>div a:last-child {
    border-bottom: none;
}

.buy-link>div a:hover {
    background: linear-gradient(to-right, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.04));
    color: #3B82F6;
    padding-left: 1.5rem;
}

/* Add icon-like styling to retailer links */
.buy-link>div a span {
    position: relative;
    padding-left: 1.5rem;
}

.buy-link>div a span::before {
    content: '→';
    position: absolute;
    left: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #3B82F6;
}

.buy-link>div a:hover span::before {
    opacity: 1;
}

/* Loading state */
.buy-link.loading button {
    opacity: 0.7;
    cursor: wait;
}

/* Responsive adjustments for BookBuy */
@media (max-width: 640px) {
    .buy-link>div {
        left: 50%;
        transform: translateX(-50%);
        min-width: 250px;
    }

    .ar-bookbuy-section {
        padding: 1rem;
    }
}

/* Base Styles */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* H1 Line Height */
h1 {
    line-height: 1.25;
}


/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Logo Styling */
.custom-logo {
    max-height: 50px;
    width: auto;
}

/* Line Clamp Utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Prose Styling for Content */
.prose {
    color: #4A4A4A;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    color: #2D2D2D;
    font-family: 'Merriweather', Georgia, serif;
}

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

.prose a:hover {
    color: #2563EB;
}

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

.prose blockquote {
    border-left: 4px solid #3B82F6;
    padding-left: 1.5rem;
    font-style: italic;
    color: #6B7280;
}

/* Animation Utilities */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Focus Styles */
a:focus,
button:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #FAF9F6;
}

::-webkit-scrollbar-thumb {
    background: #E8E6E3;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #D1CEC9;
}

/* WordPress Alignment Classes */
.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

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

/* WordPress Gallery */
.wp-block-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

/* Pagination Styling */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid #E8E6E3;
    border-radius: 0.375rem;
    color: #4A4A4A;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination a:hover {
    background-color: #3B82F6;
    color: white;
    border-color: #3B82F6;
}

.pagination .current {
    background-color: #3B82F6;
    color: white;
    border-color: #3B82F6;
}

/* Mobile Menu Transitions */
#mobile-menu {
    transition: all 0.3s ease-in-out;
}

#mobile-menu.show {
    display: block;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Skip to Content Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: #3B82F6;
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    z-index: 100;
}

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

/* Print Styles */
@media print {

    header,
    footer,
    .no-print {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    a {
        text-decoration: underline;
    }
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode */
    /*
    body {
        background-color: #1a1a1a;
        color: #e5e5e5;
    }
    
    .bg-white {
        background-color: #2d2d2d !important;
    }
    
    .bg-off-white {
        background-color: #1a1a1a !important;
    }
    */
}