/* Accessibility Improvements for WCAG 2.2 Compliance */

/* Focus Styles - WCAG 2.4.7 Focus Visible */
.btn:focus,
a:focus,
button:focus, 
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
}

/* Remove default outline and add custom focus for better visibility */
*:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
} 

/* Form Accessibility Improvements */
.lead-form fieldset {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
}

.lead-form legend {
    font-weight: bold;
    font-size: 1.2em;
    padding: 0 0.5rem;
}

.lead-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
}

.lead-form input[type="email"],
.lead-form input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.lead-form input[type="email"]:focus,
.lead-form input[type="text"]:focus {
    border-color: #0066cc;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
}

#email-help {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 1rem;
}

/* GDPR Consent Styling */
.gdpr-consent {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.gdpr-consent input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
    width: auto;
}

.gdpr-consent label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9em;
    line-height: 1.4;
}

.privacy-info {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f0f8ff;
    border-left: 4px solid #0066cc;
    border-radius: 4px;
}

.privacy-info p {
    margin: 0;
    font-size: 0.85em;
    line-height: 1.4;
    color: #555;
}

/* reCAPTCHA Styling */
.g-recaptcha {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gdpr-consent,
    .privacy-info {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }
    
    .gdpr-consent label {
        font-size: 0.85em;
    }
    
    .privacy-info p {
        font-size: 0.8em;
    }
}

/* Button Accessibility */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #0066cc;
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #0052a3;
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: #545b62;
    color: white;
    text-decoration: none;
}

/* Cookie Consent Accessibility */
#consent-overlay h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.5em;
    color: #333;
}

#consent-overlay input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

#consent-overlay label {
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

#consent-overlay label h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1em;
}

#consent-overlay label p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

