/**
 * Article Content Enhancements
 * Beautiful styling for H3, links, images, and zoom functionality
 * Last Updated: January 12, 2026
 */

/* ==========================================================================
   H3 HEADINGS - Left Accent Bar Style
   Complements the H2 gradient underline with a vertical gradient bar
   ========================================================================== */

.article-content h3,
.page-content h3 {
    position: relative;
    padding-left: 16px;
    margin-top: 1.75em;
    margin-bottom: 0.75em;
    font-weight: 600;
    color: #2c3e50;
    transition: color 0.2s ease;
}

.article-content h3::before,
.page-content h3::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.15em;
    bottom: 0.15em;
    width: 4px;
    background: linear-gradient(180deg, #0052cc 0%, #00c453 100%);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Subtle hover effect on H3 */
.article-content h3:hover::before,
.page-content h3:hover::before {
    width: 5px;
    box-shadow: 0 0 8px rgba(0, 82, 204, 0.3);
}

/* ==========================================================================
   H4 HEADINGS - Dot Indicator Style
   Subtle styling for sub-sub-sections
   ========================================================================== */

.article-content h4,
.page-content h4 {
    position: relative;
    padding-left: 20px;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #34495e;
    font-size: 1.1em;
}

.article-content h4::before,
.page-content h4::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #0052cc 0%, #00c453 100%);
    border-radius: 50%;
}

/* ==========================================================================
   LINKS - Animated Underline Effect
   Elegant hover animation with gradient underline
   ========================================================================== */

