/**
 * Shared layout for /content and /articles hub pages.
 * Color tokens are overridden by theme-professional.css on light pages.
 */

.trainings-hero {
    position: relative;
    padding: 6.5rem 0 1.25rem;
    text-align: center;
    overflow: hidden;
}

.trainings-hero .hero-decor {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.trainings-hero .hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 169, 224, 0.12) 0%, transparent 70%);
    filter: blur(60px);
}

.topic-nav-wrapper {
    position: sticky;
    top: calc(45px + var(--header-height, 80px));
    z-index: 900;
    padding: 0.65rem 0;
    margin-bottom: 0.75rem;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.topic-nav-wrapper.scrolled {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border-glass, #e2e8f0);
    backdrop-filter: blur(12px);
}

.topic-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    padding: 0.25rem 0;
    margin: 0;
    list-style: none;
    width: 100%;
}

.topic-list li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.topic-link {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--border-glass, #e2e8f0);
    color: var(--text-secondary, #475569);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.topic-link:hover,
.topic-link.active {
    color: var(--accent-primary, #ff3621);
    background: rgba(255, 54, 33, 0.08);
    border-color: rgba(255, 54, 33, 0.25);
}

.filter-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.5rem;
    margin-bottom: 1.25rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--border-glass, #e2e8f0);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.06));
}

.filter-container.filter-sticky {
    position: sticky;
    top: calc(45px + var(--header-height, 80px) + 52px);
    z-index: 850;
}

.search-wrapper {
    flex: 1 1 220px;
    display: flex;
    align-items: center;
    min-width: min(100%, 220px);
    height: 48px;
    padding: 0 1rem;
    border-radius: 12px;
    background: var(--bg-tertiary, #eef1f6);
    border: 1px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-wrapper:focus-within {
    border-color: rgba(255, 54, 33, 0.25);
    box-shadow: 0 0 0 2px rgba(255, 54, 33, 0.08);
}

.search-icon {
    color: var(--text-muted, #64748b);
    margin-right: 0.75rem;
}

.search-wrapper .search-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary, #0f172a);
    font-size: 0.95rem;
    outline: none;
}

.search-wrapper .search-input::placeholder {
    color: var(--text-muted, #64748b);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-divider {
    width: 1px;
    height: 24px;
    background: var(--border-glass, #e2e8f0);
    flex-shrink: 0;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 12px;
    background: var(--bg-tertiary, #eef1f6);
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary, #475569);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.filter-pill:hover {
    color: var(--text-primary, #0f172a);
}

.filter-pill.active {
    background: rgba(255, 54, 33, 0.1);
    color: var(--accent-primary, #ff3621);
    border-color: rgba(255, 54, 33, 0.2);
    font-weight: 600;
}

.resource-count {
    margin-left: auto;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}

.resource-section {
    padding: 0.75rem 0 1.5rem;
    scroll-margin-top: 140px;
}

.resource-section .section-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-glass, #e2e8f0);
}

.resource-section .section-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
}

@media (max-width: 968px) {
    .topic-nav-wrapper {
        top: calc(40px + 64px);
    }

    .filter-container.filter-sticky {
        top: calc(40px + 64px + 48px);
    }

    .filter-container {
        padding: 0.75rem;
    }

    .search-wrapper {
        flex: 1 1 100%;
        order: 1;
    }

    .filter-controls {
        flex: 1 1 100%;
        order: 2;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .filter-controls::-webkit-scrollbar {
        display: none;
    }

    .resource-count {
        flex: 1 1 100%;
        order: 3;
        margin-left: 0;
        text-align: right;
    }
}