/* Skip Link for Keyboard Navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100000;
}

.skip-link:focus {
    top: 6px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    #consent-notice {
        border: 2px solid white;
    }
    
    #consent-overlay > div {
        border: 2px solid black;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .btn,
    #consent-overlay {
        transition: none;
    }
}

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

/* Book Promo Shortcode Styling */
.book-promo {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.book-promo-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.book-cover {
    flex-shrink: 0;
    width: 150px;
}

.book-cover-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.book-info {
    flex: 1;
}

.book-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

.book-subtitle {
    margin: 0 0 1rem 0;
    font-size: 1.1em;
    color: #666;
    font-style: italic;
}

.book-price {
    font-size: 1.8em;
    font-weight: bold;
    color: #0066cc;
    margin-bottom: 1rem;
}

.book-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.book-buy-btn,
.book-info-btn {
    padding: 0.75rem 1.5rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    transition: all 0.2s ease;
}

.book-buy-btn {
    background-color: #ff9500;
    color: white;
}

.book-buy-btn:hover,
.book-buy-btn:focus {
    background-color: #e6850e;
    color: white;
    text-decoration: none;
}

.book-info-btn {
    background-color: #6c757d;
    color: white;
}

.book-info-btn:hover,
.book-info-btn:focus {
    background-color: #545b62;
    color: white;
    text-decoration: none;
}

.book-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.book-features li {
    padding: 0.25rem 0;
    color: #333;
    font-size: 0.95em;
}

.book-features li::before {
    content: "✓";
    color: #28a745;
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Responsive Design for Book Promo */
@media (max-width: 768px) {
    .book-promo-content {
        flex-direction: column;
        text-align: center;
    }
    
    .book-cover {
        width: 120px;
        margin: 0 auto;
    }
    
    .book-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .book-buy-btn,
    .book-info-btn {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .book-promo {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .book-cover {
        width: 100px;
    }
    
    .book-title {
        font-size: 1.3em;
    }
    
    .book-price {
        font-size: 1.5em;
    }
}

/* Related Posts Shortcode Styling */
.related-posts {
    margin: 3rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.related-posts h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5em;
    color: #333;
    text-align: center;
    border-bottom: 2px solid #0066cc;
    padding-bottom: 0.5rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.related-post-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.related-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #0066cc;
}

.related-post-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.2em;
    line-height: 1.3;
}

.related-post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-post-title a:hover,
.related-post-title a:focus {
    color: #0066cc;
    text-decoration: underline;
}

.related-post-description {
    margin: 0 0 1rem 0;
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

.related-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: #888;
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
}

.related-post-meta time {
    font-weight: 500;
}

.related-post-tags {
    display: flex;
    gap: 0.5rem;
}

.related-post-tags .tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 500;
}

/* Responsive Design for Related Posts */
@media (max-width: 768px) {
    .related-posts {
        padding: 1.5rem;
        margin: 2rem 0;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .related-post-card {
        padding: 1.25rem;
    }
    
    .related-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .related-posts {
        padding: 1rem;
        margin: 1.5rem 0;
    }
    
    .related-post-card {
        padding: 1rem;
    }
    
    .related-posts h3 {
        font-size: 1.3em;
    }
    
    .related-post-title {
        font-size: 1.1em;
    }
}

/* Blog Post Sidebar Layout */
.blog-post-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    max-width: 1200px;
    margin: 4rem auto 6rem auto;
    padding: 2rem 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Ensure proper page margins for blog posts */
body .blog-post-container {
    margin-top: 4rem;
    margin-bottom: 6rem;
}

.blog-content {
    min-width: 0; /* Prevents overflow issues */
    padding: 2rem;
    border-right: 1px solid #e9ecef;
    background: white;
}

.blog-post-header {
    margin-bottom: 2rem;
}

.blog-post-header h1 {
    margin: 0 0 1rem 0;
    font-size: 2.2em;
    line-height: 1.2;
    color: #333;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #666;
    font-size: 0.9em;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.blog-post-tags {
    display: flex;
    gap: 0.5rem;
}

.blog-post-tags .tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 500;
}

.blog-post-content {
    line-height: 1.6;
    font-size: 1.1em;
}

.blog-post-content h2 {
    margin: 2rem 0 1rem 0;
    font-size: 1.6em;
    color: #333;
}

.blog-post-content h3 {
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1.3em;
    color: #333;
}

/* Sidebar Styling */
.blog-sidebar {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.2em;
    color: #333;
    border-bottom: 2px solid #0066cc;
    padding-bottom: 0.5rem;
}

/* Related Posts Sidebar */
.related-posts-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-post-sidebar-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.related-post-sidebar-item:hover {
    border-color: #0066cc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.related-post-sidebar-title {
    margin: 0 0 0.5rem 0;
    font-size: 1em;
    line-height: 1.3;
}

.related-post-sidebar-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-post-sidebar-title a:hover,
.related-post-sidebar-title a:focus {
    color: #0066cc;
    text-decoration: underline;
}

.related-post-sidebar-description {
    margin: 0 0 0.5rem 0;
    color: #666;
    font-size: 0.85em;
    line-height: 1.4;
}

.related-post-sidebar-date {
    font-size: 0.8em;
    color: #888;
    font-weight: 500;
}

/* Book Promo Sidebar */
.book-promo-sidebar {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
}

.book-cover-sidebar {
    margin-bottom: 1rem;
}

.book-cover-sidebar-image {
    width: 120px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.book-title-sidebar {
    margin: 0 0 0.5rem 0;
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
}

.book-subtitle-sidebar {
    margin: 0 0 1rem 0;
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    line-height: 1.3;
}

.book-price-sidebar {
    font-size: 1.4em;
    font-weight: bold;
    color: #0066cc;
    margin-bottom: 1rem;
}

.book-actions-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.book-buy-btn-sidebar,
.book-info-btn-sidebar {
    padding: 0.6rem 1rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    transition: all 0.2s ease;
    font-size: 0.9em;
    text-align: center;
}

.book-buy-btn-sidebar {
    background-color: #ff9500;
    color: white;
}

.book-buy-btn-sidebar:hover,
.book-buy-btn-sidebar:focus {
    background-color: #e6850e;
    color: white;
    text-decoration: none;
}

.book-info-btn-sidebar {
    background-color: #6c757d;
    color: white;
}

.book-info-btn-sidebar:hover,
.book-info-btn-sidebar:focus {
    background-color: #545b62;
    color: white;
    text-decoration: none;
}

.book-features-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.book-features-sidebar li {
    padding: 0.25rem 0;
    color: #333;
    font-size: 0.85em;
    line-height: 1.3;
}

.book-features-sidebar li::before {
    content: "✓";
    color: #28a745;
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Responsive Design for Sidebar Layout */
@media (max-width: 1024px) {
    .blog-post-container {
        grid-template-columns: 1fr 280px;
        gap: 1.5rem;
    }
    
    .blog-sidebar {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .blog-post-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1rem;
    }
    
    .blog-sidebar {
        position: static;
        order: -1; /* Move sidebar above content on mobile */
    }
    
    .related-posts-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .book-promo-sidebar {
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .blog-post-container {
        padding: 0.5rem;
    }
    
    .blog-sidebar {
        padding: 1rem;
        margin: 0 0.5rem;
    }
    
    .related-posts-sidebar {
        grid-template-columns: 1fr;
    }
    
    .blog-post-header h1 {
        font-size: 1.8em;
    }
    
    .book-cover-sidebar-image {
        width: 100px;
    }
    
    .book-title-sidebar {
        font-size: 1em;
    }
    
    .book-price-sidebar {
        font-size: 1.2em;
    }
}