.article-content a:not(.btn):not(.share-btn):not(.badge):not([class*="article-"]),
.page-content a:not(.btn):not(.share-btn):not(.badge) {
    color: #0052cc;
    text-decoration: none;
    position: relative;
    font-weight: 500;
    transition: color 0.2s ease;
    background-image: linear-gradient(90deg, #0052cc 0%, #00c453 100%);
    background-repeat: no-repeat;
    background-size: 0% 2px;
    background-position: left bottom;
    padding-bottom: 2px;
}

.article-content a:not(.btn):not(.share-btn):not(.badge):not([class*="article-"]):hover,
.page-content a:not(.btn):not(.share-btn):not(.badge):hover {
    color: #00c453;
    background-size: 100% 2px;
}

/* External link indicator */
.article-content a[target="_blank"]:not(.btn):not(.share-btn)::after,
.page-content a[target="_blank"]:not(.btn):not(.share-btn)::after {
    content: "\f35d"; /* Font Awesome external link icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.7em;
    margin-left: 4px;
    opacity: 0.6;
    vertical-align: super;
}

/* Visited link style */
.article-content a:visited:not(.btn):not(.share-btn):not(.badge):not([class*="article-"]),
.page-content a:visited:not(.btn):not(.share-btn):not(.badge) {
    color: #6c5ce7;
}

/* ==========================================================================
   IMAGES - Beautiful Frames and Shadows
   Professional appearance with subtle depth
   ========================================================================== */

.article-content img:not(.emoji):not(.avatar),
.page-content img:not(.emoji):not(.avatar) {
    border-radius: 8px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.07),
        0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: zoom-in;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.article-content img:not(.emoji):not(.avatar):hover,
.page-content img:not(.emoji):not(.avatar):hover {
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Image figures (for captioned images) */
.article-content figure,
.page-content figure {
    margin: 2em 0;
    text-align: center;
}

.article-content figure img,
.page-content figure img {
    margin-bottom: 0.75em;
}

.article-content figcaption,
.page-content figcaption {
    font-size: 0.9em;
    color: #6c757d;
    font-style: italic;
    padding: 0 1em;
}

/* Article inner images specific styling */
.article-inner-image {
    margin: 2em auto;
    max-width: 100%;
}

.article-inner-image img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

/* Section images that appear after H2 */
.article-image {
    margin: 1.5em 0 2em 0;
}

.article-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ==========================================================================
   IMAGE LIGHTBOX - Click to Zoom
   Full-screen overlay for image viewing
   ========================================================================== */

.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: zoom-out;
    backdrop-filter: blur(5px);
}

.image-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.image-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.image-lightbox.active img {
    transform: scale(1);
}

/* Close button for lightbox */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-close::before,
.lightbox-close::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

.lightbox-close::before {
    transform: rotate(45deg);
}

.lightbox-close::after {
    transform: rotate(-45deg);
}

/* Image caption in lightbox */
.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95em;
    text-align: center;
    max-width: 80%;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

/* Navigation arrows for multiple images */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #fff;
    font-size: 24px;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

/* Image counter */
.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 30px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
}

/* ==========================================================================
   READ ALSO BLOCK - Enhanced Styling
   Better visual separation for related articles
   ========================================================================== */

.related-articles-block,
.read-also-block {
    background: linear-gradient(135deg, rgba(0, 82, 204, 0.03) 0%, rgba(0, 196, 83, 0.03) 100%);
    border-left: 4px solid;
    border-image: linear-gradient(180deg, #0052cc 0%, #00c453 100%) 1;
    padding: 20px 24px;
    margin: 2em 0;
    border-radius: 0 8px 8px 0;
}

.related-articles-block h5,
.read-also-block h5 {
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1em;
}

.related-articles-block ul,
.read-also-block ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.related-articles-block li,
.read-also-block li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.related-articles-block li:last-child,
.read-also-block li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.related-articles-block a,
.read-also-block a {
    color: #0052cc !important;
    font-weight: 500;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.related-articles-block a::before,
.read-also-block a::before {
    content: "\f105"; /* Font Awesome chevron */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.8em;
    color: #00c453;
    transition: transform 0.2s ease;
}

.related-articles-block a:hover,
.read-also-block a:hover {
    color: #00c453 !important;
}

.related-articles-block a:hover::before,
.read-also-block a:hover::before {
    transform: translateX(4px);
}

/* ==========================================================================
   LISTS - Better Visual Hierarchy
   Improved bullet points and spacing
   ========================================================================== */

.article-content ul:not([class]),
.page-content ul:not([class]) {
    list-style: none;
    padding-left: 0;
}

.article-content ul:not([class]) li,
.page-content ul:not([class]) li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
}

.article-content ul:not([class]) li::before,
.page-content ul:not([class]) li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #0052cc 0%, #00c453 100%);
    border-radius: 50%;
}

/* Nested lists - different style */
.article-content ul:not([class]) ul li::before,
.page-content ul:not([class]) ul li::before {
    background: transparent;
    border: 2px solid #0052cc;
    width: 6px;
    height: 6px;
}

.article-content ul:not([class]) ul ul li::before,
.page-content ul:not([class]) ul ul li::before {
    border-radius: 0;
    transform: rotate(45deg);
    width: 5px;
    height: 5px;
}

/* Ordered lists - gradient numbers */
.article-content ol:not([class]),
.page-content ol:not([class]) {
    list-style: none;
    padding-left: 0;
    counter-reset: custom-counter;
}

.article-content ol:not([class]) > li,
.page-content ol:not([class]) > li {
    position: relative;
    padding-left: 40px;
    margin-bottom: 12px;
    counter-increment: custom-counter;
}

.article-content ol:not([class]) > li::before,
.page-content ol:not([class]) > li::before {
    content: counter(custom-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #0052cc 0%, #00c453 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.85em;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   TABLES - Clean Modern Style
   ========================================================================== */

.article-content table,
.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.article-content th,
.page-content th {
    background: linear-gradient(135deg, #0052cc 0%, #00c453 100%);
    color: #fff;
    font-weight: 600;
    padding: 14px 16px;
    text-align: left;
}

.article-content td,
.page-content td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.article-content tr:last-child td,
.page-content tr:last-child td {
    border-bottom: none;
}

.article-content tr:hover td,
.page-content tr:hover td {
    background: rgba(0, 82, 204, 0.03);
}

/* ==========================================================================
   DARK MODE ADJUSTMENTS
   ========================================================================== */

[data-theme="dark"] .article-content h3,
[data-theme="dark"] .page-content h3 {
    color: #e9ecef;
}

[data-theme="dark"] .article-content h4,
[data-theme="dark"] .page-content h4 {
    color: #ced4da;
}

[data-theme="dark"] .article-content a:not(.btn):not(.share-btn):not(.badge):not([class*="article-"]),
[data-theme="dark"] .page-content a:not(.btn):not(.share-btn):not(.badge) {
    color: #6ea8fe;
}

[data-theme="dark"] .article-content a:not(.btn):not(.share-btn):not(.badge):not([class*="article-"]):hover,
[data-theme="dark"] .page-content a:not(.btn):not(.share-btn):not(.badge):hover {
    color: #00c453;
}

[data-theme="dark"] .article-content img:not(.emoji):not(.avatar),
[data-theme="dark"] .page-content img:not(.emoji):not(.avatar) {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.2),
        0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .related-articles-block,
[data-theme="dark"] .read-also-block {
    background: linear-gradient(135deg, rgba(0, 82, 204, 0.1) 0%, rgba(0, 196, 83, 0.1) 100%);
}

[data-theme="dark"] .related-articles-block h5,
[data-theme="dark"] .read-also-block h5 {
    color: #e9ecef;
}

[data-theme="dark"] .related-articles-block li,
[data-theme="dark"] .read-also-block li {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .article-content table,
[data-theme="dark"] .page-content table {
    background: #2d2d2d;
}

[data-theme="dark"] .article-content td,
[data-theme="dark"] .page-content td {
    border-color: #404040;
}

[data-theme="dark"] .article-content tr:hover td,
[data-theme="dark"] .page-content tr:hover td {
    background: rgba(0, 82, 204, 0.1);
}

[data-theme="dark"] .article-content ul:not([class]) li::before,
[data-theme="dark"] .page-content ul:not([class]) li::before {
    box-shadow: 0 0 4px rgba(0, 196, 83, 0.3);
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 767px) {
    .article-content h3,
    .page-content h3 {
        padding-left: 14px;
        font-size: 1.25em;
    }

    .article-content h3::before,
    .page-content h3::before {
        width: 3px;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }

    .lightbox-nav.prev {
        left: 10px;
    }

    .lightbox-nav.next {
        right: 10px;
    }

    .related-articles-block,
    .read-also-block {
        padding: 16px 18px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .article-content a,
    .article-content img,
    .article-content h3::before,
    .image-lightbox,
    .image-lightbox img {
        transition: none;
    }
}

/* ==========================================================================
   SECTION TEMPLATES - Branded styling for standard sections
   FAQ, Conclusion, Summary, Key Takeaways, Final Thoughts, References
   No images needed - pure CSS with icons
   ========================================================================== */

/* Base template section styling */
.section-template {
    position: relative;
    margin: 2em 0;
    padding: 24px 24px 24px 70px;
    border-radius: 12px;
    border-left: 4px solid;
}

.section-template::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 20px;
    top: 24px; /* Align with the H2 heading at top */
    font-size: 28px;
    opacity: 0.9;
}

.section-template h2 {
    margin: 0 0 0.5em 0 !important;
    padding: 0 !important;
    font-size: 1.4em;
}

.section-template h2::after {
    display: none !important; /* Hide the default H2 gradient line */
}

/* FAQ Section - Question mark, Teal/Blue theme */
.section-faq {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.08) 0%, rgba(0, 150, 199, 0.08) 100%);
    border-color: #00bcd4;
}

.section-faq::before {
    content: "\f059"; /* question-circle */
    color: #00bcd4;
}

.section-faq h2 {
    color: #00838f;
}

/* Conclusion Section - Checkmark, Green theme */
.section-conclusion {
    background: linear-gradient(135deg, rgba(0, 196, 83, 0.08) 0%, rgba(0, 150, 65, 0.08) 100%);
    border-color: #00c453;
}

.section-conclusion::before {
    content: "\f058"; /* check-circle */
    color: #00c453;
}

.section-conclusion h2 {
    color: #00873d;
}

/* Summary Section - List, Purple theme */
.section-summary {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.08) 0%, rgba(123, 31, 162, 0.08) 100%);
    border-color: #9c27b0;
}

.section-summary::before {
    content: "\f03a"; /* list-alt */
    color: #9c27b0;
}

.section-summary h2 {
    color: #7b1fa2;
}

/* Key Takeaways Section - Lightbulb, Gold theme */
.section-takeaways {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.12) 0%, rgba(255, 160, 0, 0.12) 100%);
    border-color: #ffc107;
}

