/* Resources Page Styles */

/* ===== LIGHT THEME OVERRIDES ===== */
[data-theme="light"] .resources-hero .hero-title {
    background: linear-gradient(135deg, var(--fg) 0%, #0891B2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .resources-hero .hero-subtitle {
    color: rgba(15, 23, 42, 0.7);
}

[data-theme="light"] .resources-hero .gradient-text {
    background: linear-gradient(135deg, var(--fg) 0%, #0891B2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== END LIGHT THEME OVERRIDES ===== */

/* Resources Hero Section - matches solutions/team pattern */
.resources-hero {
    position: relative;
    min-height: auto;
    display: flex;
    align-items: left;
    padding: 6rem 0 1rem 0;
    margin-top: 70px;
    overflow: hidden;
}

.resources-hero-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.resources-hero-content {
    position: relative;
    z-index: 1;
    text-align: left;
    max-width: 1000px;
}

.resources-hero .hero-title {
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.resources-hero .gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, #04D9FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.resources-hero .hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    line-height: 1.6;
}

/* Filter Tabs */
.resources-filters {
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--muted);
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.filter-btn.active {
    background: var(--cyan);
    color: var(--bg-primary);
    border-color: var(--cyan);
}

/* Section Labels */
.resources-section-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

/* Light theme section label */
[data-theme="light"] .resources-section-label {
    color: #0891B2;
}

/* Light theme guide icons */
[data-theme="light"] .guide-icon {
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.15), rgba(8, 145, 178, 0.1));
}

[data-theme="light"] .guide-icon svg {
    color: #0891B2;
}

/* Light theme link category badge */
[data-theme="light"] .link-category-badge {
    background: rgba(8, 145, 178, 0.15);
    color: #0891B2;
}

/* Light theme filter buttons */
[data-theme="light"] .filter-btn {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.1);
    color: rgba(15, 23, 42, 0.7);
}

[data-theme="light"] .filter-btn:hover {
    background: rgba(15, 23, 42, 0.1);
    color: var(--fg);
}

[data-theme="light"] .filter-btn.active {
    background: #0891B2;
    color: #FFFFFF;
    border-color: #0891B2;
}

/* Articles Grid - Resources Page Override */
#articles .articles-grid,
.resources-page .articles-grid,
section#articles .articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    width: 100%;
    max-width: 100%;
    grid-auto-flow: initial;
    grid-auto-columns: initial;
    overflow-x: visible;
    padding-left: 0;
    padding-right: 0;
}

/* Article Card */
.article-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.article-thumbnail {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
}

.article-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-category {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-summary {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--gray-500);
}

.article-link {
    color: var(--cyan);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.3s ease;
}

.article-link:hover {
    gap: 0.5rem;
}

/* Guides Grid */
.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Guide Card */
.guide-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s ease;
}

.guide-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

.guide-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 255, 136, 0.1));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guide-icon svg {
    width: 24px;
    height: 24px;
    color: var(--cyan);
}

.guide-info {
    flex: 1;
}

.guide-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 0.5rem;
}

.guide-description {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.guide-download {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--cyan);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.guide-download:hover {
    text-decoration: underline;
}

/* Links Grid */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

/* Link Card */
.link-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--fg);
}

.link-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

.link-category-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--cyan);
    background: rgba(0, 212, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.link-info {
    flex: 1;
}

.link-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--fg);
    margin-bottom: 0.25rem;
}

.link-description {
    font-size: 0.8rem;
    color: var(--muted);
}

.link-arrow {
    color: var(--muted);
    transition: transform 0.3s ease, color 0.3s ease;
}

.link-card:hover .link-arrow {
    color: var(--cyan);
    transform: translateX(4px);
}

/* Article Detail Page */
.article-detail {
    padding-top: 8rem;
}

.article-detail-header {
    margin-bottom: 2rem;
}

.article-detail-category {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

/* Light theme article category label */
[data-theme="light"] .article-detail-category {
    color: #0891B2;
}

.article-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--fg);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-detail-meta {
    display: flex;
    gap: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--muted);
}

.article-detail-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.article-detail-content {
    text-align: left;
    max-width: 70%;
}

.article-detail-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cyan);
    margin: 2.5rem 0 1rem;
    counter-reset: article-ol-counter;
}

/* Light theme h2 styling */
[data-theme="light"] .article-detail-content h2 {
    color: #0891B2;
}

.article-detail-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cyan);
    margin: 2rem 0 0.75rem;
    counter-reset: article-ol-counter;
}

/* Light theme h3 styling */
[data-theme="light"] .article-detail-content h3 {
    color: #0891B2;
}

.article-detail-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.article-detail-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    list-style: none;
}

.article-detail-content ul > li {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--muted);
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
    position: relative;
}

.article-detail-content ul > li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--cyan);
    font-weight: bold;
}

/* Counter reset at article content level for continuous numbering */
.article-detail-content {
    counter-reset: article-ol-counter;
}

.article-detail-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    list-style: none;
    /* Don't reset counter here - inherit from parent for continuous numbering */
}

