/* Article Widget Component Styles */

/* Widget container */
.article-widget {
    display: block;
    box-shadow: var(--card-shadow);
}

/* Filing cabinet tab styles */
.article-perspective-tabs {
    margin-bottom: 0;
    position: relative;
}

/* Loading indicator for perspective switching */
.perspective-loading {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    z-index: 10;
}

.tab-container {
    display: flex;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    overflow: hidden;
}

.tab {
    flex: 1;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    font-size: var(--font-size-xs); /* 12px for mobile */
    text-align: center;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    position: relative;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab:last-child {
    border-right: none;
}

.tab:hover {
    color: #495057;
    background: #e9ecef;
    text-decoration: none;
}

.tab.active {
    background: white;
    color: #126E51;
    font-weight: 600;
    border-bottom: none;
    z-index: 1;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: white;
}

/* Article content container */
.article-content {
    background: white;
    padding: 2rem;
    border: 1px solid #dee2e6;
    border-top: none;
    position: relative;
}

/* Article header styles */
.article-header {
    margin-bottom: 2rem;
}

.article-title {
    font-size: 1.625rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

/* Article body styles */
.article-body {
    font-size: 1.125rem;
    line-height: 1.75;
    color: #374151;
}

/* H2 - Major sections */
.article-body h2 {
    font-size: 1.25rem;
    font-weight: 500;
    color: #1a202c;
    line-height: 1.4;
    margin-top: 2rem;
    margin-bottom: 1rem;
    letter-spacing: normal;
}

/* H3 - Subsections */
.article-body h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
    line-height: 1.4;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* H4 - Minor headings (if needed) */
.article-body h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.4;
    margin-top: 1.75rem;
    margin-bottom: 0.875rem;
}

/* Paragraphs */
.article-body p {
    font-size: 1rem;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

/* Ensure proper spacing between elements */
.article-body > *:first-child {
    margin-top: 0;
}

.article-body > *:last-child {
    margin-bottom: 0;
}

.no-content-message {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Article header image styles with blur padding effect */
.article-header-image {
    width: 100%;
    margin: 0 0 2rem 0;
    text-align: left;
}

/* Hero image container with horizontal blur padding effect */
.hero-image-container {
    position: relative;
    width: 100%;
    height: 400px; /* Desktop height - need fixed height for absolute positioning */
    overflow: hidden;
    background-color: #f8f9fa; /* Fallback background */
}

/* Blurred background that fills the container horizontally */
.hero-blur-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(20px);
    transform: scale(1.1); /* Slightly scale to avoid blur edge artifacts */
    z-index: 1;
    /* Performance optimizations */
    will-change: filter;
    backface-visibility: hidden;
    /* Ensure smooth blending with main image */
    opacity: 0.8;
}

/* Main sharp image - maintain natural proportions, never crop */
.hero-main-image {
    position: absolute;
    z-index: 2;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* Ensures no cropping, maintains aspect ratio */
    display: block;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Perfect centering */
    /* Smooth transitions */
    transition: all 0.3s ease;
    /* Ensure crisp rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Set text size to xs */
    font-size: var(--font-size-xs);
}

/* Legacy support for old img structure */
.article-header-image img:not(.hero-main-image) {
    width: auto;
    height: auto;
    max-height: 500px;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.article-header-image figcaption {
    font-size: var(--font-size-xs); /* 12px - same as paragraphs on mobile */
    color: #6b7280;
    font-style: italic;
    margin-top: 0.75rem;
    padding-left: 1rem;
    position: relative;
    text-align: left;
}

.article-header-image figcaption::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #d1d5db;
    border-radius: 2px;
}

.article-image-placeholder {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #9ca3af;
}

.article-image-placeholder i {
    font-size: 4rem;
}

/* Article Navigation */
.article-navigation {
    margin-top: 3rem;
    margin-bottom: 2rem;
    border-top: 2px solid #e5e7eb;
}

.nav-section {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.nav-article {
    flex: 1;
    max-width: 48%;
}

.nav-article.next {
    text-align: right;
}

.nav-article-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.nav-article-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: inherit;
    text-decoration: none;
}

.nav-article-image {
    width: 100%;
    height: 120px; /* Fixed height for consistent appearance */
    object-fit: cover;
    object-position: center;
    background: #f3f4f6;
    border-radius: 4px 4px 0 0;
}

.nav-article-content {
    padding: 1rem;
}

.nav-article-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.nav-article-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nav-article-meta {
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-category-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.nav-article.previous .nav-article-label::before {
    content: "← ";
}

.nav-article.next .nav-article-label::after {
    content: " →";
}

/* Responsive Breakpoints - Isolated Ranges */

/* Mobile Small: 0-374px (Base styles - no media query needed) */
.hero-image-container {
    height: 180px;
}

.hero-blur-background {
    filter: blur(10px);
}

.article-content {
    padding: 0.75rem;
}

.article-title {
    font-size: var(--font-size-md); /* 16px - one size up from sm h2 on mobile */
}

.article-body h2 {
    font-size: var(--font-size-sm); /* 14px - one size up from xs paragraphs */
    margin-top: 1.25rem;
    margin-bottom: 0.625rem;
}

.article-body h3 {
    font-size: 0.875rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.article-body h4 {
    font-size: 0.8125rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.article-body p {
    font-size: var(--font-size-xs); /* 12px for mobile */
    line-height: 1.6;
    margin-bottom: 1rem;
}

.nav-section {
    flex-direction: column;
    gap: 1rem;
}

.nav-article {
    max-width: 100%;
}

.nav-article.next {
    text-align: left;
}

.tab {
    font-size: var(--font-size-xs); /* 12px for mobile */
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Medium: 375px-424px */
@media (min-width: 375px) and (max-width: 424px) {
    .hero-image-container {
        height: 200px;
    }
    
    .hero-blur-background {
        filter: blur(10px);
    }
    
    .article-content {
        padding: 0.75rem;
    }
    
    .article-title {
        font-size: var(--font-size-md); /* 16px - one size up from sm h2 on mobile */
    }
    
    .article-header-image figcaption {
        font-size: var(--font-size-xs); /* 12px - same as paragraphs on mobile */
    }
    
    .article-body h2 {
        font-size: var(--font-size-sm); /* 14px - one size up from xs paragraphs */
        margin-top: 1.25rem;
        margin-bottom: 0.625rem;
    }
    
    .article-body h3 {
        font-size: 0.875rem;
        margin-top: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .article-body h4 {
        font-size: 0.8125rem;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .article-body p {
        font-size: var(--font-size-xs); /* 12px for mobile */
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    .nav-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-article {
        max-width: 100%;
    }
    
    .nav-article.next {
        text-align: left;
    }
    
    .tab {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Mobile Large: 425px-767px */
@media (min-width: 425px) and (max-width: 767px) {
    .hero-image-container {
        height: 250px;
    }
    
    .hero-blur-background {
        filter: blur(15px);
    }
    
    .article-content {
        padding: 1rem;
    }
    
    .article-title {
        font-size: var(--font-size-md); /* 16px - one size up from sm h2 on mobile */
    }
    
    .article-header-image figcaption {
        font-size: var(--font-size-xs); /* 12px - same as paragraphs on mobile */
    }
    
    .article-body h2 {
        font-size: var(--font-size-sm); /* 14px - one size up from xs paragraphs */
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .article-body h3 {
        font-size: 0.9375rem;
        margin-top: 1.5rem;
        margin-bottom: 0.625rem;
    }
    
    .article-body h4 {
        font-size: 0.875rem;
        margin-top: 1.25rem;
        margin-bottom: 0.625rem;
    }
    
    .article-body p {
        font-size: var(--font-size-xs); /* 12px for mobile */
        line-height: 1.65;
        margin-bottom: 1.125rem;
    }
    
    .nav-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-article {
        max-width: 100%;
    }
    
    .nav-article.next {
        text-align: left;
    }
    
    .tab {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Tablet: 768px-1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero-image-container {
        height: 300px;
    }
    
    .article-content {
        padding: 1.5rem;
    }
    
    .article-title {
        font-size: var(--font-size-lg); /* 18px - one size up from md h2 on tablet */
    }
    
    .article-header-image figcaption {
        font-size: var(--font-size-sm); /* 14px - same as paragraphs on tablet */
    }
    
    .article-body h2 {
        font-size: var(--font-size-md); /* 16px - one size up from sm paragraphs */
        margin-top: 1.75rem;
        margin-bottom: 0.875rem;
    }
    
    .article-body h3 {
        font-size: 1rem;
        margin-top: 1.75rem;
        margin-bottom: 0.75rem;
    }
    
    .article-body h4 {
        font-size: 0.9375rem;
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .article-body p {
        font-size: var(--font-size-sm); /* 14px for tablet */
        line-height: 1.7;
        margin-bottom: 1.25rem;
    }
    
    .tab {
        font-size: var(--font-size-sm); /* 14px for tablet */
    }
}

/* Laptop: 1024px-1439px */
@media (min-width: 1024px) and (max-width: 1439px) {
    .hero-image-container {
        height: 400px;
    }
    
    .article-title {
        font-size: var(--font-size-xl); /* 20px - one size up from lg h2 on laptop */
    }
    
    .article-header-image figcaption {
        font-size: var(--font-size-sm); /* 14px - same as paragraphs on laptop */
    }
    
    .article-body h2 {
        font-size: var(--font-size-lg); /* 18px - one size up from sm paragraphs */
        margin-top: 2rem;
        margin-bottom: 0.875rem;
    }
    
    .article-body h3 {
        font-size: 1rem;
        margin-top: 1.875rem;
        margin-bottom: 0.875rem;
    }
    
    .article-body p {
        font-size: var(--font-size-sm); /* 14px for laptop */
        line-height: 1.75;
    }
    
    .tab {
        font-size: var(--font-size-sm); /* 14px for laptop */
    }
}

/* Laptop Large: 1440px+ */
@media (min-width: 1440px) {
    .hero-image-container {
        height: 400px;
    }
    
    .tab {
        font-size: var(--font-size-sm); /* 14px for laptop large */
    }
    
    .article-body p {
        font-size: var(--font-size-sm); /* 14px for laptop large */
        line-height: 1.75;
    }
    
    .article-body h2 {
        font-size: var(--font-size-lg); /* 18px - one size up from sm paragraphs */
        margin-top: 2rem;
        margin-bottom: 0.875rem;
    }
    
    .article-title {
        font-size: var(--font-size-xl); /* 20px - one size up from lg h2 on laptop large */
    }
    
    .article-header-image figcaption {
        font-size: var(--font-size-sm); /* 14px - same as paragraphs on laptop large */
    }
}