.section-takeaways::before {
    content: "\f0eb"; /* lightbulb */
    color: #f9a825;
}

.section-takeaways h2 {
    color: #f57c00;
}

/* Final Thoughts Section - Comment/Thought, Orange theme */
.section-thoughts {
    background: linear-gradient(135deg, rgba(255, 87, 34, 0.08) 0%, rgba(230, 74, 25, 0.08) 100%);
    border-color: #ff5722;
}

.section-thoughts::before {
    content: "\f4ad"; /* comment-dots */
    color: #ff5722;
}

.section-thoughts h2 {
    color: #e64a19;
}

/* References/Sources Section - Book, Gray theme */
.section-references {
    background: linear-gradient(135deg, rgba(96, 125, 139, 0.08) 0%, rgba(69, 90, 100, 0.08) 100%);
    border-color: #607d8b;
}

.section-references::before {
    content: "\f02d"; /* book */
    color: #607d8b;
}

.section-references h2 {
    color: #455a64;
}

/* Wrap Up Section - Same as Conclusion */
.section-wrapup {
    background: linear-gradient(135deg, rgba(0, 196, 83, 0.08) 0%, rgba(0, 150, 65, 0.08) 100%);
    border-color: #00c453;
}

.section-wrapup::before {
    content: "\f058"; /* check-circle */
    color: #00c453;
}