.article-detail-content ol > li {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--muted);
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
    position: relative;
    counter-increment: article-ol-counter;
}

.article-detail-content ol > li::before {
    content: counter(article-ol-counter) ".";
    position: absolute;
    left: -1.5rem;
    color: var(--cyan);
    font-weight: bold;
}

/* PDF Download Section */
.pdf-download-section {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.pdf-download-section h3 {
    font-size: 1.25rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.pdf-download-section p {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.pdf-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--cyan);
    color: #000000 !important;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pdf-download-btn:hover {
    background: #0BC5EA;
    color: #000000 !important;
    transform: translateY(-2px);
}

/* Light theme PDF download button */
[data-theme="light"] .pdf-download-btn {
    background: #0891B2;
    color: #FFFFFF !important;
}

[data-theme="light"] .pdf-download-btn:hover {
    background: #0E7490;
    color: #FFFFFF !important;
}

/* Back to Resources Link */
.back-to-resources {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--cyan);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: gap 0.3s ease;
}

.back-to-resources:hover {
    gap: 0.75rem;
}

/* Light theme back to resources link */
[data-theme="light"] .back-to-resources {
    color: #0891B2;
}

[data-theme="light"] .back-to-resources:hover {
    color: #0E7490;
}

/* Light theme article detail headers */
[data-theme="light"] .article-detail-content h2 {
    color: #0891B2;
}

/* PDF Link Styles in Article Content - Theme-aware */
/* With wrapper (preferred) */
.article-detail-content .pdf-link-wrapper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    background-color: var(--card);
    margin: 8px 0;
    transition: all 0.3s ease;
}

.article-detail-content .pdf-link-wrapper:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(4, 217, 255, 0.15);
}

/* Direct pdf-link styling (works with or without wrapper) */
.article-detail-content .pdf-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--accent);
    gap: 6px;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--card);
    margin: 8px 0;
}

.article-detail-content .pdf-link:hover {
    color: var(--fg);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(4, 217, 255, 0.15);
}

.article-detail-content .pdf-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: var(--accent);
    transition: stroke 0.3s ease;
}

.article-detail-content .pdf-link:hover svg {
    stroke: var(--fg);
}

.article-detail-content .pdf-link-text {
    font-weight: 500;
}

/* When inside wrapper, remove duplicate padding/border from link */
.article-detail-content .pdf-link-wrapper .pdf-link {
    padding: 0;
    border: none;
    background: none;
    margin: 0;
}

/* Light theme PDF link adjustments */
[data-theme="light"] .article-detail-content .pdf-link-wrapper {
    border-color: rgba(13, 148, 136, 0.2);
    background-color: rgba(13, 148, 136, 0.03);
}

[data-theme="light"] .article-detail-content .pdf-link-wrapper:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.15);
}

[data-theme="light"] .article-detail-content .pdf-link {
    color: var(--accent);
    border-color: rgba(13, 148, 136, 0.2);
    background-color: rgba(13, 148, 136, 0.03);
}

[data-theme="light"] .article-detail-content .pdf-link:hover {
    color: var(--fg);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.15);
}

[data-theme="light"] .article-detail-content .pdf-link svg {
    stroke: var(--accent);
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--muted);
    font-family: var(--font-mono);
}

/* Archive Section Styles */
#archive {
    padding-top: 1rem;
}

#archive .articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    grid-auto-flow: initial;
    grid-auto-columns: initial;
    overflow-x: visible;
    padding-left: 0;
    padding-right: 0;
}

/* Archive card - slightly muted compared to recent articles */
.archive-card {
    opacity: 0.95;
}

.archive-card:hover {
    opacity: 1;
}

/* Archive Action Buttons */
.archive-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Load More Button Container */
.load-more-container,
.collapse-container {
    display: flex;
    justify-content: center;
    padding: 1rem 0 2rem;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: var(--cyan);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.load-more-btn svg {
    transition: transform 0.3s ease;
}

.load-more-btn:hover svg {
    transform: translateY(2px);
}

/* Light theme load more button */
[data-theme="light"] .load-more-btn {
    background: rgba(8, 145, 178, 0.1);
    border-color: rgba(8, 145, 178, 0.3);
    color: #0891B2;
}

[data-theme="light"] .load-more-btn:hover {
    background: rgba(8, 145, 178, 0.2);
    border-color: rgba(8, 145, 178, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .resources-hero {
        min-height: auto;
        padding: 5rem 0 3rem 0;
    }

    .resources-hero .hero-title {
        font-size: clamp(2rem, 7vw, 3rem);
    }

    .resources-hero .hero-subtitle {
        font-size: 1rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }

    .article-detail-title {
        font-size: 1.75rem;
    }

    .article-detail-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .article-detail-content {
        max-width: 100%;
    }

    /* Filter badges wrap on mobile */
    .resources-filters {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .filter-btn {
        flex-shrink: 1;
    }
}

@media (max-width: 480px) {
    .resources-hero {
        padding: 4rem 0 2rem 0;
    }

    .resources-hero .hero-title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }

    .resources-hero .hero-subtitle {
        font-size: 0.9rem;
    }
}
