/* Toolbar Container */
.blog-reader-tools {
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #dee2e6;
    font-size: 14px;
    color: #333;
}

/* Grid layout for options */
.reader-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    align-items: end;
}

.reader-option-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reader-option-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
}

.reader-option-group.full-width {
    grid-column: 1 / -1;
}

@media (max-width: 576px) {
    .blog-reader-tools {
        padding: 15px;
    }
    .reader-options-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .reader-option-group.full-width {
        grid-column: span 2;
    }
}

/* Themes */
/* Base theme colors */
.reader-theme-white { background-color: #ffffff !important; color: #000000 !important; }
.reader-theme-lightgray { background-color: #f4f4f4 !important; color: #1a1a1a !important; }
.reader-theme-sepia { background-color: #fdf6e3 !important; color: #433422 !important; }
.reader-theme-contrast-light { background-color: #ffffff !important; color: #000000 !important; font-weight: 600 !important; }
.reader-theme-contrast-dark { background-color: #000000 !important; color: #ffffff !important; }
.reader-theme-darkgray { background-color: #2c2c2c !important; color: #e0e0e0 !important; }

/* Apply to inner text elements safely */
.reader-theme-white .post_body, .reader-theme-white .post_body p, .reader-theme-white .post_body span, .reader-theme-white .post_body li, .reader-theme-white h1, .reader-theme-white h2, .reader-theme-white h3, .reader-theme-white h4, .reader-theme-white h5, .reader-theme-white .fecha_post_view { color: #000000 !important; }
.reader-theme-lightgray .post_body, .reader-theme-lightgray .post_body p, .reader-theme-lightgray .post_body span, .reader-theme-lightgray .post_body li, .reader-theme-lightgray h1, .reader-theme-lightgray h2, .reader-theme-lightgray h3, .reader-theme-lightgray h4, .reader-theme-lightgray h5, .reader-theme-lightgray .fecha_post_view { color: #1a1a1a !important; }
.reader-theme-sepia .post_body, .reader-theme-sepia .post_body p, .reader-theme-sepia .post_body span, .reader-theme-sepia .post_body li, .reader-theme-sepia h1, .reader-theme-sepia h2, .reader-theme-sepia h3, .reader-theme-sepia h4, .reader-theme-sepia h5, .reader-theme-sepia .fecha_post_view { color: #433422 !important; }
.reader-theme-contrast-light .post_body, .reader-theme-contrast-light .post_body p, .reader-theme-contrast-light .post_body span, .reader-theme-contrast-light .post_body li, .reader-theme-contrast-light h1, .reader-theme-contrast-light h2, .reader-theme-contrast-light h3, .reader-theme-contrast-light h4, .reader-theme-contrast-light h5, .reader-theme-contrast-light .fecha_post_view { color: #000000 !important; font-weight: 600 !important; }
.reader-theme-contrast-dark .post_body, .reader-theme-contrast-dark .post_body p, .reader-theme-contrast-dark .post_body span, .reader-theme-contrast-dark .post_body li, .reader-theme-contrast-dark h1, .reader-theme-contrast-dark h2, .reader-theme-contrast-dark h3, .reader-theme-contrast-dark h4, .reader-theme-contrast-dark h5, .reader-theme-contrast-dark .fecha_post_view { color: #ffffff !important; }
.reader-theme-darkgray .post_body, .reader-theme-darkgray .post_body p, .reader-theme-darkgray .post_body span, .reader-theme-darkgray .post_body li, .reader-theme-darkgray h1, .reader-theme-darkgray h2, .reader-theme-darkgray h3, .reader-theme-darkgray h4, .reader-theme-darkgray h5, .reader-theme-darkgray .fecha_post_view { color: #e0e0e0 !important; }

/* Adjust Toolbar colors in dark modes to remain usable */
.reader-theme-contrast-dark .blog-reader-tools,
.reader-theme-darkgray .blog-reader-tools {
    background: #444 !important;
    border-color: #555 !important;
    color: #fff !important;
}
.reader-theme-contrast-dark .blog-reader-tools select, 
.reader-theme-contrast-dark .blog-reader-tools button,
.reader-theme-darkgray .blog-reader-tools select, 
.reader-theme-darkgray .blog-reader-tools button {
    background-color: #333 !important;
    color: #fff !important;
    border-color: #666 !important;
}

/* Typography Options */
.reader-font-serif .post_body, .reader-font-serif .post_body p, .reader-font-serif .post_body li, .reader-font-serif .post_body span { font-family: Georgia, 'Times New Roman', serif !important; }
.reader-font-sans .post_body, .reader-font-sans .post_body p, .reader-font-sans .post_body li, .reader-font-sans .post_body span { font-family: Arial, Helvetica, sans-serif !important; }

/* Font Size Options */
.reader-font-small .post_body, .reader-font-small .post_body p, .reader-font-small .post_body li, .reader-font-small .post_body div { font-size: 14px !important; }
.reader-font-normal .post_body, .reader-font-normal .post_body p, .reader-font-normal .post_body li, .reader-font-normal .post_body div { font-size: 16px !important; }
.reader-font-large .post_body, .reader-font-large .post_body p, .reader-font-large .post_body li, .reader-font-large .post_body div { font-size: 20px !important; }
.reader-font-xlarge .post_body, .reader-font-xlarge .post_body p, .reader-font-xlarge .post_body li, .reader-font-xlarge .post_body div { font-size: 24px !important; }

/* Line Height Options */
.reader-line-normal .post_body, .reader-line-normal .post_body p, .reader-line-normal .post_body li { line-height: 1.5 !important; }
.reader-line-medium .post_body, .reader-line-medium .post_body p, .reader-line-medium .post_body li { line-height: 1.8 !important; }
.reader-line-wide .post_body, .reader-line-wide .post_body p, .reader-line-wide .post_body li { line-height: 2.2 !important; }

/* Reading Mode active state (layout focus) */
.reader-mode-active {
    box-shadow: none !important;
    max-width: 800px;
    margin: 0 auto;
    border: none !important;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    .article-reader-container, .article-reader-container * {
        visibility: visible;
    }
    .article-reader-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Hide non-content elements inside article */
    .blog-reader-tools, 
    .fb-comments, 
    .btn, 
    #myCarousel .carousel-control-prev, 
    #myCarousel .carousel-control-next, 
    .carousel-indicators {
        display: none !important;
    }
    
    /* Force high contrast for printing regardless of dark theme selected */
    .article-reader-container, 
    .article-reader-container *,
    .reader-theme-contrast-dark .post_body, 
    .reader-theme-contrast-dark .post_body p,
    .reader-theme-darkgray .post_body,
    .reader-theme-darkgray .post_body p {
        background-color: #fff !important;
        color: #000 !important;
    }
}