.section-wrapup h2 {
    color: #00873d;
}

/* Dark mode for section templates */
[data-theme="dark"] .section-template {
    border-width: 4px;
}

[data-theme="dark"] .section-faq {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.15) 0%, rgba(0, 150, 199, 0.15) 100%);
}

[data-theme="dark"] .section-faq h2 {
    color: #4dd0e1;
}

[data-theme="dark"] .section-conclusion,
[data-theme="dark"] .section-wrapup {
    background: linear-gradient(135deg, rgba(0, 196, 83, 0.15) 0%, rgba(0, 150, 65, 0.15) 100%);
}

[data-theme="dark"] .section-conclusion h2,
[data-theme="dark"] .section-wrapup h2 {
    color: #69f0ae;
}

[data-theme="dark"] .section-summary {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.15) 0%, rgba(123, 31, 162, 0.15) 100%);
}

[data-theme="dark"] .section-summary h2 {
    color: #ce93d8;
}

[data-theme="dark"] .section-takeaways {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 160, 0, 0.2) 100%);
}

[data-theme="dark"] .section-takeaways h2 {
    color: #ffca28;
}

[data-theme="dark"] .section-thoughts {
    background: linear-gradient(135deg, rgba(255, 87, 34, 0.15) 0%, rgba(230, 74, 25, 0.15) 100%);
}

[data-theme="dark"] .section-thoughts h2 {
    color: #ff8a65;
}

[data-theme="dark"] .section-references {
    background: linear-gradient(135deg, rgba(96, 125, 139, 0.15) 0%, rgba(69, 90, 100, 0.15) 100%);
}

[data-theme="dark"] .section-references h2 {
    color: #90a4ae;
}

/* Mobile responsiveness for section templates */
@media (max-width: 767px) {
    .section-template {
        padding: 20px 16px 20px 56px;
    }

    .section-template::before {
        left: 14px;
        font-size: 24px;
    }

    .section-template h2 {
        font-size: 1.2em;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .article-content img {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .article-content a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    .image-lightbox {
        display: none !important;
    }
}
